umcu / clinlp

A Python library for performing NLP on clinical text written in Dutch
GNU General Public License v3.0
33 stars 0 forks source link

Example code in the README.md gives an error on line 2 'from clinlp import Term' #51

Closed msnackey closed 7 months ago

msnackey commented 8 months ago

Using clinlp 0.3.0: Trying out clinlp with the example code provided in the README.md gives an immediate error while trying to import Term from clinlp.

Traceback (most recent call last):
  File "/.../clinlp_test/test_new.py", line 2, in <module>
    from clinlp import Term
  File "/.../clinlp_test/venv/lib/python3.9/site-packages/clinlp/__init__.py", line 3, in <module>
    from .qualifier import ContextAlgorithm, NegationTransformer'
  File "/.../clinlp_test/venv/lib/python3.9/site-packages/clinlp/qualifier/__init__.py", line 1, in <module>
    from .context_algorithm import ContextAlgorithm, ContextRule, ContextRuleDirection
  File "/.../clinlp_test/venv/lib/python3.9/site-packages/clinlp/qualifier/context_algorithm.py", line 92, in <module>
    class ContextAlgorithm(QualifierDetector):
  File "/.../clinlp_test/venv/lib/python3.9/site-packages/clinlp/qualifier/context_algorithm.py", line 109, in ContextAlgorithm
    rules: Optional[Union[str | dict]] = _defaults_context_algorithm["rules"],
TypeError: unsupported operand type(s) for |: 'type' and 'type'
msnackey commented 7 months ago

This was related to the Python version 3.9.