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
2 answers

PRAW Posting new submission with a flair?

Trying to post to a subreddit that requires flairs reddit.subreddit('test').submit(title,url=link,flair_id='') i didn't know how to find the flair_id of a subreddit ? also when I try to share an image with praw using Trying to post to a subreddit…
tamer_mz
  • 33
  • 4
0
votes
1 answer

Why FLAIR does't recognize the entire location name of simple sentence?

I'm tying to to detect simple location with NER algorithm, and I'm getting semi-correct results: from flair.data import Sentence from flair.models import SequenceTagger tagger = SequenceTagger.load('ner') text = 'Jackson leaves at north…
user3668129
  • 4,318
  • 6
  • 45
  • 87
0
votes
0 answers

experiencing error while installing flair

Im experiencing this error while running the command pip install flair building 'gensim.models.word2vec_inner' extension error: Microsoft Visual C++ 14.0 or greater is required. Get it with "Microsoft C++ Build Tools":…
hammi
  • 804
  • 5
  • 14
0
votes
0 answers

flair introduces empty spaces in string when doing NER task

I'm working on a NER task using flair. I noticed that sometimes flair introduces empty spaces after processing a sentence. Example: the input sentence Herman Melvilles email is mobydick123@gmail.com ;-) gives as output [PERSON_NAME] email is…
albus_c
  • 6,292
  • 14
  • 36
  • 77
0
votes
1 answer

Can't deploy python script to google cloud functions due to issue with flairnlp import

I am trying to deploy a Google Cloud Function that performs sentiment analysis on tweets using a flair nlp model. The code deploys perfectly fine without the line 'import flair' or alternatives like 'from flair import x,y,z'. As soon as I include…
0
votes
2 answers

flair PermissionError: [Errno 13] Permission denied: '/root/.cache'

I am calling the python script with the flair package with a www-data user (no sudo rights). The models are in path for which that user has access rights, which I have set flair.cache_root = Path("tools/flair") However, when I run the script with…
sandboxj
  • 1,234
  • 3
  • 21
  • 47
0
votes
1 answer

Adding '-' sign to negative flair sentiment analysis

I am creating a sentiment analysis code for stock market analysis. This is the heart of the code: import flair flair_sentiment = flair.models.TextClassifier.load('en-sentiment') columns = ['ticker', 'date', 'time', 'headline'] parsed_and_scored_news…
Aryagm
  • 530
  • 1
  • 7
  • 18
0
votes
2 answers

How can I change the .flair cache folder location (https://github.com/flairNLP/flair)?

This question is about the NLP Python module Flair (https://github.com/flairNLP/flair). The default download folder for models is in the flair cache (~/.flair). However, working on a server I would prefer this download to take place in another…
Orysza
  • 574
  • 1
  • 5
  • 10
0
votes
1 answer

Handling emojis in Flair Sentiment Analysis

I'm using the Flair NLP Library to get the sentiment scores of tweets . How do I handle emojis in Flair? I know that vader can handle emojis pretty well without preprocessing , but what about Flair ? What Should I add to the code to account for the…
Bharathi
  • 201
  • 1
  • 8
0
votes
1 answer

Flair Sentimental Analysis not Not giving Neutral results

I am using Flair for sentimental analysis. However, when i try to predict the label, i am not able to get a Neutral class ever. Also, the confidence of class is too unreal, i.e it is positive with probability >0.97 always or negative with such high…
Nidutt
  • 185
  • 2
  • 17
0
votes
1 answer

Is there a way to get submissions or a subreddit based on the flair using pushshift API?

I looked through the documentation but I was not able to find how to retrieve submissions based on flair from a particular subreddit for a given time period, without using BigQuery. Just using the API.
mk03
  • 98
  • 7
0
votes
1 answer

Flair NER Metrics interpretation

I'm currently preparing a NER Task with Flair and I'm looking for some information about metrics used for NER task. What are the most used metrics and how to interpretate them ?
Nicolas Roche
  • 105
  • 1
  • 1
  • 14
0
votes
1 answer

Prepare dataframe for Flair model training

I am trying to get a dataframe in the format below into a txt file as shown in the screenshot. I get relatively close with the code shown but get the following error when I tried to read the txt into my ML algorithm: "labels = set([label.value for…
ms5573
  • 41
  • 5
-1
votes
1 answer

Error: A token can only be part of one entity, so make sure the entities you're setting don't overlap

While trying to convert spaCy NER dataset format to Flair format, using this code: from spacy.gold import biluo_tags_from_offsets nlp = spacy.load("en_core_web_md") ents = TRAIN_DATA with open("flair_ner.txt","w") as f: for sent,tags in ents: …
BAKYAC
  • 155
  • 2
  • 12
-1
votes
1 answer

Flair NLP package on cloud TPU

Is it possible to use "flair" nlp library on Google cloud TPU ? I am trying to use Google Colab runtime TPUs and getting some errors.