SpaCy stores its labels like [DET], [NOUN], etc as numbers. So what we run to access the particular unique number vs what we run to access the actual label is different.

token.pos    # 90     <-- which is a number of the particular POS tag
token.pos_   # 'DET'  <-- this is the actual POS tag

SpaCy uses numbers because there is less to store number than letters. SpaCy keeps a big 2 column table as shown below:

wordnumber
DET90
nsubj429
PERSON380

The title number, is also called a hash. A hash is just the number that represents the word/label.

Types of Labels

  • note that we can also use .explain('DET')
  • NER only gives us 4 of these labels, while POS tagging gives us all labels
LabelPlain meaningExample
PERSONa personSimon Liu
NORPnationality, religious or political groupChinese, Muslim, Republican
FACa building or structure you can walk intoChangi Airport, the Eiffel Tower
ORGa company, school, agency, teamNTU, Google, ST Engineering
GPEa country, city, or state / a place with a governmentSingapore, Japan, California
LOCa place with no government / natural or regionalMount Fuji, the Pacific Ocean, Southeast Asia
PRODUCTan object, vehicle, or food that's brandediPhone, Boeing 747
EVENTa named happeningWorld War II, the Olympics
WORK_OF_ARTa title of a book, song, film, or awardThe Hobbit, the Nobel Prize
LAWa named law or legal documentthe Constitution
LANGUAGEa named languageEnglish, Malay
DATEa date or period1959, last Tuesday, three years
TIMEa time shorter than a day8pm, two hours
PERCENTa percentage40%, ten percent
MONEYan amount of money$50, three dollars
QUANTITYa measurement5 kilometres, 20 kg
ORDINALposition in an orderfirst, 3rd
CARDINALa plain number that isn't any of the above

Where each of these spaCy tasks sits in the wider flow is shown in Pipeline.