Skip to content

Commit

Permalink
Rename ground_truth to expected_chunks
Browse files Browse the repository at this point in the history
  • Loading branch information
0xideas committed Nov 13, 2024
1 parent cd80525 commit 49bc07d
Showing 1 changed file with 4 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -47,18 +47,18 @@
}


def run_chunking_test(test_text, ground_truth):
def run_chunking_test(test_text, expected_chunks):
chunks = []
for chunk_data in chunk_by_paragraph(test_text, 12, batch_paragraphs=False):
chunks.append(chunk_data)

assert len(chunks) == 3

for ground_truth_item, chunk in zip(ground_truth, chunks):
for expected_chunks_item, chunk in zip(expected_chunks, chunks):
for key in ["text", "word_count", "cut_type"]:
assert (
chunk[key] == ground_truth_item[key]
), f"{key = }: {chunk[key] = } != {ground_truth_item[key] = }"
chunk[key] == expected_chunks_item[key]
), f"{key = }: {chunk[key] = } != {expected_chunks_item[key] = }"


def test_chunking_whole_text():
Expand Down

0 comments on commit 49bc07d

Please sign in to comment.