system commited on
Commit
1cb96a4
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

.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
cornell_movie_dialog.py ADDED
@@ -0,0 +1,169 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ """TODO(cornell_movie_dialog): Add a description here."""
2
+
3
+ from __future__ import absolute_import, division, print_function
4
+
5
+ import ast
6
+ import os
7
+
8
+ import datasets
9
+
10
+
11
+ # TODO(cornell_movie_dialog): BibTeX citation
12
+ _CITATION = """\
13
+ @InProceedings{Danescu-Niculescu-Mizil+Lee:11a,
14
+
15
+ author={Cristian Danescu-Niculescu-Mizil and Lillian Lee},
16
+
17
+ title={Chameleons in imagined conversations:
18
+ A new approach to understanding coordination of linguistic style in dialogs.},
19
+
20
+ booktitle={Proceedings of the
21
+
22
+ Workshop on Cognitive Modeling and Computational Linguistics, ACL 2011},
23
+
24
+ year={2011}
25
+
26
+ }
27
+ """
28
+
29
+ # TODO(cornell_movie_dialog):
30
+ _DESCRIPTION = """\
31
+ This corpus contains a large metadata-rich collection of fictional conversations extracted from raw movie scripts:
32
+ - 220,579 conversational exchanges between 10,292 pairs of movie characters
33
+ - involves 9,035 characters from 617 movies
34
+ - in total 304,713 utterances
35
+ - movie metadata included:
36
+ - genres
37
+ - release year
38
+ - IMDB rating
39
+ - number of IMDB votes
40
+ - IMDB rating
41
+ - character metadata included:
42
+ - gender (for 3,774 characters)
43
+ - position on movie credits (3,321 characters)
44
+ """
45
+
46
+ _URL = "https://www.cs.cornell.edu/~cristian/data/cornell_movie_dialogs_corpus.zip"
47
+
48
+
49
+ class CornellMovieDialog(datasets.GeneratorBasedBuilder):
50
+ """TODO(cornell_movie_dialog): Short description of my dataset."""
51
+
52
+ # TODO(cornell_movie_dialog): Set up version.
53
+ VERSION = datasets.Version("0.1.0")
54
+
55
+ def _info(self):
56
+ # TODO(cornell_movie_dialog): Specifies the datasets.DatasetInfo object
57
+ return datasets.DatasetInfo(
58
+ # This is the description that will appear on the datasets page.
59
+ description=_DESCRIPTION,
60
+ # datasets.features.FeatureConnectors
61
+ features=datasets.Features(
62
+ {
63
+ "movieID": datasets.Value("string"),
64
+ "movieTitle": datasets.Value("string"),
65
+ "movieYear": datasets.Value("string"),
66
+ "movieIMDBRating": datasets.Value("string"),
67
+ "movieNoIMDBVotes": datasets.Value("string"),
68
+ "movieGenres": datasets.features.Sequence(datasets.Value("string")),
69
+ "characterID1": datasets.Value("string"),
70
+ "characterID2": datasets.Value("string"),
71
+ "characterName1": datasets.Value("string"),
72
+ "characterName2": datasets.Value("string"),
73
+ "utterance": datasets.features.Sequence(
74
+ {"text": datasets.Value("string"), "LineID": datasets.Value("string")}
75
+ )
76
+ # These are the features of your dataset like images, labels ...
77
+ }
78
+ ),
79
+ # If there's a common (input, target) tuple from the features,
80
+ # specify them here. They'll be used if as_supervised=True in
81
+ # builder.as_dataset.
82
+ supervised_keys=None,
83
+ # Homepage of the dataset for documentation
84
+ homepage="http://www.cs.cornell.edu/~cristian/Cornell_Movie-Dialogs_Corpus.html",
85
+ citation=_CITATION,
86
+ )
87
+
88
+ def _split_generators(self, dl_manager):
89
+ """Returns SplitGenerators."""
90
+ # TODO(cornell_movie_dialog): Downloads the data and defines the splits
91
+ # dl_manager is a datasets.download.DownloadManager that can be used to
92
+ # download and extract URLs
93
+ dl_dir = dl_manager.download_and_extract(_URL)
94
+ return [
95
+ datasets.SplitGenerator(
96
+ name=datasets.Split.TRAIN,
97
+ # These kwargs will be passed to _generate_examples
98
+ gen_kwargs={"filepaths": os.path.join(dl_dir, "cornell movie-dialogs corpus")},
99
+ ),
100
+ ]
101
+
102
+ def _generate_examples(self, filepaths):
103
+ """Yields examples."""
104
+ # TODO(cornell_movie_dialog): Yields (key, example) tuples from the dataset
105
+ movie_char_file = os.path.join(filepaths, "movie_characters_metadata.txt")
106
+ movie_conv_file = os.path.join(filepaths, "movie_conversations.txt")
107
+ movie_lines_file = os.path.join(filepaths, "movie_lines.txt")
108
+ movie_titles_file = os.path.join(filepaths, "movie_titles_metadata.txt")
109
+
110
+ with open(movie_char_file, "rb") as f:
111
+ movie_char_data = [x.decode("latin").split("+++$+++") for x in f.readlines()]
112
+
113
+ with open(movie_conv_file, "rb") as f:
114
+ movie_conv_data = [x.decode("latin").split("+++$+++") for x in f.readlines()]
115
+
116
+ with open(movie_lines_file, "rb") as f:
117
+ movie_lines_data = [x.decode("latin").split("+++$+++") for x in f.readlines()]
118
+
119
+ with open(movie_titles_file, "rb") as f:
120
+ movie_titles_data = [x.decode("latin").split("+++$+++") for x in f.readlines()]
121
+ # looping over movie conversation file
122
+ for id_, conv in enumerate(movie_conv_data):
123
+ char_id_1 = conv[0]
124
+ char_id_2 = conv[1]
125
+ movie_id = conv[2]
126
+ line_ids = conv[-1].replace("\n", "")
127
+ line_ids = ast.literal_eval(line_ids.strip())
128
+ lines_texts = []
129
+ # searching text corresponding to each lineID in line_ids in movie lines file
130
+ for line_id in line_ids:
131
+ i = 0
132
+ while i < len(movie_lines_data) and movie_lines_data[i][0].strip() != line_id:
133
+ i += 1
134
+ lines_texts.append(movie_lines_data[i][0]) # if i < len(movie_lines_data) else '')
135
+ # look for char names in movie character file
136
+ j = 0
137
+ while j < len(movie_char_data) and movie_char_data[j][0].strip() != char_id_1.strip():
138
+ j += 1
139
+ char_name_1 = movie_char_data[j][1] # if j < len(movie_char_data) else ''
140
+ movie_title = movie_char_data[j][3] # if j < len(movie_char_data) else ''
141
+
142
+ k = 0
143
+ while k < len(movie_char_data) and movie_char_data[k][0].strip() != char_id_2.strip():
144
+ k += 1
145
+ char_name_2 = movie_char_data[k][1]
146
+
147
+ # look for movie year, IMDBRating, genre, no_imdb_voting in movie tiles file
148
+ li = 0
149
+ while li < len(movie_titles_data) and movie_titles_data[li][0].strip() != movie_id.strip():
150
+ li += 1
151
+ movie_year = movie_titles_data[li][2]
152
+ imdb_rating = movie_titles_data[li][3]
153
+ no_imdb_vote = movie_titles_data[li][4]
154
+ genre = movie_titles_data[li][5].replace("\n", "").strip()
155
+ movie_genres = ast.literal_eval(genre)
156
+
157
+ yield id_, {
158
+ "movieID": movie_id,
159
+ "movieTitle": movie_title,
160
+ "movieYear": movie_year,
161
+ "movieIMDBRating": imdb_rating,
162
+ "movieNoIMDBVotes": no_imdb_vote,
163
+ "movieGenres": movie_genres,
164
+ "characterID1": char_id_1,
165
+ "characterID2": char_id_2,
166
+ "characterName1": char_name_1,
167
+ "characterName2": char_name_2,
168
+ "utterance": {"text": lines_texts, "LineID": line_ids},
169
+ }
dataset_infos.json ADDED
@@ -0,0 +1 @@
 
1
+ {"default": {"description": " \nThis corpus contains a large metadata-rich collection of fictional conversations extracted from raw movie scripts:\n- 220,579 conversational exchanges between 10,292 pairs of movie characters\n- involves 9,035 characters from 617 movies\n- in total 304,713 utterances\n- movie metadata included:\n - genres\n - release year\n - IMDB rating\n - number of IMDB votes\n - IMDB rating\n- character metadata included:\n - gender (for 3,774 characters)\n - position on movie credits (3,321 characters)\n", "citation": " @InProceedings{Danescu-Niculescu-Mizil+Lee:11a,\n\n author={Cristian Danescu-Niculescu-Mizil and Lillian Lee},\n\n title={Chameleons in imagined conversations: \n A new approach to understanding coordination of linguistic style in dialogs.},\n\n booktitle={Proceedings of the \n\n Workshop on Cognitive Modeling and Computational Linguistics, ACL 2011},\n\n year={2011}\n\n}\n", "homepage": "http://www.cs.cornell.edu/~cristian/Cornell_Movie-Dialogs_Corpus.html", "license": "", "features": {"movieID": {"dtype": "string", "id": null, "_type": "Value"}, "movieTitle": {"dtype": "string", "id": null, "_type": "Value"}, "movieYear": {"dtype": "string", "id": null, "_type": "Value"}, "movieIMDBRating": {"dtype": "string", "id": null, "_type": "Value"}, "movieNoIMDBVotes": {"dtype": "string", "id": null, "_type": "Value"}, "movieGenres": {"feature": {"dtype": "string", "id": null, "_type": "Value"}, "length": -1, "id": null, "_type": "Sequence"}, "characterID1": {"dtype": "string", "id": null, "_type": "Value"}, "characterID2": {"dtype": "string", "id": null, "_type": "Value"}, "characterName1": {"dtype": "string", "id": null, "_type": "Value"}, "characterName2": {"dtype": "string", "id": null, "_type": "Value"}, "utterance": {"feature": {"text": {"dtype": "string", "id": null, "_type": "Value"}, "LineID": {"dtype": "string", "id": null, "_type": "Value"}}, "length": -1, "id": null, "_type": "Sequence"}}, "supervised_keys": null, "builder_name": "cornell_movie_dialog", "config_name": "default", "version": {"version_str": "0.1.0", "description": null, "datasets_version_to_prepare": null, "major": 0, "minor": 1, "patch": 0}, "splits": {"train": {"name": "train", "num_bytes": 19548840, "num_examples": 83097, "dataset_name": "cornell_movie_dialog"}}, "download_checksums": {"https://www.cs.cornell.edu/~cristian/data/cornell_movie_dialogs_corpus.zip": {"num_bytes": 9916637, "checksum": "3bde8a571f615201bc2d2453e22878090719638592f774720eddec739de8c900"}}, "download_size": 9916637, "dataset_size": 19548840, "size_in_bytes": 29465477}}
dummy/0.1.0/dummy_data.zip ADDED
@@ -0,0 +1,3 @@
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:ed40b26791d08f6777054d4611f8da947acad70aa6c802e75ef5d6c971583f69
3
+ size 1584