Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
D
db_gpt
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
linyangyang
db_gpt
Commits
1cd0211d
Commit
1cd0211d
authored
Sep 11, 2024
by
于飞
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
铭感词过滤修改
parent
b2a61834
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
2 additions
and
2 deletions
+2
-2
keywordsviews.py
dbgpt/app/apps/vadmin/keywordsviews.py
+2
-2
No files found.
dbgpt/app/apps/vadmin/keywordsviews.py
View file @
1cd0211d
...
@@ -35,12 +35,12 @@ async def get_spacy_keywords(dialogue: ConversationVo = Body(), auth: Auth = Dep
...
@@ -35,12 +35,12 @@ async def get_spacy_keywords(dialogue: ConversationVo = Body(), auth: Auth = Dep
await
mydfafiter
.
parse_from_db
(
auth
.
db
)
await
mydfafiter
.
parse_from_db
(
auth
.
db
)
#先判断敏感词
#先判断敏感词
dfa_result
,
is_sensitive
=
mydfafiter
.
filter
(
dialogue
.
user_input
,
"*"
)
dfa_result
,
is_sensitive
,
matched_sensitives
=
mydfafiter
.
filter
(
dialogue
.
user_input
,
"*"
)
print
(
dfa_result
)
print
(
dfa_result
)
if
is_sensitive
:
if
is_sensitive
:
print
(
'用户输入有敏感词'
)
print
(
'用户输入有敏感词'
)
result
=
{
'code'
:
200
,
'message'
:
'success'
,
'data'
:
[{
'type'
:
3
,
'word_name'
:
'111'
,
'is_sensitive'
:
1
,
'user_input'
:
dfa_result
}]}
result
=
{
'code'
:
200
,
'message'
:
'success'
,
'data'
:
[{
'type'
:
3
,
'word_name'
:
matched_sensitives
,
'is_sensitive'
:
1
,
'user_input'
:
dfa_result
}]}
return
SuccessResponse
(
result
)
#返回type=3
return
SuccessResponse
(
result
)
#返回type=3
#没有敏感词的时候,查找是否有相关图片 或者 视频
#没有敏感词的时候,查找是否有相关图片 或者 视频
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment