Rithwik Rajendran
Rithwik Rajendran

Reputation: 109

How to add explanation/description for a newly defined label in SpaCy's NER?

I'm creating a new label called GADGET to identify gadgets like Apple iPhone, Samsung TV etc. How do I add a custom description for the new label ?

For example, if label='ORG' & we give spacy.explain(label), it gives a description for ORG. How can I add similarly for a new label?

Upvotes: 0

Views: 125

Answers (2)

Darkknight
Darkknight

Reputation: 1826

Go to the spacy model in your project and you can find glossary.py file spaCy/spacy/glossary.py there You can define your label and save it. Then You can get explanation of your label using spacy.explain(label)

Upvotes: 1

Piyush
Piyush

Reputation: 111

You can update the spacy glossary file available in your site-packages path.

I hope this helps!

Upvotes: 0

Related Questions