LLM-Prompt-Prompt-Konstruktionsfall

Referenz:
https://github.com/PlexPt/awesome-chatgpt-prompts-zh
Fügen Sie hier eine Bildbeschreibung ein

Schnelle technische Anwendung von Wu Enda:
https://www.bilibili.com/video/BV1No4y1t7Zn
Fügen Sie hier eine Bildbeschreibung ein

Code für den sofortigen Baufall

prompt = """文本分类任务:将一段用户给外卖服务的评论进行分类,分成好评或者差评。

下面是一些范例:

味道真不错 -> 好评
太辣了,吃不下都  -> 差评

请对下述评论进行分类。返回'好评'或者'差评',无需其它说明和解释。

xxxxxx ->

"""

def get_prompt(text):
    return prompt.replace('xxxxxx',text)


response, his = model.chat(tokenizer, get_prompt('味道不错,下次还来'), history=[])
print(response)

Guess you like

Origin blog.csdn.net/weixin_42357472/article/details/131523996