xingqiang commited on
Commit
09b1a05
·
verified ·
1 Parent(s): 5282dc6

Update with comprehensive datacard and documentation

Browse files
Files changed (1) hide show
  1. README.md +254 -52
README.md CHANGED
@@ -1,99 +1,301 @@
1
  ---
2
  language:
3
  - zh
 
 
 
 
 
 
 
 
4
  tags:
5
  - sentiment-analysis
6
  - chinese
7
  - herbal-medicine
 
8
  - reviews
9
  - e-commerce
10
- - traditional-chinese-medicine
11
- task_categories:
12
- - text-classification
13
- task_ids:
14
- - sentiment-classification
15
- size_categories:
16
- - 100K<n<1M
17
- license: mit
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
18
  ---
19
 
20
- # Chinese Herbal Medicine Sentiment Analysis Dataset
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
21
 
22
- ## Dataset Description
23
 
24
- A comprehensive sentiment analysis dataset of Chinese herbal medicine product reviews
 
 
 
 
 
 
 
 
 
25
 
26
- This dataset contains **234,879** reviews for **259** different Chinese herbal medicine products, collected from e-commerce platforms. The reviews are pre-labeled with sentiment classifications.
 
 
 
27
 
28
- ## Dataset Statistics
29
 
30
- - **Total Reviews**: 234,879
31
- - **Unique Products**: 259
32
- - **Date Range**: 2010-01-13T20:22:34 to 2024-07-02T19:54:44
33
- - **Languages**: zh-CN
34
 
35
- ### Sentiment Distribution
36
- - **Positive Reviews**: 178,014 (75.8%)
37
- - **Neutral Reviews**: 27,023 (11.5%)
38
- - **Negative Reviews**: 29,842 (12.7%)
39
 
40
- ## Data Fields
 
 
 
 
41
 
42
- | Column | Type | Description |
43
- |--------|------|-------------|
44
- | username | string | Anonymized username of the reviewer |
45
- | user_id | integer | Unique user identifier |
46
- | review_text | string | The actual review content in Chinese |
47
- | review_time | datetime | Timestamp when the review was posted |
48
- | rating | integer | Numerical rating (1-5 scale) |
49
- | product_id | string | Unique product identifier |
50
- | sentiment_label | string | Sentiment classification (positive/neutral/negative) |
51
- | source_file | string | Original data file name |
52
 
53
- ## Usage
 
 
 
54
 
55
- This dataset is suitable for:
56
- - Sentiment analysis research
57
- - Chinese natural language processing
58
- - E-commerce review analysis
59
- - Traditional Chinese medicine market research
60
 
61
- ### Loading the Dataset
 
 
 
 
62
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
63
  ```python
64
  from datasets import load_dataset
65
 
 
66
  dataset = load_dataset("xingqiang/chinese-herbal-medicine-sentiment")
 
 
 
 
 
 
 
67
  ```
68
 
69
- ## Data Collection
 
 
70
 
71
- The data was collected from Chinese e-commerce platforms and includes reviews for various herbal medicine products. Reviews were originally categorized by the platform users into positive (好评), neutral (中评), and negative (差评) sentiments.
 
72
 
73
- ## License
 
 
 
74
 
75
- This dataset is released under the MIT License.
 
 
 
76
 
77
- ## Citation
78
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
79
  If you use this dataset in your research, please cite:
80
 
81
- ```
82
- @dataset{chinese_herbal_sentiment,
83
  title={Chinese Herbal Medicine Sentiment Analysis Dataset},
84
- author={Xingqiang Chen},
85
  year={2024},
86
  version={1.0.0},
87
- url={https://huggingface.co/datasets/xingqiang/chinese-herbal-medicine-sentiment}
 
88
  }
89
  ```
90
 
91
- ## Contact
 
 
 
 
 
 
92
 
93
- For questions or issues regarding this dataset, please open an issue in this repository.
 
94
 
95
  ---
96
 
97
- **Version**: 1.0.0
98
- **Created**: 2025-08-26T02:44:29.879572
99
 
 
1
  ---
2
  language:
3
  - zh
4
+ license: mit
5
+ size_categories:
6
+ - 100K<n<1M
7
+ task_categories:
8
+ - text-classification
9
+ task_ids:
10
+ - sentiment-classification
11
+ paperswithcode_id: chinese-herbal-medicine-sentiment
12
  tags:
13
  - sentiment-analysis
14
  - chinese
15
  - herbal-medicine
16
+ - traditional-chinese-medicine
17
  - reviews
18
  - e-commerce
19
+ - healthcare
20
+ - nlp
21
+ - text-mining
22
+ pretty_name: Chinese Herbal Medicine Sentiment Analysis Dataset
23
+ dataset_info:
24
+ features:
25
+ - name: username
26
+ dtype: string
27
+ - name: user_id
28
+ dtype: int64
29
+ - name: review_text
30
+ dtype: string
31
+ - name: review_time
32
+ dtype: string
33
+ - name: rating
34
+ dtype: int64
35
+ - name: product_id
36
+ dtype: string
37
+ - name: sentiment_label
38
+ dtype: string
39
+ - name: source_file
40
+ dtype: string
41
+ splits:
42
+ - name: train
43
+ num_bytes: 24800000
44
+ num_examples: 211391
45
+ - name: validation
46
+ num_bytes: 2760000
47
+ num_examples: 23488
48
+ download_size: 27600000
49
+ dataset_size: 27560000
50
+ configs:
51
+ - config_name: default
52
+ data_files:
53
+ - split: train
54
+ path: data/train-*
55
+ - split: validation
56
+ path: data/validation-*
57
  ---
58
 
59
+ # 中药情感分析数据集 - 数据说明书
60
+ # Chinese Herbal Medicine Sentiment Analysis Dataset - Datacard
61
+
62
+ ## 数据集概述 / Dataset Overview
63
+
64
+ ### 基本信息 / Basic Information
65
+ - **数据集名称 / Dataset Name**: Chinese Herbal Medicine Sentiment Analysis Dataset
66
+ - **版本 / Version**: 1.0.0
67
+ - **创建日期 / Created**: 2025-08-26
68
+ - **作者 / Author**: Xingqiang Chen
69
+ - **许可证 / License**: MIT
70
+ - **语言 / Language**: 中文 (Chinese)
71
+ - **领域 / Domain**: 中药 / 传统中医药 (Traditional Chinese Medicine)
72
+
73
+ ### 数据规模 / Data Scale
74
+ - **总样本数 / Total Samples**: 234,879
75
+ - **唯一产品数 / Unique Products**: 259
76
+ - **唯一用户数 / Unique Users**: 210,749
77
+ - **时间跨度 / Time Span**: 14.5 年 / years (2010-01-13 20:22:34 至 / to 2024-07-02 19:54:44)
78
+
79
+ ## 数据内容 / Data Content
80
+
81
+ ### 情感分布 / Sentiment Distribution
82
+ | 情感类别 / Sentiment | 数量 / Count | 百分比 / Percentage |
83
+ |-------------------|------------|------------------|
84
+ | 正面 / Positive | 178,014 | 75.8% |
85
+ | 中性 / Neutral | 27,023 | 11.5% |
86
+ | 负面 / Negative | 29,842 | 12.7% |
87
+
88
+ ### 评分分布 / Rating Distribution
89
+ | 评分 / Rating | 数量 / Count | 百分比 / Percentage |
90
+ |--------------|------------|------------------|
91
+ | 1 星 / stars | 29,842 | 12.7% |
92
+ | 2 星 / stars | 7,554 | 3.2% |
93
+ | 3 星 / stars | 19,469 | 8.3% |
94
+ | 4 星 / stars | 1,953 | 0.8% |
95
+ | 5 星 / stars | 176,061 | 75.0% |
96
+
97
+ ### 文本统计 / Text Statistics
98
+ - **平均长度 / Average Length**: 42.4 字符 / characters
99
+ - **中位数长度 / Median Length**: 27 字符 / characters
100
+ - **最短长度 / Minimum Length**: 1 字符 / characters
101
+ - **最长长度 / Maximum Length**: 563 字符 / characters
102
+ - **总字符数 / Total Characters**: 9,966,582
103
+
104
+ ### 产品统计 / Product Statistics
105
+ - **每个产品的平均评论数 / Average Reviews per Product**: 906.9
106
+ - **每个产品的评论数中位数 / Median Reviews per Product**: 1018
107
+ - **单个产品最少评论数 / Minimum Reviews per Product**: 1
108
+ - **单个产品最多评论数 / Maximum Reviews per Product**: 3030
109
+
110
+ ## 数据结构 / Data Structure
111
 
112
+ ### 字段说明 / Field Descriptions
113
 
114
+ | 字段名 / Field Name | 类型 / Type | 描述 / Description | 示例 / Example |
115
+ |-------------------|------------|------------------|---------------|
116
+ | `username` | string | 匿名化的用户名 / Anonymized username | "用***客" |
117
+ | `user_id` | integer | 唯一用户标识符 / Unique user identifier | 16788761848 |
118
+ | `review_text` | string | 中文评论内容 / Chinese review content | "产品质量很好,效果明显" |
119
+ | `review_time` | datetime | 评论发布时间 / Review timestamp | "2021-12-09 12:56:37" |
120
+ | `rating` | integer | 评分 (1-5分) / Rating (1-5 scale) | 5 |
121
+ | `product_id` | string | 产品唯一标识符 / Product identifier | "100001642346" |
122
+ | `sentiment_label` | string | 情感标签 / Sentiment label | "positive", "neutral", "negative" |
123
+ | `source_file` | string | 原始数据文件名 / Source file name | "100001642346-好评.xls" |
124
 
125
+ ### 数据格式 / Data Format
126
+ - **文件格式 / File Format**: CSV (UTF-8 encoding)
127
+ - **分隔符 / Delimiter**: 逗号 / Comma (`,`)
128
+ - **缺失值 / Missing Values**: 无 / None (所有字段都有值 / All fields have values)
129
 
130
+ ## 数据收集 / Data Collection
131
 
132
+ ### 来源 / Source
133
+ - **平台 / Platform**: 中国电商平台 / Chinese e-commerce platforms
134
+ - **收集时间 / Collection Period**: 2010-2024
135
+ - **收集方法 / Collection Method**: 网络爬虫 / Web scraping
136
 
137
+ ### 数据质量 / Data Quality
138
+ - **完整性 / Completeness**: 100% (无缺失值 / No missing values)
139
+ - **一致性 / Consistency**: / High (统一的数据格式和编码 / Unified format and encoding)
140
+ - **准确性 / Accuracy**: / High (原始用户评论数据 / Original user review data)
141
 
142
+ ### 数据预处理 / Data Preprocessing
143
+ 1. **文本清理 / Text Cleaning**:
144
+ - 去除空白评论 / Remove empty reviews
145
+ - 统一编码格式 / Standardize encoding
146
+ - 过滤无效内容 / Filter invalid content
147
 
148
+ 2. **情感标注 / Sentiment Labeling**:
149
+ - 基于平台原始分类 / Based on platform original classification
150
+ - 好评 positive / 中评 neutral / 差评 → negative
 
 
 
 
 
 
 
151
 
152
+ 3. **数据验证 / Data Validation**:
153
+ - 检查数据类型 / Check data types
154
+ - 验证时间格式 / Validate time format
155
+ - 确保情感标签一致性 / Ensure sentiment label consistency
156
 
157
+ ## 使用案例 / Use Cases
 
 
 
 
158
 
159
+ ### 适用场景 / Suitable Applications
160
+ 1. **情感分析研究 / Sentiment Analysis Research**
161
+ - 中文文本情感分类 / Chinese text sentiment classification
162
+ - 情感分析模型训练 / Sentiment analysis model training
163
+ - 跨领域情感分析 / Cross-domain sentiment analysis
164
 
165
+ 2. **自然语言处理 / Natural Language Processing**
166
+ - 中文文本理解 / Chinese text understanding
167
+ - 文本分类任务 / Text classification tasks
168
+ - 语言模型微调 / Language model fine-tuning
169
+
170
+ 3. **中医药研究 / Traditional Chinese Medicine Research**
171
+ - 用户满意度分析 / User satisfaction analysis
172
+ - 产品质量评估 / Product quality assessment
173
+ - 市场反馈分析 / Market feedback analysis
174
+
175
+ 4. **商业智能 / Business Intelligence**
176
+ - 客户意见挖掘 / Customer opinion mining
177
+ - 产品改进建议 / Product improvement suggestions
178
+ - 竞争分析 / Competitive analysis
179
+
180
+ ### 基准任务 / Benchmark Tasks
181
+ - **三分类情感分析 / 3-class Sentiment Classification**: positive, neutral, negative
182
+ - **五分类评分预测 / 5-class Rating Prediction**: 1-5 stars
183
+ - **文本-情感对齐 / Text-Sentiment Alignment**: 评论内容与情感标签的对应关系
184
+
185
+ ## 技术规范 / Technical Specifications
186
+
187
+ ### 系统要求 / System Requirements
188
+ ```python
189
+ # Python 依赖 / Dependencies
190
+ pandas >= 1.3.0
191
+ datasets >= 2.0.0
192
+ transformers >= 4.20.0
193
+ torch >= 1.10.0 # 可选 / Optional
194
+ tensorflow >= 2.8.0 # 可选 / Optional
195
+ ```
196
+
197
+ ### 加载方式 / Loading Methods
198
+
199
+ #### 1. 使用 Hugging Face Datasets
200
  ```python
201
  from datasets import load_dataset
202
 
203
+ # 加载完整数据集 / Load full dataset
204
  dataset = load_dataset("xingqiang/chinese-herbal-medicine-sentiment")
205
+
206
+ # 访问训练集和验证集 / Access train and validation sets
207
+ train_data = dataset['train']
208
+ val_data = dataset['validation']
209
+
210
+ # 查看数据样例 / View data sample
211
+ print(train_data[0])
212
  ```
213
 
214
+ #### 2. 使用 Pandas
215
+ ```python
216
+ import pandas as pd
217
 
218
+ # CSV 文件加载 / Load from CSV
219
+ df = pd.read_csv("chinese_herbal_sentiment.csv")
220
 
221
+ # 查看基本信息 / View basic info
222
+ print(df.info())
223
+ print(df.head())
224
+ ```
225
 
226
+ ### 数据分割 / Data Splits
227
+ - **训练集 / Training Set**: 90% (211,391 样本 / samples)
228
+ - **验证集 / Validation Set**: 10% (23,487 样本 / samples)
229
+ - **分割方式 / Split Method**: 随机分割 / Random split (seed=42)
230
 
231
+ ## 伦理考虑 / Ethical Considerations
232
 
233
+ ### 隐私保护 / Privacy Protection
234
+ - **用户隐私 / User Privacy**: 所有��户名已匿名化处理 / All usernames are anonymized
235
+ - **个人信息 / Personal Information**: 不含任何个人身份信息 / No personal identifying information
236
+ - **数据脱敏 / Data Desensitization**: 保留分析价值同时保护用户隐私 / Preserve analytical value while protecting privacy
237
+
238
+ ### 使用限制 / Usage Restrictions
239
+ - **学术研究 / Academic Research**: 鼓励用于学术研究和教育 / Encouraged for academic research and education
240
+ - **商业用途 / Commercial Use**: 遵循 MIT 许可证条款 / Follow MIT license terms
241
+ - **数据再分发 / Data Redistribution**: 允许在保持归属的情况下再分发 / Allowed with proper attribution
242
+
243
+ ### 潜在偏见 / Potential Biases
244
+ - **时间偏见 / Temporal Bias**: 数据跨越多年,可能存在时间相关的偏见 / Data spans multiple years, potential temporal biases
245
+ - **平台偏见 / Platform Bias**: 来自特定电商平台,可能不代表整体市场 / From specific e-commerce platforms, may not represent overall market
246
+ - **产品偏见 / Product Bias**: 仅包含中药产品,情感表达可能具有领域特性 / Only includes herbal medicine products, sentiment expressions may be domain-specific
247
+
248
+ ## 质量保证 / Quality Assurance
249
+
250
+ ### 数据验证 / Data Validation
251
+ - ✅ 无重复记录 / No duplicate records
252
+ - ✅ 无缺失值 / No missing values
253
+ - ✅ 时间格式一致 / Consistent time format
254
+ - ✅ 情感标签有效 / Valid sentiment labels
255
+ - ✅ 文本编码正确 / Correct text encoding
256
+
257
+ ### 统计检查 / Statistical Checks
258
+ - ✅ 情感分布合理 / Reasonable sentiment distribution
259
+ - ✅ 评分与情感标签对应 / Rating-sentiment correspondence
260
+ - ✅ 时间分布连续 / Continuous temporal distribution
261
+ - ✅ 产品覆盖充分 / Sufficient product coverage
262
+
263
+ ## 版本历史 / Version History
264
+
265
+ ### v1.0.0 (2024-08-26)
266
+ - 初始发布 / Initial release
267
+ - 包含 234,879 条评论数据 / Contains 234,879 reviews
268
+ - 支持三分类情感分析任务 / Supports 3-class sentiment analysis task
269
+
270
+ ## 引用方式 / Citation
271
+
272
+ 如果您在研究中使用了此数据集,请引用:
273
  If you use this dataset in your research, please cite:
274
 
275
+ ```bibtex
276
+ @dataset{chinese_herbal_sentiment_2024,
277
  title={Chinese Herbal Medicine Sentiment Analysis Dataset},
278
+ author={Chen, Xingqiang},
279
  year={2024},
280
  version={1.0.0},
281
+ url={https://huggingface.co/datasets/xingqiang/chinese-herbal-medicine-sentiment},
282
+ note={A comprehensive sentiment analysis dataset for Traditional Chinese Medicine product reviews}
283
  }
284
  ```
285
 
286
+ ## 联系方式 / Contact
287
+
288
+ - **数据集维护者 / Dataset Maintainer**: Xingqiang Chen
289
+ - **Hugging Face**: [xingqiang](https://huggingface.co/xingqiang)
290
+ - **问题反馈 / Issue Reports**: 请在 Hugging Face 数据集页面提交 / Please submit on the Hugging Face dataset page
291
+
292
+ ## 致谢 / Acknowledgments
293
 
294
+ 感谢所有提供评论数据的用户,以及中医药电商平台提供的数据基础。
295
+ Thanks to all users who provided review data and the e-commerce platforms for the data foundation.
296
 
297
  ---
298
 
299
+ **最后更新 / Last Updated**: 2025-08-26 02:50:03
300
+ **数据集大小 / Dataset Size**: ~9.5 MB (文本内容 / text content)
301