fix bug
Browse files- app/message_processor.py +1 -1
- app/reranker.py +4 -4
app/message_processor.py
CHANGED
|
@@ -275,7 +275,7 @@ class MessageProcessor:
|
|
| 275 |
for i, match in enumerate(matches, 1):
|
| 276 |
if not top or (match.get('similarity', 0) > top.get('similarity', 0)):
|
| 277 |
top = match
|
| 278 |
-
full_result_text += f"\n{match.get('structure'
|
| 279 |
tieude = (match.get('tieude') or '').strip()
|
| 280 |
noidung = (match.get('noidung') or '').strip()
|
| 281 |
hanhvi = (tieude + "\n" + noidung).strip().replace('\n', ' ')
|
|
|
|
| 275 |
for i, match in enumerate(matches, 1):
|
| 276 |
if not top or (match.get('similarity', 0) > top.get('similarity', 0)):
|
| 277 |
top = match
|
| 278 |
+
full_result_text += f"\n{(match.get('structure') or '').strip()}:\n"
|
| 279 |
tieude = (match.get('tieude') or '').strip()
|
| 280 |
noidung = (match.get('noidung') or '').strip()
|
| 281 |
hanhvi = (tieude + "\n" + noidung).strip().replace('\n', ' ')
|
app/reranker.py
CHANGED
|
@@ -104,8 +104,8 @@ class Reranker:
|
|
| 104 |
# Không giới hạn content length, giữ nguyên nội dung luật
|
| 105 |
docs_content = []
|
| 106 |
for i, doc in enumerate(docs):
|
| 107 |
-
tieude = doc.get('tieude'
|
| 108 |
-
noidung = doc.get('noidung'
|
| 109 |
content = f"{tieude} {noidung}".strip()
|
| 110 |
docs_content.append(f"{i+1}. {content}")
|
| 111 |
|
|
@@ -171,8 +171,8 @@ class Reranker:
|
|
| 171 |
Score một document với query.
|
| 172 |
Không cắt bớt nội dung luật.
|
| 173 |
"""
|
| 174 |
-
tieude = doc.get('tieude'
|
| 175 |
-
noidung = doc.get('noidung'
|
| 176 |
content = f"{tieude} {noidung}".strip()
|
| 177 |
prompt = (
|
| 178 |
f"Đánh giá mức độ liên quan:\n"
|
|
|
|
| 104 |
# Không giới hạn content length, giữ nguyên nội dung luật
|
| 105 |
docs_content = []
|
| 106 |
for i, doc in enumerate(docs):
|
| 107 |
+
tieude = (doc.get('tieude') or '').strip()
|
| 108 |
+
noidung = (doc.get('noidung') or '').strip()
|
| 109 |
content = f"{tieude} {noidung}".strip()
|
| 110 |
docs_content.append(f"{i+1}. {content}")
|
| 111 |
|
|
|
|
| 171 |
Score một document với query.
|
| 172 |
Không cắt bớt nội dung luật.
|
| 173 |
"""
|
| 174 |
+
tieude = (doc.get('tieude') or '').strip()
|
| 175 |
+
noidung = (doc.get('noidung') or '').strip()
|
| 176 |
content = f"{tieude} {noidung}".strip()
|
| 177 |
prompt = (
|
| 178 |
f"Đánh giá mức độ liên quan:\n"
|