mirror of
https://github.com/infiniflow/ragflow.git
synced 2025-12-08 20:42:30 +08:00
add auto keywords and auto-question (#2965)
### What problem does this PR solve? #2687 ### Type of change - [x] New Feature (non-breaking change which adds functionality)
This commit is contained in:
@ -570,14 +570,3 @@ def naive_merge_docx(sections, chunk_token_num=128, delimiter="\n。;!?"):
|
||||
|
||||
return cks, images
|
||||
|
||||
|
||||
def keyword_extraction(chat_mdl, content):
|
||||
prompt = """
|
||||
You're a question analyzer.
|
||||
1. Please give me the most important keyword/phrase of this question.
|
||||
Answer format: (in language of user's question)
|
||||
- keyword:
|
||||
"""
|
||||
kwd = chat_mdl.chat(prompt, [{"role": "user", "content": content}], {"temperature": 0.2})
|
||||
if isinstance(kwd, tuple): return kwd[0]
|
||||
return kwd
|
||||
|
||||
Reference in New Issue
Block a user