system HF staff commited on
Commit
853a9fd
0 Parent(s):

Update files from the datasets library (from 1.0.0)

Browse files

Release notes: https://github.com/huggingface/datasets/releases/tag/1.0.0

Files changed (4) hide show
  1. .gitattributes +27 -0
  2. aeslc.py +107 -0
  3. dataset_infos.json +1 -0
  4. dummy/1.0.0/dummy_data.zip +3 -0
.gitattributes ADDED
@@ -0,0 +1,27 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ *.7z filter=lfs diff=lfs merge=lfs -text
2
+ *.arrow filter=lfs diff=lfs merge=lfs -text
3
+ *.bin filter=lfs diff=lfs merge=lfs -text
4
+ *.bin.* filter=lfs diff=lfs merge=lfs -text
5
+ *.bz2 filter=lfs diff=lfs merge=lfs -text
6
+ *.ftz filter=lfs diff=lfs merge=lfs -text
7
+ *.gz filter=lfs diff=lfs merge=lfs -text
8
+ *.h5 filter=lfs diff=lfs merge=lfs -text
9
+ *.joblib filter=lfs diff=lfs merge=lfs -text
10
+ *.lfs.* filter=lfs diff=lfs merge=lfs -text
11
+ *.model filter=lfs diff=lfs merge=lfs -text
12
+ *.msgpack filter=lfs diff=lfs merge=lfs -text
13
+ *.onnx filter=lfs diff=lfs merge=lfs -text
14
+ *.ot filter=lfs diff=lfs merge=lfs -text
15
+ *.parquet filter=lfs diff=lfs merge=lfs -text
16
+ *.pb filter=lfs diff=lfs merge=lfs -text
17
+ *.pt filter=lfs diff=lfs merge=lfs -text
18
+ *.pth filter=lfs diff=lfs merge=lfs -text
19
+ *.rar filter=lfs diff=lfs merge=lfs -text
20
+ saved_model/**/* filter=lfs diff=lfs merge=lfs -text
21
+ *.tar.* filter=lfs diff=lfs merge=lfs -text
22
+ *.tflite filter=lfs diff=lfs merge=lfs -text
23
+ *.tgz filter=lfs diff=lfs merge=lfs -text
24
+ *.xz filter=lfs diff=lfs merge=lfs -text
25
+ *.zip filter=lfs diff=lfs merge=lfs -text
26
+ *.zstandard filter=lfs diff=lfs merge=lfs -text
27
+ *tfevents* filter=lfs diff=lfs merge=lfs -text
aeslc.py ADDED
@@ -0,0 +1,107 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # coding=utf-8
2
+ # Copyright 2020 The TensorFlow Datasets Authors and the HuggingFace Datasets Authors.
3
+ #
4
+ # Licensed under the Apache License, Version 2.0 (the "License");
5
+ # you may not use this file except in compliance with the License.
6
+ # You may obtain a copy of the License at
7
+ #
8
+ # http://www.apache.org/licenses/LICENSE-2.0
9
+ #
10
+ # Unless required by applicable law or agreed to in writing, software
11
+ # distributed under the License is distributed on an "AS IS" BASIS,
12
+ # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13
+ # See the License for the specific language governing permissions and
14
+ # limitations under the License.
15
+
16
+ # Lint as: python3
17
+ """Annotated Enron Subject Line Corpus Dataset."""
18
+
19
+ from __future__ import absolute_import, division, print_function
20
+
21
+ import glob
22
+ import os
23
+
24
+ import datasets
25
+
26
+
27
+ _CITATION = """
28
+ @misc{zhang2019email,
29
+ title={This Email Could Save Your Life: Introducing the Task of Email Subject Line Generation},
30
+ author={Rui Zhang and Joel Tetreault},
31
+ year={2019},
32
+ eprint={1906.03497},
33
+ archivePrefix={arXiv},
34
+ primaryClass={cs.CL}
35
+ }
36
+ """
37
+
38
+ _DESCRIPTION = """
39
+ A collection of email messages of employees in the Enron Corporation.
40
+
41
+ There are two features:
42
+ - email_body: email body text.
43
+ - subject_line: email subject text.
44
+ """
45
+
46
+ _URL = "https://github.com/ryanzhumich/AESLC/archive/master.zip"
47
+
48
+ _DOCUMENT = "email_body"
49
+ _SUMMARY = "subject_line"
50
+
51
+
52
+ class Aeslc(datasets.GeneratorBasedBuilder):
53
+ """Annotated Enron Subject Line Corpus Dataset."""
54
+
55
+ VERSION = datasets.Version("1.0.0")
56
+
57
+ def _info(self):
58
+ return datasets.DatasetInfo(
59
+ description=_DESCRIPTION,
60
+ features=datasets.Features({_DOCUMENT: datasets.Value("string"), _SUMMARY: datasets.Value("string")}),
61
+ supervised_keys=(_DOCUMENT, _SUMMARY),
62
+ homepage="https://github.com/ryanzhumich/AESLC",
63
+ citation=_CITATION,
64
+ )
65
+
66
+ def _split_generators(self, dl_manager):
67
+ """Returns SplitGenerators."""
68
+ dl_path = dl_manager.download_and_extract(_URL)
69
+ input_path = os.path.join(dl_path, "AESLC-master", "enron_subject_line")
70
+ return [
71
+ datasets.SplitGenerator(
72
+ name=datasets.Split.TRAIN,
73
+ gen_kwargs={"pattern": os.path.join(input_path, "train", "*.subject")},
74
+ ),
75
+ datasets.SplitGenerator(
76
+ name=datasets.Split.VALIDATION,
77
+ gen_kwargs={"pattern": os.path.join(input_path, "dev", "*.subject")},
78
+ ),
79
+ datasets.SplitGenerator(
80
+ name=datasets.Split.TEST,
81
+ gen_kwargs={"pattern": os.path.join(input_path, "test", "*.subject")},
82
+ ),
83
+ ]
84
+
85
+ def _generate_examples(self, pattern=None):
86
+ """Yields examples."""
87
+ for filename in sorted(glob.glob(pattern)):
88
+ email_body, subject_line = _parse_email_file(filename)
89
+ key = os.path.basename(filename).rstrip(".subject")
90
+ yield key, {_DOCUMENT: email_body, _SUMMARY: subject_line}
91
+
92
+
93
+ def _parse_email_file(filename):
94
+ """Parse email file text for email body and subject."""
95
+ with open(filename, encoding="utf-8") as f:
96
+ email_body = ""
97
+ for line in f:
98
+ if line == "\n":
99
+ break
100
+ email_body += line
101
+ line = next(f)
102
+ subject = ""
103
+ for line in f:
104
+ if line == "\n":
105
+ break
106
+ subject += line
107
+ return email_body, subject
dataset_infos.json ADDED
@@ -0,0 +1 @@
 
 
1
+ {"default": {"description": "\nA collection of email messages of employees in the Enron Corporation.\n\nThere are two features:\n - email_body: email body text.\n - subject_line: email subject text.\n", "citation": "\n@misc{zhang2019email,\n title={This Email Could Save Your Life: Introducing the Task of Email Subject Line Generation},\n author={Rui Zhang and Joel Tetreault},\n year={2019},\n eprint={1906.03497},\n archivePrefix={arXiv},\n primaryClass={cs.CL}\n}\n", "homepage": "https://github.com/ryanzhumich/AESLC", "license": "", "features": {"email_body": {"dtype": "string", "id": null, "_type": "Value"}, "subject_line": {"dtype": "string", "id": null, "_type": "Value"}}, "supervised_keys": {"input": "email_body", "output": "subject_line"}, "builder_name": "aeslc", "config_name": "default", "version": {"version_str": "1.0.0", "description": null, "datasets_version_to_prepare": null, "major": 1, "minor": 0, "patch": 0}, "splits": {"test": {"name": "test", "num_bytes": 1384177, "num_examples": 1906, "dataset_name": "aeslc"}, "train": {"name": "train", "num_bytes": 11902668, "num_examples": 14436, "dataset_name": "aeslc"}, "validation": {"name": "validation", "num_bytes": 1660730, "num_examples": 1960, "dataset_name": "aeslc"}}, "download_checksums": {"https://github.com/ryanzhumich/AESLC/archive/master.zip": {"num_bytes": 11643743, "checksum": "b5ea2ffb837c5cfb9b033d62b3940a8a2330a9eb69bd2a39a9f55db6a23a40a4"}}, "download_size": 11643743, "dataset_size": 14947575, "size_in_bytes": 26591318}}
dummy/1.0.0/dummy_data.zip ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:56fb0ebcbd72036f72c0f5a20de360de22b0c78ea069eedc41fa70e3d0511691
3
+ size 2257