Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

TypeError: Couldn't build proto file into descriptor pool! #5

Open
@XiaohanYa

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.

Screen Shot 2021年11月09日 at 10 01 08 PM

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions

        AltStyle によって変換されたページ (->オリジナル) /