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|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
---
|
| 2 |
+
license: cc-by-nc-4.0
|
| 3 |
+
language:
|
| 4 |
+
- vi
|
| 5 |
+
tags:
|
| 6 |
+
- tiktok
|
| 7 |
+
- video
|
| 8 |
+
- multimodal
|
| 9 |
+
- harmful-content
|
| 10 |
+
- content-moderation
|
| 11 |
+
pretty_name: TikTok Harmful Video Dataset (Vietnamese)
|
| 12 |
+
task_categories:
|
| 13 |
+
- video-classification
|
| 14 |
+
---
|
| 15 |
+
|
| 16 |
+
# Dataset Card for TikTok Harmful Video Dataset (Vietnamese)
|
| 17 |
+
|
| 18 |
+
## Dataset Details
|
| 19 |
+
|
| 20 |
+
### Dataset Description
|
| 21 |
+
|
| 22 |
+
This dataset contains TikTok videos collected for research on harmful content detection in Vietnamese.
|
| 23 |
+
Each sample is stored as a folder with:
|
| 24 |
+
- the original video file (`video.mp4`)
|
| 25 |
+
- a metadata file (`metadata.json`)
|
| 26 |
+
|
| 27 |
+
The dataset is designed for multimodal learning (video + audio + text from metadata).
|
| 28 |
+
|
| 29 |
+
- **Curated by:** Student research project (IE212 – Big Data, UIT, VNU-HCM)
|
| 30 |
+
- **Language(s):** Vietnamese
|
| 31 |
+
- **License:** CC BY-NC 4.0 (non-commercial research/education use)
|
| 32 |
+
|
| 33 |
+
### Dataset Sources
|
| 34 |
+
|
| 35 |
+
- **Source platform:** TikTok
|
| 36 |
+
- **Collection method:** Automated crawling (keyword/hashtag-based), then manual filtering
|
| 37 |
+
|
| 38 |
+
## Uses
|
| 39 |
+
|
| 40 |
+
### Direct Use
|
| 41 |
+
|
| 42 |
+
You can use this dataset for:
|
| 43 |
+
- Video classification (e.g., Safe vs Not Safe)
|
| 44 |
+
- Multimodal research (video/audio/text)
|
| 45 |
+
- Feature extraction pipelines (frames, audio waveform, captions)
|
| 46 |
+
|
| 47 |
+
### Out-of-Scope Use
|
| 48 |
+
|
| 49 |
+
This dataset is **not** intended for:
|
| 50 |
+
- Commercial use
|
| 51 |
+
- Decisions impacting individuals (e.g., banning accounts, legal enforcement)
|
| 52 |
+
- Identifying or profiling TikTok users
|
| 53 |
+
|
| 54 |
+
## Dataset Structure
|
| 55 |
+
|
| 56 |
+
Data is stored using a simple folder-per-video layout:
|
| 57 |
+
|
| 58 |
+
```
|
| 59 |
+
{video_id}/
|
| 60 |
+
├── video.mp4
|
| 61 |
+
└── metadata.json
|
| 62 |
+
```
|
| 63 |
+
|
| 64 |
+
**Files**
|
| 65 |
+
- `video.mp4`: raw TikTok video
|
| 66 |
+
- `metadata.json`: JSON describing the video (caption/hashtags/stats/etc., depending on what your crawler saved)
|
| 67 |
+
|
| 68 |
+
> Note: This dataset does not necessarily include official train/val/test splits.
|
| 69 |
+
|
| 70 |
+
## How to Use (Python)
|
| 71 |
+
|
| 72 |
+
Below are simple examples to load and iterate the dataset from a local folder clone.
|
| 73 |
+
|
| 74 |
+
### 1. List samples and read metadata
|
| 75 |
+
|
| 76 |
+
```python
|
| 77 |
+
import json
|
| 78 |
+
from pathlib import Path
|
| 79 |
+
|
| 80 |
+
dataset_dir = Path("PATH_TO_DATASET_ROOT") # e.g. "./tiktok_dataset"
|
| 81 |
+
|
| 82 |
+
video_folders = [p for p in dataset_dir.iterdir() if p.is_dir()]
|
| 83 |
+
print("Total samples:", len(video_folders))
|
| 84 |
+
|
| 85 |
+
# Read first sample
|
| 86 |
+
sample_dir = video_folders[0]
|
| 87 |
+
video_path = sample_dir / "video.mp4"
|
| 88 |
+
meta_path = sample_dir / "metadata.json"
|
| 89 |
+
|
| 90 |
+
with meta_path.open("r", encoding="utf-8") as f:
|
| 91 |
+
meta = json.load(f)
|
| 92 |
+
|
| 93 |
+
print("Sample video_id:", sample_dir.name)
|
| 94 |
+
print("Video path:", video_path)
|
| 95 |
+
print("Metadata keys:", list(meta.keys()))
|
| 96 |
+
```
|
| 97 |
+
|
| 98 |
+
### 2. Build a simple manifest (CSV/JSONL) for training
|
| 99 |
+
|
| 100 |
+
This is useful if you want a single file listing all samples.
|
| 101 |
+
|
| 102 |
+
```python
|
| 103 |
+
import json
|
| 104 |
+
import csv
|
| 105 |
+
from pathlib import Path
|
| 106 |
+
|
| 107 |
+
dataset_dir = Path("PATH_TO_DATASET_ROOT")
|
| 108 |
+
out_csv = Path("manifest.csv")
|
| 109 |
+
|
| 110 |
+
rows = []
|
| 111 |
+
for d in dataset_dir.iterdir():
|
| 112 |
+
if not d.is_dir():
|
| 113 |
+
continue
|
| 114 |
+
video_path = d / "video.mp4"
|
| 115 |
+
meta_path = d / "metadata.json"
|
| 116 |
+
if not video_path.exists() or not meta_path.exists():
|
| 117 |
+
continue
|
| 118 |
+
|
| 119 |
+
meta = json.loads(meta_path.read_text(encoding="utf-8"))
|
| 120 |
+
caption = meta.get("caption") or meta.get("desc") or ""
|
| 121 |
+
|
| 122 |
+
# If you have labels inside metadata.json, try:
|
| 123 |
+
# label = meta.get("label") # e.g. "safe" / "not_safe"
|
| 124 |
+
# Otherwise set it to empty and label later.
|
| 125 |
+
label = meta.get("label", "")
|
| 126 |
+
|
| 127 |
+
rows.append({
|
| 128 |
+
"video_id": d.name,
|
| 129 |
+
"video_path": str(video_path),
|
| 130 |
+
"caption": caption,
|
| 131 |
+
"label": label,
|
| 132 |
+
})
|
| 133 |
+
|
| 134 |
+
with out_csv.open("w", newline="", encoding="utf-8") as f:
|
| 135 |
+
writer = csv.DictWriter(f, fieldnames=["video_id", "video_path", "caption", "label"])
|
| 136 |
+
writer.writeheader()
|
| 137 |
+
writer.writerows(rows)
|
| 138 |
+
|
| 139 |
+
print("Wrote:", out_csv, "rows =", len(rows))
|
| 140 |
+
```
|
| 141 |
+
|
| 142 |
+
### 3. Extract audio from MP4 (optional)
|
| 143 |
+
|
| 144 |
+
If you want audio for ASR or audio embeddings, you can extract WAV using `ffmpeg`.
|
| 145 |
+
|
| 146 |
+
```python
|
| 147 |
+
import subprocess
|
| 148 |
+
from pathlib import Path
|
| 149 |
+
|
| 150 |
+
video_path = Path("PATH_TO_A_VIDEO.mp4")
|
| 151 |
+
out_wav = video_path.with_suffix(".wav")
|
| 152 |
+
|
| 153 |
+
cmd = [
|
| 154 |
+
"ffmpeg", "-y",
|
| 155 |
+
"-i", str(video_path),
|
| 156 |
+
"-ac", "1", # mono
|
| 157 |
+
"-ar", "16000", # 16kHz
|
| 158 |
+
str(out_wav)
|
| 159 |
+
]
|
| 160 |
+
subprocess.run(cmd, check=True)
|
| 161 |
+
print("Saved:", out_wav)
|
| 162 |
+
```
|
| 163 |
+
|
| 164 |
+
### 4) Read frames with OpenCV (optional)
|
| 165 |
+
|
| 166 |
+
```python
|
| 167 |
+
import cv2
|
| 168 |
+
|
| 169 |
+
video_path = "PATH_TO_A_VIDEO.mp4"
|
| 170 |
+
cap = cv2.VideoCapture(video_path)
|
| 171 |
+
|
| 172 |
+
frames = []
|
| 173 |
+
max_frames = 16
|
| 174 |
+
|
| 175 |
+
while len(frames) < max_frames:
|
| 176 |
+
ok, frame = cap.read()
|
| 177 |
+
if not ok:
|
| 178 |
+
break
|
| 179 |
+
frames.append(frame)
|
| 180 |
+
|
| 181 |
+
cap.release()
|
| 182 |
+
print("Extracted frames:", len(frames))
|
| 183 |
+
```
|
| 184 |
+
|
| 185 |
+
## Dataset Creation
|
| 186 |
+
|
| 187 |
+
### Curation Rationale
|
| 188 |
+
|
| 189 |
+
The dataset was created to support Vietnamese-focused research on harmful content detection for short-form videos.
|
| 190 |
+
It supports multimodal modeling by combining raw video with metadata text.
|
| 191 |
+
|
| 192 |
+
### Data Collection and Processing
|
| 193 |
+
|
| 194 |
+
* Videos were collected using keyword/hashtag-based crawling.
|
| 195 |
+
* Broken/duplicate items were filtered out.
|
| 196 |
+
* Each sample is stored as `{video_id}/video.mp4` + `{video_id}/metadata.json`.
|
| 197 |
+
|
| 198 |
+
### Annotations (if applicable)
|
| 199 |
+
|
| 200 |
+
If your dataset includes labels:
|
| 201 |
+
|
| 202 |
+
* **Classes:** Safe / Not Safe
|
| 203 |
+
* **Method:** Manual labeling using project guidelines
|
| 204 |
+
|
| 205 |
+
(If you do not publish labels, you can remove this part.)
|
| 206 |
+
|
| 207 |
+
## Personal and Sensitive Information
|
| 208 |
+
|
| 209 |
+
Since the source is social media videos, the dataset may contain personal or sensitive content present in the original videos.
|
| 210 |
+
No extra personal data was added by the dataset curators.
|
| 211 |
+
Use the dataset only for non-commercial research and follow ethical data handling practices.
|
| 212 |
+
|
| 213 |
+
## Bias, Risks, and Limitations
|
| 214 |
+
|
| 215 |
+
* The dataset may reflect TikTok platform bias (recommendation, trends, sampling).
|
| 216 |
+
* Harmful content definitions may be subjective and context-dependent.
|
| 217 |
+
* The dataset may not represent all demographics or topics equally.
|
| 218 |
+
|
| 219 |
+
### Recommendations
|
| 220 |
+
|
| 221 |
+
* Use this dataset for research/education only.
|
| 222 |
+
* Do not use it as the sole basis for real-world moderation decisions.
|
| 223 |
+
* Report limitations and potential bias when publishing results.
|
| 224 |
+
|
| 225 |
+
## Dataset Card Contact
|
| 226 |
+
|
| 227 |
+
Please open an issue in the dataset repository for questions or problems.
|