Skip to content

How to get a list of all ent_type and pos integers for a model #13377

Discussion options

You must be logged in to vote

Hi!

I want to get a list of all possible values ent_type and pos can take

Builtin components in spaCy typically support the labels property, so you can do:

    nlp = spacy.load("en_core_web_lg")
    print(f"NER labels: {nlp.get_pipe('ner').labels}")
    print(f"Tagger labels: {nlp.get_pipe('tagger').labels}")

Which will give you

NER labels: ('CARDINAL', 'DATE', 'EVENT', 'FAC', 'GPE', 'LANGUAGE', 'LAW', 'LOC', 'MONEY', 'NORP', 'ORDINAL', 'ORG', 'PERCENT', 'PERSON', 'PRODUCT', 'QUANTITY', 'TIME', 'WORK_OF_ART')

Tagger labels: ('$', "''", ',', '-LRB-', '-RRB-', '.', ':', 'ADD', 'AFX', 'CC', 'CD', 'DT', 'EX', 'FW', 'HYPH', 'IN', 'JJ', 'JJR', 'JJS', 'LS', 'MD', 'NFP', 'NN', 'NNP', 'NNPS', …

Replies: 1 comment

Comment options

You must be logged in to vote
0 replies
Answer selected by svlandeg
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feat / doc Feature: Doc, Span and Token objects
2 participants