Skip to content

Conversation

liisaratsep
Copy link

There were inconsitencies with variable names, 'tespath' was used in some places and 'testpath' in others and thus testing didn't work. Fixed that.

Also, added a new command line flag --cpos. When turned on, it will use CPOS (or UPOS for CoNLL-U) part-of-speech tags for parsing instead of POS (XPOS) tags. This is useful for CoNLL-U in particular, where the language-specific XPOS tags are very narrow and often express morphological features as well. With really specific POS tags, the parser can end up with POS keyerrors such as the one from UD_Arabic[1] below:

Traceback (most recent call last):
  File "src/parser.py", line 59, in <module>
    utils.write_conll(devpath, parser.Predict(options.conll_dev))
  File "/mnt/c/Users/Liisa/Documents/ATI/NMT/bist-parser/barchybrid/src/utils.py", line 119, in write_conll
    for sentence in conll_gen:
  File "/mnt/c/Users/Liisa/Documents/ATI/NMT/bist-parser/barchybrid/src/arc_hybrid.py", line 232, in Predict
    self.getWordEmbeddings(conll_sentence, False)
  File "/mnt/c/Users/Liisa/Documents/ATI/NMT/bist-parser/barchybrid/src/arc_hybrid.py", line 179, in getWordEmbeddings
    root.posvec = self.plookup[int(self.pos[root.pos])] if self.pdims > 0 else None
KeyError: 'QC-----S1R'

But UPOS tags are universal, so such errors are less likely to occur with this flag.

[1] https://github.com/UniversalDependencies/UD_Arabic

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

Successfully merging this pull request may close these issues.

1 participant