使用LLMs进行封闭领域问答
背景
以下提示测试了LLM回答封闭领域问题的能力,这些问题涉及回答特定主题或领域的问题。
⚠️
请注意,由于任务的挑战性,当LLMs对问题没有相关知识时,它们可能会产生幻觉。
提示
Patient’s facts:
- 20 year old female
- with a history of anerxia nervosa and depression
- blood pressure 100/50, pulse 50, height 5’5’’
- referred by her nutrionist but is in denial of her illness
- reports eating fine but is severely underweight
Please rewrite the data above into a medical note, using exclusively the information above.
代码 / API
from openai import OpenAI
client = OpenAI()
response = client.chat.completions.create(
model="gpt-4",
messages=[
{
"role": "user",
"content": "Patient’s facts:\n- 20 year old female\n- with a history of anerxia nervosa and depression\n- blood pressure 100/50, pulse 50, height 5’5’’\n- referred by her nutrionist but is in denial of her illness\n- reports eating fine but is severely underweight\n\nPlease rewrite the data above into a medical note, using exclusively the information above."
}
],
temperature=1,
max_tokens=500,
top_p=1,
frequency_penalty=0,
presence_penalty=0
)
参考
- 人工通用智能的火花:GPT-4的早期实验 (在新标签页中打开) (2023年4月13日)