VietCat commited on
Commit
72d54ca
·
1 Parent(s): 9d82430

update content_summary in chunking

Browse files
Files changed (1) hide show
  1. app/law_document_chunker.py +2 -3
app/law_document_chunker.py CHANGED
@@ -207,10 +207,9 @@ class LawDocumentChunker:
207
  # Tìm tất cả ancestors từ index trước đó
208
  for i in range(parent_index - 1, -1, -1):
209
  chunk_id, level, level_value, content = chunk_stack[i]
210
- ancestor_priority = level_priority.get(level, 999)
211
 
212
- # Nếu level này cao hơn (priority thấp hơn) Điều/Khoản
213
- if ancestor_priority < current_priority and level in ["DIEU", "KHOAN"]:
214
  ancestors.append((level, level_value, content))
215
  logger.debug(f"[CHUNKER] Found ancestor: {level} {level_value}")
216
 
 
207
  # Tìm tất cả ancestors từ index trước đó
208
  for i in range(parent_index - 1, -1, -1):
209
  chunk_id, level, level_value, content = chunk_stack[i]
 
210
 
211
+ # Tìm tất cả chunks Điều/Khoản xuất hiện trước chunk hiện tại
212
+ if level in ["DIEU", "KHOAN"]:
213
  ancestors.append((level, level_value, content))
214
  logger.debug(f"[CHUNKER] Found ancestor: {level} {level_value}")
215