更新
- 现在使用随机权来决定文字输出,随机权定义为词频的平方
- 添加了词组模式,如果一组词重复出现则捆绑输出
- 添加了标点符号(这只是一个尝试)
功能
- 根据输入的单词生成一段话(当前训练材料不足,生成词数大约只有 \(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
---
猫娘这一次挤在陶哥身边,说,还有城堡,还有树,还有谁是海洋之星,还有每一个猫娘从来没有来敲过城堡,豆角之间的关系。涛哥以前是干的!我可以在新的一天检查一口水井,因为猫娘没有看到任何带豆角树的猪,他突然听到前面有声音。在涛哥没有时间的时候,厨师就被城堡里的他所引起了,他很快就从他身上跳了出来,发现我往下看又恢复了一些线段树,我没有猪吗?哦,我的朋友,涛哥住在城堡里,经理偶尔还会邀请我们,你想从主席树上看到他们吗?他向我们道歉,说那天早上阳光明媚,并向城堡解释了这一刻
下载
浅度训练版本对标点符号的训练效果并不好
标签:城堡,tree,ge,beta2,CatGPT,castle,tao,he From: https://www.cnblogs.com/HaneDaCafe/p/18480935