---
title: spaCy models for NER
type: guide
tier: all
order: 70
hide_menu: true
hide_frontmatter_title: true
meta_title: Use spaCy models with Label Studio
meta_description: Tutorial on how to use Label Studio and spaCy for faster NER and POS labeling
categories:
- Natural Language Processing
- Named Entity Recognition
- SpaCy
This ML backend provides a simple way to use spaCy models for Named Entity Recognition (NER) and Part-of-Speech (POS) tagging.
Current implementation includes the following models:
- Named Entity Recognition (NER)
- [coming soon...] Part-of-Speech (POS) tagging
Before you begin, you must install the Label Studio ML backend.
This tutorial uses the spacy example.
http://localhost:9090docker-compose up
$ curl http://localhost:9090/health
{"status":"UP"}
http://localhost:9090.This model is compatible with the following labeling configurations:xml <View> <Labels name="label" toName="text"> <Label value="CARDINAL" background="#FFA39E"/> <Label value="DATE" background="#D4380D"/> <Label value="EVENT" background="#FFC069"/> <Label value="FAC" background="#AD8B00"/> <Label value="GPE" background="#D3F261"/> <Label value="LANGUAGE" background="#389E0D"/> <Label value="LAW" background="#5CDBD3"/> <Label value="LOC" background="#096DD9"/> <Label value="ORG" background="#ADC6FF"/> <Label value="PERSON" background="#9254DE"/> <Label value="TIME" background="#F759AB"/> </Labels> <Text name="text" value="$text"/> </View>
You can also use the default configuration from the Named Entity Recognition template provided with Label Studio.
Note: If your labels are different from the default ones, the text spans will still be highlighted, but you have to manually map the labels to the ones you have in the model. Go to
model.pyand change_custom_labels_mappingto map from SpaCy entities to your labels. Check for predefined labels in the official SpaCy documentation, for example for en_core_web_sm.
To change default parameters, specify the following environment variables:
PORT - port to run the server on, default is 9090WORKERS - number of workers to run the server with, default is 2SPACY_MODEL - spaCy model to use, default is en_core_web_sm