microsoft / vert-papers

This repository contains code and datasets related to entity/knowledge papers from the VERT (Versatile Entity Recognition & disambiguation Toolkit) project, by the Knowledge Computing group at Microsoft Research Asia (MSRA).
MIT License
266 stars 93 forks source link

Obtaining Predicted NER Results for a Series of Sentences with DecomposedMetaNER #65

Closed Yuan-9 closed 1 year ago

Yuan-9 commented 1 year ago

I am hoping to use the DecomposedMetaNER model for a learning project. My expectation is to input a series of sentences and, after processing by the model, receive a series of NER predictions, including entities and their corresponding types. However, after following the Quick Start steps and running the model, I did not get this kind of output. I can only see the evaluation results in the console.

Is there any method or guidance available to help me obtain the desired predicted NER results for my input sentences? Any assistance would be greatly appreciated.

iofu728 commented 1 year ago

Thank you for your attention to our project. Previously, in order to adapt to the Few-NERD benchmark, the code did not have interactive processing logic, but you can get the results of all predicted entities in the preds of the function in https://github.com/microsoft/vert-papers/blob/master/papers/DecomposedMetaNER/learner.py#L759, but note that the index here refers to the index after tokenization.

Yuan-9 commented 1 year ago

Thanks for your answer! I will make my own modifications on this code for my research.

DeterjoSimon commented 1 year ago

Hello, I have a question regarding seeing the output of the model once it is trained. When @iofu728 you refer to the variable preds, do you mean we should print out the results of the variable? Or do you otherwise mean that the is_debug flag should be active and that you have to look at the e.pklfile?

I can also see that the model once trained outputs files like all_test_preds.pkl. How could one see what the target and prediction refers to in real text?

Thank you for your time and the interesting project :)