Vojtech Hejlek commited on
Commit
fc91b00
·
verified ·
1 Parent(s): 5fc1ab3

Update README.md

Browse files
Files changed (1) hide show
  1. README.md +18 -18
README.md CHANGED
@@ -15,37 +15,37 @@ size_categories:
15
  # Dataset Card for C-to-Rust Parallel Semantic Similarity Corpus
16
 
17
  ## Dataset Summary
18
- The **C-to-Rust Parallel Semantic Similarity Corpus** is a curated dataset consisting of **1,886 aligned, function-level C and Rust code pairs**[cite: 1]. It was developed to evaluate cross-language semantic similarity and functional equivalence between a traditional legacy language (C) and a modern memory-safe language (Rust)[cite: 1].
19
 
20
- The source code snippets are drawn from accepted competitive programming submissions across **Project CodeNet**, **xCodeEval**, and **The Algorithms**[cite: 1]. Every pair shares identical algorithmic logic, has been validated to compile under modern environments (GCC C17 and Rust 1.94.0), and is filtered to ensure functional correctness[cite: 1].
21
 
22
  ## Dataset Structure
23
 
24
- The dataset is distributed as a single JSONL file where each row represents an aligned problem pair[cite: 1].
25
 
26
  ### Data Fields
27
- * `problem_id` (`string`): A zero-padded sequential identifier spanning `0001` to `1886`[cite: 1].
28
- * `problem_description` (`string`): The full natural language problem statement provided by the source platform[cite: 1].
29
- * `c_code` (`string`): The normalized, fully functional C implementation[cite: 1].
30
- * `rust_code` (`string`): The normalized, fully functional Rust implementation[cite: 1].
31
- * `difficulty` (`string`): The alignment difficulty tier assigned to the pair (`easy`, `medium`, or `hard`)[cite: 1].
32
 
33
  ---
34
 
35
  ## Dataset Creation & Curation
36
 
37
  ### Filtering and Preprocessing Pipeline
38
- 1. **Functional Correctness:** Restricted exclusively to submissions marked as "Accepted" by online judges to guarantee true semantic alignment[cite: 1].
39
- 2. **Compilation Validation:** Submissions were strictly compiled locally using GCC (C17 standard) and Rust 1.94.0 to eliminate syntax errors or compiler drift[cite: 1].
40
- 3. **Code Normalization:** Dead code, redundant macros, comments, and explicit Rust `#[allow(...)]` attributes were systematically stripped[cite: 1]. Code layouts were standardized using `clang-format` and `rustfmt`[cite: 1].
41
- 4. **Function Inlining:** Core logic was restricted to a single function block, and all function identifiers were normalized to `solution` to eliminate superficial retrieval shortcuts[cite: 1].
42
- 5. **Semantic Deduplication:** Dense textual vectors from OpenAI's `text-embedding-3-large` were used to compute problem description similarities[cite: 1]. Redundant problems with a cosine similarity above 0.90 were filtered out, removing 127 duplicate tasks[cite: 1].
43
-
44
  ### Difficulty Categorization
45
- Difficulty tiers were empirically mapped using zero-shot cosine similarity scores from the `SFR-Embedding-Code-400M_R` model[cite: 1]. Quantile thresholds at the 25th and 75th percentiles partition the dataset[cite: 1]:
46
- * **Easy (25%):** Similarity $\ge 0.868$[cite: 1]
47
- * **Medium (50%):** Similarity between $0.781$ and $0.868$[cite: 1]
48
- * **Hard (25%):** Similarity $< 0.781$ (Representing heavy syntax/paradigm divergence)[cite: 1].
49
 
50
  ---
51
 
 
15
  # Dataset Card for C-to-Rust Parallel Semantic Similarity Corpus
16
 
17
  ## Dataset Summary
18
+ The **C-to-Rust Parallel Semantic Similarity Corpus** is a curated dataset consisting of **1,886 aligned, function-level C and Rust code pairs**. It was developed to evaluate cross-language semantic similarity and functional equivalence between a traditional legacy language (C) and a modern memory-safe language (Rust).
19
 
20
+ The source code snippets are drawn from accepted competitive programming submissions across **Project CodeNet**, **xCodeEval**, and **The Algorithms. Every pair shares identical algorithmic logic, has been validated to compile under modern environments (GCC C17 and Rust 1.94.0), and is filtered to ensure functional correctness.
21
 
22
  ## Dataset Structure
23
 
24
+ The dataset is distributed as a single JSONL file where each row represents an aligned problem pair.
25
 
26
  ### Data Fields
27
+ * `problem_id` (`string`): A zero-padded sequential identifier spanning `0001` to `1886`.
28
+ * `problem_description` (`string`): The full natural language problem statement provided by the source platform.
29
+ * `c_code` (`string`): The normalized, fully functional C implementation.
30
+ * `rust_code` (`string`): The normalized, fully functional Rust implementation.
31
+ * `difficulty` (`string`): The alignment difficulty tier assigned to the pair (`easy`, `medium`, or `hard`).
32
 
33
  ---
34
 
35
  ## Dataset Creation & Curation
36
 
37
  ### Filtering and Preprocessing Pipeline
38
+ 1. **Functional Correctness:** Restricted exclusively to submissions marked as "Accepted" by online judges to guarantee true semantic alignment.
39
+ 2. **Compilation Validation:** Submissions were strictly compiled locally using GCC (C17 standard) and Rust 1.94.0 to eliminate syntax errors or compiler drift.
40
+ 3. **Code Normalization:** Dead code, redundant macros, comments, and explicit Rust `#[allow(...)]` attributes were systematically stripped. Code layouts were standardized using `clang-format` and `rustfmt`.
41
+ 4. **Function Inlining:** Core logic was restricted to a single function block, and all function identifiers were normalized to `solution` to eliminate superficial retrieval shortcuts.
42
+ 5. **Semantic Diversity:** The final corpus contains a diverse set of unique problems with no overlapping duplicates, providing a clean benchmark for cross-language evaluation.
43
+ 6.
44
  ### Difficulty Categorization
45
+ Difficulty tiers were empirically mapped using zero-shot cosine similarity scores from the `SFR-Embedding-Code-400M_R` model. Quantile thresholds at the 25th and 75th percentiles partition the dataset:
46
+ * **Easy (25%):** Similarity $\ge 0.868$
47
+ * **Medium (50%):** Similarity between $0.781$ and $0.868$
48
+ * **Hard (25%):** Similarity $< 0.781$ (Representing heavy syntax/paradigm divergence)
49
 
50
  ---
51