Skip to content

Commit

Permalink
新增本地回答库,启用后优先匹配库内问答,无匹配结果则按正常流程运行
Browse files Browse the repository at this point in the history
  • Loading branch information
Ikaros-521 committed Jun 23, 2023
1 parent 4e2e7d4 commit 3639264
Show file tree
Hide file tree
Showing 7 changed files with 993 additions and 51 deletions.
3 changes: 3 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -81,6 +81,8 @@ pip install -r requirements_ks.txt
"after_prompt": "",
// 弹幕日志类型,用于记录弹幕触发时记录的内容,默认只记录回答,降低当用户使用弹幕日志显示在直播间时,因为用户的不良弹幕造成直播间被封禁问题
"commit_log_type": "回答",
// 是否启用本地问答库匹配机制,优先级最高,如果匹配则直接合成问答库内的内容,如果不匹配则按照正常流程继续。
"local_qa": false,
"filter": {
// 弹幕过滤,必须携带的触发前缀字符串(任一)
"before_must_str": [],
Expand Down Expand Up @@ -484,6 +486,7 @@ ChatterBot 的核心思想是:基于历史对话数据,使用机器学习和

### 2023-06-23
- 针对整合包问题进行了优化和处理,新增了Scripts文件夹用于存储制作整合包时需要用的相关脚本。
- 新增本地回答库,启用后优先匹配库内问答,无匹配结果则按正常流程运行

</details>

Expand Down
1 change: 1 addition & 0 deletions config.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
"before_prompt": "请简要回复:",
"after_prompt": "",
"commit_log_type": "回答",
"local_qa": false,
"filter": {
"before_must_str": [],
"after_must_str": [
Expand Down
1 change: 1 addition & 0 deletions config.json.bak
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
"before_prompt": "请简要回复:",
"after_prompt": "",
"commit_log_type": "回答",
"local_qa": false,
"filter": {
"before_must_str": [],
"after_must_str": [
Expand Down
4 changes: 4 additions & 0 deletions data/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
本地问答库.txt,此文件用于 本地问答库匹配机制的数据来源,格式为 一问一答(奇数行是问题,下一行就是其回答)。
x.pdf langchain模式的数据文件。
x.zip langchain_pdf_local模式的数据文件。
badwords.txt 本地违禁词词库文件,每一行就是一个违禁词。
8 changes: 8 additions & 0 deletions data/本地问答库.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
打卡
打卡成功喵~
在吗
在的呢,宝贝,诶嘿
在?
在哟
奇数行是问题行,下一行就是这个问题对应的答案
我就是上一行问题的回答
Loading

0 comments on commit 3639264

Please sign in to comment.