flair
spacy-models
Our great sponsors
flair | spacy-models | |
---|---|---|
9 | 3 | |
13,558 | 1,506 | |
1.0% | 1.7% | |
9.4 | 9.2 | |
7 days ago | 5 months ago | |
Python | Python | |
GNU General Public License v3.0 or later | - |
Stars - the number of stars that a project has on GitHub. Growth - month over month growth in stars.
Activity is a relative number indicating how actively a project is being developed. Recent commits have higher weight than older ones.
For example, an activity of 9.0 indicates that a project is amongst the top 10% of the most actively developed projects that we are tracking.
flair
- Flair: A simple framework for state-of-the-art Natural Language Processing
-
Artificial Intelligence sentiment analysis of the Harry Potter movies. The greener the edge the happier the conversations, the bigger the edge the more they talk. Made by me.
The code of the module is available there for easy access: https://github.com/flairNLP/flair
-
The Spacy NER model for Spanish is terrible
Had the same experience with the german model in spacy (but tbh, the quailty of my textdata was bad). A bert based approach with flair really improved my results. I think there is a spanish pretrained model also available
-
How to create a dataset for training NER models when you only have entity data
We have a list of entities in text files separated with a new line. We intend to train the flair model to detect these entities in text, but NER models require the entity to be labeled in a paragraph with BOI format.
-
Preparing data for training NER models
Training most of the Named Entity Recognition (NER) models for example Flair usually needs to format data in BOI tagging) scheme as shown below where each sentence is separated by blank line
-
German POS Corpus for Commercial use
I had the same problem a couple years ago. I think Flair, form Zalando uses a different Corpus. However, it's not great and I am pretty sure they are infringing the license anyway...
-
Advice for how to approach classifying apartment posts on facebook?
For example, my first approach to the pet sentences would be to label all sentences within a respective text corpus containing according information for either yes or no. You would then convert this to a tertiary tag set, something like ["pet allowed", "pet not allowed", "irrelevant"]. You could then try out a model based on SentenceBert, other sentence-level embeddings/language models or 1D CNNs for this. flairNLP (https://github.com/flairNLP/flair) is a small, little framework which provides comfortable high-level access to different common language models which integrates perfectly with pyTorch.
-
SpaCy VS Transformers for NER
For NER, if you don't need the full toolkit of spacy, I'd highly recommend checking out Flair. It will likely run faster than transformer-based models (like en_core_web_trf) and it tends to be one of the best performing approaches to NER.
-
[D] NLP Q: How to extract this part from a messy short text?
You then train the whole thing on sequences where each position has a label that is begin/inside/outside and thus you can calculate cross-entropy loss. So all in all it is basically: https://github.com/flairNLP/flair, https://huggingface.co/transformers/model_doc/distilbert.html#tfdistilbertforsequenceclassification or any huggingface model "for sequence classificaiton" or but just char based instead of word based. The CRF layer (as included in flair) is optional but may be useful.
spacy-models
-
spacy Can't find model 'en_core_web_sm' on windows 10 and Python 3.5.3 :: Anaconda custom (64-bit)
(C:\Users\nikhizzz\AppData\Local\conda\conda\envs\tensorflowspyder) C:\Users\nikhizzz>conda install -c conda-forge spacyFetching package metadata .............Solving package specifications: .Package plan for installation in environment C:\Users\nikhizzz\AppData\Local\conda\conda\envs\tensorflowspyder:The following NEW packages will be INSTALLED: blas: 1.0-mkl cymem: 1.31.2-py35h6538335_0 conda-forge dill: 0.2.8.2-py35_0 conda-forge msgpack-numpy: 0.4.4.2-py_0 conda-forge murmurhash: 0.28.0-py35h6538335_1000 conda-forge plac: 0.9.6-py_1 conda-forge preshed: 1.0.0-py35h6538335_0 conda-forge pyreadline: 2.1-py35_1000 conda-forge regex: 2017.11.09-py35_0 conda-forge spacy: 2.0.12-py35h830ac7b_0 conda-forge termcolor: 1.1.0-py_2 conda-forge thinc: 6.10.3-py35h830ac7b_2 conda-forge tqdm: 4.29.1-py_0 conda-forge ujson: 1.35-py35hfa6e2cd_1001 conda-forgeThe following packages will be UPDATED: msgpack-python: 0.4.8-py35_0 --> 0.5.6-py35he980bc4_3 conda-forgeThe following packages will be DOWNGRADED: freetype: 2.7-vc14_2 conda-forge --> 2.5.5-vc14_2Proceed ([y]/n)? yblas-1.0-mkl.t 100% |###############################| Time: 0:00:00 0.00 B/scymem-1.31.2-p 100% |###############################| Time: 0:00:00 1.65 MB/smsgpack-python 100% |###############################| Time: 0:00:00 5.37 MB/smurmurhash-0.2 100% |###############################| Time: 0:00:00 1.49 MB/splac-0.9.6-py_ 100% |###############################| Time: 0:00:00 0.00 B/spyreadline-2.1 100% |###############################| Time: 0:00:00 4.62 MB/sregex-2017.11. 100% |###############################| Time: 0:00:00 3.31 MB/stermcolor-1.1. 100% |###############################| Time: 0:00:00 187.81 kB/stqdm-4.29.1-py 100% |###############################| Time: 0:00:00 2.51 MB/sujson-1.35-py3 100% |###############################| Time: 0:00:00 1.66 MB/sdill-0.2.8.2-p 100% |###############################| Time: 0:00:00 4.34 MB/smsgpack-numpy- 100% |###############################| Time: 0:00:00 0.00 B/spreshed-1.0.0- 100% |###############################| Time: 0:00:00 0.00 B/sthinc-6.10.3-p 100% |###############################| Time: 0:00:00 5.49 MB/sspacy-2.0.12-p 100% |###############################| Time: 0:00:10 7.42 MB/s(C:\Users\nikhizzz\AppData\Local\conda\conda\envs\tensorflowspyder) C:\Users\nikhizzz>python -VPython 3.5.3 :: Anaconda custom (64-bit)(C:\Users\nikhizzz\AppData\Local\conda\conda\envs\tensorflowspyder) C:\Users\nikhizzz>python -m spacy download enCollecting en_core_web_sm==2.0.0 from https://github.com/explosion/spacy-models/releases/download/en_core_web_sm-2.0.0/en_core_web_sm-2.0.0.tar.gz#egg=en\_core\_web\_sm==2.0.0 Downloading https://github.com/explosion/spacy-models/releases/download/en_core_web_sm-2.0.0/en_core_web_sm-2.0.0.tar.gz (37.4MB) 100% |################################| 37.4MB ...Installing collected packages: en-core-web-sm Running setup.py install for en-core-web-sm ... doneSuccessfully installed en-core-web-sm-2.0.0 Linking successful C:\Users\nikhizzz\AppData\Local\conda\conda\envs\tensorflowspyder\lib\site-packages\en_core_web_sm --> C:\Users\nikhizzz\AppData\Local\conda\conda\envs\tensorflowspyder\lib\site-packages\spacy\data\en You can now load the model via spacy.load('en')(C:\Users\nikhizzz\AppData\Local\conda\conda\envs\tensorflowspyder) C:\Users\nikhizzz>
-
word similarity vs. sentence similarity
Well the medium model is using Glove (common crawl) for word vectors. There are only 685K keys so depending on the corpus you are working with, its possible lots of the words you are interested in don't have a corresponding vector and end up as zero vectors. Spacy Document/Span vectors are simply averages of the word vectors. So the higher performance of phrases may simply be because there is a higher chance of non Out of Vocabulary (OOV) words. So less chance of a zero vector.
-
SpaCy VS Transformers for NER
spaCy vs transformers isn't really a good comparison. You can plug a variety of things into spaCy's NLP pipelines, including Huggingface's transformer models. spaCy 3, in particular, has pre-built models with Huggingface's transformers, like en_core_web_trf.
What are some alternatives?
BERT-NER - Pytorch-Named-Entity-Recognition-with-BERT
rasa - 💬 Open source machine learning framework to automate text- and voice-based conversations: NLU, dialogue management, connect to Slack, Facebook, and more - Create chatbots and voice assistants
spaCy - 💫 Industrial-strength Natural Language Processing (NLP) in Python
MAX-Toxic-Comment-Classifier - Detect 6 types of toxicity in user comments.
Stanza - Stanford NLP Python library for tokenization, sentence segmentation, NER, and parsing of many human languages
thinc-apple-ops - 🍏 Make Thinc faster on macOS by calling into Apple's native Accelerate library
gensim - Topic Modelling for Humans
pytextrank - Python implementation of TextRank algorithms ("textgraphs") for phrase extraction
seqeval - A Python framework for sequence labeling evaluation(named-entity recognition, pos tagging, etc...)
Dragonfire - the open-source virtual assistant for Ubuntu based Linux distributions
textacy - NLP, before and after spaCy