richardpaulhudson / coreferee

Coreference resolution for English, French, German and Polish, optimised for limited training data and easily extensible for further languages
MIT License
102 stars 16 forks source link

Minimum python version? #22

Closed picaultj closed 1 year ago

picaultj commented 1 year ago

Hello,

First, great project and good job!

I'm trying to use coreferee for French data. I tried the public example for French in your doc. I got the following error when I'm running it with Python 3.8.13.

⚠ Unexpected error in Coreferee annotating document, skipping ....
⚠ <class 'TypeError'>
⚠ unsupported operand type(s) for |: 'dict' and 'dict'

  File "/home/jerome/miniconda3/envs/origami_conda/lib/python3.8/site-packages/coreferee/manager.py", line 144, in __call__
    self.annotator.annotate(doc)
  File "/home/jerome/miniconda3/envs/origami_conda/lib/python3.8/site-packages/coreferee/annotation.py", line 377, in annotate
    self.rules_analyzer.initialize(doc)
  File "/home/jerome/miniconda3/envs/origami_conda/lib/python3.8/site-packages/coreferee/rules.py", line 314, in initialize
    if self.language_independent_is_potential_anaphoric_pair(
  File "/home/jerome/miniconda3/envs/origami_conda/lib/python3.8/site-packages/coreferee/rules.py", line 474, in language_independent_is_potential_anaphoric_pair
    if self.is_potential_coreferring_noun_pair(
  File "/home/jerome/miniconda3/envs/origami_conda/lib/python3.8/site-packages/coreferee/lang/fr/language_specific_rules.py", line 1276, in is_potential_coreferring_noun_pair
    new_reverse_entity_noun_dictionary = {

The error does not occur with Python 3.9.

Would it be possible to fix this problem? (the project I want to use it is still using 3.8...)

Best, Jérôme

richardpaulhudson commented 1 year ago

It just so happens you wrote this while I was packaging the new v1.4.0 release, which already fixed this bug. So it should be enough to update to the new version of Coreferee.