flairNLP / flair

A very simple framework for state-of-the-art Natural Language Processing (NLP)
https://flairnlp.github.io/flair/
Other
13.85k stars 2.09k forks source link

[Question]: Using flair for creating tags or keywords that represents a given text #3443

Open B0rner opened 5 months ago

B0rner commented 5 months ago

Question

Hey, I wonder if it is possible to use one of the flair model (for example provided over huggingface) in such a way that it generates keywords from a text that is passed to the data model. Preferably in German.

I tried ner-english-ontonotes-large which works very well on German text for specific entities.

But what I need is model, that returns not specific entities, like the name of the person or the name of the city. I need a model, that returns a couple of keywords, that describes the context of the input text, like input: "I like to have pizza for breakfast."output: "breakfast", "pizza", "favorite meal"` ..which should also work for longer texts.

There is no model in the flair-oniverse, that fits exactly that usecase, right?

But is it possible, to train or fine-tune a flair-model for that? A have a huge set of data, that provides a text and related keywords, which would be ideal for finetuning a model. Is there a way (and a tutorial), how to feed the trainig-data to make the model fit for the usecase?