Luo Pan luopan commited on
Commit
8766c6a
·
1 Parent(s): a004a85

Fix bug in hierarchical_merge function (#4006)

Browse files

### What problem does this PR solve?

Fix hierarchical_merge function. From idx vs. actual value to actual
value vs. actual value.
Related issue #4003

### Type of change

- [x] Bug Fix (non-breaking change which fixes an issue)

Co-authored-by: luopan <[email protected]>

Files changed (1) hide show
  1. rag/nlp/__init__.py +1 -1
rag/nlp/__init__.py CHANGED
@@ -466,7 +466,7 @@ def hierarchical_merge(bull, sections, depth):
466
  jj = binary_search(levels[ii], j)
467
  if jj < 0:
468
  continue
469
- if jj > cks[-1][-1]:
470
  cks[-1].pop(-1)
471
  cks[-1].append(levels[ii][jj])
472
  for ii in cks[-1]:
 
466
  jj = binary_search(levels[ii], j)
467
  if jj < 0:
468
  continue
469
+ if levels[ii][jj] > cks[-1][-1]:
470
  cks[-1].pop(-1)
471
  cks[-1].append(levels[ii][jj])
472
  for ii in cks[-1]: