thunlp / OpenPrompt

An Open-Source Framework for Prompt-Learning.
https://thunlp.github.io/OpenPrompt/
Apache License 2.0
4.38k stars 455 forks source link

[help] How to do NER using OpenPrompt? #233

Open megaduks opened 1 year ago

megaduks commented 1 year ago

Hello, despite my best efforts, I could not succeed in NER tagging using OpenPrompt. The docs show an example of a prompt for NER tagging, but I haven't managed to put all the pieces together. I have assumed that it should be done using PromptForGeneration and I was trying to adapt https://github.com/thunlp/OpenPrompt/blob/main/tutorial/2.1_conditional_generation.py, but to no avail.

Could someone post a simple example of tagging entities in a sentence? That would be extremely useful and appreciated.

NtaylorOX commented 1 year ago

I would also love to see this

yulinchen99 commented 1 year ago

Doing NER with prompt learning is not a straightforward task, because in NER you are basically doing classification for every token in the sentence. You can refer to this paper Template-free Prompt Tuning for Few-shot NER