# 題目:利用AI串接程式碼生成數學詳解影片 :::success 研究內容:打造一個能透過生成數學詳解影片,輔助小學生解答數學疑難的AI數學輔具,以manim函式庫為主體,結合自然語言模型,讓學生能看到影片完整呈現解題步驟,引導學生解決數學題目。流程是先讓使用者輸入一段應用題,接著把這個問題傳給ChatGPT產生步驟解,同時透過事先設計好的manim程式碼模板,告訴ChatGPT它能在這些條件下自由編排出一個數學詳解影片。最後把它生成的程式碼擷取下來執行產出影片回傳給使用者。透過AI串接不同部分的程式碼,讓影片的編排自動布局,能夠針對不同的題目類型生成適合的影片。 ::: [TOC] ## github https://github.com/RyanHongd/manim ## 測試影片 https://docs.google.com/spreadsheets/d/1zRPl8oEWPaqEN28y5bouqJdE4KeUF-1BMxc-oFktUGM/edit?usp=sharing ## 作品說明書 https://docs.google.com/document/d/1KKJhmT8flq5SW2r3suE539vwU05hp8L0kG5zfI6nS7Y/edit?usp=sharing ## 規劃進程 ### 六月 這段時間主要閱讀文獻和教授討論,確認研究方向,此時主要的研究內容是利用外部模型orca-math,結合自然語言模型,來打造能與學生對話的數學家教。orca-math是一個能分析小學數學應用題,給出詳解的模型,它的準確率勝過許多大型模型。但由於這個模型並沒有開源,再加上這個方向的計畫範圍太大,經過和教授討論之後決定作罷。 #### 6月第一周 確立目標 註冊Hugging Face [hugging face tutorial](https://ithelp.ithome.com.tw/articles/10291739) #### 6月第二周 開始架設編譯環境,學習pytorch 學習內容: 張量,機器學習的基礎,主要用於存儲資料 0維:數字 1維:向量 2維:矩陣 3維:時間序列 4維:圖像 - [pytorch](https://datawhalechina.github.io/thorough-pytorch/index.html) - [機器學習從零到一](https://daniel820710.medium.com/機器學習從零到一-day3-pytorch-介紹與範例-cosmetics-classification-6e826fbce59b) - [hugging face-orca](https://huggingface.co/models?search=orca-math) - [chatgpt response](https://chatgpt.com/share/c4b60523-a723-4005-9c91-e1a18d5be299) - [arxiv](https://arxiv.org/abs/2402.14830) #### 6月第三、四周 -[deepseek](https://huggingface.co/deepseek-ai/deepseek-math-7b-base) -[網站學習](https://github.com/RyanHongd/RyanHongd.github.io) 準備段考 ### 七月 7月的時候終於確立研究的方向,經過兩個禮拜的資料收集後,決定以生成數學詳解影片做為AI學習輔具的主體。因此首先要做的就是學習manim的語法,把模板影片建立出來之後才能給ChatGPT做為範例。 #### 7月第一周 試著實作簡單的AI模型 - [pytorch it幫幫忙](https://ithelp.ithome.com.tw/articles/10293531) - [NLP](https://ithelp.ithome.com.tw/articles/10311173) - [pytorch 實戰](https://ithelp.ithome.com.tw/articles/10322732?sc=rss.iron) - [pytorch](https://mofanpy.com/tutorials/machine-learning/torch/) - [7/4研究報告](https://docs.google.com/document/d/1sCVQZu8PdEstTP1dEKQvI7tNAAftkSaPhcgo451WqA4/edit) - [prompt engineering](https://www.promptingguide.ai/zh/techniques/tot) - [prompt engineering大補帖](https://medium.com/@cch.chichieh/llm-%E5%90%84%E7%A8%AE%E6%8A%80%E5%B7%A7-prompt-engineering-%E6%8C%87%E5%8D%97-6ac4201a4cbe) - [Survey of Artificial Intelligence for Card Games and Its Application to the Swiss Game Jass](https://chatgpt.com/c/98cf1e06-d060-4ede-a6c3-869f0d1a4982) 蒙地卡羅法:當一個問題未能夠用邏輯推理解決,就試用隨機方法解決,不斷隨機試試到正確為止 #### 7月第二周 文獻閱讀 - [dialogflow](https://www.gaia.net/tc/news_detail/2/33/dialogflow) - [a project to intergrate OpenAI chatGPT to Dialogflow](https://github.com/hank199599/openGPT-with-Dialogflow) - [dialogflow 連接open ai](https://www.ai-cn.net/post/2366) - [dialogflow intergate open ai](https://www.quora.com/How-do-I-integrate-Chatgpt-with-a-Dialogflow-chatbot) - [7/8研究報告](https://docs.google.com/document/d/1njV8FaKAyecSJbQ19Qa0YHRGK8xEtEQPNLh9yZC4iK4/edit?usp=sharing) #### 7月第三周 在台大資工系訓練班修習AI課程(實體課程) - [7/11研究報告](https://docs.google.com/document/d/1r1rd_44u3nvtgoyrRHcu-zbUjq90SZ1I83w4aaiwTzA/edit) - [7/15研究報告](https://docs.google.com/document/d/1-ob1-7j66E212IcHQKRjXGUhyQup4OF1o7QPWmb-aoo/edit) #### 7月第四周 在台大資工系訓練班修習AI課程(實體課程) - [7/22研究報告](https://docs.google.com/document/d/1VtBB2dsOBmsbOWPt12bxV7EX60v90cAvQdoMw0hEE5I/edit?usp=sharing) - [訓練班](https://train.csie.ntu.edu.tw/train/course.php?id=4651&bid=412) - [manim colab](https://colab.research.google.com/drive/1CyGQhBs0AM6xLOl0LWPUxthvgv-6NMcp?usp=sharing) - [7/25研究報告](https://docs.google.com/document/d/1TdVH_YiE0uBIiobPPENXFQ60AfD_6CVJkQwvdgKYh84/edit?usp=sharing) ### 八月 在確定好研究方向後,這個月開始進行模板的實作與測試,先做出加減模板並提供給GPT,加上適當的提示後觀察能不能生出適合的影片程式碼。並在這個過程中思考模板有沒有可以改進的地方 #### 8月第一周 manim簡單實作 - [7/29研究報告](https://docs.google.com/document/d/1zngSzJ-FWtjL3FNlaj9VrU4fWGQxq6UG-r2bmX8mHDc/edit?usp=sharing) - [8/1研究報告](https://docs.google.com/document/d/1h2KuCXssEKJwyTNcYlNOsTl7-NgtCqEuVR1jGiywcDA/edit?usp=sharing) #### 8月第二周 家庭旅遊(出國)時的一些靈感 - [8/5研究報告](https://docs.google.com/document/d/1pCGh3tFEb3Z8gON3WSzo3w-hSLn7hqMEhGHkciZGweQ/edit?usp=sharing) - [8/8研究報告](https://docs.google.com/document/d/1GdqrJjuQV8keyQt-Wrn6gR4lMyuB8pLfxjjKzaR5s7c/edit) #### 8月第三周 家庭旅遊(出國)時的一些靈感 - [8/13研究報告](https://docs.google.com/document/d/1vijd87zP7u8IEChC9qwHWzY9F77_24NMs03jcSOmSIA/edit) - [8/17研究報告](https://docs.google.com/document/d/1Vru8w9_DH9ZBmWWHjWjPBWvUq2ZHL9Ez9W6gk2vZcGM/edit?usp=sharing) #### 8月第四周 直接拿基礎的模板給GPT測試,發現會出現很多錯誤 - [8/20研究報告](https://docs.google.com/document/d/1raqxcv4rqs7pNN6UpkrNlsm9xR6V4QBdzSCFZ394Xwk/edit?usp=sharing) - [8/22研究報告](https://docs.google.com/document/d/1J1TuMssgSBx5sR0xUs3UyaGRFgiZQvCD4iD4cXius34/edit?usp=sharing) #### 8月第五周 找找看有沒有其他語言模型來進行測試,出現針對模板進行模組化的想法 - [8/26研究報告](https://docs.google.com/document/d/14g7WxB-HpbVhk1_a_RpOYSBRMDdz651OsqPV4-WSQZM/edit?usp=sharing) - [8/29研究報告](https://docs.google.com/document/d/1R_uPOVCEvVQ42unqzgMBL1zsmuSnl6aBdLXLPnpq5hs/edit?usp=sharing) ### 九月 #### 9月第一周 自己作結合模板了解GPT生成的問題 - [9/2研究報告](https://docs.google.com/document/d/1OKL3GOjedZMduTn1EHk_K6_KhYnDXCdaovGlbQsF5rU/edit?usp=sharing) #### 9月第二周 決定使用主程式把各個模板結合在一起的形式,用函式表示每個模板,讓GPT只要在主程式調動模板就好。 - [9/9研究報告](https://docs.google.com/document/d/1Y_2DdHFAEHahV8Kokr4PulnaPpV5W7MjpWNw9r8tF7g/edit?usp=sharing) #### 9月第三周 GPT可以藉由僅調動函式的方式來生成正確的影片,當他處理的內容只有參數,文字和函式順序時,GPT不容易出現錯誤 - [9/16研究報告](https://docs.google.com/document/d/1gornbXxBCQ2Q9lhg3yZdh2ooK5LnFC-ufILEjnyjGwI/edit?usp=sharing) #### 9月第四周 包含加減乘除的系統 - [9/23研究報告](https://docs.google.com/document/d/18wl5Ud3pZTmvAr2LSHnY5G26zEGP7fE6PlA8ZAAsumA/edit?usp=sharing) #### 9月第五周 和gatekeep ai的比較 - [9/30研究報告](https://docs.google.com/document/d/1Zs7ICUE7wBOav3-eVzVS3ZqNwgYuuOsv45i4cDI1qtI/edit?usp=sharing) ### 十月 直接用python 問GPT問題,之前都是手動複製到網頁上,現在直接讓問問題的流程自動化 - [10/7研究報告](https://docs.google.com/document/d/11t0wzV2m7YW2qpu__CUCtzrqMRptPyLmlZ76gypRT5A/edit?usp=sharing) - [10/21研究報告](https://docs.google.com/document/d/1b6AvzSPgMJTuVrAgxgMgtKXvrc2-DWUg4dkTOAFKm3g/edit?usp=sharing) - [10/28研究報告](https://docs.google.com/document/d/1C2Fm9KldLxAJ32f0E1hpQ4bMAPtS3Hm-3AeNHfNm0f8/edit?usp=sharing) ### 十一月 開始作直式模板,為了面對更多類型的題目,包含更大數目的運算 - [11/4研究報告](https://docs.google.com/document/d/1-zZSJAC_w47A4OHprbTje2eI4rT06XcuTwjarsd8fPI/edit?usp=sharing) - [11/11研究報告](https://docs.google.com/document/d/1qVzN8aG9l6XHpjcWNv0qLZPXobg4gGX_FSTWCb8y7o0/edit?usp=sharing) - [11/18研究報告](https://docs.google.com/document/d/1PBBw9PCbkSYmUnPx3MMocm0_puX5HZfUBdLT0UlJ_I8/edit?usp=sharing) 第二次期中考 ### 十二月 - [12/2研究報告](https://docs.google.com/document/d/1VIDNzuDq22HwJ0eQfOLUMohUWNi9uPD9hlJvwE7q9Ak/edit?usp=sharing) - [12/9研究報告](https://docs.google.com/document/d/1bfuqKAxIltt5dL0XvoEL3xgPdGC1ecwFl15D1K-_vU8/edit?usp=sharing) - [12/16研究報告](https://docs.google.com/document/d/1nOqaJTnS74k-MClBCBERuv69GFq90FO2sgdL1Kpu8FE/edit?usp=sharing) - [12/23研究報告](https://docs.google.com/document/d/1FWoo1Mffh-6W6lB7lXuGUguJZd50J2-4-C2rZYf7c08/edit?usp=sharing) ### 一月 撰寫科展說明書&海報 - [1/27研究報告](https://docs.google.com/document/d/1cM-S1bsWsdRjmOemZlocVX6HVH8cRNKZ0OkKyrWaglQ/edit?usp=sharing) ### 二月 針對報告書中發現的不足之處進行改進 - [2/3研究報告](https://docs.google.com/document/d/1nxVwTEIZSBPO63tqOAIo8_01BvcVt6fUBpTySqRHyiA/edit?usp=sharing) - [2/13研究報告](https://docs.google.com/document/d/1ZLw7bm-JUACFnGR0iaQymaozDTH_VnP9AknNXquUSy4/edit?usp=sharing) - [2/17研究報告](https://docs.google.com/document/d/16EdtF-tPsQQjgr90djPcqsCQ0eIc38efJ9pjXTbE-QU/edit?usp=sharing) 期末考、寒假 ### 三月 - [3/4研究報告](https://docs.google.com/document/d/1CGO0opAUDgxdlacAMBYfwi60A2YcTRgvvPcMHcrTAJs/edit?usp=sharing) - ### 四月 - [4/1研究報告](https://docs.google.com/document/d/11c9PdDSE3-srrZKU1gZYrONqYXPLmhP73e24BLWhEsA/edit?usp=sharing) - [4/14研究報告](https://docs.google.com/document/d/1Ec9lh_KvRfT9K8nEUlAGuL68wzhj_oHsdQD6Dh8aiig/edit?usp=sharing) 整理研究成果,歸納,撰寫成果報告 ### 五月 撰寫成果報告