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
1
vote
0 answers

python flair module is giving error cannot import name '_BaseLazyModule' from 'transformers.file_utils'

from flair.models import TextClassifier from flair.data import Sentence I am receiving error: cannot import name '_BaseLazyModule' from 'transformers.file_utils' Can anyone help me?
Veera
  • 11
  • 2
1
vote
1 answer

what is the max limit of entities in a custom NER model

what is the maximum limit of entities we can have in a spacy or bert based custom NER models ? I have seen examples over the web which have been trained to a max of 10 custom entities per model and even the Ontonotes data set has 18 entities, so…
1
vote
1 answer

Flair English sentiment model download

I'm trying to download the en-sentiment model using the following code: clf = TextClassifier.load('en-sentiment') but I'm getting the following SSL error: SSLError: HTTPSConnectionPool(host='nlp.informatik.hu-berlin.de', port=443): Max retries…
Tom Smith
  • 178
  • 2
  • 13
1
vote
0 answers

How to improve the flair NER-model results?

I am new to NER and NLP in general and I want to know if I understood the material right. So for example I have pre-trained model "ner-english-large". I am using a model and it turns out that the model is not recognizing the right entities. (In this…
1
vote
1 answer

iterating over a pandas dataframe super fast

I am trying to create labels for my dataset which is just a csv file with 20_000 lines of text. I 've used the following method but it takes about 15 minutes to create all the results. The desired outcome is "This was a really crappy product",…
Reza Afra
  • 133
  • 3
  • 8
1
vote
0 answers

Extreme performance disparity between training output and evaluate function with flair NLP?

Ive trained a custom NER model in flair and after the training is completed, it outputs the results which were Results: - F1-score (micro) 0.5714 - F1-score (macro) 0.4831 By class: SymProp tp: 13 - fp: 25 - fn: 21 - precision: 0.3421 - recall:…
George
  • 105
  • 1
  • 4
1
vote
2 answers

is there anyway to get the actual vector embedding of a word or set of characters using flair nlp? i.e flair embeddings

Basically I'm trying to use a custom flair language model to get a word or sentence's embedding in a vector. Is this possible or do flair embeddings only function when using flair NER models? When using the embeddings .embed() function I receive an…
George
  • 105
  • 1
  • 4
1
vote
0 answers

Flair Elmo Embeddings use in Pytorch model

I am trying to generate the elmo embeddings on a PyTorch model, on every batch iteration, like: for batch in iterator: optimizer.zero_grad() embeddings = get_elmo_embeddings(batch.dataset.examples) predictions =…
Nick
  • 11
  • 2
1
vote
2 answers

How to convert spaCy NER dataset format to Flair format?

I have already labled a dataset using dataturks to train a spaCy NER and everything works fine, however, I just realized that Flair has a different format and I am just wondering if there is a way to convert my "spaCy's NER" json dataset format into…
BAKYAC
  • 155
  • 2
  • 12
1
vote
2 answers

flair import failing on mac ubuntu and google colab

i am trying to use flair nlp framework , https://github.com/flairNLP/flair but getting error # load the NER tagger tagger = SequenceTagger.load('ner') tried on local , remote and other machine . all failing as its not able to download a model from…
ajaypr55
  • 141
  • 2
  • 11
1
vote
2 answers

How can i use flair NER tagger with DKpro-core

There are already many taggers such as Stanford,opennlp, etc in DKpro but I would like to know how can I implement flair NER tagger in DKpro-core?
Sundeep Pidugu
  • 2,377
  • 2
  • 21
  • 43
1
vote
1 answer

Feature extraction using flairNLP

I'm trying to use flair for sentiment analysis, but I also need to know how much each word influenced the score of a sentence. I've followed this article to predict the sentiment, but it doesn't show how to extract the features of the given…
orKach
  • 111
  • 1
  • 7
1
vote
1 answer

Using Flair in combination with TensroFlow on GPU produces errors

When I tried to use Flair taggers in combination with Universal Sentence Encoder(USE) for embedding everything worked well on CPU and GPU produced error: self._session = tf_session.TF_NewSessionRef(self._graph.c_graph,…
Tomasz Kot
  • 66
  • 5
1
vote
2 answers

Transform flair language model tensors for viewing in TensorBoard Projector

I want to convert "vectors," vectors = [token.embedding for token in sentence] print(type(vectors)) print(vectors) [tensor([ 0.0077, -0.0227, -0.0004, ..., 0.1377, -0.0003, 0.0028]), ... tensor([ 0.0003, -0.0461, 0.0043, ...,…
Victoria Stuart
  • 4,610
  • 2
  • 44
  • 37
0
votes
1 answer

AttributeError: 'str' object has no attribute 'is_context_set'

I am trying to implement flair to obtain ner tags for a piece of text (doing this in colab). Encountered this error while trying tagger.predict(text). What should I do to resolve this? Here's my code: from flair.data import Sentence from…