Datasets:
Tasks:
Text Generation
Modalities:
Text
Sub-tasks:
language-modeling
Languages:
English
Size:
10M - 100M
License:
Commit ·
0fec0e5
1
Parent(s): 9d62f0a
Update parquet files
Browse filesFiles changed (12)
- .gitattributesDeleted-37
- README.mdDeleted-179
- cpp/source_code-test.parquetAdded+3
- cpp/source_code-train.parquetAdded+3
- cpp/source_code-validation.parquetAdded+3
- java/source_code-test.parquetAdded+3
- java/source_code-train.parquetAdded+3
- java/source_code-validation.parquetAdded+3
- python/source_code-test.parquetAdded+3
- python/source_code-train.parquetAdded+3
- python/source_code-validation.parquetAdded+3
- source_code.pyDeleted-117
12345678910111213141516171819202122232425262728293031323334353637*.7z filter=lfs diff=lfs merge=lfs -text*.arrow filter=lfs diff=lfs merge=lfs -text*.bin filter=lfs diff=lfs merge=lfs -text*.bin.* filter=lfs diff=lfs merge=lfs -text*.bz2 filter=lfs diff=lfs merge=lfs -text*.ftz filter=lfs diff=lfs merge=lfs -text*.gz filter=lfs diff=lfs merge=lfs -text*.h5 filter=lfs diff=lfs merge=lfs -text*.joblib filter=lfs diff=lfs merge=lfs -text*.lfs.* filter=lfs diff=lfs merge=lfs -text*.model filter=lfs diff=lfs merge=lfs -text*.msgpack filter=lfs diff=lfs merge=lfs -text*.onnx filter=lfs diff=lfs merge=lfs -text*.ot filter=lfs diff=lfs merge=lfs -text*.parquet filter=lfs diff=lfs merge=lfs -text*.pb filter=lfs diff=lfs merge=lfs -text*.pt filter=lfs diff=lfs merge=lfs -text*.pth filter=lfs diff=lfs merge=lfs -text*.rar filter=lfs diff=lfs merge=lfs -textsaved_model/**/* filter=lfs diff=lfs merge=lfs -text*.tar.* filter=lfs diff=lfs merge=lfs -text*.tflite filter=lfs diff=lfs merge=lfs -text*.tgz filter=lfs diff=lfs merge=lfs -text*.xz filter=lfs diff=lfs merge=lfs -text*.zip filter=lfs diff=lfs merge=lfs -text*.zstandard filter=lfs diff=lfs merge=lfs -text*tfevents* filter=lfs diff=lfs merge=lfs -text# Audio files - uncompressed*.pcm filter=lfs diff=lfs merge=lfs -text*.sam filter=lfs diff=lfs merge=lfs -text*.raw filter=lfs diff=lfs merge=lfs -text# Audio files - compressed*.aac filter=lfs diff=lfs merge=lfs -text*.flac filter=lfs diff=lfs merge=lfs -text*.mp3 filter=lfs diff=lfs merge=lfs -text*.ogg filter=lfs diff=lfs merge=lfs -text*.wav filter=lfs diff=lfs merge=lfs -text123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179---annotations_creators:- no-annotationlanguage_creators:- crowdsourcedlanguage:- enlicense:- cc-by-4.0- gfdlmultilinguality:- monolingualsize_categories:- 100M<n<200Msource_datasets:- https://github.com/shibing624/code-autocomplete- https://github.com/bharathgs/Awesome-pytorch-list- https://github.com/akullpp/awesome-java- https://github.com/fffaraz/awesome-cpptask_categories:- text-generationtask_ids:- language-modeling---# Dataset Card for "SourceCode"## Table of Contents- [Dataset Description](#dataset-description) - [Dataset Summary](#dataset-summary) - [Supported Tasks and Leaderboards](#supported-tasks-and-leaderboards) - [Languages](#languages)- [Dataset Structure](#dataset-structure) - [Data Instances](#data-instances) - [Data Fields](#data-fields) - [Data Splits](#data-splits)- [Dataset Creation](#dataset-creation) - [Curation Rationale](#curation-rationale) - [Source Data](#source-data) - [Annotations](#annotations) - [Personal and Sensitive Information](#personal-and-sensitive-information)- [Considerations for Using the Data](#considerations-for-using-the-data) - [Social Impact of Dataset](#social-impact-of-dataset) - [Discussion of Biases](#discussion-of-biases) - [Other Known Limitations](#other-known-limitations)- [Additional Information](#additional-information) - [Dataset Curators](#dataset-curators) - [Licensing Information](#licensing-information) - [Citation Information](#citation-information) - [Contributions](#contributions)
## Dataset Description- **Repository:** [code-autocomplete](https://github.com/shibing624/code-autocomplete)- **Leaderboard:** [leaderboard](https://github.com/shibing624/code-autocomplete) (located on the homepage)- **Size of downloaded dataset files:** 105 MB- **Total amount of disk used:** 570 MB
### Dataset Summary
Source code dataset is a collection of Github awesome repos, it contains Python, Java, C++, and other programming languages.This dataset can be used in different NLP tasks like language modeling and text generation tasks.
data source:
- PYTHON_CODE: https://github.com/bharathgs/Awesome-pytorch-list- JAVA_CODE: https://github.com/akullpp/awesome-java- CPP_CODE: https://github.com/fffaraz/awesome-cpp
### Supported Tasks and Leaderboards- language modeling - code generation tasks, **Leaderboard:** [code-autocomplete](https://github.com/shibing624/code-autocomplete)
### Languages
- programming languages: Python, Java, C++- natural language: English
## Dataset Structure### Data InstancesAn example of 'train' looks as follows.```This example was too long and was cropped:
{ "text": """import jsonimport argparse
def _parse_args(): parser = argparse.ArgumentParser( description=__doc__, formatter_class=argparse.RawTextHelpFormatter, ) parser.add_argument( '--model-file', required=True, help=( 'A pt file from ' 'https://github.com/pytorch/fairseq/tree/main/examples/hubert' ) ) return parser.parse_args() """}```### Data FieldsThe data fields are the same among all splits.- `text`: a `string` feature.### Data Splits#### python```shell$ wc -l python/* 10000 python/test.txt 5215412 python/train.txt 10000 python/valid.txt 5235412 total```#### java```shell$ wc -l java/* 950083 java/test.txt 2802880 java/train.txt 940803 java/valid.txt 4693766 total```#### cpp```shell$ wc -l cpp/* 1060014 cpp/test.txt 3119241 cpp/train.txt 1099124 cpp/valid.txt 5278379 total```## Dataset Creation### Curation RationaleAs code generation dataset, I upload it to huggingface datasets.### Source Data#### Initial Data Collection and Normalization#### Who are the source language producers?Citation:
APA:```latexXu, M. code-autocomplete: Code AutoComplete with GPT2 model (Version 0.0.4) [Computer software]. https://github.com/shibing624/code-autocomplete```
BibTeX:```latex@software{Xu_code-autocomplete_Code_AutoComplete,author = {Xu, Ming},title = {code-autocomplete: Code AutoComplete with GPT2 model},url = {https://github.com/shibing624/code-autocomplete},version = {0.0.4}}```
### Annotations#### Annotation process#### Who are the annotators?nobody### Personal and Sensitive Information## Considerations for Using the Data### Social Impact of DatasetThis dataset was developed as a benchmark for evaluating code generation model.### Discussion of Biases### Other Known Limitations## Additional Information### Dataset Curators
Github awesome programing code repos.
### Licensing Information
GNU Free Documentation License v1.3 or later.
For research use only.
### ContributionsThanks to [@shibing624](https://github.com/shibing624) add this dataset.123version https://git-lfs.github.com/spec/v1oid sha256:3ed8fc92d8a90f8fbb6c21b2d092b9a26a1a3f628ea1442e7c70ddbd7f65a6d5size 14777918123version https://git-lfs.github.com/spec/v1oid sha256:24b94f1059f6693185d3cf2cac2efea62619c0f9cd85ccabacb444634b829b2asize 43310554123version https://git-lfs.github.com/spec/v1oid sha256:ec29da474598e23dfa838e72328827a4c544a7c936955e7370670395339d4cfasize 13398188123version https://git-lfs.github.com/spec/v1oid sha256:01cf04b41b788bc1e43084549d3e4d0671fb66ab956d0e03b6f480d2aa5466aasize 13125149123version https://git-lfs.github.com/spec/v1oid sha256:55321d53ebad853c2830782a990bca28ab6cda05d551fb45f5160f95df5c4262size 39000045123version https://git-lfs.github.com/spec/v1oid sha256:94f929eeb467866baa79991e4ee18ecde722c635d038546953344dadf46ab042size 12826887123version https://git-lfs.github.com/spec/v1oid sha256:b61f40a604c9d09ae58629002e0dbf4079a5e26c319b0ef7b6f3c8f624e1420fsize 154538123version https://git-lfs.github.com/spec/v1oid sha256:587fe15486fa942f14a16c58fe8b96cc5fb6eda765faff3402644d115a8ad987size 84203586123version https://git-lfs.github.com/spec/v1oid sha256:6e7acf2a0e299dd21ec8b48750aca9043cea7c1d1b327715abd0ce0d6b47e945size 151687123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117# -*- coding: utf-8 -*-"""@author:XuMing(xuming624@qq.com)@description:"""
"""Code AutoComplete Python dataset Corpus.(code_autocomplete)"""
import os
import datasets
_DESCRIPTION = """纯文本数据,内容:高质量编程源代码,包括Python,Java,CPP源代码"""
PYTHON_HOME = "https://github.com/bharathgs/Awesome-pytorch-list"JAVA_HOME = "https://github.com/akullpp/awesome-java"CPP_HOME = "https://github.com/fffaraz/awesome-cpp"
_CITATION = "https://github.com/shibing624/code-autocomplete"
_DATA_URL = "https://github.com/shibing624/code-autocomplete/releases/download/0.0.4/source_code.zip"
class SourceCodeConfig(datasets.BuilderConfig): """BuilderConfig for NLI_zh"""
def __init__(self, features, data_url, citation, url, **kwargs): """BuilderConfig for NLI_zh Args: features: `list[string]`, list of the features that will appear in the feature dict. Should not include "label". data_url: `string`, url to download the zip file from. citation: `string`, citation for the data set. url: `string`, url for information about the data set. **kwargs: keyword arguments forwarded to super. """ super().__init__(version=datasets.Version("1.0.0"), **kwargs) self.features = features self.data_url = data_url self.citation = citation self.url = url
class SourceCode(datasets.GeneratorBasedBuilder): """The Natural Language Inference Chinese(NLI_zh) Corpus."""
BUILDER_CONFIGS = [ SourceCodeConfig( name="python", description=_DESCRIPTION, features=["text"], data_url=_DATA_URL, citation=_CITATION, url=PYTHON_HOME, ), SourceCodeConfig( name="java", description=_DESCRIPTION, features=["text"], data_url=_DATA_URL, citation=_CITATION, url=JAVA_HOME, ), SourceCodeConfig( name="cpp", description=_DESCRIPTION, features=["text"], data_url=_DATA_URL, citation=_CITATION, url=CPP_HOME, ), ]
def _info(self): return datasets.DatasetInfo( description=self.config.description, features=datasets.Features( { "text": datasets.Value("string"), } ), homepage=self.config.url, citation=self.config.citation, )
def _split_generators(self, dl_manager): dl_dir = dl_manager.download_and_extract(self.config.data_url) or "" dl_dir = os.path.join(dl_dir, f"source_code/{self.config.name}") return [ datasets.SplitGenerator( name=datasets.Split.TRAIN, gen_kwargs={ "filepath": os.path.join(dl_dir, f"train.txt"), }, ), datasets.SplitGenerator( name=datasets.Split.VALIDATION, gen_kwargs={ "filepath": os.path.join(dl_dir, f"valid.txt"), }, ), datasets.SplitGenerator( name=datasets.Split.TEST, gen_kwargs={ "filepath": os.path.join(dl_dir, f"test.txt"), }, ), ]
def _generate_examples(self, filepath): """This function returns the examples in the raw (text) form.""" with open(filepath, 'r', encoding="utf-8") as f: for idx, row in enumerate(f): if row.strip(): yield idx, {"text": row} else: yield idx, {"text": ""}.gitattributesDeleted-37
README.mdDeleted-179
cpp/source_code-test.parquetAdded+3
cpp/source_code-train.parquetAdded+3
cpp/source_code-validation.parquetAdded+3
java/source_code-test.parquetAdded+3
java/source_code-train.parquetAdded+3
java/source_code-validation.parquetAdded+3
python/source_code-test.parquetAdded+3
python/source_code-train.parquetAdded+3
python/source_code-validation.parquetAdded+3
source_code.pyDeleted-117