VietCat commited on
Commit
5f692f2
·
1 Parent(s): bc7420b

update content_summary in chunking

Browse files
Files changed (1) hide show
  1. app/law_document_chunker.py +2 -6
app/law_document_chunker.py CHANGED
@@ -210,14 +210,10 @@ class LawDocumentChunker:
210
 
211
  current_priority = level_priority.get(current_level, 999)
212
 
213
- # Tìm tất cả ancestors từ toàn bộ stack trước chunk hiện tại
214
- for i in range(len(chunk_stack) - 1, -1, -1):
215
  chunk_id, level, level_value, content = chunk_stack[i]
216
 
217
- # Dừng khi gặp chunk hiện tại
218
- if chunk_id == parent_id:
219
- break
220
-
221
  # Tìm tất cả chunks Điều xuất hiện trước chunk hiện tại
222
  if level == "DIEU":
223
  ancestors.append((level, level_value, content))
 
210
 
211
  current_priority = level_priority.get(current_level, 999)
212
 
213
+ # Tìm tất cả ancestors từ index trước chunk hiện tại
214
+ for i in range(parent_index - 1, -1, -1):
215
  chunk_id, level, level_value, content = chunk_stack[i]
216
 
 
 
 
 
217
  # Tìm tất cả chunks Điều xuất hiện trước chunk hiện tại
218
  if level == "DIEU":
219
  ancestors.append((level, level_value, content))