Datasets:
Tasks:
Text Classification
Modalities:
Text
Formats:
parquet
Languages:
English
Size:
10K - 100K
License:
| language: | |
| - en | |
| license: cc-by-4.0 | |
| size_categories: | |
| - 10K<n<100K | |
| task_categories: | |
| - text-classification | |
| pretty_name: Java Code Readability Krod | |
| tags: | |
| - readability | |
| - code | |
| - source code | |
| - code readability | |
| - Java | |
| features: | |
| - name: code_snippet | |
| dtype: string | |
| - name: score | |
| dtype: float | |
| dataset_info: | |
| features: | |
| - name: code_snippet | |
| dtype: string | |
| - name: score | |
| dtype: float64 | |
| splits: | |
| - name: train | |
| num_bytes: 43914782 | |
| num_examples: 63460 | |
| download_size: 15905551 | |
| dataset_size: 43914782 | |
| configs: | |
| - config_name: default | |
| data_files: | |
| - split: train | |
| path: data/train-* | |
| # Java Code Readability Krod | |
| This dataset contains **63460 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 | |
| } | |
| ``` | |
| 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**. | |
| 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 are relatively small, with combined 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 various public GitHub repositories: | |
| TODO: Add repos | |
| #### 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 downloaded and labeled as highly readable. The extracted methods are labeled with a score of 4.5. | |
| Second, the code was intentionally manipulated to reduce readability. The resulting code was labelled with a score of 1.5. | |
| 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 estimation. | |
| ### Recommendations | |
| The dataset should be used to train Java code readability classifiers. We recommend fine-tuning and evaluation on manually labelled data. | |
| ## 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. |