I have trained a simple NER pipeline using spacy 3.0. After training I want to get a list of predicted IOB tags, among other things from a Doc
(doc = nlp(text)
). For example, ["O", "O", "B", "I", "O"]
I can easily get the IOB ids (integers) using
>> doc.to_array("ENT_IOB")
array([2, 2, ..., 2], dtype=uint64)
But how can I get the mappings/lookup?
I didn't find any lookup tables in doc.vocab.lookups.tables
.
I also understand that I can achieve the same effect by accessing the ent_iob_
at each token ([token.ent_iob_ for token in doc]
), but I was wondering if there is a better way?