-
Notifications
You must be signed in to change notification settings - Fork 7
Open
Description
Hi,
I'm using CoreNLP Client from stanza to annotate my text, and I want to save my results. I used the following code to save my results. I think it works well but I encountered errors when reading in the result file.
with open(dir_path+'reproduced/corenlp/results.pb2', 'wb') as f:
f.write(annotated_doc.SerializeToString())
When reading the file, I tried the following code. The corenlp-protobuf I installed is version 3.8.0.
from corenlp_protobuf import Document, parseFromDelimitedString
def readCoreNLPProtoFile(protoFile):
with open('protoFile', 'rb') as f:
buf = f.read()
doc = Document()
parseFromDelimitedString(doc, buf)
return doc
However, I got the TypeError as follows. Could someone help me? Thanks in advance.
Metadata
Metadata
Assignees
Labels
No labels