Questions tagged [flair]

A very simple framework for state-of-the-art NLP. Developed by Humboldt University of Berlin and friends.


Flair is:

  • A powerful NLP library. Flair allows you to apply our state-of-the-art natural language processing (NLP) models to your text, such as named entity recognition (NER), part-of-speech tagging (PoS), sense disambiguation and classification.

  • Multilingual. Thanks to the Flair community, we support a rapidly growing number of languages. We also now include 'one model, many languages' taggers, i.e. single models that predict PoS or NER tags for input text in various languages.

  • A text embedding library. Flair has simple interfaces that allow you to use and combine different word and document embeddings, including our proposed Flair embeddings, BERT embeddings and ELMo embeddings.

  • A PyTorch NLP framework. Our framework builds directly on PyTorch, making it easy to train your own models and experiment with new approaches using Flair embeddings and classes.

61 questions
0
votes
0 answers

Getting ACHTUNG! No gold labels and no all_predicted_values found message

This is how my traing data looks like, (for testing/debuging) Sentence[8]: "ziedona B-LOC iela I-LOC ane B-LOC latvia B-LOC" Sentence[4]: "ziedona B-LOC iela I-LOC" why I get this message, what is wrong with the data? 2023-08-17 13:34:43,943…
realPro
  • 1,713
  • 3
  • 22
  • 34
0
votes
0 answers

NoImplementation error when training a Flair NER Model

I am trying to train a custom model for sentiment analysis using the python Flair module. I have created the Dev, Test and Train CSVs successfully. When running the code to train the model: from flair.datasets import ClassificationCorpus from…
thecodeman
  • 49
  • 5
0
votes
0 answers

Training Flair Few Shot Learning Model Results in an OSError Related to Model Loading

When I am creating a few shot learning model by finetuning tars-base, the model crashes after training without saving to my local drive like it's supposed to. The training completed all epochs before crashing. The same code has worked in the…
0
votes
0 answers

With Reddit python bot to set flair, how can I adjust some rules to allow for part of the text to updated while part to remain the same?

I have inherited a bot on Reddit that sets user flair, its Python based. I have a set of rules that interact with the bot that tells it what is acceptable to add. That snippet is as below { "rules": [ { "set": { "text": [ "Dogs Samsung Chinese lol",…
0
votes
1 answer

Annotate Entity inside another Entity

We have to extract an entity which is inside another entity, any idea on how can we annotate the training data to train a NER model for this task. We are using Flair model for custom entity training and prediction. Ex: Text: "" Address: 123, ABC…
Surya
  • 159
  • 1
  • 2
  • 9
0
votes
0 answers

Convert pytorch NLP model to onnx format

I built a NLP model to extract named entities from raw text using flair sequencetagger algorithm. I'm not able to export it to onnx format. I don't know how to give dummy input for this model I tried with torch.onnx.export but got errormessage as…
Arun
  • 1
  • 1
0
votes
1 answer

flair erroring out in libcublasLt.so.11 module

Using flair 0.11.3. Getting below error for from flair.data import Sentence. Not clear on what is causing the issue. It worked on local laptop but running in AzureML Compute instance giving below error. One observation - In local flair did not…
Mohan Rayapuvari
  • 289
  • 1
  • 4
  • 18
0
votes
1 answer

how to create Flair Huggingface output to dataframe

I am new to huggingface and i working on Flair (NER) module which gives me below output: from flair.data import Sentence from flair.models import SequenceTagger # load tagger tagger = SequenceTagger.load("flair/ner-german-large") # make example…
0
votes
0 answers

How does FLAIR implement Text Classification

I have used the FLAIR library for text classification. I was amazed to find it produces high accuracy with pre-trained embedding on different datasets. I was wondering how this library implements its text classification (sentiment analysis). Looking…
0
votes
1 answer

AttributeError: partially initialized module 'torch' has no attribute 'autograd' (most likely due to a circular import)

I'm trying to run code for sentiment analysis of a file using python flair. However it gives me AttributeError in torch on ubutnu 22.04. Traceback: Traceback (most recent call last): File "/home/ayush/myproj/vaahan/scrape/sentimentF.py", line 9,…
ayu_j
  • 27
  • 4
0
votes
0 answers

Alternative Way to use Flair TextClassifier in Databricks

I am trying to migrate my Flair sentiment analysis from local machine to Azure Databricks. However, I face the following error: from flair.models import TextClassifier classifier =…
0
votes
0 answers

OSError: [WinError 1314] when doing sentiment analysis using flair

When trying the following sentiment codes from flair package (please see https://towardsdatascience.com/the-best-python-sentiment-analysis-package-1-huge-common-mistake-d6da9ad6cdeb), I am getting OSError: [WinError 1314]. I am using VS Code. This…
Sam S.
  • 627
  • 1
  • 7
  • 23
0
votes
0 answers

NLP text classification (flair)

So I have basic question which I did not get answered by reading the documentation. If I want to do text classification (sentiment) about lets say an Articel with a topic. I already have the plain text without the html stuff through python…
sabrov
  • 1
  • 1
0
votes
1 answer

How to incorporate flair model into presidio framework?

I was looking for some sample code/tutorial how to implement flair based model within the presidio framework and I found this https://github.com/microsoft/presidio/blob/main/docs/samples/python/flair_recognizer.py, but actually, it is not wroking.…
0
votes
1 answer

Combining BERT and other types of embeddings

The flair model can give a representation of any word (it can handle the OOV problem), while the BERT model splits the unknown word into several sub-words. For example, the word "hjik" will have one vector represented in flair, while in BERT it will…