update content_summary in chunking
Browse files
app/law_document_chunker.py
CHANGED
|
@@ -281,7 +281,7 @@ class LawDocumentChunker:
|
|
| 281 |
summary = summary_response.strip() if summary_response else "Không có tóm tắt"
|
| 282 |
|
| 283 |
# Tạo context_summary theo format yêu cầu
|
| 284 |
-
context_summary = f"Structure: {level} |
|
| 285 |
|
| 286 |
return context_summary
|
| 287 |
|
|
@@ -297,7 +297,7 @@ class LawDocumentChunker:
|
|
| 297 |
level_parts.append(f"Điều {metadata.article_number}")
|
| 298 |
|
| 299 |
level = " ".join(reversed(level_parts)) if level_parts else "Nội dung"
|
| 300 |
-
return f"Structure: {level} |
|
| 301 |
|
| 302 |
def _split_into_chunks(self, text: str, chunk_size: int, overlap: int) -> List[str]:
|
| 303 |
"""Chia text thành các chunk với overlap."""
|
|
|
|
| 281 |
summary = summary_response.strip() if summary_response else "Không có tóm tắt"
|
| 282 |
|
| 283 |
# Tạo context_summary theo format yêu cầu
|
| 284 |
+
context_summary = f"Structure: {level} | Semantic: {summary}"
|
| 285 |
|
| 286 |
return context_summary
|
| 287 |
|
|
|
|
| 297 |
level_parts.append(f"Điều {metadata.article_number}")
|
| 298 |
|
| 299 |
level = " ".join(reversed(level_parts)) if level_parts else "Nội dung"
|
| 300 |
+
return f"Structure: {level} | Semantic: Không có tóm tắt"
|
| 301 |
|
| 302 |
def _split_into_chunks(self, text: str, chunk_size: int, overlap: int) -> List[str]:
|
| 303 |
"""Chia text thành các chunk với overlap."""
|