Dataset Viewer
Duplicate
The dataset viewer is not available for this split.
Cannot load the dataset split (in streaming mode) to extract the first rows.
Error code:   StreamingRowsError
Exception:    CastError
Message:      Couldn't cast
text: string
source: string
source_id: string
source_file: string
repository: string
commit: string
license: string
total_characters: int64
license_summary: string
purpose: string
sources: list<item: struct<id: string, title: string, repository: string, commit: string, license_files: list (... 16 chars omitted)
  child 0, item: struct<id: string, title: string, repository: string, commit: string, license_files: list<item: stri (... 4 chars omitted)
      child 0, id: string
      child 1, title: string
      child 2, repository: string
      child 3, commit: string
      child 4, license_files: list<item: string>
          child 0, item: string
file: string
records: int64
target_model: string
to
{'file': Value('string'), 'records': Value('int64'), 'total_characters': Value('int64'), 'purpose': Value('string'), 'target_model': Value('string'), 'license_summary': Value('string'), 'sources': List({'id': Value('string'), 'title': Value('string'), 'repository': Value('string'), 'commit': Value('string'), 'license_files': List(Value('string'))})}
because column names don't match
Traceback:    Traceback (most recent call last):
                File "/src/services/worker/src/worker/utils.py", line 147, in get_rows_or_raise
                  return get_rows(
                      dataset=dataset,
                  ...<4 lines>...
                      column_names=column_names,
                  )
                File "/src/libs/libcommon/src/libcommon/utils.py", line 272, in decorator
                  return func(*args, **kwargs)
                File "/src/services/worker/src/worker/utils.py", line 127, in get_rows
                  rows_plus_one = list(itertools.islice(safe_iter(ds, dataset=dataset), rows_max_number + 1))
                File "/src/services/worker/src/worker/utils.py", line 483, in safe_iter
                  yield from ds.decode(False) if ds.features else ds
                File "/usr/local/lib/python3.14/site-packages/datasets/iterable_dataset.py", line 2840, in __iter__
                  for key, example in ex_iterable:
                                      ^^^^^^^^^^^
                File "/usr/local/lib/python3.14/site-packages/datasets/iterable_dataset.py", line 2373, in __iter__
                  for key, pa_table in self._iter_arrow():
                                       ~~~~~~~~~~~~~~~~^^
                File "/usr/local/lib/python3.14/site-packages/datasets/iterable_dataset.py", line 2398, in _iter_arrow
                  for key, pa_table in self.ex_iterable._iter_arrow():
                                       ~~~~~~~~~~~~~~~~~~~~~~~~~~~~^^
                File "/usr/local/lib/python3.14/site-packages/datasets/iterable_dataset.py", line 536, in _iter_arrow
                  for key, pa_table in iterator:
                                       ^^^^^^^^
                File "/usr/local/lib/python3.14/site-packages/datasets/iterable_dataset.py", line 419, in _iter_arrow
                  for key, pa_table in self.generate_tables_fn(**gen_kwags):
                                       ~~~~~~~~~~~~~~~~~~~~~~~^^^^^^^^^^^^^
                File "/usr/local/lib/python3.14/site-packages/datasets/packaged_modules/json/json.py", line 343, in _generate_tables
                  self._cast_table(pa_table, json_field_paths=json_field_paths),
                  ~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
                File "/usr/local/lib/python3.14/site-packages/datasets/packaged_modules/json/json.py", line 132, in _cast_table
                  pa_table = table_cast(pa_table, self.info.features.arrow_schema)
                File "/usr/local/lib/python3.14/site-packages/datasets/table.py", line 2378, in table_cast
                  return cast_table_to_schema(table, schema)
                File "/usr/local/lib/python3.14/site-packages/datasets/table.py", line 2306, in cast_table_to_schema
                  raise CastError(
                  ...<3 lines>...
                  )
              datasets.table.CastError: Couldn't cast
              text: string
              source: string
              source_id: string
              source_file: string
              repository: string
              commit: string
              license: string
              total_characters: int64
              license_summary: string
              purpose: string
              sources: list<item: struct<id: string, title: string, repository: string, commit: string, license_files: list (... 16 chars omitted)
                child 0, item: struct<id: string, title: string, repository: string, commit: string, license_files: list<item: stri (... 4 chars omitted)
                    child 0, id: string
                    child 1, title: string
                    child 2, repository: string
                    child 3, commit: string
                    child 4, license_files: list<item: string>
                        child 0, item: string
              file: string
              records: int64
              target_model: string
              to
              {'file': Value('string'), 'records': Value('int64'), 'total_characters': Value('int64'), 'purpose': Value('string'), 'target_model': Value('string'), 'license_summary': Value('string'), 'sources': List({'id': Value('string'), 'title': Value('string'), 'repository': Value('string'), 'commit': Value('string'), 'license_files': List(Value('string'))})}
              because column names don't match

Need help to make the dataset viewer work? Make sure to review how to configure the dataset viewer, and open a discussion for direct support.

Ferrous Corpus: Advanced Rust Knowledge & Crate Documentation

A comprehensive, version-controlled dual-corpus dataset designed for Rust language pre-training, continued pre-training, and domain adaptation of Large Language Models. This dataset combines deep theoretical foundations from official Rust governance/learning materials with practical, real-world third-party crate implementations and documentation.

Dataset Details

Dataset Description

The Ferrous Corpus is split into two primary components to provide both deep theoretical grammar/memory-safety understanding and practical code application for Rust:

  1. Official Advanced Corpus: Ingests core official documents (The Book, Nomicon, Reference, etc.) tracked by precise GitHub commit hashes.
  2. Crate Documentation Corpus: Ingests documentation, code comments, and examples from 60 of the most popular crates on crates.io, filtered strictly for permissive OSI-compliant licenses.
  • Curated by: Independent AI & Data Engineer
  • Language(s) (NLP): English (Programming Language: Rust)
  • License: Mixed upstream licensing (primarily MIT OR Apache-2.0). The dataset creator claims ownership only of the collection, cleaning, paragraph-aware chunking, and packaging assembly. See upstream license files for details.

Dataset Sources

Uses

Direct Use

  • Continued Pre-training / Domain Adaptation: Adapting base Large Language Models (such as Qwen, Llama, or Mistral variants) to master Rust syntax, lifetime annotations, and borrow-checker logic.
  • RAG & Documentation Retrieval: Serving as a rich knowledge base for retrieval-augmented generation systems focused on Rust development.
  • Code Assistance: Providing context for models generating or explaining idiomatic Rust code and documentation.

Out-of-Scope Use

  • Direct Chat Fine-Tuning: This is a knowledge/documentation corpus, not a formatted instruction-response (SFT) chatbot dataset. Using it raw for direct chat alignment without an SFT formatting phase will yield sub-optimal conversational performance.
  • Unverified Production Deployment: Models trained solely on this data should still be checked by human developers, as upstream code samples may contain deprecated patterns or specific edge cases.

Dataset Structure

The dataset is structured into JSONL format with detailed provenance metadata per chunk.

  • Total Scale: ~266,907 total chunks across both sub-datasets.
  • Fields included in records:
    • text: The cleaned, chunked prose or code segment.
    • source / source_id: Name of the official guide or crate.
    • source_file / source_path: Original relative path of the file.
    • repository: Upstream repository URL.
    • commit (Official Corpus): Git commit hash for reproducibility.
    • crate & crate_version (Crates Corpus): Exact version tracking from crates.io.
    • license: Upstream license expression.

Dataset Creation

Curation Rationale

Most general-purpose LLMs struggle with niche systems-programming concepts like Rust's ownership model, lifetimes, and unsafe code blocks. This dataset was built to bridge that gap by aggregating authoritative explanations directly from the Rust core team's guides alongside high-download ecosystem crates.

Source Data

Data Collection and Processing

  • Official Corpus: Cloned shallowly from official rust-lang GitHub repositories at fixed commits. Markdown files smaller than 300 characters were filtered out, and remaining text was split using a paragraph-aware boundary splitter (split_chunks) with overlap buffers.
  • Crates Corpus: Queried top-downloaded packages via the crates.io API. Filtered programmatically to exclude non-permissive licenses (blocking GPL, AGPL, SSPL). Extracted .md, .rs, .toml, and .txt files under 500KB, cleaned comment/markup formatting, and chunked them cleanly with boundary-aware text slicing.

Who are the source data producers?

The Rust core team, official documentation contributors, and open-source maintainers of the top 60 crates on crates.io.

Personal and Sensitive Information

No personal, private, or sensitive human data is included. The dataset consists entirely of programming language syntax, technical documentation, public APIs, and open-source code.

Bias, Risks, and Limitations

  • Ecosystem Bias: The crates portion heavily weights the top 60 most-downloaded packages on crates.io, meaning niche or newer async runtimes/libraries may be underrepresented.
  • Temporal Validity: Crates and language editions evolve; code snippets reflect the specific package versions captured during dataset compilation.

Recommendations

Users should be aware that this corpus optimizes a model's foundational knowledge of Rust. For chat-bot behavior, developers should follow up pre-training with a verified instruction-tuning (SFT) phase.

Citation [optional]

If you use or build upon this corpus, please reference its assembly components and credit the upstream Rust repositories (rust-lang/book, rust-lang/nomicon, etc.).

BibTeX:

@dataset{ferrous_corpus_2026,
  title={Ferrous Corpus: Advanced Rust Knowledge & Crate Documentation},
  author={Playfulbug!},
  year={2026},
  publisher={Hugging Face}
}
Downloads last month
-