Get text generation in particular format
hi, i am currently inferring different LLMs for classification and their inherit understanding of requirement engineering.this is a zero shot prompt designed for inferring the LLMs.few LLMs are giving the output in described format. but few models, even with higher number of parameters are not giving answer. rather they just giving output like this:‘generated_text’ : \nSentence1\n\nSentence2\n\nSentence3.expected output is: label1, label2, label3test_zero_prompt = “”"Functional requirements specify the functions or behaviors that a system must provide. They describe what the system should do.Non-functional requirements specify constraints, qualities, or characteristics that the system must possess, such as performance, usability, or security, etc. They describe how the system should behave or perform.Information (also known as non-requirements) refers to statements that provide context, background, or explanations but do not specify any requirements for the system.classify the given sentences into functional requirement, non-functional requirement, or information. Give the answer in the classification labels only.Sentence 1: this is a functional requirement.Sentence 2: this is a non-functional requirement.Sentence 3: this is an information.Sentence 4: this is a functional requirement.Answers:functional requirement, non-functional requirement, information, functional requirementClassify the following Sentences according to format above: “”"can anyone suggest, how can i improve the prompt or change it.or find mistake or error in prompt?
2024-04-18T08:58:44Z
You may be interested in libraries likeoutlinesthat enable enforcing a format/json/regex on generated text
2024-04-18T09:11:47Z
Is it compatible with hugging face libraries. Like accelerate or pipeline?
2024-04-18T09:30:44Z
If you want compatibility withtransformers, look intothiswhich implemented constraints as a separate LogitsProcessor. I believe it should be compatible by simply passinglogits_processor=[grammar_processor]intomodel.generate()
2024-04-18T09:45:01Z
Thanks, I think I can pass logits processor in pipeline or use it with accelerate.
2024-04-18T21:45:20Z
This topic was automatically closed 12 hours after the last reply. New replies are no longer allowed.