fix: replace single quotation marks by triple backticks

This commit is contained in:
AntoineChn
2023-05-01 11:04:35 +02:00
parent 808fb74e31
commit 4b72edd4c6

View File

@ -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,