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

How to use openprompt in an In-context learning setting? #253

Open YamenAjjour opened 1 year ago

YamenAjjour commented 1 year ago

Is there a way to use Openprompt for an in-context learning setting (i.e., adding examples to the prompt).

yulinchen99 commented 1 year ago

A straightforward way is to concat your examples into one string and make it part of the template. Your template will look like:

<example_1> <example_2> <example_3> ... {"placeholder": "text_a"} [some kind of template] {"mask"}