Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Error with serializing fasttext model? #16

Open
kodymoodley opened this issue May 30, 2022 · 0 comments
Open

Error with serializing fasttext model? #16

kodymoodley opened this issue May 30, 2022 · 0 comments

Comments

@kodymoodley
Copy link

After running the following code:

run_nlp = stanza.Pipeline(lang='nl', processors='srl')

I get the following output:

Downloading https://raw.githubusercontent.com/stanfordnlp/stanza-resources/main/resources_1.4.0.json: 154kB [00:00, 22.0MB/s]
2022-05-30 18:14:28 INFO: Loading these models for language: nl (Dutch):
=======================
| Processor | Package |
-----------------------
| srl       | default |
=======================

2022-05-30 18:14:28 INFO: Use device: cpu
2022-05-30 18:14:28 INFO: Loading: srl
Warning : `load_model` does not return WordVectorModel or SupervisedModel any more, but a `FastText` object which is very similar.
2022-05-30 18:14:30 INFO: Done loading processors!

The warning is no problem, per se, but then when executing run_nlp(text) afterwards (where text is some input text from a text file) I get the following error:

File /Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/site-packages/stanza/pipeline/core.py:386, in Pipeline.__call__(self, doc, processors)
    385 def __call__(self, doc, processors=None):
--> 386     return self.process(doc, processors)

File /Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/site-packages/stanza/pipeline/core.py:382, in Pipeline.process(self, doc, processors)
    380     if self.processors.get(processor_name):
    381         process = self.processors[processor_name].bulk_process if bulk else self.processors[processor_name].process
--> 382         doc = process(doc)
    383 return doc

File /Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/site-packages/stroll/stanza.py:69, in SrlProcessor.process(self, doc)
     67 def process(self, doc):
     68     # convert Document to ConlluDataset
---> 69     dicts = doc.to_dict()
     70     dataset = ConlluDataset()
     72     for sent_id, input_sentence in enumerate(doc.sentences):

AttributeError: 'str' object has no attribute 'to_dict'

I am running Mac OSX Monterey v12.3.1. Python v3.8.3

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant