File size: 16,477 Bytes
0da4f25
21ccf4a
 
748367f
21ccf4a
 
 
 
80d91b0
21ccf4a
 
 
 
 
 
 
 
 
 
 
0da4f25
 
d1f6433
 
0da4f25
 
 
 
 
 
da1d213
 
 
 
0da4f25
 
 
 
 
 
 
80d91b0
21ccf4a
8a5630a
21ccf4a
 
 
 
 
6bcfd33
21ccf4a
 
 
 
 
 
 
 
 
 
 
 
 
 
 
8a5630a
21ccf4a
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
8a5630a
21ccf4a
 
 
 
 
 
 
 
 
 
80d91b0
21ccf4a
 
 
 
 
ff63142
21ccf4a
 
 
 
80d91b0
 
5d7591c
 
 
 
 
 
 
 
 
 
 
 
80d91b0
 
 
5d7591c
 
 
80d91b0
5d7591c
 
 
 
 
8a5630a
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
---
language:
- en
license: cc-by-4.0
size_categories:
- 10K<n<100K
task_categories:
- text-classification
pretty_name: Java Code Readability Mined & Modified
tags:
- readability
- code
- source code
- code readability
- Java
features:
- name: code_snippet
  dtype: string
- name: score
  dtype: float
dataset_info:
  features:
  - name: name
    dtype: string
  - name: code_snippet
    dtype: string
  - name: score
    dtype: float64
  splits:
  - name: train
    num_bytes: 48684700
    num_examples: 69276
  download_size: 21595103
  dataset_size: 48684700
configs:
- config_name: default
  data_files:
  - split: train
    path: data/train-*
---

# Java Code Readability Merged & Modified

This dataset contains **69276 Java code snippets** along with a **readability score**, mined from [Github](https://github.com/) and automatically processed and labelled.

You can download the dataset using Hugging Face:

```python
from datasets import load_dataset
ds = load_dataset("se2p/code-readability-krod")
```

The snippets are **not** split into train and test (and validation) set. Thus, the whole dataset is in the **train** set:
```python
ds = ds['train']
ds_as_list = ds.to_list() # Convert the dataset to whatever format suits you best

```

The dataset is structured as follows:

```json
{
  "code_snippet": ...,  # Java source code snippet
  "score": ...          # Readability score
  "name": ...           # The name of the code snippet refering to its origin
}
```

The main goal of this repository is to train code **readability classifiers for Java source code**. 

## Dataset Details

### Dataset Description

- **Curated by:** Krodinger Lukas
- **Shared by:** Krodinger Lukas
- **Language(s) (NLP):** Java
- **License:** Unknown

## Uses

The dataset can be used for training Java code readability classifiers.

## Dataset Structure

Each entry of the dataset consists of a **code_snippet** and a **score** (and a name). 
The code_snippet (string) is the code snippet that was downloaded from GitHub. Each snippet has a readability score assigned.
The score is based on a five point Likert scale, with 1 being very unreadable and 5 being very readable.

## Dataset Creation

### Curation Rationale

To advance code readability classification, the creation of datasets in this research field is of high importance.
We provide a new dataset generated with a new approach. 
Previous datasets for code readability classification are mostly generated by humans manually annotating the readability of code.
[Those datasets](https://huggingface.co/datasets/se2p/code-readability-merged) are relatively small, with combined size of only 421 samples.
As our approach allows automation, we can provide a different scale of code snippets.
We share this dataset on Hugging Face to share access and make the ease of usage easy.

### Source Data

The initial source of code snippets are from 100 public GitHub which can be found [at the end of this file](#origin-repositories).

#### Data Collection and Processing

The Data Collection and Preprocessing for this Hugging Face dataset involved two main steps.
First, GitHub repositories known for high code quality were **mined** and labeled as highly readable. The extracted methods are labeled with a score of 3.68.
Second, the code was intentionally **modified** to reduce readability. The resulting code was labelled with a score of 3.26.
This resulted in an automatically generated training dataset for source code readability classification.

#### Who are the source data producers?

The source data producers are the people that wrote the used open source Java projects.

#### Personal and Sensitive Information

The ratings of the code snippets are automatically assigned. Thus, no personal or sensitive information is contained in this dataset.

## Bias, Risks, and Limitations

The assigned labels are not accurate as they are only an average estimate based on a survey.
The average score for the mined code snippets of the survey was 3.68.
The average score for the modified code snippets of the survey was 3.26.

### Recommendations

The dataset should be used to train Java code readability classifiers. We recommend fine-tuning and evaluation on [manually labeled data](https://huggingface.co/datasets/se2p/code-readability-merged).

## Dataset Card Authors
Lukas Krodinger, [Chair of Software Engineering II](https://www.fim.uni-passau.de/en/chair-for-software-engineering-ii), [University of Passau](https://www.uni-passau.de/en/).

## Dataset Card Contact
Feel free to contact me via [E-Mail](mailto:[email protected]) if you have any questions or remarks.

# Appendix
## Origin Repositories
- [Backbase/stream-services](https://github.com/Backbase/stream-services) - cf2cddc9515e9fc594f1b3bb0f2c2aadc2890c99
- [jcabi/jcabi-maven-plugin](https://github.com/jcabi/jcabi-maven-plugin) - d53c49094014afd97ae181d267aa209842053883
- [alfasoftware/morf](https://github.com/alfasoftware/morf) - 6d44a8a4d660e3a393fdeaff14059972959e9ab2
- [apache/nifi-maven](https://github.com/apache/nifi-maven) - 25a21a83acc9f4c25f8624aa4d0cf2dcd5a0b9f5
- [codice/imaging-nitf](https://github.com/codice/imaging-nitf) - fcafa31b4f9663dd9efd6b9162657538a45d6ef2
- [TestingResearchIllinois/starts](https://github.com/TestingResearchIllinois/starts) - 487a8005b1ec24825b18a2a149216b23fda268f8
- [orangesignal/orangesignal-csv](https://github.com/orangesignal/orangesignal-csv) - 60432ca09f2fd3884f75246d4b51eb44666e8e8f
- [vesoft-inc/nebula-flink-connector](https://github.com/vesoft-inc/nebula-flink-connector) - 24a751463f2db0c045a83aec2408e3301aa5b146
- [jwhitbeck/java-rdb-parser](https://github.com/jwhitbeck/java-rdb-parser) - 499cbab24caef7de29cf4e654967f11ff7fde432
- [tinkerpop/tinkubator](https://github.com/tinkerpop/tinkubator) - a2f6cc94fb53c0045c42f9bd1e9020e3f19e92a6
- [eclipse-sirius/sirius-web](https://github.com/eclipse-sirius/sirius-web) - 5f4f3d1909762ff16a654d16a345dd02bc98ac51
- [mohamed-taman/JavaSE8-Features](https://github.com/mohamed-taman/JavaSE8-Features) - eba5360c0c9ff47895ec043c64a0d0bfaa80ba1a
- [CloudSlang/cs-actions](https://github.com/CloudSlang/cs-actions) - ae3b6f210b951897935438433a7f0bbdeeb70a33
- [k8ssandra/management-api-for-apache-cassandra](https://github.com/k8ssandra/management-api-for-apache-cassandra) - 9795d838e7c965c50a0a6a0d687c93db70344255
- [elventear/quartz-scheduler](https://github.com/elventear/quartz-scheduler) - fad901a332a47004e367972d4c4e014c61843e85
- [vmzakharov/mutate-test-kata](https://github.com/vmzakharov/mutate-test-kata) - 5bdef12f2de49b5e8db916763a319dc2a787f42e
- [apache/maven-checkstyle-plugin](https://github.com/apache/maven-checkstyle-plugin) - 56157e4c1d8c3dc25ee69a0dd35a92007ae126a6
- [ObeoNetwork/InformationSystem](https://github.com/ObeoNetwork/InformationSystem) - 7a73de597529685318b4ebb8f3ed34f8273fc5e8
- [gordonad/enterprise-spring-best-practices](https://github.com/gordonad/enterprise-spring-best-practices) - 496874ee53406142abd974006313b315b64f853b
- [PacktPublishing/TypeScript-Microservices](https://github.com/PacktPublishing/TypeScript-Microservices) - 91aa8e66696971354245c826bc5d23f885e8c27a
- [apache/incubator-hugegraph-toolchain](https://github.com/apache/incubator-hugegraph-toolchain) - e8fd3e0a6c10d34b4bf5e92495f493c913d7895e
- [NLthijs48/AreaShop](https://github.com/NLthijs48/AreaShop) - 557d11dfb477b1bc67ca3fb2995fe97b9732f9dd
- [jenkinsci/plot-plugin](https://github.com/jenkinsci/plot-plugin) - 7e7504adc1f710a384af9961ea3940ab2ed11657
- [Hipparchus-Math/hipparchus](https://github.com/Hipparchus-Math/hipparchus) - f1948e10f100a5380c869c76b4f0e8f5f1004b68
- [apache/tiles](https://github.com/apache/tiles) - 2601bcd2d8c7c5f1dde663830093c426ffff3da4
- [radargun/radargun](https://github.com/radargun/radargun) - ca4982116d0d92cccd6f947afa6424f2b51a67fc
- [vzakharchenko/keycloak-radius-plugin](https://github.com/vzakharchenko/keycloak-radius-plugin) - 986b84991db0a947c42a6928dfe21c8591dda52a
- [xwiki/xwiki-commons](https://github.com/xwiki/xwiki-commons) - 2123f979e42020e0fbfd2633c7af64e4b56a89f2
- [ddf-project/DDF](https://github.com/ddf-project/DDF) - e4e68315dcec1ed8b287bf1ee73baa88e7e41eba
- [apache/rocketmq-connect](https://github.com/apache/rocketmq-connect) - 8dcf2b37f247e2261512df8e00df7f875d4190d0
- [apache/maven-release](https://github.com/apache/maven-release) - 9e0713b83d99723ebeb3e8347f3f69c69c585ed0
- [aklivity/zilla](https://github.com/aklivity/zilla) - 94a3362b972f6d27c296b9aa69c2bb8cbbda558a
- [heshanera/HealthPlus](https://github.com/heshanera/HealthPlus) - 61bcaf20a0e1ae6c7d9f267ecdc3f9cf2b8e8b5d
- [apache/xmlgraphics-fop](https://github.com/apache/xmlgraphics-fop) - 2d0e0424a1e7b5c544427e9923a1efdc15be152d
- [adorsys/open-banking-gateway](https://github.com/adorsys/open-banking-gateway) - 81ae59db8c48b6d266eeb9a500bf4abe6a296e63
- [timothymiko/narrate-android](https://github.com/timothymiko/narrate-android) - de2ae0668ac0cc88c0fa06489709141fbf741935
- [Asqatasun/Asqatasun](https://github.com/Asqatasun/Asqatasun) - af9064357e881786cc7cc72e782662908bd91c5b
- [javadelight/delight-nashorn-sandbox](https://github.com/javadelight/delight-nashorn-sandbox) - 51bb26934b48ac0bacad8b9751393e86d6dbe31e
- [aws-powertools/powertools-lambda-java](https://github.com/aws-powertools/powertools-lambda-java) - 628a2ca93223df2b2962d1bc122f32a6f572b382
- [victools/jsonschema-generator](https://github.com/victools/jsonschema-generator) - 85d1bc1db05a3dab2a22a05466f97f399dcf8ea2
- [elBukkit/MagicPlugin](https://github.com/elBukkit/MagicPlugin) - 1edc4fec2f4d98c5dbf25c89840899e2b52fb90f
- [yegor256/qulice](https://github.com/yegor256/qulice) - cdd3fe15b49dccfa42a5bd2f6ab0cad94d7927d7
- [apache/syncope](https://github.com/apache/syncope) - 4eb29a8ebdc506ddaaaf61eb8f159791fb34c3f2
- [nmyphp/tbschedule](https://github.com/nmyphp/tbschedule) - 65c3a671a2e76aca7db7251c438c55d7516366ba
- [spring-projects-experimental/spring-boot-migrator](https://github.com/spring-projects-experimental/spring-boot-migrator) - a3a55917094056e332c23a7762c6625352d6c04b
- [kokorin/Jaffree](https://github.com/kokorin/Jaffree) - b503d1fb3e5ac54f6dc1f315321cb8d696818d9c
- [davidmoten/geo](https://github.com/davidmoten/geo) - 54a0f51a8c457a0bb1dd4bf6758e65f66e501673
- [openmessaging/benchmark](https://github.com/openmessaging/benchmark) - d0c0277fec37379a466e41e2917f0765901d6f9c
- [opencast/opencast](https://github.com/opencast/opencast) - 80a38af951c970be5bbd051e784e04a0770e37d9
- [apache/streampipes](https://github.com/apache/streampipes) - 34b33bdcf7afe75cbe5090517ca61b7ee0ad8555
- [nielsbasjes/yauaa](https://github.com/nielsbasjes/yauaa) - e7d0d18a3cb2a7a0bfa625fe1158410d3755d8c0
- [mulesoft/mule](https://github.com/mulesoft/mule) - c72aeaec2b9ca92bac4e89d03ed331c472e7214e
- [awslabs/aws-saas-boost](https://github.com/awslabs/aws-saas-boost) - a36032b1c99f1bc745c1433dcf3f8798b70261cb
- [hazelcast/hazelcast-code-samples](https://github.com/hazelcast/hazelcast-code-samples) - e4eca08e35853d677bb993560d506c8f9fc1b8ac
- [jmrozanec/cron-utils](https://github.com/jmrozanec/cron-utils) - d31697ec4c30d4f43a1b528e5781d1d00ea1c967
- [xwiki/xwiki-platform](https://github.com/xwiki/xwiki-platform) - e8b78226eb0f36ea02dacdb3f14105badda5612d
- [dremio/dremio-oss](https://github.com/dremio/dremio-oss) - be47367c523e4eded35df4e8fff725f53160558e
- [hibernate/hibernate-validator](https://github.com/hibernate/hibernate-validator) - 6e73c5f45d81a74b4f51754a80c629ef5ffc42cb
- [android-cn/android-open-project-demo](https://github.com/android-cn/android-open-project-demo) - 2ed4800f62c1a3683a0e16ec56957619acbcc57a
- [vaadin/framework](https://github.com/vaadin/framework) - c4d78a6dad72ea2fe95b8023ef3a5ba73c135277
- [apache/tika](https://github.com/apache/tika) - 8a6493b49323ff9838fb6744ea6f2a1b770f3c82
- [aws/aws-sdk-java-v2](https://github.com/aws/aws-sdk-java-v2) - 1cae596d881f7f1da7914da92d5f2d400277829f
- [confluentinc/kafka-rest](https://github.com/confluentinc/kafka-rest) - 55a50c4f76183903f14cce14245edc4fc85942a9
- [apache/rocketmq-spring](https://github.com/apache/rocketmq-spring) - 33a4186f6ab19cc3b1bd3305450476fe35141c3d
- [eclipse/eclipse-collections](https://github.com/eclipse/eclipse-collections) - a7fa499844523bc79cbf0883bacf62db5d818332
- [confluentinc/schema-registry](https://github.com/confluentinc/schema-registry) - 8390e1268f08e9759ec26c55a8ba2bd299179626
- [confluentinc/kafka-streams-examples](https://github.com/confluentinc/kafka-streams-examples) - d218996f8e58693dd311c63120d018ce05892e84
- [apache/activemq](https://github.com/apache/activemq) - 58867f7c3cef580134cb4e32e2f9086552c1876a
- [spring-cloud/spring-cloud-kubernetes](https://github.com/spring-cloud/spring-cloud-kubernetes) - ef6d06f3373abcc5ffc7c391b10fd7083b2678ab
- [roboguice/roboguice](https://github.com/roboguice/roboguice) - d96250c41149e13a159d26a532365c3f7034c07e
- [cucumber/cucumber-jvm](https://github.com/cucumber/cucumber-jvm) - 1a6c5a6052ce1354cb34731c75a29991b9d06818
- [oracle/opengrok](https://github.com/oracle/opengrok) - 1f70700b151ddf9f5f852982a6bad0be2279ebab
- [spring-io/initializr](https://github.com/spring-io/initializr) - 3641ed46a72997a5b727179775a0812fafd48b16
- [querydsl/querydsl](https://github.com/querydsl/querydsl) - cd608f04ed7534b1b62a78a28beb141071d149b6
- [dromara/hmily](https://github.com/dromara/hmily) - 52dc6ba3a44f9ade8d49bcc6ad49485ef9879c49
- [jetty/jetty.project](https://github.com/jetty/jetty.project) - b77a8054a2f3d883ad99df2eb9a954b0b25eb8d3
- [graphhopper/graphhopper](https://github.com/graphhopper/graphhopper) - 09c1013185bfb6388661cbcfef7cbb34ea138f57
- [JodaOrg/joda-time](https://github.com/JodaOrg/joda-time) - 1b5c2a0899c9fcf705d0892946deab00c4619a97
- [apache/ignite](https://github.com/apache/ignite) - b7a8f021f8caf22ad51977be0323dc4085d095e3
- [apache/hudi](https://github.com/apache/hudi) - 4c3a1db146bc5f81545f5d17020175ea9797fcd9
- [hazelcast/hazelcast](https://github.com/hazelcast/hazelcast) - ed063c769f450eb3a9aac1b0463309e4ebd643b9
- [mapstruct/mapstruct](https://github.com/mapstruct/mapstruct) - 2bb2aefed8957861bf297b8f953b40e8753a8c75
- [apache/hbase](https://github.com/apache/hbase) - dba900f778614b392e5e83522cdda72487558f48
- [NanoHttpd/nanohttpd](https://github.com/NanoHttpd/nanohttpd) - efb2ebf85a2b06f7c508aba9eaad5377e3a01e81
- [apache/zeppelin](https://github.com/apache/zeppelin) - 56da029ffe413c55ba34f46e4e4b91b8d20d9ce2
- [Alluxio/alluxio](https://github.com/Alluxio/alluxio) - f7eed03eaeae3bdf59407a6f7f78346df4f0bb1f
- [apache/storm](https://github.com/apache/storm) - c0d7b475da99c28043b137e892d58aedde4eb840
- [apache/shardingsphere-elasticjob](https://github.com/apache/shardingsphere-elasticjob) - 0b3a6eb993ee1abcb8ae81efa6ccaeb9b494ea5c
- [apache/doris](https://github.com/apache/doris) - 5bdfaf64479e73ac319ca95562711cb1898e2f05
- [codecentric/spring-boot-admin](https://github.com/codecentric/spring-boot-admin) - 4515db94c0e6398892523780778b76c156e0f08b
- [Activiti/Activiti](https://github.com/Activiti/Activiti) - b0fbe2b1c6ce204161f3536fc3caf1039a395471
- [apache/pulsar](https://github.com/apache/pulsar) - e1d06b5f54f08c09debab7a9a513b7c173c1779b
- [apache/zookeeper](https://github.com/apache/zookeeper) - 75d0a0a850352743e584f78321cf7c51417f46f8
- [apache/hadoop](https://github.com/apache/hadoop) - d72cdf7205c9e5310e832b2faa2e5b103f0804e0
- [OpenAPITools/openapi-generator](https://github.com/OpenAPITools/openapi-generator) - 8669646d998691b67f9c665e890349bf1c790edc
- [jenkinsci/jenkins](https://github.com/jenkinsci/jenkins) - f9f542bffd9f38189f3c1393475b473f1f0e035e
- [seata/seata](https://github.com/seata/seata) - 2122c6d53ae9cabcab4c53946b4a1b999e0aef76
- [apache/flink](https://github.com/apache/flink) - 00785b00b84dadae4c8b33a35ca9a5ac48e4a4c6
- [alibaba/druid](https://github.com/alibaba/druid) - 0be591b0c43ed57078a13dc0c7b7108b9ee0b388
- [alibaba/nacos](https://github.com/alibaba/nacos) - 93cc842c903487a2df6bd8f10cbd1027c67a7891
- [zxing/zxing](https://github.com/zxing/zxing) - 9c89873cfa148e961da3b0a1f9537fd9b5356564
- [jeecgboot/jeecg-boot](https://github.com/jeecgboot/jeecg-boot) - b3e4a73a342445f1ed1555c8f927b04a8d6b27d0
- [apache/dubbo](https://github.com/apache/dubbo) - e63d275eb61db8eaac00f7474e6e76e19ac805d0
- [eugenp/tutorials](https://github.com/eugenp/tutorials) - bf7bf5dacf8cff97021ab1b11020103104132d11
- [iluwatar/java-design-patterns](https://github.com/iluwatar/java-design-patterns) - 163c3017bb356937d876cd9a05905c012f3b0af6