Nealcly / templateNER

Source code for template-based NER

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Seq2SeqModel predicts one entity at a time

savasy opened this issue · comments

Hi,
Seq2SeqModel.predict function predicts one entity at a time. e.g.

predict("Tesla, IBM, and Amazon are the good tech companies") -> "Tesla is an Organization"
What about extracting IBM and Amazon as well at the same time!

During inference, we do not generate the prediction directly. We consider the model as the scoring function. Given a sentence, we first enumerate all possible text spans in the input sentence as named entity candidates, and then classify them into entities or non-entities based on BART scores on templates.

Thank you @Nealcly
My problem is that I do not calculate the detailed performance (F1, Prec etc.) for different Label sets other than PER LOC ORG. I managed to train model with 9 labels and get a good accuracy btw.
When I use your Inference.py code to run the model trained with 9 labels, I got some errors. Maybe I share it with a different issue thread