Datasets:

ArXiv:
License:
NamCyan commited on
Commit
1c3d0ef
1 Parent(s): 2539160

updata load script

Browse files
Files changed (1) hide show
  1. the-vault-function.py +58 -7
the-vault-function.py CHANGED
@@ -38,11 +38,62 @@ for lang in _LANG_TO_TEXT:
38
  _LANG_CONFIGS = ["all"] + list(_LANG_TO_TEXT.keys())
39
 
40
  num_shard_split = {
41
- 'train/small/python': 1,
42
- 'train/medium/python': 1,
43
- 'train/small/c': 1,
44
- 'train/medium/c': 1
45
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
46
  _SPLIT_CONFIGS = ["all", "train", "train/small", "train/medium", "train/full", "validation", "test"]
47
 
48
  class TheVaultFunctionConfig(datasets.BuilderConfig):
@@ -104,7 +155,7 @@ class TheVaultFunction(datasets.GeneratorBasedBuilder):
104
  "language": datasets.Value("string"),
105
  "identifier": datasets.Value("string"),
106
  "return_type": datasets.Value("string"),
107
- # "original_string": datasets.Value("string"),
108
  "original_docstring": datasets.Value("string"),
109
  "docstring": datasets.Value("string"),
110
  "docstring_tokens": datasets.Sequence(datasets.Value("string")),
@@ -232,7 +283,7 @@ class TheVaultFunction(datasets.GeneratorBasedBuilder):
232
  "language": row['language'][0],
233
  "identifier": row['identifier'][0],
234
  "return_type": row['return_type'][0],
235
- # "original_string": row['original_string'][0],
236
  "original_docstring": row['original_docstring'][0],
237
  "docstring": row['docstring'][0],
238
  "docstring_tokens": row['docstring_tokens'][0],
 
38
  _LANG_CONFIGS = ["all"] + list(_LANG_TO_TEXT.keys())
39
 
40
  num_shard_split = {
41
+ "train/small/ruby": 1,
42
+ "train/small/c": 1,
43
+ "train/small/c_sharp": 1,
44
+ "train/small/cpp": 1,
45
+ "train/small/go": 1,
46
+ "train/small/java": 2,
47
+ "train/small/javascript": 1,
48
+ "train/small/php": 1,
49
+ "train/small/python": 2,
50
+ "train/small/rust": 1,
51
+
52
+ "train/medium/c": 2,
53
+ "train/medium/c_sharp": 3,
54
+ "train/medium/cpp": 2,
55
+ "train/medium/go": 4,
56
+ "train/medium/java": 6,
57
+ "train/medium/javascript": 2,
58
+ "train/medium/php": 4,
59
+ "train/medium/python": 9,
60
+ "train/medium/ruby": 1,
61
+ "train/medium/rust": 1,
62
+
63
+ "train/full/c": 7,
64
+ "train/full/c_sharp": 12,
65
+ "train/full/cpp": 7,
66
+ "train/full/go": 13,
67
+ "train/full/java": 24,
68
+ "train/full/javascript": 7,
69
+ "train/full/php": 13,
70
+ "train/full/python": 9,
71
+ "train/full/ruby": 1,
72
+ "train/full/rust": 1,
73
+
74
+ "validation/ruby": 1,
75
+ "validation/c": 1,
76
+ "validation/c_sharp": 1,
77
+ "validation/cpp": 1,
78
+ "validation/go": 1,
79
+ "validation/java": 1,
80
+ "validation/javascript": 1,
81
+ "validation/php": 1,
82
+ "validation/python": 1,
83
+ "validation/rust": 1,
84
+
85
+ "test/ruby": 1,
86
+ "test/c": 1,
87
+ "test/c_sharp": 1,
88
+ "test/cpp": 1,
89
+ "test/go": 1,
90
+ "test/java": 1,
91
+ "test/javascript": 1,
92
+ "test/php": 1,
93
+ "test/python": 1,
94
+ "test/rust": 1
95
+
96
+ }
97
  _SPLIT_CONFIGS = ["all", "train", "train/small", "train/medium", "train/full", "validation", "test"]
98
 
99
  class TheVaultFunctionConfig(datasets.BuilderConfig):
 
155
  "language": datasets.Value("string"),
156
  "identifier": datasets.Value("string"),
157
  "return_type": datasets.Value("string"),
158
+ "original_string": datasets.Value("string"),
159
  "original_docstring": datasets.Value("string"),
160
  "docstring": datasets.Value("string"),
161
  "docstring_tokens": datasets.Sequence(datasets.Value("string")),
 
283
  "language": row['language'][0],
284
  "identifier": row['identifier'][0],
285
  "return_type": row['return_type'][0],
286
+ "original_string": row['original_string'][0],
287
  "original_docstring": row['original_docstring'][0],
288
  "docstring": row['docstring'][0],
289
  "docstring_tokens": row['docstring_tokens'][0],