dmis-lab / biobert

Bioinformatics'2020: BioBERT: a pre-trained biomedical language representation model for biomedical text mining
http://doi.org/10.1093/bioinformatics/btz682
Other
1.93k stars 451 forks source link

getting NER labels from BioBert via huggingfaces #116

Open mariaBio opened 4 years ago

mariaBio commented 4 years ago

Dear all,

Could someone tell how/where I can get entity labels for the NER task implemented by BioBert? I am using huggingfaces to load the model and get predictions on a sentence; but I cannot get tokens/entity pairs using example from https://huggingface.co/transformers/usage.html#named-entity-recognition because I have no labels list. Predictions look like this: tensor([[524, 524, 571, 272, 248, 254, 471, 413, 413, 300, 471, 369, 463, 222, 27, 272, 687, 524, 471, 27, 575, 338, 29, 670, 733, 0, 764, 526, 254, 212, 29, 254, 254, 169, 85, 11, 505, 27, 254, 254, 656, 342, 609, 609, 687, 27, 254, 386, 116, 11, 505, 733, 614, 413, 83, 342, 369, 463, 222, 479, 112, 505, 300, 464]], grad_fn=)

Thank you very much!

BharathRajaGajula commented 4 years ago

Even I am struggling with this part.

mgavish commented 3 years ago

Have you guys made progress?

I'm also attempting to use BioBERT and Hugging Face for inference mode, i.e., my corpus is unlabeled. I figure I must use the labels that BioBERT used but have not figured out how to extract them. I've been struggling to use the bioBERT model without using the API/cloned repo.

shoaibb commented 3 years ago

@Raja18820 @mgavish @mariaBio Were you able to solve this? I am also facing a similar issue.