diff --git a/content/Building Systems with the ChatGPT API/10.Evaluation-part2.ipynb b/content/Building Systems with the ChatGPT API/10.Evaluation-part2.ipynb index 1848b58..ca790e5 100644 --- a/content/Building Systems with the ChatGPT API/10.Evaluation-part2.ipynb +++ b/content/Building Systems with the ChatGPT API/10.Evaluation-part2.ipynb @@ -38,7 +38,7 @@ "import sys\n", "sys.path.append('../..')\n", "import utils_en\n", - "import utils_ch\n", + "import utils_zh\n", "from dotenv import load_dotenv, find_dotenv\n", "_ = load_dotenv(find_dotenv()) # read local .env file\n", "\n", @@ -124,13 +124,13 @@ "另外,你们这有什么 TVs ?\"\"\"\n", "\n", "# 从问题中抽取商品名\n", - "products_by_category = utils_ch.get_products_from_query(customer_msg)\n", + "products_by_category = utils_zh.get_products_from_query(customer_msg)\n", "# 将商品名转化为列表\n", - "category_and_product_list = utils_ch.read_string_to_list(products_by_category)\n", + "category_and_product_list = utils_zh.read_string_to_list(products_by_category)\n", "# 查找商品对应的信息\n", - "product_info = utils_ch.get_mentioned_product_info(category_and_product_list)\n", + "product_info = utils_zh.get_mentioned_product_info(category_and_product_list)\n", "# 由信息生成回答\n", - "assistant_answer = utils_ch.answer_user_msg(user_msg=customer_msg, product_info=product_info)" + "assistant_answer = utils_zh.answer_user_msg(user_msg=customer_msg, product_info=product_info)" ] }, { diff --git a/content/Building Systems with the ChatGPT API/8.Evaluation.ipynb b/content/Building Systems with the ChatGPT API/8.Evaluation.ipynb index 50afa5b..43bec3f 100644 --- a/content/Building Systems with the ChatGPT API/8.Evaluation.ipynb +++ b/content/Building Systems with the ChatGPT API/8.Evaluation.ipynb @@ -81,7 +81,7 @@ "# 使用英文 Prompt 的工具包\n", "import utils_en\n", "# 使用中文 Prompt 的工具包\n", - "import utils_ch\n", + "import utils_zh\n", "\n", "import panel as pn # 用于图形化界面\n", "pn.extension()\n", @@ -286,16 +286,16 @@ " if debug: print(\"第一步:输入通过 Moderation 检查\")\n", " \n", " # 第二步:抽取出商品和对应的目录,类似于之前课程中的方法,做了一个封装\n", - " category_and_product_response = utils_ch.find_category_and_product_only(user_input, utils_ch.get_products_and_category())\n", + " category_and_product_response = utils_zh.find_category_and_product_only(user_input, utils_zh.get_products_and_category())\n", " #print(category_and_product_response)\n", " # 将抽取出来的字符串转化为列表\n", - " category_and_product_list = utils_ch.read_string_to_list(category_and_product_response)\n", + " category_and_product_list = utils_zh.read_string_to_list(category_and_product_response)\n", " #print(category_and_product_list)\n", "\n", " if debug: print(\"第二步:抽取出商品列表\")\n", "\n", " # 第三步:查找商品对应信息\n", - " product_information = utils_ch.generate_output_string(category_and_product_list)\n", + " product_information = utils_zh.generate_output_string(category_and_product_list)\n", " if debug: print(\"第三步:查找抽取出的商品信息\")\n", "\n", " # 第四步:根据信息生成回答\n", diff --git a/content/Building Systems with the ChatGPT API/9.Evaluation-part1.ipynb b/content/Building Systems with the ChatGPT API/9.Evaluation-part1.ipynb index 05ba75d..8fdc63a 100644 --- a/content/Building Systems with the ChatGPT API/9.Evaluation-part1.ipynb +++ b/content/Building Systems with the ChatGPT API/9.Evaluation-part1.ipynb @@ -82,7 +82,7 @@ "import time\n", "sys.path.append('../..')\n", "import utils_en\n", - "import utils_ch\n", + "import utils_zh\n", "\n", "openai.api_key = \"your_key\"" ]