I tried your demo on your GitHub to create a constituency parser with the RoBerta CRF pre-trained model but get an error when running parsing.
con = Parser.load('crf-con-roberta-en')
sent = "This is my sentence to be parsed with SuPar !"
parse = con.predict(sent.split(), verbose=False)
print(parse[0])
got this error:
AttributeError Traceback (most recent call last)
<ipython-input-16-7b8ab5d2fd23> in <module>()
1 sent = "This is my sentence to be parsed with SuPar !"
----> 2 parse = con.predict(sent.split(), verbose=False)
3 print(parse[0])
5 frames
/usr/local/lib/python3.7/dist-packages/supar/utils/transform.py in build(cls, tree, sequence)
687 """
688
--> 689 root = tree.label()
690 leaves = [subtree for subtree in tree.subtrees()
691 if not isinstance(subtree[0], nltk.Tree)]
AttributeError: 'Tensor' object has no attribute 'label'
Hi,
I tried your demo on your GitHub to create a constituency parser with the RoBerta CRF pre-trained model but get an error when running parsing.
got this error:
Here is a Google colab to try and reproduce the problem: (check Issue # 2) https://colab.research.google.com/drive/1CDZRPab8P4ba7amPxy5jhY6mBrdJ54B4?usp=sharing