Closed reckart closed 3 years ago
How do you then write recommender? You hard code the token type then inside the recommender instead of a util function, Does that help you?
What I do right now looks like e.g. this:
words = [cas.get_covered_text(cas_token) for cas_token in cas.select(MY_NON_DKPRO_TOKEN_TYPE)]
...
AnnotationType = cas.typesystem.get_type(layer) // layer from the predict-method argument
for cas_token, spacy_token in zip(cas.select(MY_NON_DKPRO_TOKEN_TYPE), doc):
fields = {"begin": cas_token.begin, "end": cas_token.end, feature: spacy_token.pos_, "componentId": "spacy"}
cas.add_annotation(AnnotationType(**fields))
Is your feature request related to a problem? Please describe. The helper methods we have right now e.g. to create predictions are very hard-coded to the DKPro Core type system.
Describe the solution you'd like Either make the helpers more flexible or remove them in favor of calling cassis directly.