inception-project / inception-external-recommender

Get annotation suggestions for the INCEpTION text annotation platform from spaCy, Sentence BERT, scikit-learn and more. Runs as a web-service compatible with the external recommender API of INCEpTION.
Apache License 2.0
40 stars 17 forks source link

An unexpected keyword argument 'inception_internal_predicted' #32

Closed dmilcevski closed 2 years ago

dmilcevski commented 2 years ago

Hi,

Am am trying to create an external recommender and when using the method in inception_util.py here I am getting the following error:

  File "inception_util.py", line 18, in create_prediction
    prediction = AnnotationType(**fields)
  File "cassis/typesystem.py", line 252, in __call__
    return self._constructor(**kwargs)
TypeError: __init__() got an unexpected keyword argument 'inception_internal_predicted'

I am using version 0.5.3 fromdkpro-cassis. My question is, is the field IS_PREDICTION = "inception_internal_predicted" absolutely needed for the recommended annotations and how can we make it work? Do I need to downgrade dkpro-casis to 0.5.0?

Thanks!

reckart commented 2 years ago

The inception_internal_predicted feature tells INCEpTION that an annotation is a prediction - so yes, it should be important.

Can you please dump the type system of the CAS that you receive on the python side and check if the feature is available on the type that you want to predict. Normally, it should be available on any annotation layer types configured on the INCEpTION side.

dmilcevski commented 2 years ago

Thanks @reckart for the hint. It seems that I was using and outdated file for testing, namely this file here: https://github.com/inception-project/external-recommender-flair/blob/master/tests/test.json, which probably didn't contain the feature in the type system.

Thanks for the help!