转载

ChatGPT插件例子 ML/AI语言模型导师

这是一个 QA 风格的聊天机器人,可以回答有关语言模型的问题。

提问

ML导师:我是ML/AI语言模型导师
你:什么是语言模型?
ML导师:语言模型是一种统计模型,它描述了给定前一个词的一个词的概率。
你:什么是统计模型?

回答

ML 导师:统计模型是现实世界现象的数学表示。它用于根据数据做出预测或决策。统计模型使用概率和统计数据来推断数据。



API请求

<font size="3">import os
import openai

openai.api_key = os.getenv("OPENAI_API_KEY")

response = openai.Completion.create(
  model="text-davinci-003",
  prompt="ML Tutor: I am a ML/AI language model tutor\nYou: What is a language model?\nML Tutor: A language model is a statistical model that describes the probability of a word given the previous words.\nYou: What is a statistical model?",
  temperature=0.3,
  max_tokens=60,
  top_p=1.0,
  frequency_penalty=0.5,
  presence_penalty=0.0,
  stop=["You:"]
)</font>