Seeking assistance to extract specific information from the given prompt without generating new content

RaushanTurganbay
Fri, 24 May 2024 08:45:42 +0000

Hey!

To generate guaranteed structured output from LLMs you can use one of the following tools:

1. Outlines: Can be easily used with transformers and offers constraints with JSON, regex and more.

2. Context-Free_grammar based tool: similar to outlines but works only with context-free-grammar constraint. Compared to outlines, this one is better and faster for complex rules/constraints.

3. JsonFormer: Specifically crafted for json format. I have’t tried it yet personally.

In general I would recommend to use either outlines or jsonformer if you’re trying to generate dict-like object