SPACY'S ENTITY RECOGNITION MODEL: incremental parsing with Bloom embeddings & residual CNNs

Explosion · 94K views · 2017 · 54:54

Open on YouTube

Computer vision, speech & NLPMachine learning & deep learningtalk

Why Stack Overflow recommends it

Stack Overflow users link it as the best description of how spaCy's NER model, its embeddings and its transition-based training objective actually work.

Recommended by 5 people across 6 different months, 2018 to 2023.

What it is

A conference talk by spaCy creator Matthew Honnibal explaining how spaCy v2.0's named entity recognizer works. It covers Bloom embeddings with subword features, a residual convolutional network, and a transition-based approach to parsing entities, with an intro to NER and Explosion AI's other work.

What people said

Recommends ahalt · 2018-01 · Stack Overflow · on “How does spacy use word embeddings for Named Entity Recognition (NER)?”

spaCy does use word embeddings for its NER model, which is a multilayer CNN. There's a quite a nice video that Matthew Honnibal, the creator of spaCy made, about how its NER works here [this video] . All three English models use GloVe vectors trained on Common Crawl, but the smaller models "prune" the number of vectors by having similar words mapped to the same vector link [LINK] . It's quite doable to add custom vectors. There's an overview of the process in the spaCy docs [LINK] , plus some example code on Github [LINK] .

Recommends syllogism_ · 2018-03 · Stack Overflow · on “Feeding Spacy NER model negative examples to improve training”

Yes, it's possible to learn from the negative examples -- it's implemented in spaCy because it's a key feature of our commercial annotation tool, Prodigy: [LINK] To mark a span as "not PERSON", you can makes its label !PERSON. That should be all you need to do. There's currently no easy way to encode constraints like "not PERSON and not ORG" -- you would have to customise the cost functions, within spacy/syntax/ner.pyx The model can learn from annotations like "not PERSON" because spaCy's NER and parser both use transition-based imitation learning algorithms. At each word we're trying to predict which action to take, to transform the current state. The supervision comes from an oracle that t

Recommends Alejandro · 2018-11 · Stack Overflow · on “Where can one configure the CNN used by the Spacy TextCategorizer?”

The network architecture is defined in the _.ml module specifically within the build_text_classifier [LINK] function. The code related with the training is within the pipeline module specifically within the TextCategorizer [LINK] class. Some parameters like drop_out, batch_size and the number of epochs can be configured as showed in the example, you can also modify the architecture of the network but for that you have to know about the framework behind spaCy which is called Thinc [LINK] and some Cython. I don't know about any paper describing the model but this video provide a great description of it [this video]

Recommends Ines Montani · 2019-09 · Stack Overflow · on “Difference between spaCy models sm, md, lg”

Yes, the word vector gives you a more useful representation of a word than just its text /prefix/suffix/shape. This video [this video] explains the features in more detail. The impact depends on how relevant the vectors are. It's not always that significant, because word vectors are limiting and don't really reflect the "context". That's why transfer learning and embeddings like BERT are so exciting. And there's no "neural vs. statistical" distinction. The components that predict linguistic features are statistical models, implemented using neural networks.

Recommends Omri374 · 2020-02 · Stack Overflow · on “Which Deep Learning Algorithm does Spacy uses when we train Custom model?”

Which learning algorithm does spaCy use? spaCy has its own deep learning library called thinc [LINK] used under the hood for different NLP models. for most (if not all) tasks, spaCy uses a deep neural network based on CNN with a few tweaks. Specifically for Named Entity Recognition, spacy uses: A transition based approach borrowed from shift-reduce parsers, which is described in the paper Neural Architectures for Named Entity Recognition [LINK] by Lample et al. Matthew Honnibal describes how spaCy uses this on a [this video] . A framework that's called "Embed. Encode. Attend. Predict" (Starting here [this video] on the video), slides here [LINK] . Embed : Words are embedded using a Bloom filter, which

Recommends syllogism_ · 2023-06 · Stack Overflow · on “What loss function does Space use for Named Entity Recognition (NER)”

The answer to this is more complicated than you might expect, because spaCy uses a transition-based NER model with an imitation learning objective. The best description of the algorithm is this video, especially the structured prediction part: [this video] The actual loss function used to decide between the different actions is also a bit tricky. The implementation is here: [LINK] I'm sure I've described this in other comments but I can't immediately find it. Basically there may be several equally good transitions, and we want the objective function to account for that. The equations for this are described in Section 4 here: [LINK]

Cites Ray Johns · 2019-10 · Stack Overflow · on “Disabling Gensim's removal of punctuation etc. when parsing a wiki corpus”

You can use a gensim word2vec pretrained model in spaCy, but the problem here is your processing pipeline's order: You pass the texts to gensim Gensim parses and tokenizes the strings You normalize the tokens You pass the tokens back to spaCy You make a w2v corpus (with spaCy) (?) That means the docs are already tokenized when spaCy gets them, and yes, its NER is... complex: [this video] What you'd probably like to do is: You pass the texts to spaCy spaCy parses them with NER spaCy tokenizes them accordingly, keeping entities as one token you load the gensim w2v model with spacy.load() you use the loaded model to create the w2v corpus in spaCy All you need to do is download the model from gensim

Cites Kim Tang · 2020-03 · Stack Overflow · on “spacy summarize model architcture”

I think you are referring to this [LINK] and for that, you can see that the pipeline consists of a tagger, parser and ner. In spacy's documentation for the models, you can check out the architecture section ( [LINK] ) in which the NER model with residual CNNs is explained in a video: [this video] Hope that helps.