Traceback (most recent call last):
File "/tmp/stanza/./run_stanza.py", line 41, in <module>
main()
File "/tmp/stanza/./run_stanza.py", line 33, in main
conll = CoNLL.convert_dict(dicts)
AttributeError: type object 'CoNLL' has no attribute 'convert_dict'
which seemingly can be fixed with:
diff --git a/utils/run_stanza.py b/utils/run_stanza.py
index 02318ff..1508ac5 100755
--- a/utils/run_stanza.py
+++ b/utils/run_stanza.py
@@ -29,12 +29,7 @@ def main():
filename = os.path.basename(fh.name)
text = fh.read()
doc = nlp(text)
- dicts = doc.to_dict()
- conll = CoNLL.convert_dict(dicts)
- with open(os.path.join(args.output_dir, filename + ".conllu"), mode="w", encoding="utf-8") as out:
- for sentence in conll:
- out.write("\n".join(("\t".join(token) for token in sentence)))
- out.write("\n\n")
+ CoNLL.write_doc2conll(doc, os.path.join(args.output_dir, filename + ".conllu"))
stanza deprecated
convert_dict()
and (at least in 1.7.0) it's not supported anymore. Hence, run_stanza.py fails with:which seemingly can be fixed with: