Custom suggester function in spancat

Hi Team,

Note : i had asked this question last year and was told to wait for some bug fixes. Hopefully there's more documentation on how to achieve this now.

I am trying to build a more complex suggester function for use in spancat. Basically my suggester function is going to define the spans [character or token spans] in the text that are eligible to be annotated by spancat manual. I'm looking to see if i can do entity sentiment analysis using spancat with my suggested spans going to be from an existing ner model.

I'm not sure if i have chosen to right approach for my problem, but could i please get some resources/guidance on how to restrict the suggester function to use spans that are output of an NER model.

Hi there!

I checked in with a colleague who pointed me to this Github repo with experimental suggesters:

Have you seen these? They might offer a convenient place to start. There's also a section in the original blogpost that talks about custom suggesters.

Your approach sounds like it's worth a try though. Effectively you'd be doing classification on previously detected spans, which is a two-step approach. Spancat does not use any embedding information from around the suggested tokens, but for sentiment that might just be enough.

One thing though: if you're interested in going through some nitty gritty details on spaCy then you might want to check the spaCy forum. This is where the spaCy team members hang out and it's also a place where you might find relevant answers to similar questions as well.