Implement FineWeb quality filter and update helpers#3
Merged
Conversation
This commit introduces the `FineWebQualityFilterImpl`, a Rust implementation
of the FineWeb quality filtering algorithm, replacing a previous placeholder
filter that checked a metadata score.
Key changes:
- Added `FineWebQualityFilterImpl` in `src/pipeline/filters/fineweb_quality.rs`
with configurable parameters (line punctuation, short lines, character
duplicates, newline ratio) and logic based on the reference Python version.
- Updated `src/utils/text.rs`:
- Corrected the `split_into_words` function for accurate word segmentation
using ICU.
- Implemented the `find_duplicates` function to calculate character
duplication ratios.
- Added comprehensive unit tests for `FineWebQualityFilterImpl`, covering
various scenarios and edge cases for each filtering criterion.
- Updated filter registration in `src/pipeline/filters/mod.rs`.
- Updated `src/config.rs` to define `FineWebQualityFilterImplParams` for
YAML configuration and updated the `StepConfig` enum.
- Updated `src/bin/worker.rs` to correctly instantiate and integrate
the new filter into the pipeline using the new parameters.
All existing and new tests pass, ensuring the filter behaves as expected
and integrates correctly with the existing pipeline infrastructure.
…utils, fixed faulty worker logic.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This commit introduces the
FineWebQualityFilterImpl, a Rust implementation of the FineWeb quality filtering algorithm, replacing a previous placeholder filter that checked a metadata score.Key changes:
FineWebQualityFilterImplinsrc/pipeline/filters/fineweb_quality.rswith configurable parameters (line punctuation, short lines, character duplicates, newline ratio) and logic based on the reference Python version.src/utils/text.rs:split_into_wordsfunction for accurate word segmentation using ICU.find_duplicatesfunction to calculate character duplication ratios.FineWebQualityFilterImpl, covering various scenarios and edge cases for each filtering criterion.src/pipeline/filters/mod.rs.src/config.rsto defineFineWebQualityFilterImplParamsfor YAML configuration and updated theStepConfigenum.src/bin/worker.rsto correctly instantiate and integrate the new filter into the pipeline using the new parameters.All existing and new tests pass, ensuring the filter behaves as expected and integrates correctly with the existing pipeline infrastructure.