CatGPT beta2

HaneDaniko發表於2024-10-19

更新

  • 現在使用隨機權來決定文字輸出,隨機權定義為詞頻的平方
  • 新增了片語模式,如果一組詞重複出現則捆綁輸出
  • 新增了標點符號(這只是一個嘗試)

功能

  • 根據輸入的單詞生成一段話(當前訓練材料不足,生成詞數大約只有 \(50\) 左右)
  • 根據一段材料自訓練

原理

  • 統計累計詞頻,為詞頻計入權重
  • 統計使用次數(防止迴圈用詞等情況)

注意

  • 並不支援根據未見過的詞生成句子,因此太偏僻的不行,不過你可以透過喂 AI 一篇帶這個詞的文章來讓它學

使用

  • 主函式上方的 #define TRAIN,註釋掉即可使用 test(),即根據詞生成句子,不註釋掉則可以根據本地 train 檔案裡的內容自訓練
  • 請務必保證有一個 info 檔案,如果你想重頭訓練,可以刪掉 info 中得全部內容,但請務必保留一個 \(0\)

如果你不想動腦子地使用,也可以看下面這一版

  • 測試:註釋掉主函式上方的 #define TRAIN,然後在主函式里修改 test() 函式的值,這個值是你句子的第一個單詞
  • 訓練:向 train 檔案中貼上文字,然後取消對 #define TRAIN 的註釋,直接編譯執行程式即可

宣告

  • 這只是一個嘗試,程式碼實現與生成效果比較爛,僅供娛樂與參考使用

效果例(beta2)

cat girls are left the castle , it has a long as usual mr . b returned , said he saw cth said tao ge had completed his head , tao ge is on the castle , and looked at this time , tao ge to be honest there is not a bean tree and the tree and regulations every time , tao ge , he saw that the cat lady falls behind like a cat girls are quite peculiar 
---
貓娘們都離開了城堡,有一個和往常一樣長的 B 先生回來了,說他看見cth說濤哥已經完成了他的頭,濤哥就在城堡上,看著這一次,濤哥老實說沒有一棵豆樹,每次都有樹和規定,濤哥,他看見貓娘像貓娘一樣落在後面,很奇怪
cat lady back to the tree tao ge feels ashamed to grow in the castle, as he had a small village but also responsible for the person from the house so he quickly dodged and finally arrived at this moment , and scratched his head , and the castle needs to the castle , he had completed his hat
---
貓娘回到樹上,濤哥覺得在城堡里長大很羞恥,因為他有一個小村莊,但也負責從房子裡出來的人,所以他很快躲開了,終於到了這一刻,撓了撓頭,城堡需要城堡,他已經完成了帽子
cth scratched his eerie smile on the leaves , but also took off the castle , but the tree king ? hurry to the castle where tao ge was wrong strange , but he saw that the castle where tao ge , the castle manager mr . b is not right branch and the castle , it is already as much larger and doesnt look dazed and the tree , and doesnt look very smart . b is also recite praises loudly saying hi , but cth said tao ges hand holding hands high school gate like this time , they will be punished for a living how could build a big deal because he will be one bite dont know why did you can only found that read transport little cat lady this happens
---
cth在樹葉上撓了撓他詭異的笑容,也離開了城堡,但樹王呢?匆匆趕到濤哥所在的城堡,奇怪的是,他看到了濤哥所在城堡的城堡經理 B 先生。不是右邊的樹枝和城堡,它已經大得多了,看起來不那麼茫然,也不是那棵樹,看起來不太聰明。B 先生也大聲地念著讚歌打招呼,但cth說濤哥像這次這樣手牽手高中大門,他們怎麼會被罰衛生,因為他會被咬一口,不知道為什麼,你只能找到讀運輸的小貓女士這種事發生
huge had a walk alone until today is not enough , tao ge , and the castle this sense , he asked tao ge was his head vigorously
---
huge 獨自一人走到今天還不夠,濤哥,還有城堡這種感覺,他用力問濤哥是不是他的頭
cat lady this was too crowded around tao ge , and said , but also the castle , and the tree , and people who was oceansofstars , and each cat girl had never come knocking on the castle , the relationship between doujiao . tao ge used to be done ! ! ! ! i can be checked for a water well in a new day because the cat girl is not to see any pigs with a bean tree , he suddenly heard some noise ahead . at tao ge had no time , and the chef has been caused by the castle where he quickly jumped straight out of him to find me looking down regained some line segment tree , i dont have any pigs ? oh my buddy , tao ge lives on the castle manager still occasionally invites us are you want to see them from the chairman tree and asked sorry , and said that morning sunshine , and asked huge explained to the castle this moment
---
貓娘這一次擠在陶哥身邊,說,還有城堡,還有樹,還有誰是海洋之星,還有每一個貓娘從來沒有來敲過城堡,豆角之間的關係。濤哥以前是乾的!我可以在新的一天檢查一口水井,因為貓娘沒有看到任何帶豆角樹的豬,他突然聽到前面有聲音。在濤哥沒有時間的時候,廚師就被城堡裡的他所引起了,他很快就從他身上跳了出來,發現我往下看又恢復了一些線段樹,我沒有豬嗎?哦,我的朋友,濤哥住在城堡裡,經理偶爾還會邀請我們,你想從主席樹上看到他們嗎?他向我們道歉,說那天早上陽光明媚,並向城堡解釋了這一刻

下載

執行效果例使用的版本 (0.33%)

淺度訓練版本 (1.2084%)

淺度訓練版本對標點符號的訓練效果並不好

相關文章