Datasets:
Tasks:
Text Generation
Formats:
json
Sub-tasks:
language-modeling
Languages:
code
Size:
100K - 1M
License:
mvasiliniuc
commited on
Commit
•
8eade86
1
Parent(s):
d8ebc4f
Create README.md
Browse files
README.md
ADDED
@@ -0,0 +1,178 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
---
|
2 |
+
annotations_creators:
|
3 |
+
- crowdsourced
|
4 |
+
license: other
|
5 |
+
language_creators:
|
6 |
+
- crowdsourced
|
7 |
+
language:
|
8 |
+
- code
|
9 |
+
task_categories:
|
10 |
+
- text-generation
|
11 |
+
tags:
|
12 |
+
- code, swift, native iOS development, curated
|
13 |
+
size_categories:
|
14 |
+
- 100K<n<1M
|
15 |
+
source_datasets: []
|
16 |
+
pretty_name: iva-swift-codeint-clean
|
17 |
+
task_ids:
|
18 |
+
- language-modeling
|
19 |
+
---
|
20 |
+
|
21 |
+
# IVA Swift GitHub Code Dataset
|
22 |
+
|
23 |
+
## Dataset Description
|
24 |
+
|
25 |
+
This is the curated IVA Swift dataset extracted from GitHub.
|
26 |
+
It contains curated Swift files gathered with the purpose to train a code generation model.
|
27 |
+
|
28 |
+
The dataset consists of 383380 swift code files from GitHub totaling ~542MB of data.
|
29 |
+
The [uncurated](https://huggingface.co/datasets/mvasiliniuc/iva-swift-codeint) dataset was created from the public GitHub dataset on Google BiqQuery.
|
30 |
+
|
31 |
+
### How to use it
|
32 |
+
|
33 |
+
To download the full dataset:
|
34 |
+
|
35 |
+
```python
|
36 |
+
from datasets import load_dataset
|
37 |
+
dataset = load_dataset('mvasiliniuc/iva-swift-codeint-clean', split='train')
|
38 |
+
```
|
39 |
+
|
40 |
+
```python
|
41 |
+
|
42 |
+
from datasets import load_dataset
|
43 |
+
dataset = load_dataset('mvasiliniuc/iva-swift-codeint-clean', split='train')
|
44 |
+
print(dataset[723])
|
45 |
+
|
46 |
+
#OUTPUT:
|
47 |
+
{
|
48 |
+
"repo_name":"jdkelley/Udacity-OnTheMap-ExampleApps",
|
49 |
+
"path":"TheMovieManager-v2/TheMovieManager/BorderedButton.swift",
|
50 |
+
"copies":"2",
|
51 |
+
"size":"2649",
|
52 |
+
"content":"...let phoneBorderedButtonExtraPadding: CGFloat = 14.0\n \n var backingColor: UIColor? = nil\n var highlightedBackingColor: UIColor? = nil\n \n // MARK: Initialization\n}",
|
53 |
+
"license":"mit",
|
54 |
+
"hash":"db1587fd117e9a835f58cf8203d8bf05",
|
55 |
+
"line_mean":29.1136363636,
|
56 |
+
"line_max":87,
|
57 |
+
"alpha_frac":0.6700641752,
|
58 |
+
"ratio":5.298,
|
59 |
+
"autogenerated":false,
|
60 |
+
"config_or_test":false,
|
61 |
+
"has_no_keywords":false,
|
62 |
+
"has_few_assignments":false
|
63 |
+
}
|
64 |
+
```
|
65 |
+
|
66 |
+
## Data Structure
|
67 |
+
|
68 |
+
### Data Fields
|
69 |
+
|
70 |
+
|Field|Type|Description|
|
71 |
+
|---|---|---|
|
72 |
+
|repo_name|string|name of the GitHub repository|
|
73 |
+
|path|string|path of the file in GitHub repository|
|
74 |
+
|copies|string|number of occurrences in dataset|
|
75 |
+
|content|string|content of source file|
|
76 |
+
|size|string|size of the source file in bytes|
|
77 |
+
|license|string|license of GitHub repository|
|
78 |
+
|hash|string|Hash of content field.|
|
79 |
+
|line_mean|number|Mean line length of the content.
|
80 |
+
|line_max|number|Max line length of the content.
|
81 |
+
|alpha_frac|number|Fraction between mean and max line length of content.
|
82 |
+
|ratio|number|Character/token ratio of the file with tokenizer.
|
83 |
+
|autogenerated|boolean|True if the content is autogenerated by looking for keywords in the first few lines of the file.
|
84 |
+
|config_or_test|boolean|True if the content is a configuration file or a unit test.
|
85 |
+
|has_no_keywords|boolean|True if a file has none of the keywords for Swift Programming Language.
|
86 |
+
|has_few_assignments|boolean|True if file uses symbol '=' less than `minimum` times.
|
87 |
+
|
88 |
+
### Instance
|
89 |
+
|
90 |
+
```json
|
91 |
+
{
|
92 |
+
"repo_name":"...",
|
93 |
+
"path":".../BorderedButton.swift",
|
94 |
+
"copies":"2",
|
95 |
+
"size":"2649",
|
96 |
+
"content":"...",
|
97 |
+
"license":"mit",
|
98 |
+
"hash":"db1587fd117e9a835f58cf8203d8bf05",
|
99 |
+
"line_mean":29.1136363636,
|
100 |
+
"line_max":87,
|
101 |
+
"alpha_frac":0.6700641752,
|
102 |
+
"ratio":5.298,
|
103 |
+
"autogenerated":false,
|
104 |
+
"config_or_test":false,
|
105 |
+
"has_no_keywords":false,
|
106 |
+
"has_few_assignments":false
|
107 |
+
}
|
108 |
+
```
|
109 |
+
|
110 |
+
## Languages
|
111 |
+
|
112 |
+
The dataset contains only Swift files.
|
113 |
+
|
114 |
+
```json
|
115 |
+
{
|
116 |
+
"Swift": [".swift"]
|
117 |
+
}
|
118 |
+
```
|
119 |
+
|
120 |
+
## Licenses
|
121 |
+
|
122 |
+
Each entry in the dataset contains the associated license. The following is a list of licenses involved and their occurrences.
|
123 |
+
|
124 |
+
```json
|
125 |
+
{
|
126 |
+
"agpl-3.0":4052,
|
127 |
+
"apache-2.0":114641,
|
128 |
+
"artistic-2.0":159,
|
129 |
+
"bsd-2-clause":474,
|
130 |
+
"bsd-3-clause":4571,
|
131 |
+
"cc0-1.0":198,
|
132 |
+
"epl-1.0":991,
|
133 |
+
"gpl-2.0":5625,
|
134 |
+
"gpl-3.0":25102,
|
135 |
+
"isc":436,
|
136 |
+
"lgpl-2.1":146,
|
137 |
+
"lgpl-3.0":3406,
|
138 |
+
"mit":39399,
|
139 |
+
"mpl-2.0":1819,
|
140 |
+
"unlicense":824
|
141 |
+
}
|
142 |
+
```
|
143 |
+
|
144 |
+
## Dataset Statistics
|
145 |
+
|
146 |
+
```json
|
147 |
+
{
|
148 |
+
"Total size": "~542 MB",
|
149 |
+
"Number of files": 383380,
|
150 |
+
"Number of files under 500 bytes": 3680,
|
151 |
+
"Average file size in bytes": 5942,
|
152 |
+
}
|
153 |
+
```
|
154 |
+
|
155 |
+
## Curation Process
|
156 |
+
|
157 |
+
* Removal of duplication files based on file hash.
|
158 |
+
* Removal of file templates. File containing the following: `___FILENAME___, ___PACKAGENAME___, ___FILEBASENAME___, ___FILEHEADER___, ___VARIABLE`
|
159 |
+
* Removal of the files containing the following words in the first 10 lines: `generated, auto-generated", "autogenerated", "automatically generated`
|
160 |
+
* Removal of the files containing the following words in the first 10 lines with a probability of 0.7: `test", "unit test", "config", "XCTest", "JUnit`
|
161 |
+
* Removal of file with the rate of alphanumeric characters below 0.3 of the file.
|
162 |
+
* Removal of near duplication based MinHash and Jaccard similarity.
|
163 |
+
* Removal of files with mean line length above 100.
|
164 |
+
* Removal of files without mention of keywords with a probability of 0.7: `struct ", "class ", "for ", "while ", "enum ", "func ", "typealias ", "var ", "let ", "protocol ", "public ", "private ", "internal ", "import "`
|
165 |
+
* Removal of files that use the assignment operator `=` less than 3 times.
|
166 |
+
* Removal of files with the ratio between the number of characters and number of tokens after tokenization lower than 1.5.
|
167 |
+
|
168 |
+
Curation process is a derivation of the one used in CodeParrot project: https://huggingface.co/codeparrot
|
169 |
+
|
170 |
+
## Data Splits
|
171 |
+
The dataset only contains a train split which is separated into train and valid which can be found here:
|
172 |
+
* Clean Version Train: https://huggingface.co/datasets/mvasiliniuc/iva-swift-codeint-clean-train
|
173 |
+
* Clean Version Valid: https://huggingface.co/datasets/mvasiliniuc/iva-swift-codeint-clean-valid
|
174 |
+
|
175 |
+
# Considerations for Using the Data
|
176 |
+
|
177 |
+
The dataset consists of source code from a wide range of repositories.
|
178 |
+
As such they can potentially include harmful or biased code as well as sensitive information like passwords or usernames.
|