Json output format issue

#16
by rastegar - opened

i asked output json in prompt
but i got malformed json output
{"items": [{"type": "text", "content_type": "text", "text_align": "center", "content": "X = Back to the Future : \{Adventure,Comedy,SciFi\}\nY = Mad max Beyond Thunderdome : \{Action,Adventure,SciFi\}\n\n\[ J(X,Y) = \frac{|\{Adventure,SciFi\}|}{|\{Action,Adventure,Comedy,SciFi\}|} = \frac{2}{4} = 0.5 \]"}]


i test multiple time it return wrong when we have latex or a little complex content 

i have same issue

I've used this prompt and it works pretty well for json format output (I purposly anonymized the prompt).

""" Extract the name of the organization and its associated reference number.
In this document, look for the mention of a project, and identify which one appears.
Return the results in JSON format with the following keys:

  • "organization" for the name of the recipient organization,
  • "reference_number" for the reference number,
  • "project_code" ... """

I think the best way is to specify each key in the prompt !

How did you change the prompt?

Unstead of using the build_finetuning_prompt function, I simply replace it by a custom prompt.
prompt = build_finetuning_prompt(anchor_text) --> custom prompt

Your need to confirm your account before you can post a new comment.

Sign up or log in to comment