Spaces:
Sleeping
Sleeping
Update api.py
Browse files
api.py
CHANGED
@@ -286,9 +286,12 @@ def summarize_from_wikipedia(query, top_n=3):
|
|
286 |
return textrank_summarize(raw_summary, top_n=top_n)
|
287 |
|
288 |
def build_contexted_prompt(history: List[str], user_input: str):
|
|
|
289 |
recent = ' '.join(history[-3:])
|
290 |
summary = textrank_summarize(recent, top_n=2)
|
291 |
-
|
|
|
|
|
292 |
|
293 |
# 의도 분류기
|
294 |
def simple_intent_classifier(text):
|
|
|
286 |
return textrank_summarize(raw_summary, top_n=top_n)
|
287 |
|
288 |
def build_contexted_prompt(history: List[str], user_input: str):
|
289 |
+
# 최근 대화 3개를 합쳐서 요약
|
290 |
recent = ' '.join(history[-3:])
|
291 |
summary = textrank_summarize(recent, top_n=2)
|
292 |
+
# 요약 + 최신 사용자 입력을 같이 던져줌
|
293 |
+
prompt = f"{summary} {user_input}"
|
294 |
+
return prompt
|
295 |
|
296 |
# 의도 분류기
|
297 |
def simple_intent_classifier(text):
|