-
Notifications
You must be signed in to change notification settings - Fork 7
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
AttributeError #38
Comments
Not sure what did you put in the docs, but it's supposed to be a str (can contain many sents then the tokenizer will split it into several sents). |
this is one of the sample of my docs(R8 dataset) 'france currency intervention debt france today repaid billion francs short term currency intervention debt european monetary cooperation fund finance ministry said said debt part billion franc liability incurred swap facilities defend franc january european monetary system realignment realignment following several weeks speculative pressure produced three pct revaluation west german mark dutch guilder french franc two pct revaluation belgian franc reuter' |
Did you put a tokenizer in your tools? I just ran the POS and it works fine.
|
yes I put it there |
it worked now, for single sentence, I couldn't pass many instances, If I do it throws same error as I mentioned earlier. |
docs = 'Sentence one. Sentence two.' |
tools = [tok,POS] above code works fine, but for tool in tools: above piece of code gives me an error, AttributeError Traceback (most recent call last) ~/anaconda3/lib/python3.7/site-packages/elit/component/tagger/pos_tagger.py in decode(self, docs, **kwargs) ~/anaconda3/lib/python3.7/site-packages/elit/component/tagger/corpus.py in convert_elit_documents(docs) AttributeError: 'str' object has no attribute 'sentences' I don't really understand the differece. |
when I ran my own data set to decode it gives an error,
for tool in tools:
shuf = tool.decode(docs)
AttributeError Traceback (most recent call last)
in
1 for tool in tools:
----> 2 shuf = tool.decode(docs)
~/anaconda3/lib/python3.7/site-packages/elit/component/tagger/pos_tagger.py in decode(self, docs, **kwargs)
61 if isinstance(docs, Document):
62 docs = [docs]
---> 63 samples = NLPTaskDataFetcher.convert_elit_documents(docs)
64 with self.context:
65 sentences = self.tagger.predict(samples)
~/anaconda3/lib/python3.7/site-packages/elit/component/tagger/corpus.py in convert_elit_documents(docs)
1298 dataset = []
1299 for d in docs:
-> 1300 for s in d.sentences:
1301 sentence = Sentence()
1302
AttributeError: 'str' object has no attribute 'sentences
but it works fine for the example given is documentation!
Please help me to figure this out.
The text was updated successfully, but these errors were encountered: