{"id":17306710,"url":"https://github.com/ninzore/chinese_chatbot_torch","last_synced_at":"2025-07-14T06:04:14.420Z","repository":{"id":135576073,"uuid":"225589007","full_name":"Ninzore/Chinese_Chatbot_Torch","owner":"Ninzore","description":"使用QQ聊天记录制作属于你自己的聊天机器人","archived":false,"fork":false,"pushed_at":"2020-09-29T05:46:31.000Z","size":44,"stargazers_count":31,"open_issues_count":2,"forks_count":1,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-04-14T13:54:28.696Z","etag":null,"topics":["chatbot"],"latest_commit_sha":null,"homepage":"","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"gpl-3.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/Ninzore.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null}},"created_at":"2019-12-03T10:09:16.000Z","updated_at":"2024-11-23T04:01:04.000Z","dependencies_parsed_at":"2023-03-16T22:00:44.653Z","dependency_job_id":null,"html_url":"https://github.com/Ninzore/Chinese_Chatbot_Torch","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/Ninzore/Chinese_Chatbot_Torch","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Ninzore%2FChinese_Chatbot_Torch","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Ninzore%2FChinese_Chatbot_Torch/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Ninzore%2FChinese_Chatbot_Torch/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Ninzore%2FChinese_Chatbot_Torch/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Ninzore","download_url":"https://codeload.github.com/Ninzore/Chinese_Chatbot_Torch/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Ninzore%2FChinese_Chatbot_Torch/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":265249300,"owners_count":23734430,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["chatbot"],"created_at":"2024-10-15T11:59:10.211Z","updated_at":"2025-07-14T06:04:14.401Z","avatar_url":"https://github.com/Ninzore.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Chinese_Chatbot_Torch\n\nrequirements: PyTorch, Jieba  \n\n使用QQ的聊天记录作为语料库，需要先把QQ聊天记录提取为txt格式才能使用  \n每个模块在干什么，在代码注释里写的还是比较清楚的  \n\n!!!由于QQ聊天过于碎片化，并且每句都很短，聊天记录最好选取关于短时间内同一个话题的内容（其实手工筛最好了）!!!\n  \n程序运行顺序\n```graph\n    格式化聊天记录--\u003e预处理--\u003e生成语料库--\u003e训练模型--\u003e聊天测试;\n```\n\n运行程序\n```graph\n    chatlog--\u003epreprocess--\u003etrain;\n```\n\n###  chatlog:\n  会根据QQ聊天记录生成一个csv文件，作为之后的材料  \n  \n###  preprocess: 会在这个csv的基础上生成\n  1.  所需要的字典index2voc和voc2index\n  2.  根据voc2index字典生成的index句子对，句子对文件分为2行，左边是input，右边是target\n  \n###  corpus_gen:\n  根据输入的句子对生成一个batch，这个batch会作为一次训练的素材\n  \n###  rnn_model: \n  训练用的神经网络，模型为RNN+Attention，其中RNN作为双向编码还有解码，Attention作为解码的一部分\n  \n###  train:\n  训练和测试，使用trainBegin函数进行训练，使用chatBegin开始试着聊天\n  在实际进行聊天时使用了贪婪算法，在GreedySearchDecoder当中可以调参数\n  默认为每1000次迭代保存一次模型参数，初始时不加载模型参数(从0开始)，字典默认是加  载的以便加快速度(重新生成字典很慢的)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fninzore%2Fchinese_chatbot_torch","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fninzore%2Fchinese_chatbot_torch","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fninzore%2Fchinese_chatbot_torch/lists"}