lannliat commited on
Commit
8a17207
1 Parent(s): 0f27664

First version of the douban dushu dataset.

Browse files
Files changed (2) hide show
  1. README.md +170 -0
  2. douban-dushu.py +103 -0
README.md ADDED
@@ -0,0 +1,170 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ ---
2
+ annotations_creators:
3
+ - no-annotation
4
+ language:
5
+ - zh
6
+ language_creators:
7
+ - crowdsourced
8
+ license:
9
+ - cc-by-4.0
10
+ multilinguality:
11
+ - monolingual
12
+ pretty_name: Book revies from DouBan Dushu.
13
+ size_categories:
14
+ - 10M<n<100M
15
+ source_datasets: []
16
+ tags: []
17
+ task_categories: []
18
+ task_ids: []
19
+ ---
20
+
21
+ # Dataset Card for Douban Dushu (豆瓣读书).
22
+
23
+ ## Table of Contents
24
+ - [Table of Contents](#table-of-contents)
25
+ - [Dataset Description](#dataset-description)
26
+ - [Dataset Summary](#dataset-summary)
27
+ - [Supported Tasks and Leaderboards](#supported-tasks-and-leaderboards)
28
+ - [Languages](#languages)
29
+ - [Dataset Structure](#dataset-structure)
30
+ - [Data Instances](#data-instances)
31
+ - [Data Fields](#data-fields)
32
+ - [Data Splits](#data-splits)
33
+ - [Dataset Creation](#dataset-creation)
34
+ - [Curation Rationale](#curation-rationale)
35
+ - [Source Data](#source-data)
36
+ - [Annotations](#annotations)
37
+ - [Personal and Sensitive Information](#personal-and-sensitive-information)
38
+ - [Considerations for Using the Data](#considerations-for-using-the-data)
39
+ - [Social Impact of Dataset](#social-impact-of-dataset)
40
+ - [Discussion of Biases](#discussion-of-biases)
41
+ - [Other Known Limitations](#other-known-limitations)
42
+ - [Additional Information](#additional-information)
43
+ - [Dataset Curators](#dataset-curators)
44
+ - [Licensing Information](#licensing-information)
45
+ - [Citation Information](#citation-information)
46
+ - [Contributions](#contributions)
47
+
48
+ ## Dataset Description
49
+
50
+ This dataset contains book reviews from DouBan Dushu.
51
+
52
+ DouBan DuShu is a Chinese website where users can share their reviews about various kinds of books. Most of the users in this website are unprofessional book reviewers. Therefore, the comments are usually spoken Chinese or even Internet slang.
53
+
54
+ - **Repository:** https://github.com/JaniceZhao/Douban-Dushu-Dataset
55
+ - **Paper:** LSICC: A Large Scale Informal Chinese Corpus
56
+
57
+ ### Dataset Summary
58
+
59
+ [More Information Needed]
60
+
61
+ ### Supported Tasks and Leaderboards
62
+
63
+ [More Information Needed]
64
+
65
+ ### Languages
66
+
67
+ Chinese
68
+
69
+ ## Dataset Structure
70
+
71
+ ### Data Instances
72
+
73
+ ```
74
+ {
75
+ 'tag': '日本文学',
76
+ 'book_name': '厨房',
77
+ 'user_name': '林大东',
78
+ 'date': '2013-03-12',
79
+ 'comment': '满月没有另外两篇好看',
80
+ 'star': 5,
81
+ 'vote_count': 0
82
+ }
83
+ ```
84
+
85
+ ### Data Fields
86
+
87
+ ```
88
+ {
89
+ "tag": datasets.Value("string"),
90
+ "book_name": datasets.Value("string"),
91
+ "user_name": datasets.Value("string"),
92
+ "date": datasets.Value("string"),
93
+ "comment": datasets.Value("string"),
94
+ "star": datasets.Value("int32"),
95
+ "vote_count": datasets.Value("int32"),
96
+ }
97
+ ```
98
+
99
+ ### Data Splits
100
+
101
+ [More Information Needed]
102
+
103
+ ## Dataset Creation
104
+
105
+ ### Curation Rationale
106
+
107
+ [More Information Needed]
108
+
109
+ ### Source Data
110
+
111
+ https://drive.google.com/drive/folders/1Me0aswzCCMtJt3clWiA39J5i-tbREgze
112
+
113
+ #### Initial Data Collection and Normalization
114
+
115
+ [More Information Needed]
116
+
117
+ #### Who are the source language producers?
118
+
119
+ [More Information Needed]
120
+
121
+ ### Annotations
122
+
123
+ #### Annotation process
124
+
125
+ [More Information Needed]
126
+
127
+ #### Who are the annotators?
128
+
129
+ [More Information Needed]
130
+
131
+ ### Personal and Sensitive Information
132
+
133
+ [More Information Needed]
134
+
135
+ ## Considerations for Using the Data
136
+
137
+ ### Social Impact of Dataset
138
+
139
+ [More Information Needed]
140
+
141
+ ### Discussion of Biases
142
+
143
+ [More Information Needed]
144
+
145
+ ### Other Known Limitations
146
+
147
+ [More Information Needed]
148
+
149
+ ## Additional Information
150
+
151
+ ### Dataset Curators
152
+
153
+ [More Information Needed]
154
+
155
+ ### Licensing Information
156
+
157
+ [More Information Needed]
158
+
159
+ ### Citation Information
160
+
161
+ @article{zhao2018lsicc,
162
+ title={LSICC: A Large Scale Informal Chinese Corpus},
163
+ author={Zhao, Jianyu and Ji, Zhuoran},
164
+ journal={arXiv preprint arXiv:1811.10167},
165
+ year={2018}
166
+ }
167
+
168
+ ### Contributions
169
+
170
+ Thanks to [@larrylawl](https://github.com/larrylawl) for adding this dataset.
douban-dushu.py ADDED
@@ -0,0 +1,103 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # Copyright 2020 The HuggingFace Datasets Authors and the current dataset script contributor.
2
+ #
3
+ # Licensed under the Apache License, Version 2.0 (the "License");
4
+ # you may not use this file except in compliance with the License.
5
+ # You may obtain a copy of the License at
6
+ #
7
+ # http://www.apache.org/licenses/LICENSE-2.0
8
+ #
9
+ # Unless required by applicable law or agreed to in writing, software
10
+ # distributed under the License is distributed on an "AS IS" BASIS,
11
+ # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12
+ # See the License for the specific language governing permissions and
13
+ """
14
+ This dataset contains book reviews from DouBan Dushu.
15
+
16
+ DouBan DuShu is a Chinese website where users can share their reviews about various kinds of books. Most of the users in this website are unprofessional book reviewers. Therefore, the comments are usually spoken Chinese or even Internet slang.
17
+ """
18
+
19
+
20
+ import csv
21
+ import os
22
+
23
+ import datasets
24
+
25
+
26
+ _CITATION = """\
27
+ @article{zhao2018lsicc,
28
+ title={LSICC: A Large Scale Informal Chinese Corpus},
29
+ author={Zhao, Jianyu and Ji, Zhuoran},
30
+ journal={arXiv preprint arXiv:1811.10167},
31
+ year={2018}
32
+ }
33
+ """
34
+
35
+ _DESCRIPTION = """\
36
+ This dataset contains book reviews from DouBan Dushu. DouBan DuShu is a Chinese website where users can share their reviews about various kinds of books. Most of the users in this website are unprofessional book reviewers. Therefore, the comments are usually spoken Chinese or even Internet slang.
37
+ """
38
+
39
+ _HOMEPAGE = "https://github.com/JaniceZhao/Douban-Dushu-Dataset"
40
+
41
+ _LICENSE = "Creative Commons Attribution-NonCommercial-ShareAlike 4.0 International License."
42
+
43
+ _URLS = ["https://drive.google.com/u/0/uc?id=1eoP1mpEso0a6vcbT_mGxmjdqVTFps0mM&export=download", "https://drive.google.com/u/0/uc?id=19JnT2jxpGRREibxkgxVyxXKjV7MOf1U4&export=download", "https://drive.google.com/u/0/uc?id=1hQ-Cn8MLl35RHf2rvcm8RakeO6Y6Sdvc&export=download", "https://drive.google.com/u/0/uc?id=1SPK9bYZ9T-ivOZFveRjOGnNh5X9XFDgq&export=download"]
44
+
45
+
46
+ class DoubanDushu(datasets.GeneratorBasedBuilder):
47
+ """This dataset contains book reviews from DouBan Dushu."""
48
+
49
+ VERSION = datasets.Version("1.1.0")
50
+
51
+ def _info(self):
52
+ features = datasets.Features(
53
+ {
54
+ "tag": datasets.Value("string"),
55
+ "book_name": datasets.Value("string"),
56
+ "user_name": datasets.Value("string"),
57
+ "date": datasets.Value("string"),
58
+ "comment": datasets.Value("string"),
59
+ "star": datasets.Value("int32"),
60
+ "vote_count": datasets.Value("int32"),
61
+ }
62
+ )
63
+ return datasets.DatasetInfo(
64
+ description=_DESCRIPTION,
65
+ features=features,
66
+ homepage=_HOMEPAGE,
67
+ license=_LICENSE,
68
+ citation=_CITATION,
69
+ )
70
+
71
+ def _split_generators(self, dl_manager):
72
+ # filepath = dl_manager.download_and_extract(_URLS)
73
+ filepaths = dl_manager.download(_URLS)
74
+
75
+ return [
76
+ datasets.SplitGenerator(
77
+ name=datasets.Split.TRAIN,
78
+ gen_kwargs={
79
+ "filepaths": filepaths,
80
+ },
81
+ ),
82
+ ]
83
+
84
+ def _generate_examples(self, filepaths):
85
+ for filepath in filepaths:
86
+ key = 0
87
+ with open(filepath, encoding="utf-8") as file:
88
+ next(file) # skip header
89
+
90
+ for i, row in enumerate(file):
91
+ row = row.strip() # remove carriage returns
92
+ row = row.split("。")
93
+ yield key, {
94
+ "tag": row[0],
95
+ "book_name": row[1],
96
+ "user_name": row[2],
97
+ "date": row[3],
98
+ "comment": row[4],
99
+ "star": row[5],
100
+ "vote_count": row[6],
101
+ }
102
+ key += 1
103
+