blindsubmissions commited on
Commit
474f0ae
1 Parent(s): bf3f02d

Update README.md

Browse files
Files changed (1) hide show
  1. README.md +77 -0
README.md CHANGED
@@ -53,5 +53,82 @@ size_categories:
53
  ---
54
  # Docstring to code data
55
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
56
  ## Licensing Information
57
  M2CRB is a subset filtered and pre-processed from [The Stack](https://huggingface.co/datasets/bigcode/the-stack), a collection of source code from repositories with various licenses. Any use of all or part of the code gathered in M2CRB must abide by the terms of the original licenses.
 
53
  ---
54
  # Docstring to code data
55
 
56
+ ## Dataset Summary
57
+ This dataset contains pairs of English text and code from multiple programming language pairs. Namely, text is paired with code snippets for: Python, Java, JavaScript, and Go. The data is curated via an automated filtering pipeline from source files within [The Stack](https://huggingface.co/datasets/bigcode/the-stack).
58
+
59
+ ## Supported Tasks
60
+ This dataset can be used to finetune models for code-to-text and/or text-to-code models, both on information retrieval or conditional generation settings.
61
+
62
+ ## Splits
63
+
64
+ ```python
65
+ DATA_SPLITS = {"python_gh", "java_gh", "javascript_gh", "go_gh"}
66
+ ```
67
+
68
+ ## How to get the data with a given programming language
69
+
70
+ ```python
71
+ from datasets import load_dataset
72
+
73
+ def get_dataset(prog_lang):
74
+
75
+ test_data = load_dataset("blindsubmissions/GH_text2code")
76
+
77
+ return test_data
78
+ ```
79
+
80
+ ## Dataset Structure
81
+
82
+ ### Data Instances
83
+ Each data instance corresponds to function/methods occurring in licensed files that compose The Stack. That is, files with permissive licences collected from GitHub.
84
+
85
+ ### Relevant Data Fields
86
+
87
+ - identifier (string): Function/method name.
88
+ - parameters (string): Function parameters.
89
+ - return_statement (string): Return statement if found during parsing.
90
+ - docstring (string): Complete docstring content.
91
+ - docstring_summary (string): Summary/processed docstring dropping args and return statements.
92
+ - function (string): Actual function/method content.
93
+ - argument_list (null): List of arguments.
94
+ - language (string): Programming language of the function.
95
+ - type (string): Return type if found during parsing.
96
+
97
+ ## Summary of data curation pipeline
98
+
99
+ - Filtering out repositories that appear in [CodeSearchNet](https://huggingface.co/datasets/code_search_net).
100
+ - Filtering the files that belong to the programming languages of interest.
101
+ - Pre-filtering the files that likely contain text in the natural languages of interest.
102
+ - AST parsing with [Tree-sitter](\url{https://tree-sitter.github.io/tree-sitter/).
103
+ - Perform language identification of docstrings in the resulting set of functions/methods and select the ones classified as English via majority voting.
104
+
105
+ ## Social Impact of the dataset
106
+
107
+ This dataset is released with the aim to increase the availability of training data available to the NLP for code research community by providing text/code paired data. We expect this data to help enable more accurate information retrieval systems and text-to-code or code-to-text summarization.
108
+
109
+ As a subset of The Stack, this dataset inherits de-risking efforts carried out when that dataset was built, though we highlight risks exist and malicious use of the data could exist such as, for instance, to aid on creation of malicious code. We highlight however that this is a risk shared by any code dataset made openly available.
110
+
111
+ Moreover, we remark that the data may contain harmful or offensive language, which could be learned by models trained on it.
112
+
113
+ ## Discussion of Biases
114
+
115
+ The data is collected from GitHub and naturally occurring text on that platform. As a consequence, certain languages are more or less likely to contain well documented code and, as such, resulting data will not be uniformly represented in terms of their programing languages.
116
+
117
+ ## Known limitations
118
+
119
+ The dataset can be expanded to further improve its coverage.
120
+ Moreover, we use text naturally occurring as comments or docstrings as opposed to human annotators. As such, resulting data will have high variance in terms of quality depending on practices of sub-communities of software developers. However, we remark that the task our evaluation dataset defines is reflective of what searching on a real codebase would look like.
121
+ Finally, we note that some imbalance on data is observed due to the same reason since certain languages are more or less likely to contain well documented code.
122
+
123
+ ## Maintenance plan:
124
+
125
+ The data will be kept up to date by following The Stack releases. We should rerun our pipeline for every new release and add non-overlapping new content to both training and testing partitions of our data.
126
+
127
+ This is so that we carry over opt-out updates and include fresh repos.
128
+
129
+ ## Update plan:
130
+
131
+ - Cover all 6 programming languages from CodeSearchNet.
132
+
133
  ## Licensing Information
134
  M2CRB is a subset filtered and pre-processed from [The Stack](https://huggingface.co/datasets/bigcode/the-stack), a collection of source code from repositories with various licenses. Any use of all or part of the code gathered in M2CRB must abide by the terms of the original licenses.