mrc-for-flat-nested-ner icon indicating copy to clipboard operation
mrc-for-flat-nested-ner copied to clipboard

How to do inference?

Open 447428054 opened this issue 4 years ago • 4 comments

@YuxianMeng @littlesulley需要得到预测的结果,是改写trainer里面的test函数嘛? 之后报个错 result = trainer.test(model=model, test_dataloaders=model.test_dataloader()) print(result)

ValueError: Dataloader returned 0 length. Please make sure that your Dataloader at least returns 1 batch

447428054 avatar Oct 21 '20 03:10 447428054

我自己写了个inference函数,不知道是否有帮到你~ https://github.com/HsiaYu/mrc-for-flat-nested-ner/blob/master/inference.py

ghost avatar Nov 19 '20 13:11 ghost

Is there an update about how to do inference? the link you shared is not reachable. Either it is a private repo or the link is not correct.

ogunoz avatar Dec 04 '20 14:12 ogunoz

你好,请问你有预测代码吗

gouhaogou avatar Apr 19 '21 13:04 gouhaogou

Hi~ Thanks for asking. We update the codebase and code for inference using the trained MRC-NER model can be found in https://github.com/ShannonAI/mrc-for-flat-nested-ner/blob/master/inference.py

  1. The inference script for flat NER can be found at https://github.com/ShannonAI/mrc-for-flat-nested-ner/blob/master/scripts/flat_inference.sh
  2. The inference script for nested NER can be found at https://github.com/ShannonAI/mrc-for-flat-nested-ner/blob/master/scripts/nested_inference.sh

xiaoya-li avatar Jul 30 '21 13:07 xiaoya-li