facebookresearch / SpanBERT

Code for using and evaluating SpanBERT.
Other
881 stars 175 forks source link

Use spanbert model for Named Entity Recognition to predict on data #96

Open pratikchhapolika opened 1 year ago

pratikchhapolika commented 1 year ago

I am using spanbert model ( I do not fine-tune it) downloaded from https://github.com/facebookresearch/SpanBERT to test it on some text samples.

The result I get is in this format using HF:

token_classifier = pipeline("token-classification", model=model, aggregation_strategy="max",tokenizer=tokenizer,grouped_entities=True)

Label_0, Label_1 How to map these Labels to entity names? Is there any function, documents where it mentions about entity type mapping?

​ ​