{
 "cells": [
  {
   "cell_type": "markdown",
   "id": "78624add",
   "metadata": {},
   "source": [
    "## 1 引言"
   ]
  },
  {
   "cell_type": "markdown",
   "id": "2fac57c2",
   "metadata": {},
   "source": [
    "LLM非常擅长将输入转换成不同的格式，例如多语种文本翻译、拼写及语法纠正、语气调整、格式转换等。\n",
    "\n",
    "本章节将介绍如何使用编程的方式，调用API接口来实现“文本转换”功能。"
   ]
  },
  {
   "cell_type": "markdown",
   "id": "f7816496",
   "metadata": {},
   "source": [
    "首先，我们需要OpenAI包，加载API密钥，定义getCompletion函数。"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 7,
   "id": "ac57ad72",
   "metadata": {},
   "outputs": [],
   "source": [
    "import openai\n",
    "import os\n",
    "import time\n",
    "OPENAI_API_KEY = os.environ.get(\"OPENAI_API_KEY2\")\n",
    "openai.api_key = OPENAI_API_KEY\n",
    "\n",
    "def get_completion(prompt, model=\"gpt-3.5-turbo\", temperature=0): \n",
    "    messages = [{\"role\": \"user\", \"content\": prompt}]\n",
    "    response = openai.ChatCompletion.create(\n",
    "        model=model,\n",
    "        messages=messages,\n",
    "        temperature=temperature, # 值越低则输出文本随机性越低\n",
    "    )\n",
    "    return response.choices[0].message[\"content\"]"
   ]
  },
  {
   "cell_type": "markdown",
   "id": "bf3733d4",
   "metadata": {},
   "source": [
    "## 2 文本翻译"
   ]
  },
  {
   "cell_type": "markdown",
   "id": "1b418e32",
   "metadata": {},
   "source": [
    "**中文转西班牙语**"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 2,
   "id": "8a5bee0c",
   "metadata": {
    "scrolled": true
   },
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "Hola, me gustaría ordenar una batidora.\n"
     ]
    }
   ],
   "source": [
    "prompt = f\"\"\"\n",
    "将以下中文翻译成西班牙语: \\ \n",
    "```您好，我想订购一个搅拌机。```\n",
    "\"\"\"\n",
    "response = get_completion(prompt)\n",
    "print(response)"
   ]
  },
  {
   "cell_type": "markdown",
   "id": "e3e922b4",
   "metadata": {},
   "source": [
    "**识别语种**"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 3,
   "id": "c2c66002",
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "这是法语。\n"
     ]
    }
   ],
   "source": [
    "prompt = f\"\"\"\n",
    "请告诉我以下文本是什么语种: \n",
    "```Combien coûte le lampadaire?```\n",
    "\"\"\"\n",
    "response = get_completion(prompt)\n",
    "print(response)"
   ]
  },
  {
   "cell_type": "markdown",
   "id": "c1841354",
   "metadata": {},
   "source": [
    "**多语种翻译**"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 4,
   "id": "b0c4fa41",
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "中文：我想订购一个篮球。\n",
      "英文：I want to order a basketball.\n",
      "法语：Je veux commander un ballon de basket.\n",
      "西班牙语：Quiero pedir una pelota de baloncesto.\n"
     ]
    }
   ],
   "source": [
    "prompt = f\"\"\"\n",
    "请将以下文本分别翻译成中文、英文、法语和西班牙语: \n",
    "```I want to order a basketball.```\n",
    "\"\"\"\n",
    "response = get_completion(prompt)\n",
    "print(response)"
   ]
  },
  {
   "cell_type": "markdown",
   "id": "68723ba5",
   "metadata": {},
   "source": [
    "**翻译+正式语气**"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 6,
   "id": "2c52ca54",
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "正式语气：请问您需要订购枕头吗？\n",
      "非正式语气：你要不要订一个枕头？\n"
     ]
    }
   ],
   "source": [
    "prompt = f\"\"\"\n",
    "请将以下文本翻译成中文，分别展示成正式与非正式两种语气: \n",
    "```Would you like to order a pillow?```\n",
    "\"\"\"\n",
    "response = get_completion(prompt)\n",
    "print(response)"
   ]
  },
  {
   "cell_type": "markdown",
   "id": "b2dc4c56",
   "metadata": {},
   "source": [
    "**通用翻译器**"
   ]
  },
  {
   "cell_type": "markdown",
   "id": "54b00aa4",
   "metadata": {},
   "source": [
    "随着全球化与跨境商务的发展，交流的用户可能来自各个不同的国家，使用不同的语言，因此我们需要一个通用翻译器，识别各个消息的语种，并翻译成目标用户的母语，从而实现更方便的跨国交流。"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 2,
   "id": "21f3af91",
   "metadata": {},
   "outputs": [],
   "source": [
    "user_messages = [\n",
    "  \"La performance du système est plus lente que d'habitude.\",  # System performance is slower than normal         \n",
    "  \"Mi monitor tiene píxeles que no se iluminan.\",              # My monitor has pixels that are not lighting\n",
    "  \"Il mio mouse non funziona\",                                 # My mouse is not working\n",
    "  \"Mój klawisz Ctrl jest zepsuty\",                             # My keyboard has a broken control key\n",
    "  \"我的屏幕在闪烁\"                                             # My screen is flashing\n",
    "]"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 8,
   "id": "6a884190",
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "原始消息 (法语): La performance du système est plus lente que d'habitude.\n",
      "\n",
      "中文翻译：系统性能比平时慢。\n",
      "英文翻译：The system performance is slower than usual. \n",
      "=========================================\n",
      "原始消息 (西班牙语): Mi monitor tiene píxeles que no se iluminan.\n",
      "\n",
      "中文翻译：我的显示器有一些像素点不亮。\n",
      "英文翻译：My monitor has pixels that don't light up. \n",
      "=========================================\n",
      "原始消息 (意大利语): Il mio mouse non funziona\n",
      "\n",
      "中文翻译：我的鼠标不工作了。\n",
      "英文翻译：My mouse is not working. \n",
      "=========================================\n",
      "原始消息 (波兰语): Mój klawisz Ctrl jest zepsuty\n",
      "\n",
      "中文翻译：我的Ctrl键坏了\n",
      "英文翻译：My Ctrl key is broken. \n",
      "=========================================\n",
      "原始消息 (中文): 我的屏幕在闪烁\n",
      "\n",
      "中文翻译：我的屏幕在闪烁。\n",
      "英文翻译：My screen is flickering. \n",
      "=========================================\n"
     ]
    }
   ],
   "source": [
    "for issue in user_messages:\n",
    "    time.sleep(20)\n",
    "    prompt = f\"告诉我以下文本是什么语种，直接输出语种，如法语，无需输出标点符号: ```{issue}```\"\n",
    "    lang = get_completion(prompt)\n",
    "    print(f\"原始消息 ({lang}): {issue}\\n\")\n",
    "\n",
    "    prompt = f\"\"\"\n",
    "    将以下消息分别翻译成英文和中文，并写成\n",
    "    中文翻译：xxx\n",
    "    英文翻译：yyy\n",
    "    的格式：\n",
    "    ```{issue}```\n",
    "    \"\"\"\n",
    "    response = get_completion(prompt)\n",
    "    print(response, \"\\n=========================================\")"
   ]
  },
  {
   "cell_type": "markdown",
   "id": "6ab558a2",
   "metadata": {},
   "source": [
    "## 3 语气/风格调整"
   ]
  },
  {
   "cell_type": "markdown",
   "id": "b85ae847",
   "metadata": {},
   "source": [
    "写作的语气往往会根据受众对象而有所调整。例如，对于工作邮件，我们常常需要使用正式语气与书面用词，而对同龄朋友的微信聊天，可能更多地会使用轻松、口语化的语气。"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 9,
   "id": "84ce3099",
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "尊敬的XXX（收件人姓名）：\n",
      "\n",
      "您好！我是XXX（发件人姓名），在此向您咨询一个问题。上次我们交流时，您提到我们部门需要采购显示器，但我忘记了您所需的尺寸是多少英寸。希望您能够回复我，以便我们能够及时采购所需的设备。\n",
      "\n",
      "谢谢您的帮助！\n",
      "\n",
      "此致\n",
      "\n",
      "敬礼\n",
      "\n",
      "XXX（发件人姓名）\n"
     ]
    }
   ],
   "source": [
    "prompt = f\"\"\"\n",
    "将以下文本翻译成商务信函的格式: \n",
    "```小老弟，我小羊，上回你说咱部门要采购的显示器是多少寸来着？```\n",
    "\"\"\"\n",
    "response = get_completion(prompt)\n",
    "print(response)"
   ]
  },
  {
   "cell_type": "markdown",
   "id": "98df9009",
   "metadata": {},
   "source": [
    "## 4 格式转换"
   ]
  },
  {
   "cell_type": "markdown",
   "id": "0bf9c074",
   "metadata": {},
   "source": [
    "ChatGPT非常擅长不同格式之间的转换，例如JSON到HTML、XML、Markdown等。在下述例子中，我们有一个包含餐厅员工姓名和电子邮件的列表的JSON，我们希望将其从JSON转换为HTML。"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 9,
   "id": "fad3f358",
   "metadata": {},
   "outputs": [],
   "source": [
    "data_json = { \"resturant employees\" :[ \n",
    "    {\"name\":\"Shyam\", \"email\":\"shyamjaiswal@gmail.com\"},\n",
    "    {\"name\":\"Bob\", \"email\":\"bob32@gmail.com\"},\n",
    "    {\"name\":\"Jai\", \"email\":\"jai87@gmail.com\"}\n",
    "]}"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 10,
   "id": "f54e7398",
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "<table>\n",
      "  <caption>resturant employees</caption>\n",
      "  <thead>\n",
      "    <tr>\n",
      "      <th>name</th>\n",
      "      <th>email</th>\n",
      "    </tr>\n",
      "  </thead>\n",
      "  <tbody>\n",
      "    <tr>\n",
      "      <td>Shyam</td>\n",
      "      <td>shyamjaiswal@gmail.com</td>\n",
      "    </tr>\n",
      "    <tr>\n",
      "      <td>Bob</td>\n",
      "      <td>bob32@gmail.com</td>\n",
      "    </tr>\n",
      "    <tr>\n",
      "      <td>Jai</td>\n",
      "      <td>jai87@gmail.com</td>\n",
      "    </tr>\n",
      "  </tbody>\n",
      "</table>\n"
     ]
    }
   ],
   "source": [
    "prompt = f\"\"\"\n",
    "将以下Python字典从JSON转换为HTML表格，保留表格标题和列名：{data_json}\n",
    "\"\"\"\n",
    "response = get_completion(prompt)\n",
    "print(response)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 11,
   "id": "a0026f3c",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/html": [
       "<table>\n",
       "  <caption>resturant employees</caption>\n",
       "  <thead>\n",
       "    <tr>\n",
       "      <th>name</th>\n",
       "      <th>email</th>\n",
       "    </tr>\n",
       "  </thead>\n",
       "  <tbody>\n",
       "    <tr>\n",
       "      <td>Shyam</td>\n",
       "      <td>shyamjaiswal@gmail.com</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <td>Bob</td>\n",
       "      <td>bob32@gmail.com</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <td>Jai</td>\n",
       "      <td>jai87@gmail.com</td>\n",
       "    </tr>\n",
       "  </tbody>\n",
       "</table>"
      ],
      "text/plain": [
       "<IPython.core.display.HTML object>"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    }
   ],
   "source": [
    "from IPython.display import display, Markdown, Latex, HTML, JSON\n",
    "display(HTML(response))"
   ]
  },
  {
   "cell_type": "markdown",
   "id": "29b7167b",
   "metadata": {},
   "source": [
    "## 5 拼写及语法纠正"
   ]
  },
  {
   "cell_type": "markdown",
   "id": "22776140",
   "metadata": {},
   "source": [
    "拼写及语法的检查与纠正是一个十分常见的需求，特别是使用非母语语言，例如发表英文论文时，这是一件十分重要的事情。\n",
    "\n",
    "以下给了一个例子，有一个句子列表，其中有些句子存在拼写或语法问题，有些则没有，我们循环遍历每个句子，要求模型校对文本，如果正确则输出“未发现错误”，如果错误则输出纠正后的文本。"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 14,
   "id": "b7d04bc0",
   "metadata": {},
   "outputs": [],
   "source": [
    "text = [ \n",
    "  \"The girl with the black and white puppies have a ball.\",  # The girl has a ball.\n",
    "  \"Yolanda has her notebook.\", # ok\n",
    "  \"Its going to be a long day. Does the car need it’s oil changed?\",  # Homonyms\n",
    "  \"Their goes my freedom. There going to bring they’re suitcases.\",  # Homonyms\n",
    "  \"Your going to need you’re notebook.\",  # Homonyms\n",
    "  \"That medicine effects my ability to sleep. Have you heard of the butterfly affect?\", # Homonyms\n",
    "  \"This phrase is to cherck chatGPT for spelling abilitty\"  # spelling\n",
    "]"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 16,
   "id": "1ef55b7b",
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "0 The girl with the black and white puppies has a ball.\n",
      "1 未发现错误。\n",
      "2 It's going to be a long day. Does the car need its oil changed?\n",
      "3 Their goes my freedom. They're going to bring their suitcases.\n",
      "4 输出：You're going to need your notebook.\n",
      "5 That medicine affects my ability to sleep. Have you heard of the butterfly effect?\n",
      "6 This phrase is to check chatGPT for spelling ability.\n"
     ]
    }
   ],
   "source": [
    "for i in range(len(text)):\n",
    "    time.sleep(20)\n",
    "    prompt = f\"\"\"请校对并更正以下文本，注意纠正文本保持原始语种，无需输出原始文本。\n",
    "    如果您没有发现任何错误，请说“未发现错误”。\n",
    "    \n",
    "    例如：\n",
    "    输入：I are happy.\n",
    "    输出：I am happy.\n",
    "    ```{text[i]}```\"\"\"\n",
    "    response = get_completion(prompt)\n",
    "    print(i, response)"
   ]
  },
  {
   "cell_type": "markdown",
   "id": "538181e0",
   "metadata": {},
   "source": [
    "以下是一个简单的类Grammarly纠错示例，输入原始文本，输出纠正后的文本，并基于Redlines输出纠错过程。"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 18,
   "id": "6696b06a",
   "metadata": {},
   "outputs": [],
   "source": [
    "text = f\"\"\"\n",
    "Got this for my daughter for her birthday cuz she keeps taking \\\n",
    "mine from my room.  Yes, adults also like pandas too.  She takes \\\n",
    "it everywhere with her, and it's super soft and cute.  One of the \\\n",
    "ears is a bit lower than the other, and I don't think that was \\\n",
    "designed to be asymmetrical. It's a bit small for what I paid for it \\\n",
    "though. I think there might be other options that are bigger for \\\n",
    "the same price.  It arrived a day earlier than expected, so I got \\\n",
    "to play with it myself before I gave it to my daughter.\n",
    "\"\"\""
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 14,
   "id": "50cca36e",
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "I got this for my daughter's birthday because she keeps taking mine from my room. Yes, adults also like pandas too. She takes it everywhere with her, and it's super soft and cute. However, one of the ears is a bit lower than the other, and I don't think that was designed to be asymmetrical. It's also a bit smaller than I expected for the price. I think there might be other options that are bigger for the same price. On the bright side, it arrived a day earlier than expected, so I got to play with it myself before giving it to my daughter.\n"
     ]
    }
   ],
   "source": [
    "prompt = f\"校对并更正以下商品评论：```{text}```\"\n",
    "response = get_completion(prompt)\n",
    "print(response)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 19,
   "id": "51de86c3",
   "metadata": {},
   "outputs": [],
   "source": [
    "response = \"\"\"\n",
    "I got this for my daughter's birthday because she keeps taking mine from my room. Yes, adults also like pandas too. She takes it everywhere with her, and it's super soft and cute. However, one of the ears is a bit lower than the other, and I don't think that was designed to be asymmetrical. It's also a bit smaller than I expected for the price. I think there might be other options that are bigger for the same price. On the bright side, it arrived a day earlier than expected, so I got to play with it myself before giving it to my daughter.\n",
    "\"\"\""
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "id": "07f32f1f",
   "metadata": {},
   "outputs": [],
   "source": [
    "# 如未安装redlines，需先安装\n",
    "!pip3.8 install redlines"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 22,
   "id": "e8604dfb",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/markdown": [
       "<span style=\"color:red;font-weight:700;text-decoration:line-through;\">Got </span><span style=\"color:red;font-weight:700;\">I got </span>this for my <span style=\"color:red;font-weight:700;text-decoration:line-through;\">daughter for her </span><span style=\"color:red;font-weight:700;\">daughter's </span>birthday <span style=\"color:red;font-weight:700;text-decoration:line-through;\">cuz </span><span style=\"color:red;font-weight:700;\">because </span>she keeps taking mine from my <span style=\"color:red;font-weight:700;text-decoration:line-through;\">room.  </span><span style=\"color:red;font-weight:700;\">room. </span>Yes, adults also like pandas <span style=\"color:red;font-weight:700;text-decoration:line-through;\">too.  </span><span style=\"color:red;font-weight:700;\">too. </span>She takes it everywhere with her, and it's super soft and <span style=\"color:red;font-weight:700;text-decoration:line-through;\">cute.  One </span><span style=\"color:red;font-weight:700;\">cute. However, one </span>of the ears is a bit lower than the other, and I don't think that was designed to be asymmetrical. It's <span style=\"color:red;font-weight:700;\">also </span>a bit <span style=\"color:red;font-weight:700;text-decoration:line-through;\">small </span><span style=\"color:red;font-weight:700;\">smaller than I expected </span>for <span style=\"color:red;font-weight:700;text-decoration:line-through;\">what I paid for it though. </span><span style=\"color:red;font-weight:700;\">the price. </span>I think there might be other options that are bigger for the same <span style=\"color:red;font-weight:700;text-decoration:line-through;\">price.  It </span><span style=\"color:red;font-weight:700;\">price. On the bright side, it </span>arrived a day earlier than expected, so I got to play with it myself before <span style=\"color:red;font-weight:700;text-decoration:line-through;\">I gave </span><span style=\"color:red;font-weight:700;\">giving </span>it to my daughter.\n"
      ],
      "text/plain": [
       "<IPython.core.display.Markdown object>"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    }
   ],
   "source": [
    "from redlines import Redlines\n",
    "from IPython.display import display, Markdown\n",
    "\n",
    "diff = Redlines(text,response)\n",
    "display(Markdown(diff.output_markdown))"
   ]
  },
  {
   "cell_type": "markdown",
   "id": "3ee5d487",
   "metadata": {},
   "source": [
    "## 6 一个综合样例：文本翻译+拼写纠正+风格调整+格式转换"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 23,
   "id": "584dcc21",
   "metadata": {},
   "outputs": [],
   "source": [
    "text = f\"\"\"\n",
    "Got this for my daughter for her birthday cuz she keeps taking \\\n",
    "mine from my room.  Yes, adults also like pandas too.  She takes \\\n",
    "it everywhere with her, and it's super soft and cute.  One of the \\\n",
    "ears is a bit lower than the other, and I don't think that was \\\n",
    "designed to be asymmetrical. It's a bit small for what I paid for it \\\n",
    "though. I think there might be other options that are bigger for \\\n",
    "the same price.  It arrived a day earlier than expected, so I got \\\n",
    "to play with it myself before I gave it to my daughter.\n",
    "\"\"\""
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 24,
   "id": "5061d6a3",
   "metadata": {
    "scrolled": true
   },
   "outputs": [
    {
     "data": {
      "text/markdown": [
       "【优点】\n",
       "- 超级柔软可爱，女儿生日礼物非常受欢迎。\n",
       "- 成人也喜欢熊猫，我也很喜欢它。\n",
       "- 提前一天到货，让我有时间玩一下。\n",
       "\n",
       "【缺点】\n",
       "- 一只耳朵比另一只低，不对称。\n",
       "- 价格有点贵，但尺寸有点小，可能有更大的同价位选择。\n",
       "\n",
       "【总结】\n",
       "这只熊猫玩具非常适合作为生日礼物，柔软可爱，深受孩子喜欢。虽然价格有点贵，但尺寸有点小，不对称的设计也有点让人失望。如果你想要更大的同价位选择，可能需要考虑其他选项。总的来说，这是一款不错的熊猫玩具，值得购买。"
      ],
      "text/plain": [
       "<IPython.core.display.Markdown object>"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    }
   ],
   "source": [
    "prompt = f\"\"\"\n",
    "针对以下三个反引号之间的英文评论文本，\n",
    "首先进行拼写及语法纠错，\n",
    "然后将其转化成中文，\n",
    "再将其转化成优质淘宝评论的风格，从各种角度出发，分别说明产品的优点与缺点，并进行总结。\n",
    "润色一下描述，使评论更具有吸引力。\n",
    "输出结果格式为：\n",
    "【优点】xxx\n",
    "【缺点】xxx\n",
    "【总结】xxx\n",
    "注意，只需填写xxx部分，并分段输出。\n",
    "将结果输出成Markdown格式。\n",
    "```{text}```\n",
    "\"\"\"\n",
    "response = get_completion(prompt)\n",
    "display(Markdown(response))"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "id": "3d54f151",
   "metadata": {},
   "outputs": [],
   "source": []
  }
 ],
 "metadata": {
  "kernelspec": {
   "display_name": "Python 3",
   "language": "python",
   "name": "python3"
  },
  "language_info": {
   "codemirror_mode": {
    "name": "ipython",
    "version": 3
   },
   "file_extension": ".py",
   "mimetype": "text/x-python",
   "name": "python",
   "nbconvert_exporter": "python",
   "pygments_lexer": "ipython3",
   "version": "3.8.13"
  },
  "latex_envs": {
   "LaTeX_envs_menu_present": true,
   "autoclose": false,
   "autocomplete": true,
   "bibliofile": "biblio.bib",
   "cite_by": "apalike",
   "current_citInitial": 1,
   "eqLabelWithNumbers": true,
   "eqNumInitial": 1,
   "hotkeys": {
    "equation": "Ctrl-E",
    "itemize": "Ctrl-I"
   },
   "labels_anchors": false,
   "latex_user_defs": false,
   "report_style_numbering": false,
   "user_envs_cfg": false
  },
  "toc": {
   "base_numbering": 1,
   "nav_menu": {},
   "number_sections": true,
   "sideBar": true,
   "skip_h1_title": false,
   "title_cell": "Table of Contents",
   "title_sidebar": "Contents",
   "toc_cell": false,
   "toc_position": {},
   "toc_section_display": true,
   "toc_window_display": true
  }
 },
 "nbformat": 4,
 "nbformat_minor": 5
}
