sinatools.arabiner.bin.infer¶
-
sinatools.arabiner.bin.infer.
ner
(text, batch_size=32)¶ This method takes a text as input, and a batch size, then performs named entity recognition (NER) on the input text and returns a list of tagged mentions.
- Parameters
- Returns
- A list of lists containing token and label pairs for each segment.
Each inner list has the format [‘token’, ‘label1 label2 …’].
- Return type
Example:
from sinatools.arabiner.bin import infer infer.ner('ذهب محمد الى جامعة بيرزيت') #the output [['ذهب', 'O'], ['محمد', 'B-PERS'], ['الى', 'O'], ['جامعة', 'B-ORG'], ['بيرزيت', 'B-GPE I-ORG']]