Add .conll / .conllu dataset format loader (CoNLL-2003 / 2000 / U)#8219
Merged
Merged
Conversation
Reads CoNLL-style files (one token per line, columns whitespace-separated, blank lines = sentence boundaries) into one row per sentence with lists aligned across configurable column names. - Supports CoNLL-2003 NER, CoNLL-2000 chunking, CoNLL-U, and arbitrary custom column schemas via ConllConfig.column_names. - Configurable delimiter (default: any whitespace), comment_prefix (CoNLL-U `#`), and skip_docstart (CoNLL-2003 -DOCSTART- markers). - Registered for .conll and .conllu extensions in _EXTENSION_TO_MODULE (the .conllu mapping pre-sets comment_prefix="#"). - Pads short rows / truncates long rows to keep column alignment. Closes huggingface#7757. Design discussed with namesarnav who suggested basing the implementation on the text builder shape since CoNLL files are line-based.
lhoestq
reviewed
May 26, 2026
Member
lhoestq
left a comment
There was a problem hiding this comment.
Sorry for the delay it looks all good to me, just running the CI and if grren let's merge :)
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.
Closes #7757.
Summary
Adds a
packaged_modules/conll/builder so.conlland.conllufiles load directly viaload_dataset(...)without manual parsing scripts. Each row of the loaded dataset corresponds to one sentence, with each configured column produced as a list aligned with the token list.Builder shape mirrors the
textpackaged module (line-based reading) — as suggested by @namesarnav in the issue thread.