Jingyi77 commited on
Commit
0db7153
·
1 Parent(s): 7b5b84e

Update README to specify binary classification and simplify notes

Browse files
Files changed (1) hide show
  1. README.md +38 -41
README.md CHANGED
@@ -19,7 +19,7 @@ tags:
19
  - advertisement
20
  - social-media
21
  - xiaohongshu
22
- - redbook
23
  pretty_name: CHASM - Covert Advertisement on RedNote
24
  ---
25
 
@@ -31,7 +31,7 @@ A dataset containing posts from Xiaohongshu (RedNote) for text classification ta
31
 
32
  ## Dataset Description
33
 
34
- - **Task Type**: Text Classification
35
  - **Language**: Chinese
36
  - **License**: MIT
37
  - **Dataset Size**: Contains two classes (label_0 and label_1)
@@ -39,40 +39,40 @@ A dataset containing posts from Xiaohongshu (RedNote) for text classification ta
39
 
40
  ### Dataset Structure
41
 
42
- 本数据集有两种格式:
43
 
44
- #### 1. 原始目录格式 (Original Directory Structure)
45
 
46
- 数据按照以下目录结构组织:
47
 
48
- - `label_0/`: 非广告内容
49
- - `label_1/`: 广告内容
50
 
51
- 每个样本有一个独立的文件夹(如 `train_889/`),包含:
52
 
53
- - `data.json`: 包含文本数据
54
- - 多个图像文件(JPG/WEBP 格式)
55
 
56
- #### 2. Hugging Face 格式 (Hugging Face Format)
57
 
58
- 为了更好地与 Hugging Face 平台兼容,我们还提供了处理后的格式:
59
 
60
- - `hf_format/train.csv` `hf_format/train.json`: 训练集
61
- - `hf_format/validation.csv` `hf_format/validation.json`: 验证集
62
- - `hf_format/test.csv` `hf_format/test.json`: 测试集
63
- - `hf_format/dataset_info.json`: 数据集元信息
64
 
65
- ### 数据字段说明
66
 
67
  Each data sample contains the following fields:
68
 
69
- - `id`: 样本唯一标识符
70
- - `title`: 帖子标题
71
- - `description`: 帖子描述
72
- - `date`: 发布日期和位置
73
- - `comments`: 评论列表
74
- - `images`: 图像文件名列表
75
- - `label`: 分类标签 (0: 非广告, 1: 广告)
76
 
77
  ### Data Example
78
 
@@ -90,56 +90,56 @@ Each data sample contains the following fields:
90
 
91
  ## Usage
92
 
93
- 使用原始目录格式:
94
 
95
  ```python
96
  import os
97
  import json
98
  from glob import glob
99
 
100
- # 遍历所有样本
101
  for label_dir in ['label_0', 'label_1']:
102
  for sample_dir in glob(f"{label_dir}/*"):
103
  if os.path.isdir(sample_dir):
104
- # 读取数据文件
105
  with open(os.path.join(sample_dir, 'data.json'), 'r', encoding='utf-8') as f:
106
  data = json.load(f)
107
 
108
- # 获取图像文件
109
  images = glob(os.path.join(sample_dir, '*.jpg'))
110
 
111
- # 处理数据...
112
  ```
113
 
114
- 使用 Hugging Face 格式:
115
 
116
  ```python
117
  import pandas as pd
118
 
119
- # 加载数据
120
  train_df = pd.read_csv('hf_format/train.csv')
121
  val_df = pd.read_csv('hf_format/validation.csv')
122
  test_df = pd.read_csv('hf_format/test.csv')
123
 
124
- # 或者使用JSON格式
125
  import json
126
  with open('hf_format/train.json', 'r', encoding='utf-8') as f:
127
  train_data = json.load(f)
128
  ```
129
 
130
- 使用 Hugging Face datasets 库:
131
 
132
  ```python
133
  from datasets import load_dataset
134
 
135
- # 加载数据集
136
  dataset = load_dataset("Jingyi77/CHASM-Covert_Advertisement_on_RedNote")
137
 
138
- # 查看数据集信息
139
  print(dataset)
140
 
141
- # 访问数据
142
- print(dataset['train'][0]) # 查看训练集的第一个数据点
143
  ```
144
 
145
  ## Data Preprocessing
@@ -150,10 +150,7 @@ print(dataset['train'][0]) # 查看训练集的第一个数据点
150
 
151
  ## Notes
152
 
153
- 1. Image files need to be downloaded and processed separately
154
- 2. Comments may contain sensitive content, please use with caution
155
- 3. All temporal information has been anonymized
156
- 4. This dataset is specifically designed for research on covert advertisement detection
157
 
158
  ## Dataset Creation
159
 
 
19
  - advertisement
20
  - social-media
21
  - xiaohongshu
22
+ - RedNote
23
  pretty_name: CHASM - Covert Advertisement on RedNote
24
  ---
25
 
 
31
 
32
  ## Dataset Description
33
 
34
+ - **Task Type**: Text Classification (Binary Classification)
35
  - **Language**: Chinese
36
  - **License**: MIT
37
  - **Dataset Size**: Contains two classes (label_0 and label_1)
 
39
 
40
  ### Dataset Structure
41
 
42
+ This dataset is available in two formats:
43
 
44
+ #### 1. Original Directory Structure
45
 
46
+ Data is organized in the following directory structure:
47
 
48
+ - `label_0/`: Non-advertisement content
49
+ - `label_1/`: Advertisement content
50
 
51
+ Each sample has its own folder (e.g., `train_889/`), containing:
52
 
53
+ - `data.json`: Text data
54
+ - Multiple image files (JPG/WEBP format)
55
 
56
+ #### 2. Hugging Face Format
57
 
58
+ For better compatibility with the Hugging Face platform, we also provide processed formats:
59
 
60
+ - `hf_format/train.csv` and `hf_format/train.json`: Training set
61
+ - `hf_format/validation.csv` and `hf_format/validation.json`: Validation set
62
+ - `hf_format/test.csv` and `hf_format/test.json`: Test set
63
+ - `hf_format/dataset_info.json`: Dataset metadata
64
 
65
+ ### Data Fields
66
 
67
  Each data sample contains the following fields:
68
 
69
+ - `id`: Sample unique identifier
70
+ - `title`: Post title
71
+ - `description`: Post description
72
+ - `date`: Publication date and location
73
+ - `comments`: List of comments
74
+ - `images`: List of image filenames
75
+ - `label`: Classification label (0: non-advertisement, 1: advertisement)
76
 
77
  ### Data Example
78
 
 
90
 
91
  ## Usage
92
 
93
+ Using the original directory structure:
94
 
95
  ```python
96
  import os
97
  import json
98
  from glob import glob
99
 
100
+ # Iterate through all samples
101
  for label_dir in ['label_0', 'label_1']:
102
  for sample_dir in glob(f"{label_dir}/*"):
103
  if os.path.isdir(sample_dir):
104
+ # Read data file
105
  with open(os.path.join(sample_dir, 'data.json'), 'r', encoding='utf-8') as f:
106
  data = json.load(f)
107
 
108
+ # Get image files
109
  images = glob(os.path.join(sample_dir, '*.jpg'))
110
 
111
+ # Process data...
112
  ```
113
 
114
+ Using Hugging Face format:
115
 
116
  ```python
117
  import pandas as pd
118
 
119
+ # Load data
120
  train_df = pd.read_csv('hf_format/train.csv')
121
  val_df = pd.read_csv('hf_format/validation.csv')
122
  test_df = pd.read_csv('hf_format/test.csv')
123
 
124
+ # Or use JSON format
125
  import json
126
  with open('hf_format/train.json', 'r', encoding='utf-8') as f:
127
  train_data = json.load(f)
128
  ```
129
 
130
+ Using Hugging Face datasets library:
131
 
132
  ```python
133
  from datasets import load_dataset
134
 
135
+ # Load dataset
136
  dataset = load_dataset("Jingyi77/CHASM-Covert_Advertisement_on_RedNote")
137
 
138
+ # View dataset information
139
  print(dataset)
140
 
141
+ # Access data
142
+ print(dataset['train'][0]) # View first data point in training set
143
  ```
144
 
145
  ## Data Preprocessing
 
150
 
151
  ## Notes
152
 
153
+ This dataset is specifically designed for research on covert advertisement detection as a binary classification task.
 
 
 
154
 
155
  ## Dataset Creation
156