--- license: mit language: - en tags: - rust - code - instruction-tuning - magicoder - oss-instruct pretty_name: Magicoder OSS Instruct Rust (3.9K Cleaned) size_categories: - 1K 3.9K) Out of the original 75,000 multi-language samples: 1. Non-Rust programming languages were filtered out. 2. Incomplete snippets or entries failing `rustc` syntax checks were removed. 3. A clean, verified set of **3,909 high-quality Rust instructions** was produced. --- ## 📊 Dataset Structure The dataset follows the **ChatML** (`messages`) format: * **`system`**: System prompt assigning the expert Rust developer role. * **`user`**: Rust programming task, module design requirement, or algorithmic problem. * **`assistant`**: Corresponding idiomatic Rust solution. ### Schema Details | Field | Type | Description | |---|---|---| | `id` | `int64` | Original dataset index | | `task_category` | `string` | Task category identifier (`oss_instruct`) | | `messages` | `list` | Conversation history containing `role` and `content` (`system`, `user`, `assistant`) | --- ## 💡 Example Entry ```json { "id": 1601, "task_category": "oss_instruct", "messages": [ { "role": "system", "content": "You are an expert assistant who solves Rust programming problems and generates correct code." }, { "role": "user", "content": "You are tasked with creating a Rust module system for a 2D game engine..." }, { "role": "assistant", "content": "```rust\n// input_handler.rs\npub mod input_handler {\n pub struct InputHandler {\n // Implementation details\n }\n}\n\n// input.rs\npub mod input {\n pub use input_handler::InputHandler;\n pub use keyboard::Keyboard;\n pub use mouse::Mouse;\n pub use gamepad::Gamepad;\n}\n```\n\nIn this solution, we have created the input modules..." } ] } ``` --- ## 💻 Usage ```python from datasets import load_dataset dataset = load_dataset("WrittenWithRust/Magicoder-OSS-Instruct-Rust-3.9K") print(dataset["train"][0]) ``` --- ## 📜 Citation ```bibtex @article{wei2023magicoder, title={Magicoder: Source Code Is All You Need}, author={Wei, Yuxiang and Wang, Zhe and Liu, Jiawei and Ding, Yuhang and Zhang, Lingming}, journal={arXiv preprint arXiv:2312.02120}, year={2023} } ```