Is it possible to use Gliner with at token level instead of text?

#2
by polodealvarado - opened

Hello @urchade !

Thank you for such amazing model.

I would like to know if it is possible to run it at token level (list of words) instead of using directly a text.
Something like:

model.predict_entities(["Albert","is","living","in","Paris","."], labels = ["person name","location"])
Owner

Hi @polodealvarado , you can joint you token lists with whitespace and use a whitespace splitter for tokenization

model.words_splitter = WordsSplitter("whitespace")

text = " ".join(["Albert","is","living","in","Paris","."])

Sorry for replying late.
Thank you @urchade !

polodealvarado changed discussion status to closed

Sign up or log in to comment