Datasets:
Tasks:
Text Classification
Modalities:
Text
Formats:
parquet
Sub-tasks:
multi-label-classification
Languages:
go
Size:
1K - 10K
DOI:
License:
Upload README.md with huggingface_hub
Browse files
README.md
CHANGED
|
@@ -1,39 +1,84 @@
|
|
|
|
|
| 1 |
---
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 2 |
dataset_info:
|
| 3 |
features:
|
| 4 |
-
|
| 5 |
-
|
| 6 |
-
|
| 7 |
-
|
| 8 |
-
|
| 9 |
-
|
| 10 |
-
|
| 11 |
-
|
| 12 |
-
|
| 13 |
-
|
| 14 |
-
|
| 15 |
-
|
| 16 |
-
|
| 17 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
| 18 |
splits:
|
| 19 |
-
|
| 20 |
-
|
| 21 |
-
|
| 22 |
-
|
| 23 |
-
|
| 24 |
-
|
| 25 |
-
|
| 26 |
-
num_bytes: 1484505
|
| 27 |
-
num_examples: 448
|
| 28 |
-
download_size: 3163434
|
| 29 |
-
dataset_size: 7522694
|
| 30 |
configs:
|
| 31 |
-
- config_name: default
|
| 32 |
-
|
| 33 |
-
|
| 34 |
-
|
| 35 |
-
|
| 36 |
-
|
| 37 |
-
|
| 38 |
-
|
| 39 |
---
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
|
| 2 |
---
|
| 3 |
+
tags:
|
| 4 |
+
- code
|
| 5 |
+
- go
|
| 6 |
+
- code-style-analysis
|
| 7 |
+
- multi-label-classification
|
| 8 |
+
license: mit
|
| 9 |
+
language:
|
| 10 |
+
- go
|
| 11 |
+
source_datasets:
|
| 12 |
+
- bigcode/the-stack-v2
|
| 13 |
+
task_categories:
|
| 14 |
+
- text-classification
|
| 15 |
+
task_ids:
|
| 16 |
+
- multi-label-classification
|
| 17 |
dataset_info:
|
| 18 |
features:
|
| 19 |
+
- name: code
|
| 20 |
+
dtype: string
|
| 21 |
+
description: A snippet of Go source code.
|
| 22 |
+
- name: labels
|
| 23 |
+
dtype:
|
| 24 |
+
sequence:
|
| 25 |
+
class_label:
|
| 26 |
+
names:
|
| 27 |
+
- assignOp
|
| 28 |
+
- builtinShadow
|
| 29 |
+
- captLocal
|
| 30 |
+
- commentFormatting
|
| 31 |
+
- elseif
|
| 32 |
+
- ifElseChain
|
| 33 |
+
- paramTypeCombine
|
| 34 |
+
- singleCaseSwitch
|
| 35 |
+
description: >
|
| 36 |
+
One or more style-rule violations detected by the go‑critic linter's "style" checker group.
|
| 37 |
splits:
|
| 38 |
+
- name: train
|
| 39 |
+
num_examples: 1536
|
| 40 |
+
- name: validation
|
| 41 |
+
num_examples: 222
|
| 42 |
+
- name: test
|
| 43 |
+
num_examples: 448
|
| 44 |
+
dataset_size: 2206
|
|
|
|
|
|
|
|
|
|
|
|
|
| 45 |
configs:
|
| 46 |
+
- config_name: default
|
| 47 |
+
data_files:
|
| 48 |
+
- split: train
|
| 49 |
+
path: data/train-*
|
| 50 |
+
- split: validation
|
| 51 |
+
path: data/validation-*
|
| 52 |
+
- split: test
|
| 53 |
+
path: data/test-*
|
| 54 |
---
|
| 55 |
+
# go-critic-style
|
| 56 |
+
|
| 57 |
+
A **multi‑label** dataset of Go code snippets annotated with style violations from the [go‑critic linter's "style" group](https://go-critic.com/overview.html#checkers-from-the-style-group).
|
| 58 |
+
Curated from the [bigcode/the‑stack‑v2‑dedup](https://huggingface.co/datasets/bigcode/the-stack-v2-dedup) "Go" split, filtered to examples of manageable length.
|
| 59 |
+
|
| 60 |
+
## Label Set
|
| 61 |
+
|
| 62 |
+
List of style violations covered by this dataset:
|
| 63 |
+
|
| 64 |
+
| ID | Label | Description |
|
| 65 |
+
|--:|----------------------|---------------------------------------------------------------------|
|
| 66 |
+
| 0 | `assignOp` | Could use `+=`, `-=`, `*=`, etc. |
|
| 67 |
+
| 1 | `builtinShadow` | Shadows a predeclared identifier. |
|
| 68 |
+
| 2 | `captLocal` | Local variable name begins with an uppercase letter. |
|
| 69 |
+
| 3 | `commentFormatting` | Comment is non‑idiomatic or badly formatted. |
|
| 70 |
+
| 4 | `elseif` | Nested `if` statement that can be replaced with `else-if`. |
|
| 71 |
+
| 5 | `ifElseChain` | Repeated `if-else` statements can be replaced with `switch`. |
|
| 72 |
+
| 6 | `paramTypeCombine` | Function parameter types that can be combined (e.g. `x, y int`). |
|
| 73 |
+
| 7 | `singleCaseSwitch` | Statement `switch` that could be better written as `if`. |
|
| 74 |
+
|
| 75 |
+
## Splits
|
| 76 |
+
|
| 77 |
+
The dataset is partitioned into training, validation, and test subsets in a 70/10/20 ratio:
|
| 78 |
+
|
| 79 |
+
| Split | # Examples | Approx. % |
|
| 80 |
+
|---------------:|-----------:|----------:|
|
| 81 |
+
| **train** | 1536 | 70% |
|
| 82 |
+
| **validation** | 222 | 10% |
|
| 83 |
+
| **test** | 448 | 20% |
|
| 84 |
+
|