Datasets:
Duplicate from Hello-SimpleAI/HC3
Browse filesCo-authored-by: beyond <beyond@users.noreply.huggingface.co>
Files changed (9)
- .gitattributesAdded+56
- HC3.pyAdded+187
- README.mdAdded+54
- all.jsonlAdded+3
- finance.jsonlAdded
- medicine.jsonlAdded
- open_qa.jsonlAdded
- reddit_eli5.jsonlAdded+3
- wiki_csai.jsonlAdded
1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556*.7z filter=lfs diff=lfs merge=lfs -text*.arrow filter=lfs diff=lfs merge=lfs -text*.bin filter=lfs diff=lfs merge=lfs -text*.bz2 filter=lfs diff=lfs merge=lfs -text*.ckpt 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*.lz4 filter=lfs diff=lfs merge=lfs -text*.mlmodel filter=lfs diff=lfs merge=lfs -text*.model filter=lfs diff=lfs merge=lfs -text*.msgpack filter=lfs diff=lfs merge=lfs -text*.npy filter=lfs diff=lfs merge=lfs -text*.npz 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*.pickle filter=lfs diff=lfs merge=lfs -text*.pkl 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 -text*.safetensors 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*.wasm filter=lfs diff=lfs merge=lfs -text*.xz filter=lfs diff=lfs merge=lfs -text*.zip filter=lfs diff=lfs merge=lfs -text*.zst 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 -text# Image files - uncompressed*.bmp filter=lfs diff=lfs merge=lfs -text*.gif filter=lfs diff=lfs merge=lfs -text*.png filter=lfs diff=lfs merge=lfs -text*.tiff filter=lfs diff=lfs merge=lfs -text# Image files - compressed*.jpg filter=lfs diff=lfs merge=lfs -text*.jpeg filter=lfs diff=lfs merge=lfs -text*.webp filter=lfs diff=lfs merge=lfs -textall.jsonl filter=lfs diff=lfs merge=lfs -textreddit_eli5.jsonl filter=lfs diff=lfs merge=lfs -text123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187# Copyright 2020 The HuggingFace Datasets Authors and the current dataset script contributor.## Licensed under the Apache License, Version 2.0 (the "License");# you may not use this file except in compliance with the License.# You may obtain a copy of the License at## http://www.apache.org/licenses/LICENSE-2.0## Unless required by applicable law or agreed to in writing, software# distributed under the License is distributed on an "AS IS" BASIS,# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.# See the License for the specific language governing permissions and# limitations under the License.# TODO: Address all TODOs and remove all explanatory comments"""TODO: Add a description here."""
import csvimport jsonimport os
import datasets
# TODO: Add BibTeX citation# Find for instance the citation on arxiv or on the dataset repo/website_CITATION = """\
"""
# TODO: Add description of the dataset here# You can copy an official description_DESCRIPTION = """\Human ChatGPT Comparison Corpus (HC3)"""
# TODO: Add a link to an official homepage for the dataset here_HOMEPAGE = "https://github.com/Hello-SimpleAI/chatgpt-comparison-detection"
# TODO: Add the licence for the dataset here if you can find it_LICENSE = ""
# TODO: Add link to the official dataset URLs here# The HuggingFace Datasets library doesn't host the datasets but only points to the original files.# This can be an arbitrary nested dict/list of URLs (see below in `_split_generators` method)_BASE_URL = 'https://huggingface.co/datasets/Hello-SimpleAI/HC3/resolve/main/'# _URLS = {# "all":"https://huggingface.co/datasets/Hello-SimpleAI/chatgpt-comparison-corpus/resolve/main/en/all.jsonl",# "reddit_eli5": "https://huggingface.co/datasets/Hello-SimpleAI/chatgpt-comparison-corpus/resolve/main/en/reddit_eli5.jsonl",# "wikipedia_csai": "https://huggingface.co/datasets/Hello-SimpleAI/chatgpt-comparison-corpus/resolve/main/en/wikipedia_csai.jsonl",# "open_questions": "https://huggingface.co/datasets/Hello-SimpleAI/chatgpt-comparison-corpus/resolve/main/en/open_questions.jsonl",# "finance": "https://huggingface.co/datasets/Hello-SimpleAI/chatgpt-comparison-corpus/resolve/main/en/finance.jsonl",# "medicine": "https://huggingface.co/datasets/Hello-SimpleAI/chatgpt-comparison-corpus/resolve/main/en/medicine.jsonl",# }
# TODO: Name of the dataset usually matches the script name with CamelCase instead of snake_caseclass NewDataset(datasets.GeneratorBasedBuilder): """Human ChatGPT Comparison Corpus (HC3)"""
VERSION = datasets.Version("1.1.0")
# This is an example of a dataset with multiple configurations. # If you don't want/need to define several sub-sets in your dataset, # just remove the BUILDER_CONFIG_CLASS and the BUILDER_CONFIGS attributes.
# If you need to make complex sub-parts in the datasets with configurable options # You can create your own builder configuration class to store attribute, inheriting from datasets.BuilderConfig # BUILDER_CONFIG_CLASS = MyBuilderConfig
# You will be able to load one or the other configurations in the following list with # data = datasets.load_dataset('my_dataset', 'first_domain') # data = datasets.load_dataset('my_dataset', 'second_domain') BUILDER_CONFIGS = [ datasets.BuilderConfig(name="all", version=VERSION, description="concatenation of all other subsets"), datasets.BuilderConfig(name="reddit_eli5", version=VERSION, description="reddit"), datasets.BuilderConfig(name="wiki_csai", version=VERSION, description="wiki"), datasets.BuilderConfig(name="open_qa", version=VERSION, description="open_questions"), datasets.BuilderConfig(name="finance", version=VERSION, description="finance"), datasets.BuilderConfig(name="medicine", version=VERSION, description="medicine"), ]
DEFAULT_CONFIG_NAME = "first_domain" # It's not mandatory to have a default configuration. Just use one if it make sense.
def _info(self): # TODO: This method specifies the datasets.DatasetInfo object which contains informations and typings for the dataset if self.config.name == "all": # This is the name of the configuration selected in BUILDER_CONFIGS above features = datasets.Features( { "id":datasets.Value("string"), "question": datasets.Value("string"), "human_answers": datasets.Sequence(datasets.Value("string")), "chatgpt_answers": datasets.Sequence(datasets.Value("string")), "source": datasets.Value("string") # These are the features of your dataset like images, labels ... } ) else: # This is an example to show how to have different features for "first_domain" and "second_domain" features = datasets.Features( { "id":datasets.Value("string"), "question": datasets.Value("string"), "human_answers": datasets.Sequence(datasets.Value("string")), "chatgpt_answers": datasets.Sequence(datasets.Value("string")), # These are the features of your dataset like images, labels ... } ) return datasets.DatasetInfo( # This is the description that will appear on the datasets page. description=_DESCRIPTION, # This defines the different columns of the dataset and their types features=features, # Here we define them above because they are different between the two configurations # If there's a common (input, target) tuple from the features, uncomment supervised_keys line below and # specify them. They'll be used if as_supervised=True in builder.as_dataset. # supervised_keys=("sentence", "label"), # Homepage of the dataset for documentation homepage=_HOMEPAGE, # License for the dataset if available license=_LICENSE, # Citation for the dataset citation=_CITATION, )
def _split_generators(self, dl_manager): # TODO: This method is tasked with downloading/extracting the data and defining the splits depending on the configuration # If several configurations are possible (listed in BUILDER_CONFIGS), the configuration selected by the user is in self.config.name
# dl_manager is a datasets.download.DownloadManager that can be used to download and extract URLS # It can accept any type or nested list/dict and will give back the same structure with the url replaced with path to local files. # By default the archives will be extracted and a path to a cached folder where they are extracted is returned instead of the archive # urls = _URLS[self.config.name] urls = _BASE_URL+self.config.name+'.jsonl' data_path = dl_manager.download_and_extract(urls) # for online datasets # data_path = _URLS[self.config.name] return [ datasets.SplitGenerator( name=datasets.Split.TRAIN, # These kwargs will be passed to _generate_examples gen_kwargs={ # "filepath": os.path.join(data_dir, "train.jsonl"), "filepath": data_path, "split": "train", }, ), # datasets.SplitGenerator( # name=datasets.Split.VALIDATION, # # These kwargs will be passed to _generate_examples # gen_kwargs={ # "filepath": os.path.join(data_dir, "dev.jsonl"), # "split": "dev", # }, # ), # datasets.SplitGenerator( # name=datasets.Split.TEST, # # These kwargs will be passed to _generate_examples # gen_kwargs={ # "filepath": os.path.join(data_dir, "test.jsonl"), # "split": "test" # }, # ), ]
# method parameters are unpacked from `gen_kwargs` as given in `_split_generators` def _generate_examples(self, filepath, split): # TODO: This method handles input defined in _split_generators to yield (key, example) tuples from the dataset. # The `key` is for legacy reasons (tfds) and is not important in itself, but must be unique for each example. with open(filepath, encoding="utf-8") as f: for key, row in enumerate(f): data = json.loads(row) if self.config.name == "all": # Yields examples as (key, example) tuples yield key, { "id": key, "question": data["question"], "human_answers": data["human_answers"], "chatgpt_answers": data["chatgpt_answers"], "source": data["source"] } else: yield key, { "id": key, "question": data["question"], "human_answers": data["human_answers"], "chatgpt_answers": data["chatgpt_answers"], }123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354---task_categories:- text-classification- question-answering- sentence-similarity- zero-shot-classificationlanguage:- en- zhtags:- ChatGPT- SimpleAI- Detection- OODsize_categories:- 10K<n<100Klicense: cc-by-sa-4.0---
# Human ChatGPT Comparison Corpus (HC3)We propose the first human-ChatGPT comparison corpus, named **HC3** dataset.
This dataset is introduced in our paper: - Paper: [***How Close is ChatGPT to Human Experts? Comparison Corpus, Evaluation, and Detection***](https://arxiv.org/abs/2301.07597)
Code, models and analysis are available on our GitHub:- GitHub: [**Chatgpt-Comparison-Detection project** 🔬](https://github.com/Hello-SimpleAI/chatgpt-comparison-detection)
# Dataset CopyrightIf the source datasets used in this corpus has a specific license which is stricter than CC-BY-SA, our products follow the same. If not, they follow CC-BY-SA license.See [dataset copyright](https://github.com/Hello-SimpleAI/chatgpt-comparison-detection#dataset-copyright).
# Citation
Checkout this papaer [arxiv: 2301.07597](https://arxiv.org/abs/2301.07597)
```@article{guo-etal-2023-hc3, title = "How Close is ChatGPT to Human Experts? Comparison Corpus, Evaluation, and Detection", author = "Guo, Biyang and Zhang, Xin and Wang, Ziyuan and Jiang, Minqi and Nie, Jinran and Ding, Yuxuan and Yue, Jianwei and Wu, Yupeng", journal={arXiv preprint arxiv:2301.07597} year = "2023",}```123version https://git-lfs.github.com/spec/v1oid sha256:ee231f82283d754050a4dc58ecf9331afaf5daea7283c6da0b096ed0fb2774cfsize 73722850123version https://git-lfs.github.com/spec/v1oid sha256:448cebaf7fdf27560daf6cc87cc1464be4988cf8110c0ec40c40b21c2c0193dbsize 55448695.gitattributesAdded+56
HC3.pyAdded+187
README.mdAdded+54
all.jsonlAdded+3
finance.jsonlAdded
medicine.jsonlAdded
open_qa.jsonlAdded
reddit_eli5.jsonlAdded+3
wiki_csai.jsonlAdded