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

Span-tagging example code [feature request] #38

Open pseudomonas opened 1 year ago

pseudomonas commented 1 year ago

There are as far as I can tell no internal recommenders for spans (the extents of the spans rather than the labels attached to the spans); so any guidance on how to write an external trainable recommender for generic nested spans would be really welcome.

reckart commented 1 year ago

There are different internal recommenders for different kinds of spans in INCEpTION, e.g.:

The label of the recommendation can be empty, but it is always required that a feature exists to which a label could be assigned. There is currently no way to define a recommender for a layer that has no features.

pseudomonas commented 1 year ago

Hmm. I'm aiming to do nested spans that have similar kinds of properties to phrases. I don't think any of those classifiers do that? I think what I probably need is something like a shift-reduce oracle or something vaguely of that flavour. But I'm far from an expert at this.

reckart commented 1 year ago

A recommender must be assigned to a string feature and produces suggestions that have a begin, end, label (optional), score (optional) and description (optional). If you need to produce suggestions for multiple features of the same layer, you'd currently need to set up multiple recommenders, one for each feature.

pseudomonas commented 1 year ago

ah, so arbitrary levels of nesting aren't possible, because you need one recommender per level?

reckart commented 1 year ago

You should be able to create overlapping suggestions if you needed that.

reckart commented 1 year ago

Mind that the layer would need to be configured to allow for overlapping if you did that.

pseudomonas commented 1 year ago

Well, I'll give it a shot. Unless I go for a dependency grammar…