violetakastreva commited on
Commit
74cca87
·
verified ·
1 Parent(s): 2a99e0a

Update README.md

Browse files
Files changed (1) hide show
  1. README.md +162 -3
README.md CHANGED
@@ -1,3 +1,162 @@
1
- ---
2
- license: odbl
3
- ---
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ ---
2
+ license: odbl
3
+ task_categories:
4
+ - text-classification
5
+ - sentence-similarity
6
+ language:
7
+ - en
8
+ tags:
9
+ - code
10
+ pretty_name: code-vs-text
11
+ size_categories:
12
+ - 10K<n<100K
13
+ ---
14
+
15
+
16
+ This dataset was created for SemEval-2026 Task 13, which focuses on distinguishing machine-generated code from human-written code across multiple programming languages and domains.
17
+
18
+ While the original SemEval task operates at the code snippet level, this dataset provides line-level annotations that enable finer-grained analysis of how code-like and text-like content is distributed within mixed inputs. The dataset is intended to support research in machine-generated code detection, robust preprocessing, and stylometric analysis, particularly in settings where natural language and programming code naturally coexist.
19
+
20
+ Each row corresponds to a single line, extracted from real-world sources such as Stack Overflow posts and Twitch chat messages.
21
+
22
+ ## **Task Definition**
23
+
24
+ **Binary line-level classification:**
25
+
26
+ * **label = 0** — natural language text
27
+ * **label = 1** — programming code
28
+
29
+ The task is intentionally defined at the **line granularity**, rather than document or block level, to support applications such as preprocessing pipelines, mixed-content filtering, and robustness evaluation.
30
+
31
+ ---
32
+
33
+ ## **Dataset Structure**
34
+
35
+ The dataset consists of **three columns**:
36
+
37
+ | Column | Description |
38
+ | -------- | ------------------------------------------------------------------------------------ |
39
+ | `line` | Raw line content (text or code). Punctuation, symbols, and formatting are preserved. |
40
+ | `label` | Binary label (0 = text, 1 = code). |
41
+ | `source` | Data origin: `stackoverflow_2019`, `stackoverflow_2020`, or `twitch`. |
42
+
43
+ No aggressive normalization has been applied; punctuation, symbols, and formatting are preserved.
44
+
45
+ ---
46
+
47
+ ## **Data Collection and Processing**
48
+
49
+ ### **Stack Overflow Data**
50
+
51
+ The Stack Overflow portion of the dataset was created by parsing **HTML post bodies** and explicitly separating structural elements:
52
+
53
+ * Code lines are extracted from `&lt;code&gt;` tags
54
+ * Text lines are extracted from `&lt;p&gt;` (paragraph) tags
55
+
56
+ To ensure that extracted code corresponds to **actual programming content**, code blocks are filtered by post tags, retaining only posts associated with the following technologies:
57
+
58
+ * `&lt;c++&gt;`, `&lt;java&gt;`, `&lt;python&gt;`, `&lt;php&gt;`, `&lt;c#&gt;`, `&lt;javascript&gt;`, `&lt;c&gt;`, `&lt;go&gt;`
59
+ * `&lt;react-native&gt;`, `&lt;laravel&gt;`, `&lt;django&gt;`, `&lt;typescript&gt;`, `&lt;node.js&gt;`, `&lt;.net-core&gt;`
60
+
61
+ **Additional filtering steps:**
62
+
63
+ * Lines containing package installation commands (e.g. `pip`) are excluded
64
+ * Lines dominated by error messages or stack traces are ignored
65
+ * Duplicate lines are removed after normalization
66
+
67
+ This filtering aims to retain **clean, representative programming code** while avoiding noisy or auxiliary content.
68
+
69
+ ---
70
+
71
+ ### **Twitch Data**
72
+
73
+ The Twitch portion consists exclusively of **natural language text** and is included to introduce **informal, unstructured, and ambiguous language** that is difficult to distinguish from code using surface-level heuristics.
74
+
75
+ **Key properties:**
76
+
77
+ * No code labels are present in this subset
78
+ * Duplicate lines are removed
79
+ * Language is short, conversational, and noisy
80
+
81
+ The purpose of this source is to **increase dataset difficulty** and improve **robustness to domain shift**.
82
+
83
+ ---
84
+
85
+ ## **Dataset Statistics**
86
+
87
+ ### **Overall Size**
88
+
89
+ * **Total lines:** 52,270
90
+ * **Text (label 0):** 27,330
91
+ * **Code (label 1):** 24,940
92
+
93
+ The dataset is approximately balanced, enabling standard classification benchmarks without mandatory resampling.
94
+
95
+ ---
96
+
97
+ ### **Label Distribution by Source**
98
+
99
+ | Source | Text (0) | Code (1) |
100
+ | ------------------ | -------: | -------: |
101
+ | stackoverflow_2019 | 14,698 | 0 |
102
+ | stackoverflow_2020 | 7,948 | 24,940 |
103
+ | twitch | 4,684 | 0 |
104
+
105
+ ---
106
+
107
+ ### **Source Distribution**
108
+
109
+ * **Stack Overflow 2020:** 32,888 lines (62.9%)
110
+ * **Stack Overflow 2019:** 14,698 lines (28.1%)
111
+ * **Twitch:** 4,684 lines (9.0%)
112
+
113
+ ---
114
+
115
+ ### **Line Length Statistics (Characters)**
116
+
117
+ **Overall:**
118
+
119
+ * **Mean:** 59.53
120
+ * **Median:** 34
121
+ * **Minimum:** 1
122
+ * **Maximum:** 9,082
123
+ * **Standard deviation:** 85.95
124
+
125
+ **By source:**
126
+
127
+ * **Stack Overflow 2019:** mean 88.71, median 58
128
+ * **Stack Overflow 2020:** mean 51.60, median 33
129
+ * **Twitch:** mean 23.62, median 17
130
+
131
+ ---
132
+
133
+ ## **Intended Use Cases**
134
+
135
+ * Line-level code vs text classification
136
+ * Mixed-content preprocessing and filtering
137
+ * Robustness evaluation across domains
138
+ * Stylometry and authorship analysis
139
+ * Code-aware language modeling pipelines
140
+
141
+ ---
142
+
143
+ ## **Limitations**
144
+
145
+ * Labels are **structural**, not semantic
146
+ * Code-like text outside `&lt;code&gt;` tags is labeled as text
147
+ * Logs or pseudo-code inside code blocks are labeled as code
148
+ * Line-level context across adjacent lines is not preserved
149
+
150
+ Users should account for these properties when designing downstream tasks.
151
+
152
+ ---
153
+
154
+ ## **Data Sources and Licensing**
155
+
156
+ This dataset is derived from **publicly available sources**.
157
+ Please refer to the following datasets for original data and licensing information:
158
+
159
+ * **Stack Overflow dataset:** *(link to be added)*
160
+ * **Twitch dataset:** *(link to be added)*
161
+
162
+ Users are responsible for complying with the original licenses when redistributing or building upon this dataset.