promptslab / Promptify

Prompt Engineering | Prompt Versioning | Use GPT or other prompt based models to get structured output. Join our discord for Prompt-Engineering, LLMs and other latest research
https://discord.gg/m88xfYMbK6
Apache License 2.0
3.11k stars 232 forks source link

Adding Index of entity in NER ? #87

Open NeoKun004 opened 11 months ago

NeoKun004 commented 11 months ago

Hello , i was wondering if its possible to use Promptfy to return the NER and the index of the detected entities , that will help alot in NER tasks ( cause some text have multipe NERs and having the index will help bypassing that issue

Hadjerkhd commented 11 months ago

You can change the output_format in pipeline and do something like this

pipeline = Pipeline(self.prompter, self.model, 
                                 output_format='[{"T":"entity type", "E":"entity text", "start": "entity start index", "end":"entity end index"}, {"T":"entity type", "E":"entity text", "start": "entity start index", "end":"entity end index"},...]',)