From 4b72edd4c646092c9ad457fb2593cfd6db4542ba Mon Sep 17 00:00:00 2001 From: AntoineChn Date: Mon, 1 May 2023 11:04:35 +0200 Subject: [PATCH 1/4] fix: replace single quotation marks by triple backticks --- content/5. 推断 Inferring.ipynb | 112 ++++++++++++++++---------------- 1 file changed, 56 insertions(+), 56 deletions(-) diff --git a/content/5. 推断 Inferring.ipynb b/content/5. 推断 Inferring.ipynb index f660517..dd614ee 100644 --- a/content/5. 推断 Inferring.ipynb +++ b/content/5. 推断 Inferring.ipynb @@ -19,7 +19,7 @@ }, { "cell_type": "code", - "execution_count": 73, + "execution_count": 1, "id": "a821d943", "metadata": { "height": 132 @@ -35,7 +35,7 @@ }, { "cell_type": "code", - "execution_count": 74, + "execution_count": 2, "id": "e82f5577", "metadata": { "height": 164 @@ -64,7 +64,7 @@ }, { "cell_type": "code", - "execution_count": 24, + "execution_count": 3, "id": "b0f3b49b", "metadata": { "height": 200 @@ -86,7 +86,7 @@ }, { "cell_type": "code", - "execution_count": 78, + "execution_count": 4, "id": "bc6260f0", "metadata": {}, "outputs": [], @@ -114,7 +114,7 @@ }, { "cell_type": "code", - "execution_count": 26, + "execution_count": 5, "id": "e3157601", "metadata": { "height": 149 @@ -133,7 +133,7 @@ "What is the sentiment of the following product review, \n", "which is delimited with triple backticks?\n", "\n", - "Review text: '''{lamp_review}'''\n", + "Review text: ```{lamp_review}```\n", "\"\"\"\n", "response = get_completion(prompt)\n", "print(response)" @@ -141,7 +141,7 @@ }, { "cell_type": "code", - "execution_count": 80, + "execution_count": 6, "id": "ac5b0bb9", "metadata": {}, "outputs": [ @@ -149,7 +149,7 @@ "name": "stdout", "output_type": "stream", "text": [ - "积极的情感。\n" + "情感是积极的/正面的。\n" ] } ], @@ -158,7 +158,7 @@ "prompt = f\"\"\"\n", "以下用三个反引号分隔的产品评论的情感是什么?\n", "\n", - "评论文本: '''{lamp_review_zh}'''\n", + "评论文本: ```{lamp_review_zh}```\n", "\"\"\"\n", "response = get_completion(prompt)\n", "print(response)" @@ -174,7 +174,7 @@ }, { "cell_type": "code", - "execution_count": 28, + "execution_count": 7, "id": "acf9ca16", "metadata": { "height": 200 @@ -196,7 +196,7 @@ "Give your answer as a single word, either \"positive\" \\\n", "or \"negative\".\n", "\n", - "Review text: '''{lamp_review}'''\n", + "Review text: ```{lamp_review}```\n", "\"\"\"\n", "response = get_completion(prompt)\n", "print(response)" @@ -204,7 +204,7 @@ }, { "cell_type": "code", - "execution_count": 82, + "execution_count": 8, "id": "84a761b3", "metadata": {}, "outputs": [ @@ -222,7 +222,7 @@ "\n", "用一个单词回答:「正面」或「负面」。\n", "\n", - "评论文本: '''{lamp_review_zh}'''\n", + "评论文本: ```{lamp_review_zh}```\n", "\"\"\"\n", "response = get_completion(prompt)\n", "print(response)" @@ -240,7 +240,7 @@ }, { "cell_type": "code", - "execution_count": 33, + "execution_count": 9, "id": "8aa7934b", "metadata": { "height": 183 @@ -250,7 +250,7 @@ "name": "stdout", "output_type": "stream", "text": [ - "happy, satisfied, grateful, impressed, content\n" + "satisfied, grateful, impressed, content, pleased\n" ] } ], @@ -261,7 +261,7 @@ "five items in the list. Format your answer as a list of \\\n", "lower-case words separated by commas.\n", "\n", - "Review text: '''{lamp_review}'''\n", + "Review text: ```{lamp_review}```\n", "\"\"\"\n", "response = get_completion(prompt)\n", "print(response)" @@ -269,7 +269,7 @@ }, { "cell_type": "code", - "execution_count": 35, + "execution_count": 10, "id": "e615c13a", "metadata": {}, "outputs": [ @@ -277,7 +277,7 @@ "name": "stdout", "output_type": "stream", "text": [ - "满意,感激,赞扬,信任,愉快\n" + "满意,感激,信任,赞扬,愉快\n" ] } ], @@ -286,7 +286,7 @@ "prompt = f\"\"\"\n", "识别以下评论的作者表达的情感。包含不超过五个项目。将答案格式化为以逗号分隔的单词列表。\n", "\n", - "评论文本: '''{lamp_review_zh}'''\n", + "评论文本: ```{lamp_review_zh}```\n", "\"\"\"\n", "response = get_completion(prompt)\n", "print(response)" @@ -312,7 +312,7 @@ }, { "cell_type": "code", - "execution_count": 37, + "execution_count": 11, "id": "dba1a538", "metadata": { "height": 166 @@ -332,7 +332,7 @@ "The review is delimited with triple backticks. \\\n", "Give your answer as either yes or no.\n", "\n", - "Review text: '''{lamp_review}'''\n", + "Review text: ```{lamp_review}```\n", "\"\"\"\n", "response = get_completion(prompt)\n", "print(response)" @@ -340,7 +340,7 @@ }, { "cell_type": "code", - "execution_count": 20, + "execution_count": 12, "id": "85bad324", "metadata": {}, "outputs": [ @@ -357,7 +357,7 @@ "prompt = f\"\"\"\n", "以下评论的作者是否表达了愤怒?评论用三个反引号分隔。给出是或否的答案。\n", "\n", - "评论文本: '''{lamp_review_zh}'''\n", + "评论文本: ```{lamp_review_zh}```\n", "\"\"\"\n", "response = get_completion(prompt)\n", "print(response)" @@ -387,7 +387,7 @@ }, { "cell_type": "code", - "execution_count": 39, + "execution_count": 13, "id": "a13bea1b", "metadata": { "height": 285 @@ -398,7 +398,7 @@ "output_type": "stream", "text": [ "{\n", - " \"Item\": \"lamp\",\n", + " \"Item\": \"lamp with additional storage\",\n", " \"Brand\": \"Lumina\"\n", "}\n" ] @@ -417,7 +417,7 @@ "as the value.\n", "Make your response as short as possible.\n", " \n", - "Review text: '''{lamp_review}'''\n", + "Review text: ```{lamp_review}```\n", "\"\"\"\n", "response = get_completion(prompt)\n", "print(response)" @@ -425,7 +425,7 @@ }, { "cell_type": "code", - "execution_count": 83, + "execution_count": 14, "id": "e9ffe056", "metadata": {}, "outputs": [ @@ -451,7 +451,7 @@ "如果信息不存在,请使用 “未知” 作为值。\n", "让你的回应尽可能简短。\n", " \n", - "评论文本: '''{lamp_review_zh}'''\n", + "评论文本: ```{lamp_review_zh}```\n", "\"\"\"\n", "response = get_completion(prompt)\n", "print(response)" @@ -477,7 +477,7 @@ }, { "cell_type": "code", - "execution_count": 43, + "execution_count": 15, "id": "e7dda9e5", "metadata": { "height": 336 @@ -512,7 +512,7 @@ "Make your response as short as possible.\n", "Format the Anger value as a boolean.\n", "\n", - "Review text: '''{lamp_review}'''\n", + "Review text: ```{lamp_review}```\n", "\"\"\"\n", "response = get_completion(prompt)\n", "print(response)" @@ -520,7 +520,7 @@ }, { "cell_type": "code", - "execution_count": 45, + "execution_count": 16, "id": "939c2b0e", "metadata": { "scrolled": true @@ -531,10 +531,10 @@ "output_type": "stream", "text": [ "{\n", - " \"Sentiment\": \"正面\",\n", - " \"Anger\": false,\n", - " \"Item\": \"卧室灯\",\n", - " \"Brand\": \"Lumina\"\n", + " \"Sentiment\": \"正面\",\n", + " \"Anger\": false,\n", + " \"Item\": \"卧室灯\",\n", + " \"Brand\": \"Lumina\"\n", "}\n" ] } @@ -553,7 +553,7 @@ "让你的回应尽可能简短。\n", "将 Anger 值格式化为布尔值。\n", "\n", - "评论文本: '''{lamp_review_zh}'''\n", + "评论文本: ```{lamp_review_zh}```\n", "\"\"\"\n", "response = get_completion(prompt)\n", "print(response)" @@ -579,7 +579,7 @@ }, { "cell_type": "code", - "execution_count": 56, + "execution_count": 17, "id": "8a74cc3e", "metadata": { "height": 472 @@ -617,7 +617,7 @@ }, { "cell_type": "code", - "execution_count": 57, + "execution_count": 18, "id": "811ff13f", "metadata": {}, "outputs": [], @@ -651,7 +651,7 @@ }, { "cell_type": "code", - "execution_count": 58, + "execution_count": 19, "id": "5c267cbe", "metadata": { "height": 217 @@ -661,7 +661,7 @@ "name": "stdout", "output_type": "stream", "text": [ - "government survey, job satisfaction, NASA, Social Security Administration, employee concerns\n" + "government survey, public sector employees, job satisfaction, NASA, Social Security Administration\n" ] } ], @@ -674,7 +674,7 @@ "\n", "Format your response as a list of items separated by commas.\n", "\n", - "Text sample: '''{story}'''\n", + "Text sample: ```{story}```\n", "\"\"\"\n", "response = get_completion(prompt)\n", "print(response)" @@ -682,7 +682,7 @@ }, { "cell_type": "code", - "execution_count": 59, + "execution_count": 20, "id": "f92f90fe", "metadata": { "height": 30, @@ -693,13 +693,13 @@ "data": { "text/plain": [ "['government survey',\n", + " ' public sector employees',\n", " ' job satisfaction',\n", " ' NASA',\n", - " ' Social Security Administration',\n", - " ' employee concerns']" + " ' Social Security Administration']" ] }, - "execution_count": 59, + "execution_count": 20, "metadata": {}, "output_type": "execute_result" } @@ -710,7 +710,7 @@ }, { "cell_type": "code", - "execution_count": 64, + "execution_count": 21, "id": "cab27b65", "metadata": {}, "outputs": [ @@ -731,7 +731,7 @@ "\n", "输出时用逗号分割每个主题。\n", "\n", - "给定文本: '''{story_zh}'''\n", + "给定文本: ```{story_zh}```\n", "\"\"\"\n", "response = get_completion(prompt)\n", "print(response)" @@ -749,7 +749,7 @@ }, { "cell_type": "code", - "execution_count": 84, + "execution_count": 22, "id": "94b8fa65", "metadata": { "height": 81 @@ -764,7 +764,7 @@ }, { "cell_type": "code", - "execution_count": 67, + "execution_count": 23, "id": "626c5b8e", "metadata": { "height": 234 @@ -792,7 +792,7 @@ "\n", "List of topics: {\", \".join(topic_list)}\n", "\n", - "Text sample: '''{story}'''\n", + "Text sample: ```{story}```\n", "\"\"\"\n", "response = get_completion(prompt)\n", "print(response)" @@ -800,7 +800,7 @@ }, { "cell_type": "code", - "execution_count": 68, + "execution_count": 24, "id": "902a7c74", "metadata": { "height": 79 @@ -822,7 +822,7 @@ }, { "cell_type": "code", - "execution_count": 71, + "execution_count": 25, "id": "9f53d337", "metadata": {}, "outputs": [ @@ -831,7 +831,7 @@ "output_type": "stream", "text": [ "美国航空航天局:1\n", - "地方政府:0\n", + "地方政府:1\n", "工程:0\n", "员工满意度:1\n", "联邦政府:1\n" @@ -847,7 +847,7 @@ "\n", "主题列表:美国航空航天局、地方政府、工程、员工满意度、联邦政府\n", "\n", - "给定文本: '''{story_zh}'''\n", + "给定文本: ```{story_zh}```\n", "\"\"\"\n", "response = get_completion(prompt)\n", "print(response)" @@ -865,7 +865,7 @@ }, { "cell_type": "code", - "execution_count": 72, + "execution_count": 26, "id": "53bf1abd", "metadata": {}, "outputs": [ @@ -926,7 +926,7 @@ "name": "python", "nbconvert_exporter": "python", "pygments_lexer": "ipython3", - "version": "3.8.13" + "version": "3.11.3" }, "latex_envs": { "LaTeX_envs_menu_present": true, From 6753bcf64a1eb001463f495ef78ad7b3cabdd3f2 Mon Sep 17 00:00:00 2001 From: AntoineChn Date: Mon, 1 May 2023 11:06:25 +0200 Subject: [PATCH 2/4] =?UTF-8?q?fix:=20fix=20a=20translation=20error=20by?= =?UTF-8?q?=20replacing=20=E5=AE=A1=E7=A8=BF=E4=BA=BA=20by=20=E8=AF=84?= =?UTF-8?q?=E8=AE=BA=E8=80=85?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- content/5. 推断 Inferring.ipynb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/content/5. 推断 Inferring.ipynb b/content/5. 推断 Inferring.ipynb index dd614ee..e3f98fa 100644 --- a/content/5. 推断 Inferring.ipynb +++ b/content/5. 推断 Inferring.ipynb @@ -544,7 +544,7 @@ "prompt = f\"\"\"\n", "从评论文本中识别以下项目:\n", "- 情绪(正面或负面)\n", - "- 审稿人是否表达了愤怒?(是或否)\n", + "- 评论者是否表达了愤怒?(是或否)\n", "- 评论者购买的物品\n", "- 制造该物品的公司\n", "\n", From 4af21f60c8dd32f8416dc4a6c8403f9b972a2a29 Mon Sep 17 00:00:00 2001 From: AntoineChn Date: Mon, 1 May 2023 19:28:08 +0200 Subject: [PATCH 3/4] =?UTF-8?q?fix:=20correct=20a=20translation=20error=20?= =?UTF-8?q?by=20replacing=20=E5=AE=A1=E7=A8=BF=E4=BA=BA=20with=20=E8=AF=84?= =?UTF-8?q?=E8=AE=BA=E8=80=85?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- content/5. 推断 Inferring.ipynb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/content/5. 推断 Inferring.ipynb b/content/5. 推断 Inferring.ipynb index e3f98fa..dd614ee 100644 --- a/content/5. 推断 Inferring.ipynb +++ b/content/5. 推断 Inferring.ipynb @@ -544,7 +544,7 @@ "prompt = f\"\"\"\n", "从评论文本中识别以下项目:\n", "- 情绪(正面或负面)\n", - "- 评论者是否表达了愤怒?(是或否)\n", + "- 审稿人是否表达了愤怒?(是或否)\n", "- 评论者购买的物品\n", "- 制造该物品的公司\n", "\n", From 3a82d79db5abe5e5fad8d00beab51a6a03d432f9 Mon Sep 17 00:00:00 2001 From: AntoineChn Date: Mon, 1 May 2023 19:31:06 +0200 Subject: [PATCH 4/4] style: correct file names of session 3 and session 7 --- .../{3. 迭代优化 Itrative.ipynb => 3. 迭代优化 Iterative.ipynb} | 0 content/{7. 文本扩展 Expand.ipynb => 7. 文本扩展 Expanding.ipynb} | 0 2 files changed, 0 insertions(+), 0 deletions(-) rename content/{3. 迭代优化 Itrative.ipynb => 3. 迭代优化 Iterative.ipynb} (100%) rename content/{7. 文本扩展 Expand.ipynb => 7. 文本扩展 Expanding.ipynb} (100%) diff --git a/content/3. 迭代优化 Itrative.ipynb b/content/3. 迭代优化 Iterative.ipynb similarity index 100% rename from content/3. 迭代优化 Itrative.ipynb rename to content/3. 迭代优化 Iterative.ipynb diff --git a/content/7. 文本扩展 Expand.ipynb b/content/7. 文本扩展 Expanding.ipynb similarity index 100% rename from content/7. 文本扩展 Expand.ipynb rename to content/7. 文本扩展 Expanding.ipynb