~/anaconda3/lib/python3.7/site-packages/elit/component/sdp/sdp_parser.py in decode(self, docs, num_buckets_test, test_batch_size, **kwargs)
119 :return: docs
120 """
--> 121 vocab = self._parser._vocab
122 for d in docs:
123 for s in d:
AttributeError: 'NoneType' object has no attribute '_vocab'
I installed and ran below code from elit.structure import Document, Sentence, TOK, POS from elit.component import SDPBiaffineParser
tokens = ['John', 'who', 'I', 'wanted', 'to', 'meet', 'was', 'smart'] postags = ['NNP', 'IN', 'WP', 'PRP', 'VBD', 'DT', 'NN', 'VBD', 'JJ'] doc = Document() doc.add_sentence(Sentence({TOK: tokens, POS: postags}))
print(doc)
sdp = SDPBiaffineParser() sdp.decode(doc) print(doc.sentences[0])
and it throws error as shown below.
AttributeError Traceback (most recent call last) in 8 #print(doc) 9 sdp = SDPBiaffineParser() ---> 10 sdp.decode(doc) 11 print(doc.sentences[0])
~/anaconda3/lib/python3.7/site-packages/elit/component/sdp/sdp_parser.py in decode(self, docs, num_buckets_test, test_batch_size, **kwargs) 119 :return: docs 120 """ --> 121 vocab = self._parser._vocab 122 for d in docs: 123 for s in d:
AttributeError: 'NoneType' object has no attribute '_vocab'