Repository navigation
fix(text): drop empty repeated-paragraph documents - #2444
Conversation
Signed-off-by: 1fanwang <1fannnw@gmail.com>
|
|
Thanks for picking this up. I ran
So the empty case from #2443 is fixed, whitespace-only text is handled the same way, and non-empty scoring is unchanged. I did not run the repository's test suite. One thing outside this change: the other filters mentioned in #2443 that divide by an empty count ( |
sarahyurick
left a comment
There was a problem hiding this comment.
Hi @1fanwang thanks for opening! Can you please check the other filters in https://github.com/NVIDIA-NeMo/Curator/blob/main/nemo_curator/stages/text/filters/heuristic/repetition/repetition.py and make sure that they all have similar behavior?
Maybe even better would be to drop empty records in https://github.com/NVIDIA-NeMo/Curator/blob/main/nemo_curator/stages/text/filters/score_filter.py instead?
Ensure RepeatedLinesFilter, RepeatedLinesByCharFilter, RepeatedParagraphsFilter, and RepeatedParagraphsByCharFilter safely return 0.0 on empty and whitespace-only inputs, guarding against ZeroDivisionError and dropping empty documents. Signed-off-by: 1fanwang <1fannnw@gmail.com>
|
Thanks @sarahyurick and @shaurya416. Updated in ac94abf.
Regarding |
|
/ok to test eaf65da |
sarahyurick
left a comment
There was a problem hiding this comment.
LGTM thanks @1fanwang !
Description
Empty documents can pass through a standalone repeated-paragraph filter as if they were valid text. That differs from the neighboring repetition filters, which treat empty or undersized inputs as documents to drop.
This changes
RepeatedParagraphsFilterso empty text scores below the keep threshold. Non-empty paragraph scoring still uses the existing unique-paragraph ratio.Closes #2443
Usage
No usage change. Existing
ScoreFilter(RepeatedParagraphsFilter())pipelines now drop empty documents instead of retaining them.Checklist
Testing Done
Raw logs
Red, before the fix:
Green, after the fix: