Datasets:
CodeMixCheck v2.2.1
Browse files- .gitattributes +5 -59
- CITATION.cff +32 -0
- LICENSE +20 -0
- README.md +575 -0
- data/abuse_detection/test_synthetic.parquet +3 -0
- data/abuse_detection/train.parquet +3 -0
- data/abuse_detection/validation.parquet +3 -0
- data/fact_verification/test_curated.parquet +3 -0
- data/fact_verification/test_synthetic.parquet +3 -0
- data/fact_verification/train.parquet +3 -0
- data/fact_verification/validation.parquet +3 -0
- data/sentiment/train.parquet +3 -0
- data/sentiment/validation.parquet +3 -0
- data_manifest.json +0 -0
- docs/annotation_guidelines.md +68 -0
- docs/data_collection.md +53 -0
- docs/data_provenance.md +40 -0
- docs/ethical_considerations.md +31 -0
- docs/limitations.md +17 -0
- docs/methodology.md +38 -0
- examples/sample_records.json +0 -0
- scripts/dataset_statistics.py +179 -0
- scripts/load_dataset.py +65 -0
- scripts/validate_dataset.py +208 -0
.gitattributes
CHANGED
|
@@ -1,60 +1,6 @@
|
|
| 1 |
-
*.7z filter=lfs diff=lfs merge=lfs -text
|
| 2 |
-
*.arrow filter=lfs diff=lfs merge=lfs -text
|
| 3 |
-
*.avro 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 |
-
*.ckpt filter=lfs diff=lfs merge=lfs -text
|
| 7 |
-
*.ftz filter=lfs diff=lfs merge=lfs -text
|
| 8 |
-
*.gz filter=lfs diff=lfs merge=lfs -text
|
| 9 |
-
*.h5 filter=lfs diff=lfs merge=lfs -text
|
| 10 |
-
*.joblib filter=lfs diff=lfs merge=lfs -text
|
| 11 |
-
*.lfs.* filter=lfs diff=lfs merge=lfs -text
|
| 12 |
-
*.lz4 filter=lfs diff=lfs merge=lfs -text
|
| 13 |
-
*.mds filter=lfs diff=lfs merge=lfs -text
|
| 14 |
-
*.mlmodel filter=lfs diff=lfs merge=lfs -text
|
| 15 |
-
*.model filter=lfs diff=lfs merge=lfs -text
|
| 16 |
-
*.msgpack filter=lfs diff=lfs merge=lfs -text
|
| 17 |
-
*.npy filter=lfs diff=lfs merge=lfs -text
|
| 18 |
-
*.npz filter=lfs diff=lfs merge=lfs -text
|
| 19 |
-
*.onnx filter=lfs diff=lfs merge=lfs -text
|
| 20 |
-
*.ot filter=lfs diff=lfs merge=lfs -text
|
| 21 |
*.parquet filter=lfs diff=lfs merge=lfs -text
|
| 22 |
-
*.
|
| 23 |
-
*.
|
| 24 |
-
*.
|
| 25 |
-
*.
|
| 26 |
-
*.
|
| 27 |
-
*.rar filter=lfs diff=lfs merge=lfs -text
|
| 28 |
-
*.safetensors filter=lfs diff=lfs merge=lfs -text
|
| 29 |
-
saved_model/**/* filter=lfs diff=lfs merge=lfs -text
|
| 30 |
-
*.tar.* filter=lfs diff=lfs merge=lfs -text
|
| 31 |
-
*.tar filter=lfs diff=lfs merge=lfs -text
|
| 32 |
-
*.tflite filter=lfs diff=lfs merge=lfs -text
|
| 33 |
-
*.tgz filter=lfs diff=lfs merge=lfs -text
|
| 34 |
-
*.wasm filter=lfs diff=lfs merge=lfs -text
|
| 35 |
-
*.xz filter=lfs diff=lfs merge=lfs -text
|
| 36 |
-
*.zip filter=lfs diff=lfs merge=lfs -text
|
| 37 |
-
*.zst filter=lfs diff=lfs merge=lfs -text
|
| 38 |
-
*tfevents* filter=lfs diff=lfs merge=lfs -text
|
| 39 |
-
# Audio files - uncompressed
|
| 40 |
-
*.pcm filter=lfs diff=lfs merge=lfs -text
|
| 41 |
-
*.sam filter=lfs diff=lfs merge=lfs -text
|
| 42 |
-
*.raw filter=lfs diff=lfs merge=lfs -text
|
| 43 |
-
# Audio files - compressed
|
| 44 |
-
*.aac filter=lfs diff=lfs merge=lfs -text
|
| 45 |
-
*.flac filter=lfs diff=lfs merge=lfs -text
|
| 46 |
-
*.mp3 filter=lfs diff=lfs merge=lfs -text
|
| 47 |
-
*.ogg filter=lfs diff=lfs merge=lfs -text
|
| 48 |
-
*.wav filter=lfs diff=lfs merge=lfs -text
|
| 49 |
-
# Image files - uncompressed
|
| 50 |
-
*.bmp filter=lfs diff=lfs merge=lfs -text
|
| 51 |
-
*.gif filter=lfs diff=lfs merge=lfs -text
|
| 52 |
-
*.png filter=lfs diff=lfs merge=lfs -text
|
| 53 |
-
*.tiff filter=lfs diff=lfs merge=lfs -text
|
| 54 |
-
# Image files - compressed
|
| 55 |
-
*.jpg filter=lfs diff=lfs merge=lfs -text
|
| 56 |
-
*.jpeg filter=lfs diff=lfs merge=lfs -text
|
| 57 |
-
*.webp filter=lfs diff=lfs merge=lfs -text
|
| 58 |
-
# Video files - compressed
|
| 59 |
-
*.mp4 filter=lfs diff=lfs merge=lfs -text
|
| 60 |
-
*.webm filter=lfs diff=lfs merge=lfs -text
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
*.parquet filter=lfs diff=lfs merge=lfs -text
|
| 2 |
+
*.arrow filter=lfs diff=lfs merge=lfs -text
|
| 3 |
+
*.json -filter -diff -merge text
|
| 4 |
+
*.md text
|
| 5 |
+
*.py text
|
| 6 |
+
*.cff text
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
CITATION.cff
ADDED
|
@@ -0,0 +1,32 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
# Add `orcid:` for each author and `doi:` once a DOI is minted.
|
| 2 |
+
cff-version: 1.2.0
|
| 3 |
+
message: "If you use this dataset, please cite it using the metadata from this file."
|
| 4 |
+
type: dataset
|
| 5 |
+
title: "CodeMixCheck: A Tanglish Fact-Checking and Auxiliary NLP Dataset"
|
| 6 |
+
version: "2.2.1"
|
| 7 |
+
license: CC-BY-NC-4.0
|
| 8 |
+
url: "https://huggingface.co/datasets/Prajjit/CodeMixCheck"
|
| 9 |
+
repository: "https://huggingface.co/datasets/Prajjit/CodeMixCheck"
|
| 10 |
+
date-released: 2026-11-01
|
| 11 |
+
abstract: >-
|
| 12 |
+
English-Tamil code-mixed (Tanglish) social-media-style text for 4-way claim
|
| 13 |
+
veracity classification (True, False, Partially True, Unverifiable), with a
|
| 14 |
+
template-generated train/validation/test set and a separately curated test
|
| 15 |
+
set, plus auxiliary sentiment and abuse-detection configurations.
|
| 16 |
+
authors:
|
| 17 |
+
- family-names: "Basu"
|
| 18 |
+
given-names: "Prajjit"
|
| 19 |
+
affiliation: "Vellore Institute of Technology, Vellore"
|
| 20 |
+
email: "basuprajjit31@gmail.com"
|
| 21 |
+
- family-names: "Roy"
|
| 22 |
+
given-names: "Sanjiban Sekhar"
|
| 23 |
+
affiliation: "Vellore Institute of Technology, Vellore"
|
| 24 |
+
keywords:
|
| 25 |
+
- code-mixing
|
| 26 |
+
- Tanglish
|
| 27 |
+
- Tamil
|
| 28 |
+
- fact verification
|
| 29 |
+
- misinformation
|
| 30 |
+
- sentiment analysis
|
| 31 |
+
- abuse detection
|
| 32 |
+
- synthetic data
|
LICENSE
ADDED
|
@@ -0,0 +1,20 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
CodeMixCheck v2.2.1
|
| 2 |
+
Copyright (c) 2026 Prajjit Basu
|
| 3 |
+
|
| 4 |
+
This dataset is licensed under the Creative Commons Attribution-NonCommercial
|
| 5 |
+
4.0 International License (CC BY-NC 4.0).
|
| 6 |
+
|
| 7 |
+
You are free to:
|
| 8 |
+
* Share - copy and redistribute the material in any medium or format;
|
| 9 |
+
* Adapt - remix, transform, and build upon the material;
|
| 10 |
+
under the following terms:
|
| 11 |
+
* Attribution - give appropriate credit (see CITATION.cff), provide a link
|
| 12 |
+
to the license, and indicate if changes were made;
|
| 13 |
+
* NonCommercial - you may not use the material for commercial purposes.
|
| 14 |
+
|
| 15 |
+
Full legal code: https://creativecommons.org/licenses/by-nc/4.0/legalcode
|
| 16 |
+
Human-readable summary: https://creativecommons.org/licenses/by-nc/4.0/
|
| 17 |
+
|
| 18 |
+
Scope: this licence covers the records released in this repository. The
|
| 19 |
+
dataset author did not release human-collected social-media comments used in
|
| 20 |
+
the project; they are not part of this repository or this licence.
|
README.md
ADDED
|
@@ -0,0 +1,575 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
---
|
| 2 |
+
pretty_name: "CodeMixCheck: Tanglish Fact-Checking and Auxiliary NLP Dataset"
|
| 3 |
+
language:
|
| 4 |
+
- ta
|
| 5 |
+
- en
|
| 6 |
+
language_bcp47:
|
| 7 |
+
- ta-Latn
|
| 8 |
+
- ta-Taml
|
| 9 |
+
- en-IN
|
| 10 |
+
multilinguality: multilingual
|
| 11 |
+
task_categories:
|
| 12 |
+
- text-classification
|
| 13 |
+
task_ids:
|
| 14 |
+
- fact-checking
|
| 15 |
+
- sentiment-classification
|
| 16 |
+
- hate-speech-detection
|
| 17 |
+
size_categories:
|
| 18 |
+
- 1K<n<10K
|
| 19 |
+
source_datasets:
|
| 20 |
+
- original
|
| 21 |
+
annotations_creators:
|
| 22 |
+
- machine-generated
|
| 23 |
+
- expert-generated
|
| 24 |
+
language_creators:
|
| 25 |
+
- machine-generated
|
| 26 |
+
- expert-generated
|
| 27 |
+
license: cc-by-nc-4.0
|
| 28 |
+
tags:
|
| 29 |
+
- code-mixing
|
| 30 |
+
- code-switching
|
| 31 |
+
- tanglish
|
| 32 |
+
- tamil
|
| 33 |
+
- romanized-tamil
|
| 34 |
+
- misinformation
|
| 35 |
+
- fact-verification
|
| 36 |
+
- synthetic
|
| 37 |
+
- low-resource
|
| 38 |
+
configs:
|
| 39 |
+
- config_name: fact_verification
|
| 40 |
+
default: true
|
| 41 |
+
data_files:
|
| 42 |
+
- split: train
|
| 43 |
+
path: data/fact_verification/train.parquet
|
| 44 |
+
- split: validation
|
| 45 |
+
path: data/fact_verification/validation.parquet
|
| 46 |
+
- split: test_synthetic
|
| 47 |
+
path: data/fact_verification/test_synthetic.parquet
|
| 48 |
+
- split: test_curated
|
| 49 |
+
path: data/fact_verification/test_curated.parquet
|
| 50 |
+
- config_name: sentiment
|
| 51 |
+
data_files:
|
| 52 |
+
- split: train
|
| 53 |
+
path: data/sentiment/train.parquet
|
| 54 |
+
- split: validation
|
| 55 |
+
path: data/sentiment/validation.parquet
|
| 56 |
+
- config_name: abuse_detection
|
| 57 |
+
data_files:
|
| 58 |
+
- split: train
|
| 59 |
+
path: data/abuse_detection/train.parquet
|
| 60 |
+
- split: validation
|
| 61 |
+
path: data/abuse_detection/validation.parquet
|
| 62 |
+
- split: test_synthetic
|
| 63 |
+
path: data/abuse_detection/test_synthetic.parquet
|
| 64 |
+
---
|
| 65 |
+
|
| 66 |
+
# CodeMixCheck v2.2.1: Tanglish Fact-Checking and Auxiliary NLP Dataset
|
| 67 |
+
|
| 68 |
+
> **Read before use.** Most of this dataset is **synthetic**. Labels on synthetic rows describe a *simulated* world: a `True` or `False` claim that names a real district, festival or scheme does **not** describe a real event. Do not use this data to judge real-world claims or to make statements about real people, places or organisations. Licence: **CC BY-NC 4.0** (non-commercial).
|
| 69 |
+
|
| 70 |
+
## 1. Short description
|
| 71 |
+
|
| 72 |
+
CodeMixCheck is a dataset of English–Tamil code-mixed ("Tanglish") social-media-style text. Its main task is **4-way claim veracity classification** (`True`, `False`, `Partially True`, `Unverifiable`). Two small auxiliary tasks, **sentiment** and **abuse detection**, are included as separate configurations. Most texts are written in Roman script, and some mix in Tamil script.
|
| 73 |
+
|
| 74 |
+
## 2. Dataset overview
|
| 75 |
+
|
| 76 |
+
| | v2.2.1 project corpus | this release | not released |
|
| 77 |
+
|---|---|---|---|
|
| 78 |
+
| records | 7,602 | **7,254** | 348 |
|
| 79 |
+
| `fact_verification` | 7,004 (6,660 synthetic + 344 curated) | 7,004 | 0 |
|
| 80 |
+
| `sentiment` | 473 (132 synthetic + 341 human-collected) | 128 | 341 human-collected + 4 synthetic* |
|
| 81 |
+
| `abuse_detection` | 125 (all synthetic) | 122 | 3 synthetic* |
|
| 82 |
+
|
| 83 |
+
\* Synthetic rows that closely resemble one of the unreleased social-media comments (normalised `fuzz.ratio` ≥ 85), held back as a precaution (audit issue G06).
|
| 84 |
+
|
| 85 |
+
Every record keeps its original `id` (`CMC-NNNNN`), text and label from v2.2.1. Nothing has been relabelled, translated, or spell-corrected.
|
| 86 |
+
|
| 87 |
+
## 3. Research motivation
|
| 88 |
+
|
| 89 |
+
Most fact-checking resources are monolingual. Indian social media often mixes Tamil and English in one message, with Romanised Tamil, Tamil script, hashtags, emoji, forwarded-message conventions and deliberate typos. CodeMixCheck was built for a final-year project (BCSE497J) at Vellore Institute of Technology. The project studies retrieval-augmented, evidence-grounded veracity classification of such text. The dataset provides controlled training data and a separate hand-curated evaluation set.
|
| 90 |
+
|
| 91 |
+
## 4. Intended applications
|
| 92 |
+
|
| 93 |
+
- Benchmarking and pre-training classifiers for veracity framing in code-mixed text: hearsay versus attributed claims, and partially true exaggerations.
|
| 94 |
+
- Studying robustness to Romanisation, script mixing, typos and social-media noise.
|
| 95 |
+
- Comparing in-distribution (`test_synthetic`) with out-of-distribution (`test_curated`) performance.
|
| 96 |
+
- Auxiliary sentiment and abuse modelling for multi-task experiments.
|
| 97 |
+
|
| 98 |
+
## 5. Supported NLP tasks
|
| 99 |
+
|
| 100 |
+
| config | task | labels |
|
| 101 |
+
|---|---|---|
|
| 102 |
+
| `fact_verification` | text classification (claim veracity) | `True`, `False`, `Partially True`, `Unverifiable`; optional 3-way `label_3way` = `SUPPORTED` / `REFUTED` / `NOT_ENOUGH_INFO` (`Partially True` has no 3-way equivalent and is `null`) |
|
| 103 |
+
| `sentiment` | text classification | `positive`, `negative`, `neutral` |
|
| 104 |
+
| `abuse_detection` | text classification | `abusive`, `not_abusive` |
|
| 105 |
+
|
| 106 |
+
## 6. Languages and linguistic characteristics
|
| 107 |
+
|
| 108 |
+
- Tamil–English code-mixed text. Matrix language and code-switching density vary by batch.
|
| 109 |
+
- Scripts: Roman (Latin) only, mixed Roman + Tamil, and a few Tamil-script-only texts (`script` column).
|
| 110 |
+
- `tamil_script_token_ratio` is the share of tokens (maximal runs of `[A-Za-z-]`) that contain Tamil characters. The stored values were reproduced exactly by recomputation.
|
| 111 |
+
- Many synthetic texts have deliberate noise (`noise_level`: none / light / medium / heavy): dropped vowels, casing changes, and repeated or replacement punctuation. **Do not "clean" this noise**, because it is part of the signal.
|
| 112 |
+
- Platform conventions: hashtags, emoji, `@` placeholder handles (invented, not real accounts) and multi-line posts.
|
| 113 |
+
|
| 114 |
+
## 7. Dataset composition
|
| 115 |
+
|
| 116 |
+
| column | description |
|
| 117 |
+
|---|---|
|
| 118 |
+
| `id` | stable v2.2.1 row id (`CMC-NNNNN`; not contiguous, because some IDs were retired in earlier versions) |
|
| 119 |
+
| `text` | the original text, unmodified |
|
| 120 |
+
| `label` | task label (unchanged from v2.2.1) |
|
| 121 |
+
| `label_3way` | (fact_verification) SUPPORTED / REFUTED / NOT_ENOUGH_INFO, `null` for Partially True |
|
| 122 |
+
| `evidence_explanation` | (fact_verification) short explanation of the label, in Tanglish or English |
|
| 123 |
+
| `proposition`, `frame_family` | (fact_verification, synthetic rows) parsed claim core, plus how the claim is framed (`forwarded_message`, `official_attribution`, `personal_hearsay`, `general_report`, `unparsed`) |
|
| 124 |
+
| `abuse_label` / `sentiment_label` | auxiliary cross-task label (on sentiment / abuse rows respectively) |
|
| 125 |
+
| `sentiment_label_suggested` | (sentiment) model suggestion, where one existed |
|
| 126 |
+
| `hf_split`, `split_v2_2_1` | Hub split name, and the split value used in the v2.2.1 project CSV |
|
| 127 |
+
| `eval_subset`, `cv_fold` | sub-benchmark and 5-fold assignment (curated test rows only) |
|
| 128 |
+
| `label_status` | `gold` or `silver` exactly as recorded in v2.2.1 |
|
| 129 |
+
| `label_origin` | `template_construction` (synthetic) or `dataset_author_annotation` (curated) |
|
| 130 |
+
| `human_validated`, `label_source`, `review_flag`, `annotation_note`, `content_flag` | original annotation metadata |
|
| 131 |
+
| `domain`, `register`, `tone`, `post_format`, `noise_level` | generation / style metadata |
|
| 132 |
+
| `script`, `tamil_script_token_ratio` | script metadata |
|
| 133 |
+
| `provenance`, `data_origin`, `source_detail` | original provenance fields |
|
| 134 |
+
| `provenance_class`, `source_reference`, `generator` | normalised provenance; `not_recorded` wherever the information was not stored |
|
| 135 |
+
| `generation_batch` | the v2.2.1 `batch` value |
|
| 136 |
+
| `release_tier` | `public` for every record in this repository |
|
| 137 |
+
| `template_group`, `content_group`, `is_content_duplicate` | template family / content-group ids for grouped splitting |
|
| 138 |
+
| `change_v2_1`, `change_v2_2`, `change_v2_2_1` | per-row version history (verbatim) |
|
| 139 |
+
| `audit_flags` | IDs of row-level issues found in the v2.2.1 release audit (see below) |
|
| 140 |
+
| `task` | config name |
|
| 141 |
+
|
| 142 |
+
`audit_flags` codes that occur in this release:
|
| 143 |
+
|
| 144 |
+
| code | meaning |
|
| 145 |
+
|---|---|
|
| 146 |
+
| C02 / C03 | normalised duplicate text (with / without hashtags) |
|
| 147 |
+
| C04 | near-duplicate (fuzz.ratio ≥ 90 after normalisation) of another row in the same task |
|
| 148 |
+
| C05 / C07 | content group / template group contains differing labels |
|
| 149 |
+
| D01 | the same claim core (`proposition`) occurs in another split, worded differently |
|
| 150 |
+
| D02 | near-duplicate of a row in another split |
|
| 151 |
+
| I01 | contains an invented `@` placeholder handle |
|
| 152 |
+
| A02 | curated row whose `evidence_explanation` was cleared in v2.2.1 after relabelling |
|
| 153 |
+
| G02 | curated row whose specific source articles were not recorded |
|
| 154 |
+
|
| 155 |
+
## 8. What is not released
|
| 156 |
+
|
| 157 |
+
| set | rows | reason |
|
| 158 |
+
|---|---|---|
|
| 159 |
+
| human-collected sentiment comments (`test_human` 119 + `silver` 222) | 341 | Comments written by third-party Instagram users. The dataset author does not have the rights to redistribute them, and some name individuals. Results on them are reported only in the accompanying research. |
|
| 160 |
+
| synthetic sentiment/abuse rows resembling those comments | 7 | precaution against releasing text derived from third-party comments |
|
| 161 |
+
|
| 162 |
+
The public `sentiment` configuration therefore has no test split. Use it for auxiliary or multi-task training, not as a standalone sentiment benchmark.
|
| 163 |
+
|
| 164 |
+
## 9. Dataset statistics
|
| 165 |
+
|
| 166 |
+
All numbers below are generated by `scripts/dataset_statistics.py` from the Parquet files in this repository. `scripts/validate_dataset.py` fails if they differ.
|
| 167 |
+
|
| 168 |
+
<!-- STATS:BEGIN -->
|
| 169 |
+
Total records in these files: **7254**.
|
| 170 |
+
|
| 171 |
+
#### `fact_verification` (7004 records)
|
| 172 |
+
|
| 173 |
+
Label distribution by split:
|
| 174 |
+
|
| 175 |
+
| label | train | validation | test_synthetic | test_curated | total |
|
| 176 |
+
|---|---|---|---|---|---|
|
| 177 |
+
| False | 1409 | 153 | 168 | 30 | 1760 |
|
| 178 |
+
| Partially True | 1311 | 158 | 140 | 15 | 1624 |
|
| 179 |
+
| True | 1330 | 207 | 218 | 149 | 1904 |
|
| 180 |
+
| Unverifiable | 1287 | 144 | 135 | 150 | 1716 |
|
| 181 |
+
| total | 5337 | 662 | 661 | 344 | 7004 |
|
| 182 |
+
|
| 183 |
+
Provenance class by split:
|
| 184 |
+
|
| 185 |
+
| provenance_class | train | validation | test_synthetic | test_curated | total |
|
| 186 |
+
|---|---|---|---|---|---|
|
| 187 |
+
| llm_assisted_human_curated | 0 | 0 | 0 | 344 | 344 |
|
| 188 |
+
| template_generated | 5337 | 662 | 661 | 0 | 6660 |
|
| 189 |
+
| total | 5337 | 662 | 661 | 344 | 7004 |
|
| 190 |
+
|
| 191 |
+
Label origin / human-validation status by split:
|
| 192 |
+
|
| 193 |
+
| label_origin | train | validation | test_synthetic | test_curated | total |
|
| 194 |
+
|---|---|---|---|---|---|
|
| 195 |
+
| dataset_author_annotation | 0 | 0 | 0 | 344 | 344 |
|
| 196 |
+
| template_construction | 5337 | 662 | 661 | 0 | 6660 |
|
| 197 |
+
| total | 5337 | 662 | 661 | 344 | 7004 |
|
| 198 |
+
|
| 199 |
+
| human_validated | train | validation | test_synthetic | test_curated | total |
|
| 200 |
+
|---|---|---|---|---|---|
|
| 201 |
+
| no | 5337 | 662 | 661 | 0 | 6660 |
|
| 202 |
+
| user_accepted_suggestion | 0 | 0 | 0 | 130 | 130 |
|
| 203 |
+
| user_labelled | 0 | 0 | 0 | 214 | 214 |
|
| 204 |
+
| total | 5337 | 662 | 661 | 344 | 7004 |
|
| 205 |
+
|
| 206 |
+
Script by split:
|
| 207 |
+
|
| 208 |
+
| script | train | validation | test_synthetic | test_curated | total |
|
| 209 |
+
|---|---|---|---|---|---|
|
| 210 |
+
| mixed_script | 817 | 109 | 100 | 243 | 1269 |
|
| 211 |
+
| roman | 4520 | 553 | 561 | 100 | 5734 |
|
| 212 |
+
| tamil_script | 0 | 0 | 0 | 1 | 1 |
|
| 213 |
+
| total | 5337 | 662 | 661 | 344 | 7004 |
|
| 214 |
+
|
| 215 |
+
Code-mixing / script statistics:
|
| 216 |
+
|
| 217 |
+
| statistic | value |
|
| 218 |
+
|---|---|
|
| 219 |
+
| mean_tokens_per_text | 12.52 |
|
| 220 |
+
| median_tokens_per_text | 12.0 |
|
| 221 |
+
| tamil_script_token_ratio_mean | 0.0295 |
|
| 222 |
+
| tamil_script_token_ratio_mean_over_texts_with_tamil | 0.1627 |
|
| 223 |
+
| pct_texts_with_any_tamil_script | 18.13 |
|
| 224 |
+
| pct_texts_roman_only | 81.87 |
|
| 225 |
+
| pct_texts_tamil_script_only | 0.01 |
|
| 226 |
+
| pct_texts_with_emoji | 70.9 |
|
| 227 |
+
| pct_texts_with_hashtag | 38.56 |
|
| 228 |
+
| heuristic_english_lexicon_share_of_roman_tokens_mean | 0.3726 |
|
| 229 |
+
|
| 230 |
+
Duplicate statistics:
|
| 231 |
+
|
| 232 |
+
| check | count |
|
| 233 |
+
|---|---|
|
| 234 |
+
| duplicate_ids | 0 |
|
| 235 |
+
| exact_duplicate_texts | 0 |
|
| 236 |
+
| normalised_duplicate_texts | 0 |
|
| 237 |
+
| normalised_text_shared_across_splits | 0 |
|
| 238 |
+
| rows_flagged_near_duplicate_C04 | 379 |
|
| 239 |
+
| rows_flagged_cross_split_near_duplicate_D02 | 115 |
|
| 240 |
+
| rows_flagged_cross_split_proposition_D01 | 228 |
|
| 241 |
+
| is_content_duplicate_true | 183 |
|
| 242 |
+
|
| 243 |
+
Columns with missing values (% null):
|
| 244 |
+
|
| 245 |
+
| column | pct_null |
|
| 246 |
+
|---|---|
|
| 247 |
+
| annotation_note | 100.0 |
|
| 248 |
+
| change_v2_1 | 98.91 |
|
| 249 |
+
| change_v2_2 | 73.63 |
|
| 250 |
+
| change_v2_2_1 | 98.14 |
|
| 251 |
+
| content_flag | 100.0 |
|
| 252 |
+
| cv_fold | 95.09 |
|
| 253 |
+
| eval_subset | 95.09 |
|
| 254 |
+
| evidence_explanation | 1.84 |
|
| 255 |
+
| frame_family | 4.91 |
|
| 256 |
+
| label_3way | 23.19 |
|
| 257 |
+
| label_source | 92.23 |
|
| 258 |
+
| noise_level | 22.27 |
|
| 259 |
+
| post_format | 4.94 |
|
| 260 |
+
| proposition | 4.91 |
|
| 261 |
+
| review_flag | 100.0 |
|
| 262 |
+
| tone | 93.76 |
|
| 263 |
+
|
| 264 |
+
#### `sentiment` (128 records)
|
| 265 |
+
|
| 266 |
+
Label distribution by split:
|
| 267 |
+
|
| 268 |
+
| label | train | validation | total |
|
| 269 |
+
|---|---|---|---|
|
| 270 |
+
| negative | 37 | 14 | 51 |
|
| 271 |
+
| neutral | 25 | 5 | 30 |
|
| 272 |
+
| positive | 36 | 11 | 47 |
|
| 273 |
+
| total | 98 | 30 | 128 |
|
| 274 |
+
|
| 275 |
+
Provenance class by split:
|
| 276 |
+
|
| 277 |
+
| provenance_class | train | validation | total |
|
| 278 |
+
|---|---|---|---|
|
| 279 |
+
| template_generated | 98 | 30 | 128 |
|
| 280 |
+
| total | 98 | 30 | 128 |
|
| 281 |
+
|
| 282 |
+
Label origin / human-validation status by split:
|
| 283 |
+
|
| 284 |
+
| label_origin | train | validation | total |
|
| 285 |
+
|---|---|---|---|
|
| 286 |
+
| template_construction | 98 | 30 | 128 |
|
| 287 |
+
| total | 98 | 30 | 128 |
|
| 288 |
+
|
| 289 |
+
| human_validated | train | validation | total |
|
| 290 |
+
|---|---|---|---|
|
| 291 |
+
| no | 98 | 30 | 128 |
|
| 292 |
+
| total | 98 | 30 | 128 |
|
| 293 |
+
|
| 294 |
+
Script by split:
|
| 295 |
+
|
| 296 |
+
| script | train | validation | total |
|
| 297 |
+
|---|---|---|---|
|
| 298 |
+
| roman | 98 | 30 | 128 |
|
| 299 |
+
| total | 98 | 30 | 128 |
|
| 300 |
+
|
| 301 |
+
Code-mixing / script statistics:
|
| 302 |
+
|
| 303 |
+
| statistic | value |
|
| 304 |
+
|---|---|
|
| 305 |
+
| mean_tokens_per_text | 4.57 |
|
| 306 |
+
| median_tokens_per_text | 4.0 |
|
| 307 |
+
| tamil_script_token_ratio_mean | 0.0 |
|
| 308 |
+
| tamil_script_token_ratio_mean_over_texts_with_tamil | n/a (no Tamil-script tokens) |
|
| 309 |
+
| pct_texts_with_any_tamil_script | 0.0 |
|
| 310 |
+
| pct_texts_roman_only | 100.0 |
|
| 311 |
+
| pct_texts_tamil_script_only | 0.0 |
|
| 312 |
+
| pct_texts_with_emoji | 100.0 |
|
| 313 |
+
| pct_texts_with_hashtag | 0.0 |
|
| 314 |
+
| heuristic_english_lexicon_share_of_roman_tokens_mean | 0.1837 |
|
| 315 |
+
|
| 316 |
+
Duplicate statistics:
|
| 317 |
+
|
| 318 |
+
| check | count |
|
| 319 |
+
|---|---|
|
| 320 |
+
| duplicate_ids | 0 |
|
| 321 |
+
| exact_duplicate_texts | 0 |
|
| 322 |
+
| normalised_duplicate_texts | 0 |
|
| 323 |
+
| normalised_text_shared_across_splits | 0 |
|
| 324 |
+
| rows_flagged_near_duplicate_C04 | 95 |
|
| 325 |
+
| rows_flagged_cross_split_near_duplicate_D02 | 58 |
|
| 326 |
+
| rows_flagged_cross_split_proposition_D01 | 0 |
|
| 327 |
+
| is_content_duplicate_true | 0 |
|
| 328 |
+
|
| 329 |
+
Columns with missing values (% null):
|
| 330 |
+
|
| 331 |
+
| column | pct_null |
|
| 332 |
+
|---|---|
|
| 333 |
+
| abuse_label | 100.0 |
|
| 334 |
+
| annotation_note | 100.0 |
|
| 335 |
+
| change_v2_1 | 100.0 |
|
| 336 |
+
| change_v2_2 | 100.0 |
|
| 337 |
+
| change_v2_2_1 | 100.0 |
|
| 338 |
+
| content_flag | 100.0 |
|
| 339 |
+
| cv_fold | 100.0 |
|
| 340 |
+
| domain | 100.0 |
|
| 341 |
+
| eval_subset | 100.0 |
|
| 342 |
+
| label_source | 100.0 |
|
| 343 |
+
| noise_level | 100.0 |
|
| 344 |
+
| review_flag | 100.0 |
|
| 345 |
+
| sentiment_label_suggested | 100.0 |
|
| 346 |
+
|
| 347 |
+
#### `abuse_detection` (122 records)
|
| 348 |
+
|
| 349 |
+
Label distribution by split:
|
| 350 |
+
|
| 351 |
+
| label | train | validation | test_synthetic | total |
|
| 352 |
+
|---|---|---|---|---|
|
| 353 |
+
| abusive | 34 | 9 | 9 | 52 |
|
| 354 |
+
| not_abusive | 33 | 18 | 19 | 70 |
|
| 355 |
+
| total | 67 | 27 | 28 | 122 |
|
| 356 |
+
|
| 357 |
+
Provenance class by split:
|
| 358 |
+
|
| 359 |
+
| provenance_class | train | validation | test_synthetic | total |
|
| 360 |
+
|---|---|---|---|---|
|
| 361 |
+
| template_generated | 67 | 27 | 28 | 122 |
|
| 362 |
+
| total | 67 | 27 | 28 | 122 |
|
| 363 |
+
|
| 364 |
+
Label origin / human-validation status by split:
|
| 365 |
+
|
| 366 |
+
| label_origin | train | validation | test_synthetic | total |
|
| 367 |
+
|---|---|---|---|---|
|
| 368 |
+
| template_construction | 67 | 27 | 28 | 122 |
|
| 369 |
+
| total | 67 | 27 | 28 | 122 |
|
| 370 |
+
|
| 371 |
+
| human_validated | train | validation | test_synthetic | total |
|
| 372 |
+
|---|---|---|---|---|
|
| 373 |
+
| no | 67 | 27 | 28 | 122 |
|
| 374 |
+
| total | 67 | 27 | 28 | 122 |
|
| 375 |
+
|
| 376 |
+
Script by split:
|
| 377 |
+
|
| 378 |
+
| script | train | validation | test_synthetic | total |
|
| 379 |
+
|---|---|---|---|---|
|
| 380 |
+
| mixed_script | 13 | 3 | 5 | 21 |
|
| 381 |
+
| roman | 54 | 24 | 23 | 101 |
|
| 382 |
+
| total | 67 | 27 | 28 | 122 |
|
| 383 |
+
|
| 384 |
+
Code-mixing / script statistics:
|
| 385 |
+
|
| 386 |
+
| statistic | value |
|
| 387 |
+
|---|---|
|
| 388 |
+
| mean_tokens_per_text | 5.87 |
|
| 389 |
+
| median_tokens_per_text | 5.5 |
|
| 390 |
+
| tamil_script_token_ratio_mean | 0.0304 |
|
| 391 |
+
| tamil_script_token_ratio_mean_over_texts_with_tamil | 0.1766 |
|
| 392 |
+
| pct_texts_with_any_tamil_script | 17.21 |
|
| 393 |
+
| pct_texts_roman_only | 82.79 |
|
| 394 |
+
| pct_texts_tamil_script_only | 0.0 |
|
| 395 |
+
| pct_texts_with_emoji | 100.0 |
|
| 396 |
+
| pct_texts_with_hashtag | 0.0 |
|
| 397 |
+
| heuristic_english_lexicon_share_of_roman_tokens_mean | 0.2057 |
|
| 398 |
+
|
| 399 |
+
Duplicate statistics:
|
| 400 |
+
|
| 401 |
+
| check | count |
|
| 402 |
+
|---|---|
|
| 403 |
+
| duplicate_ids | 0 |
|
| 404 |
+
| exact_duplicate_texts | 0 |
|
| 405 |
+
| normalised_duplicate_texts | 0 |
|
| 406 |
+
| normalised_text_shared_across_splits | 0 |
|
| 407 |
+
| rows_flagged_near_duplicate_C04 | 79 |
|
| 408 |
+
| rows_flagged_cross_split_near_duplicate_D02 | 70 |
|
| 409 |
+
| rows_flagged_cross_split_proposition_D01 | 0 |
|
| 410 |
+
| is_content_duplicate_true | 4 |
|
| 411 |
+
|
| 412 |
+
Columns with missing values (% null):
|
| 413 |
+
|
| 414 |
+
| column | pct_null |
|
| 415 |
+
|---|---|
|
| 416 |
+
| annotation_note | 100.0 |
|
| 417 |
+
| change_v2_1 | 77.05 |
|
| 418 |
+
| change_v2_2 | 100.0 |
|
| 419 |
+
| change_v2_2_1 | 100.0 |
|
| 420 |
+
| content_flag | 100.0 |
|
| 421 |
+
| cv_fold | 100.0 |
|
| 422 |
+
| domain | 100.0 |
|
| 423 |
+
| eval_subset | 100.0 |
|
| 424 |
+
| label_source | 100.0 |
|
| 425 |
+
| noise_level | 100.0 |
|
| 426 |
+
| review_flag | 100.0 |
|
| 427 |
+
<!-- STATS:END -->
|
| 428 |
+
|
| 429 |
+
## 10. Data collection methodology
|
| 430 |
+
|
| 431 |
+
See [`docs/data_collection.md`](docs/data_collection.md). In summary:
|
| 432 |
+
|
| 433 |
+
- **Template-generated records** were produced in batches (`set1`–`set4`, `set7_conversational`, `set9_expansion`, `set10_expansion`, `set11_general_knowledge`, `set8_abuse`). Claim propositions about fictional or generic entities were combined with framing templates (forwarded message, official attribution, personal hearsay, general report), post formats, tones, hashtags, emoji and controlled typing noise.
|
| 434 |
+
- **Curated records** (`test_curated`, 344) were selected by the dataset author from news and reference material and rephrased in his own Tanglish wording where needed. LLM assistants helped with drafting. Individual source articles were not recorded, so no sources are listed.
|
| 435 |
+
|
| 436 |
+
## 11. AI-assisted generation methodology
|
| 437 |
+
|
| 438 |
+
The dataset author created the templates, entity pools and curated claims, using the LLM chat assistants Claude and ChatGPT as writing helpers. Which assistant contributed to which batch or row was not recorded, so `generator` is set to `not_recorded` rather than guessed. See [`docs/methodology.md`](docs/methodology.md).
|
| 439 |
+
|
| 440 |
+
## 12. Human annotation methodology
|
| 441 |
+
|
| 442 |
+
- **Synthetic rows:** labels are assigned **by construction** from the generator's design. No human checked them row by row (`human_validated = no`, `label_origin = template_construction`). `label_status = gold` in these rows means "assigned by the generator", **not** "human-verified".
|
| 443 |
+
- **Curated test:** labelled by the dataset author (`user_labelled`, 214 rows). 130 rows went through a v2.2.1 review in which the author accepted a model-suggested correction (`user_accepted_suggestion`); 129 of these changed from `Partially True` to `True` under guideline rule 1 ("judge the claim as written"). The 129 changed rows have no `evidence_explanation`, because the old explanation no longer applied.
|
| 444 |
+
- There is a single annotator, and no inter-annotator agreement study has been done.
|
| 445 |
+
|
| 446 |
+
Full guidance: [`docs/annotation_guidelines.md`](docs/annotation_guidelines.md).
|
| 447 |
+
|
| 448 |
+
## 13. Label definitions
|
| 449 |
+
|
| 450 |
+
| label | definition used in the data |
|
| 451 |
+
|---|---|
|
| 452 |
+
| `True` | The claim, **as written**, matches the (simulated) official source or established reference knowledge. |
|
| 453 |
+
| `False` | The (simulated) official statement or records, or established knowledge, directly contradicts the claim. |
|
| 454 |
+
| `Partially True` | The core fact holds, but a sweeping, absolute or extreme part of the claim is exaggerated or incomplete. |
|
| 455 |
+
| `Unverifiable` | There is no named or checkable source (hearsay / anecdote only), so the claim can be neither confirmed nor refuted. |
|
| 456 |
+
|
| 457 |
+
For synthetic rows, "official source" refers to a **simulated evidence state** encoded in `evidence_explanation`. It does not refer to real documents. No evidence corpus is included.
|
| 458 |
+
|
| 459 |
+
## 14. Train / validation / test methodology
|
| 460 |
+
|
| 461 |
+
- Splits were assigned at **content-group / template-family level**, so no `content_group` or `template_group` spans two splits.
|
| 462 |
+
- v2.1 moved 22 rows between splits to remove template-family leakage (see `change_v2_1`).
|
| 463 |
+
- The release audit found **no exact or normalised-identical text across splits**, but it did find **semantic overlap**:
|
| 464 |
+
- fact_verification: 84 claim cores (`proposition`), covering 228 rows, appear in more than one split with different framing (flag D01). 73 cross-split near-duplicate pairs (fuzz.ratio ≥ 90) are mostly the same template with a different entity, or typo variants (flag D02).
|
| 465 |
+
- sentiment / abuse synthetic sets: many cross-split typo/emoji variants. These sets were generated by perturbation, so their validation and test scores are **optimistic**.
|
| 466 |
+
- Records were not removed. A **strict** `test_synthetic` without D01/D02 rows has 587 of 661 rows (see the loading examples).
|
| 467 |
+
|
| 468 |
+
## 15. Synthetic versus curated evaluation
|
| 469 |
+
|
| 470 |
+
`test_synthetic` (661) comes from the same generator as `train`, so it measures in-distribution performance. `test_curated` (344) was written separately and measures transfer to more natural claims. Its sub-benchmarks are in `eval_subset`:
|
| 471 |
+
|
| 472 |
+
| eval_subset | rows | labels |
|
| 473 |
+
|---|---|---|
|
| 474 |
+
| `human_verifiable_true_false` | 50 | 20 True / 30 False (science and health facts) |
|
| 475 |
+
| `human_health_lifestyle` | 144 | 129 True / 15 Partially True |
|
| 476 |
+
| `human_hearsay` | 150 | 150 Unverifiable |
|
| 477 |
+
|
| 478 |
+
**Never merge or average the two test sets.** Report them separately, report `test_curated` per `eval_subset` as well, and note that its label distribution is very skewed.
|
| 479 |
+
|
| 480 |
+
## 16. Data preprocessing
|
| 481 |
+
|
| 482 |
+
1. Read the v2.2.1 project CSV, which was left unmodified (sha256 `37d5bdc3…ad4e1c7f`).
|
| 483 |
+
2. Text columns preserved byte-for-byte. Leading/trailing whitespace stripped in categorical columns only (0 changes needed).
|
| 484 |
+
3. Empty strings converted to `null`. Booleans and numbers stored with proper types (`bool`, `int8`, `float32`).
|
| 485 |
+
4. Redundant columns dropped after verifying that they were redundant: `veracity_label` (identical to `label`), the per-task duplicate of `label`, columns that are empty for a task, and `is_human_authored` (determined by `provenance`).
|
| 486 |
+
5. Added `label_origin`, `provenance_class`, `source_reference`, `generator`, `release_tier`, `hf_split` and `audit_flags`. Original split names are kept in `split_v2_2_1`.
|
| 487 |
+
6. One Parquet file written per config and split. Records not released (section 8) were excluded and are documented here.
|
| 488 |
+
|
| 489 |
+
No label, text, split or ID was changed.
|
| 490 |
+
|
| 491 |
+
## 17. Known limitations
|
| 492 |
+
|
| 493 |
+
See [`docs/limitations.md`](docs/limitations.md). Key points:
|
| 494 |
+
|
| 495 |
+
- 6,910 of the 7,254 records are **synthetic**. Their labels follow a simulated world, and models can learn generator artefacts.
|
| 496 |
+
- There is semantic cross-split overlap (see section 14), and the synthetic sentiment/abuse sets are small and repetitive.
|
| 497 |
+
- `test_curated` is small and label-skewed (only 30 `False` and 15 `Partially True`).
|
| 498 |
+
- There is no public sentiment test set, and no evidence corpus for retrieval.
|
| 499 |
+
- Coverage is Tamil Nadu-centric, with one annotator.
|
| 500 |
+
|
| 501 |
+
## 18. Ethical considerations
|
| 502 |
+
|
| 503 |
+
See [`docs/ethical_considerations.md`](docs/ethical_considerations.md). Synthetic claims name real districts, festivals and categories of institutions together with fictional events. They must not be read or redistributed as real news. `@` handles in the text are invented placeholders. Abuse examples contain insults and slurs in Tanglish.
|
| 504 |
+
|
| 505 |
+
## 19. Licence
|
| 506 |
+
|
| 507 |
+
[**CC BY-NC 4.0**](https://creativecommons.org/licenses/by-nc/4.0/). You may share and adapt the data for **non-commercial** purposes, with attribution (see section 22). The licence covers the records in this repository only. The unreleased social-media comments are not covered.
|
| 508 |
+
|
| 509 |
+
## 20. Intended and out-of-scope uses
|
| 510 |
+
|
| 511 |
+
**Intended:** non-commercial academic research on code-mixed veracity framing, robustness to noise, and multi-task learning.
|
| 512 |
+
|
| 513 |
+
**Out of scope:** commercial use; deciding whether real-world claims are true; content moderation or fact-checking deployed on real users; any statement about the real people, places, schemes or organisations mentioned; training generative models to produce realistic misinformation; treating template labels as human-verified.
|
| 514 |
+
|
| 515 |
+
## 21. Potential biases
|
| 516 |
+
|
| 517 |
+
- Topics, districts, festivals and entity names come from author-curated pools (11 synthetic domains, Tamil Nadu-centric). Coverage is not representative of Tamil-speaking populations elsewhere (Sri Lanka, Malaysia, Singapore, diaspora).
|
| 518 |
+
- The generator's choices determine label–frame associations. For example, rows with an `unparsed` frame are mostly `True` (589 of 845), so a model may learn that shortcut.
|
| 519 |
+
- Romanisation follows Tamil Nadu social-media conventions.
|
| 520 |
+
- Abuse examples are synthetic and few (122). They do not represent naturally occurring abuse patterns.
|
| 521 |
+
|
| 522 |
+
## 22. Citation
|
| 523 |
+
|
| 524 |
+
```bibtex
|
| 525 |
+
@misc{basu2026codemixcheck,
|
| 526 |
+
author = {Basu, Prajjit and Roy, Sanjiban Sekhar},
|
| 527 |
+
title = {{CodeMixCheck}: A {Tanglish} Fact-Checking and Auxiliary {NLP} Dataset},
|
| 528 |
+
year = {2026},
|
| 529 |
+
version = {2.2.1},
|
| 530 |
+
publisher = {Hugging Face},
|
| 531 |
+
howpublished = {\url{https://huggingface.co/datasets/Prajjit/CodeMixCheck}}
|
| 532 |
+
}
|
| 533 |
+
```
|
| 534 |
+
|
| 535 |
+
`CITATION.cff` holds the same metadata. A DOI will be added here if one is minted.
|
| 536 |
+
|
| 537 |
+
## 23. Version information
|
| 538 |
+
|
| 539 |
+
| version | change |
|
| 540 |
+
|---|---|
|
| 541 |
+
| v2.1 | split renames (`test` → `test_human` / `test_synthetic`); 22 rows moved to remove template-family leakage; 4 self-referential "X vs X" texts repaired |
|
| 542 |
+
| v2.2 | script / `tamil_script_token_ratio` recomputed (1,847 rows; 1,600 script reclassifications) |
|
| 543 |
+
| v2.2.1 | review pass: 129 curated rows `Partially True` → `True` (explanation cleared); 1 confirmed; 19 abuse labels confirmed |
|
| 544 |
+
| v2.2.1 (Hugging Face release) | packaging only: typed Parquet, task configs, provenance/audit metadata, exclusions in section 8. No data changes. |
|
| 545 |
+
|
| 546 |
+
782 IDs were retired before v2.1, and no per-row reasons survive.
|
| 547 |
+
|
| 548 |
+
## 24. Loading
|
| 549 |
+
|
| 550 |
+
```python
|
| 551 |
+
from datasets import load_dataset
|
| 552 |
+
|
| 553 |
+
repo = "Prajjit/CodeMixCheck"
|
| 554 |
+
|
| 555 |
+
fv = load_dataset(repo, "fact_verification") # train / validation / test_synthetic / test_curated
|
| 556 |
+
curated = load_dataset(repo, "fact_verification", split="test_curated")
|
| 557 |
+
sent = load_dataset(repo, "sentiment") # train / validation
|
| 558 |
+
abuse = load_dataset(repo, "abuse_detection") # train / validation / test_synthetic
|
| 559 |
+
|
| 560 |
+
print(fv["train"][0]["text"], fv["train"][0]["label"])
|
| 561 |
+
|
| 562 |
+
# curated test, per sub-benchmark
|
| 563 |
+
hearsay = curated.filter(lambda r: r["eval_subset"] == "human_hearsay")
|
| 564 |
+
|
| 565 |
+
# stricter synthetic evaluation: drop rows overlapping another split
|
| 566 |
+
strict = fv["test_synthetic"].filter(lambda r: not ({"D01", "D02"} & set(r["audit_flags"])))
|
| 567 |
+
```
|
| 568 |
+
|
| 569 |
+
`scripts/load_dataset.py` runs all of these steps. `scripts/dataset_statistics.py` reproduces section 9, and `scripts/validate_dataset.py --hf` re-checks the whole release.
|
| 570 |
+
|
| 571 |
+
## 25. Contact and contributions
|
| 572 |
+
|
| 573 |
+
Authors: **Prajjit Basu** (main author; Vellore Institute of Technology) and **Dr. Sanjiban Sekhar Roy** (co-author; Vellore Institute of Technology).
|
| 574 |
+
Contact: basuprajjit31@gmail.com, or the *Community* tab of this dataset page.
|
| 575 |
+
Corrections, label disputes and takedown requests are welcome. Please quote the record `id`.
|
data/abuse_detection/test_synthetic.parquet
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:8cc02d0cf83e4309ab0e1d8058420cddab6a6edbe8fd06ec4fc0deed1cde4111
|
| 3 |
+
size 24287
|
data/abuse_detection/train.parquet
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:7207ac1e50341cdc4162ec4ed42b77163aef6023206b10097abd85b72f685221
|
| 3 |
+
size 26088
|
data/abuse_detection/validation.parquet
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:251af01e4b11fc48ebc405eb328e08bfe70e7c306b382b83d5f0109b561f031c
|
| 3 |
+
size 24086
|
data/fact_verification/test_curated.parquet
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:fe16b22d6eb2ce9c1301a598071babae9e19f6c0e890f48c9f1e19db1015fd5e
|
| 3 |
+
size 58527
|
data/fact_verification/test_synthetic.parquet
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:d44ff5acdb9e3287e272c42a668ca4aee5807f8c07698765eca34060b21074c9
|
| 3 |
+
size 85110
|
data/fact_verification/train.parquet
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:49bad9808277f084e42c987bc2d3ab68c72b021a90b519330a005e94be786959
|
| 3 |
+
size 324386
|
data/fact_verification/validation.parquet
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:1ae0ee3ae9c671ca184a08e494f987bb83dc18a8bb6db9262b12a8eae2aef8b8
|
| 3 |
+
size 84700
|
data/sentiment/train.parquet
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:4c86a1e6e43bdd2fcc24938e7b9a26e6a4b5eec43d9556b302be1e0b146be941
|
| 3 |
+
size 26617
|
data/sentiment/validation.parquet
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:2b197dea0f10393deed8a8d7547d8318941af91df775ccaed3e1aeb187e01f40
|
| 3 |
+
size 24187
|
data_manifest.json
ADDED
|
Binary file (2.02 kB). View file
|
|
|
docs/annotation_guidelines.md
ADDED
|
@@ -0,0 +1,68 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
# Annotation guidelines — CodeMixCheck v2.2.1
|
| 2 |
+
|
| 3 |
+
This document records the labelling rules that can be **evidenced from the data itself**: the label vocabularies, the templated `evidence_explanation` strings, and the review notes in `change_v2_2_1`.
|
| 4 |
+
|
| 5 |
+
## 1. Fact verification (4-way)
|
| 6 |
+
|
| 7 |
+
### General rule
|
| 8 |
+
|
| 9 |
+
**Rule 1: judge the claim as written** (quoted in the v2.2.1 review notes). The label applies to the literal statement in `text`. Do not guess what the poster probably meant, and do not apply a plausible real-world reading. For example, a text that states a true premise and correctly rejects an exaggeration is `True`, not `Partially True`.
|
| 10 |
+
|
| 11 |
+
### Labels
|
| 12 |
+
|
| 13 |
+
| label | criterion | canonical explanation pattern (most frequent in data) |
|
| 14 |
+
|---|---|---|
|
| 15 |
+
| `True` | The claim matches the official source, notice, or established general/reference knowledge. | "Confirmed — official source/notice matches this claim." |
|
| 16 |
+
| `False` | The official statement, records, or established knowledge directly contradicts the claim. | "Idhu false — official statement/records directly contradict this claim." |
|
| 17 |
+
| `Partially True` | The core fact holds, but a sweeping, absolute or extreme part is exaggerated or incomplete (for example, "100%", "ella districts", "permanently"). | "Partially true — core fact holds but the sweeping part is exaggerated or incomplete." |
|
| 18 |
+
| `Unverifiable` | There is no named or checkable source, only hearsay or anecdote, so the claim can be neither confirmed nor refuted. | "Idhu unverifiable — no named official source, hearsay only." |
|
| 19 |
+
|
| 20 |
+
`label_3way` maps True → SUPPORTED, False → REFUTED and Unverifiable → NOT_ENOUGH_INFO. `Partially True` has **no** 3-way mapping and must not be forced into one.
|
| 21 |
+
|
| 22 |
+
### Framing is not the label
|
| 23 |
+
|
| 24 |
+
Framing (`frame_family`: forwarded message, official attribution, personal hearsay, general report) is spread across all four labels in the synthetic data. A forwarded message can still be `True`. In the synthetic data, the label follows the **simulated evidence state** for the proposition, not the wording of the frame. Hearsay framing does *not* automatically mean `Unverifiable` in the synthetic batches. In the curated `hearsay` subset, every claim is `Unverifiable` because no checkable source exists for those claims.
|
| 25 |
+
|
| 26 |
+
### Synthetic labels
|
| 27 |
+
|
| 28 |
+
Template rows get their label from the generator, together with a matching templated explanation. These labels are **not** individually human-reviewed (`label_origin = template_construction`).
|
| 29 |
+
|
| 30 |
+
### Curated test labels
|
| 31 |
+
|
| 32 |
+
- Labelled by the dataset author (`label_source = user_labelled`).
|
| 33 |
+
- v2.2.1 review: the author reviewed model-suggested corrections, accepting 129 `Partially True → True` changes and confirming 1 label. The rationale is recorded verbatim in `change_v2_2_1`. Where a label changed, the explanation was cleared because it had been written for the old label. These 129 rows currently have no explanation.
|
| 34 |
+
- Sub-benchmarks: `human_verifiable_true_false` (50 science/health facts), `human_health_lifestyle` (144 claims), `human_hearsay` (150 claims).
|
| 35 |
+
- There was a single annotator (the dataset author). No agreement study has been done.
|
| 36 |
+
|
| 37 |
+
## 2. Sentiment (3-way)
|
| 38 |
+
|
| 39 |
+
| label | criterion (from annotation notes) |
|
| 40 |
+
|---|---|
|
| 41 |
+
| `positive` | The comment expresses approval, affection, encouragement or happiness. |
|
| 42 |
+
| `negative` | It expresses disappointment, irritation, hurt, mockery or dismissal, including sarcastic consolation. |
|
| 43 |
+
| `neutral` | It is neutral, informational, ambiguous or too low in context to call. Short fragments are usually neutral. |
|
| 44 |
+
|
| 45 |
+
Notes recorded in the data show these conventions:
|
| 46 |
+
- Mixed messages are labelled by their dominant valence ("bittersweet; nostalgia clause could read negative").
|
| 47 |
+
- Teasing that targets the addressee is `negative` ("teasing tone; 'cute thaan aana timing worst'").
|
| 48 |
+
- Changes from the model suggestion are recorded ("CHANGED from suggested 'positive': sarcastic consolation").
|
| 49 |
+
|
| 50 |
+
**Label status:** `silver` = model-annotated, pending human confirmation. **Never report silver labels as gold.** (The human-collected sentiment data, including all silver rows, is not part of this release.)
|
| 51 |
+
|
| 52 |
+
## 3. Abuse detection (binary)
|
| 53 |
+
|
| 54 |
+
| label | criterion |
|
| 55 |
+
|---|---|
|
| 56 |
+
| `abusive` | An insult, slur, profanity, threat, or attack directed at the addressee (including emoji-masked slurs and middle-finger emoji used with an insult). |
|
| 57 |
+
| `not_abusive` | An ordinary positive or negative comment with no insult, profanity, threat or attack. Mentioning an abuse term without using it against someone is a hard negative. |
|
| 58 |
+
|
| 59 |
+
The recorded review rule for 19 human-collected comments was: "Ordinary positive/negative comment with no insult, profanity, threat or attack: not_abusive is correct."
|
| 60 |
+
|
| 61 |
+
Some terms have a context-dependent reading, for example "'poda dei' alone reads playful here". Record the rationale in `annotation_note`.
|
| 62 |
+
|
| 63 |
+
## 4. What annotators must not do
|
| 64 |
+
|
| 65 |
+
- Do not translate, normalise or spell-correct `text`.
|
| 66 |
+
- Do not infer a missing label from the text automatically.
|
| 67 |
+
- Do not collapse `Partially True` or `Unverifiable` into True/False.
|
| 68 |
+
- Do not upgrade `silver` to `gold` without a recorded human decision. Record that decision in `human_validated` and `label_source`.
|
docs/data_collection.md
ADDED
|
@@ -0,0 +1,53 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
# Data collection: CodeMixCheck v2.2.1
|
| 2 |
+
|
| 3 |
+
This document describes how each batch in the v2.2.1 CSV was produced, based on the metadata stored in the CSV (`batch`, `provenance`, `source_detail`, `register`, `noise_level`, `post_format`, `tone`). Where the CSV does not record something, this document says so. Nothing has been filled in by assumption.
|
| 4 |
+
|
| 5 |
+
## Batches
|
| 6 |
+
|
| 7 |
+
Counts below are taken from the **full v2.2.1 CSV (7,602 rows)**, including the 348 records not included in this release.
|
| 8 |
+
|
| 9 |
+
| batch | rows | tasks | provenance | register | id range |
|
| 10 |
+
|---|---|---|---|---|---|
|
| 11 |
+
| `tang_pdf_facts` | 50 | fact_verification 50 | human_curated_llm_assisted | social_post | CMC-00001–CMC-00050 |
|
| 12 |
+
| `v1_1_claim_batch` | 294 | fact_verification 294 | human_curated_llm_assisted | social_post | CMC-00051–CMC-00344 |
|
| 13 |
+
| `set1` | 147 | fact_verification 147 | template_generated | social_post | CMC-00345–CMC-00491 |
|
| 14 |
+
| `set10_expansion` | 2414 | fact_verification 2323, sentiment 47, abuse_detection 44 | template_generated | conversational, social_post | CMC-00492–CMC-08041 |
|
| 15 |
+
| `set11_general_knowledge` | 200 | fact_verification 200 | template_generated | social_post | CMC-02819–CMC-03018 |
|
| 16 |
+
| `set2` | 240 | fact_verification 240 | template_generated | social_post | CMC-03019–CMC-03258 |
|
| 17 |
+
| `set3` | 238 | fact_verification 238 | template_generated | social_post | CMC-03259–CMC-03498 |
|
| 18 |
+
| `set4` | 199 | fact_verification 199 | template_generated | social_post | CMC-03499–CMC-03698 |
|
| 19 |
+
| `set7_conversational` | 391 | fact_verification 391 | template_generated | conversational | CMC-03699–CMC-04092 |
|
| 20 |
+
| `set9_expansion` | 3046 | fact_verification 2922, sentiment 85, abuse_detection 39 | template_generated | conversational, social_post | CMC-04093–CMC-08384 |
|
| 21 |
+
| `clean_paste_social` | 72 | sentiment 72 | human_collected | conversational | CMC-07025–CMC-07096 |
|
| 22 |
+
| `natural_collected` | 37 | sentiment 37 | human_collected | conversational | CMC-07097–CMC-07133 |
|
| 23 |
+
| `natural_collected_b2` | 107 | sentiment 107 | human_collected | conversational | CMC-07134–CMC-07240 |
|
| 24 |
+
| `natural_upload` | 125 | sentiment 125 | human_collected | conversational | CMC-07241–CMC-07365 |
|
| 25 |
+
| `set8_abuse` | 42 | abuse_detection 42 | template_generated | conversational | CMC-08042–CMC-08186 |
|
| 26 |
+
|
| 27 |
+
The id ranges overlap because IDs were assigned per batch across versions. 782 IDs between CMC-00001 and CMC-08384 are not used (they were retired in earlier versions).
|
| 28 |
+
|
| 29 |
+
## Template-generated records (public)
|
| 30 |
+
|
| 31 |
+
The design visible in the metadata is as follows:
|
| 32 |
+
- **Propositions** (`proposition`): a claim core about a domain (11 domains: Civic/Local, Cricket, Economy, Education, Entertainment, Environment, Festivals/Culture, General Knowledge, Health, Policy/Governance, Technology). Entities are a mix of real Tamil Nadu districts and festivals, generic categories ("a local engineering college"), and **fictional** organisations, apps, films and sports teams. Some are marked "(fictional league)" in the text itself.
|
| 33 |
+
- **Framing** (`frame_family`): forwarded message, official attribution, personal hearsay, general report. Unparsed frames are tagged `unparsed`.
|
| 34 |
+
- **Surface form**: `post_format` (27 formats, for example `caption_hashtag`, `group_chat`, `reply_skeptical`, `meme_reaction`), `tone`, hashtags, emoji, `@` placeholders, and multi-line posts.
|
| 35 |
+
- **Noise** (`noise_level`, set4 / set9 / set10 only): none, light, medium or heavy typing noise, such as vowel drops ("cnfirm", "sllunga"), casing changes and punctuation runs.
|
| 36 |
+
- **Labels** come from the generator, together with a templated `evidence_explanation`.
|
| 37 |
+
- `set11_general_knowledge` contains statements of general knowledge, explained against "established general knowledge".
|
| 38 |
+
- The sentiment and abuse rows in `set9_expansion` / `set10_expansion` / `set8_abuse` are short conversational comments with emoji and typo variants. Seven of them closely resemble human-collected comments and are not released (audit G06).
|
| 39 |
+
|
| 40 |
+
The dataset author wrote the templates and entity pools himself, using Claude and ChatGPT as writing helpers. The generation scripts, entity-pool versions and batch dates are not part of this release.
|
| 41 |
+
|
| 42 |
+
## Curated records (`test_curated`, released)
|
| 43 |
+
|
| 44 |
+
- `tang_pdf_facts` (50): science and health facts (antibiotics, vaccines, Earth/Moon/Sun, boiling point), written as Tanglish statements. The batch name suggests a reference PDF as the source. **The PDF is not identified in the CSV.**
|
| 45 |
+
- `v1_1_claim_batch` (294): 144 health/lifestyle claims and 150 hearsay/rumour claims. `source_detail = news_sourced_and_llm_assisted`. **No article references are stored.**
|
| 46 |
+
- The dataset author selected these claims himself and rephrased them in his own Tanglish wording where needed. The texts are short generic claims, not article sentences (see `data_provenance.md`).
|
| 47 |
+
|
| 48 |
+
## Human-collected records (not released)
|
| 49 |
+
|
| 50 |
+
- 341 comments in four batches. The dataset author states that they were collected manually from **public Instagram posts**.
|
| 51 |
+
- The CSV stores **no** post URLs, account names, capture dates, or record of consent or permission.
|
| 52 |
+
- It is not recorded whether each comment was copied verbatim or re-typed/paraphrased. The batch name `clean_paste_social` suggests verbatim copies. These comments are not part of the release.
|
| 53 |
+
- 15 comments end in `?`/`??` runs that may be emoji lost in an encoding step.
|
docs/data_provenance.md
ADDED
|
@@ -0,0 +1,40 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
# Data provenance: CodeMixCheck v2.2.1
|
| 2 |
+
|
| 3 |
+
## Provenance classes
|
| 4 |
+
|
| 5 |
+
| `provenance_class` | meaning | rows in v2.2.1 project corpus | in this release |
|
| 6 |
+
|---|---|---|---|
|
| 7 |
+
| `template_generated` | produced by the dataset author's template pipeline; templates and entity pools written by the author with Claude / ChatGPT as writing helpers (tool not recorded per row) | 6,917 | 6,910 (7 held back, see G06) |
|
| 8 |
+
| `llm_assisted_human_curated` | claims selected by the author from news and reference material and rephrased in his own Tanglish wording, with LLM help | 344 | 344 |
|
| 9 |
+
| `social_media_derived_third_party_human_authored` | comments written by third parties on public Instagram posts and collected manually | 341 | 0 (not released) |
|
| 10 |
+
|
| 11 |
+
How these map to common provenance categories:
|
| 12 |
+
|
| 13 |
+
| category | in this release? | where |
|
| 14 |
+
|---|---|---|
|
| 15 |
+
| original human-authored third-party content | no | not released |
|
| 16 |
+
| human-paraphrased content | yes | `test_curated`: author-rephrased claims |
|
| 17 |
+
| AI-assisted content | yes. LLM help went into templates and curated claims, but this is not separable per row | all configs |
|
| 18 |
+
| template-generated content | yes | train / validation / test_synthetic, sentiment, abuse |
|
| 19 |
+
| news- / reference-derived content | yes, as paraphrased claims (no article text) | `test_curated` |
|
| 20 |
+
| social-media-derived content | no | not released |
|
| 21 |
+
|
| 22 |
+
## Attestation
|
| 23 |
+
|
| 24 |
+
The dataset author (Prajjit Basu) states that:
|
| 25 |
+
- he created the templates, entity pools and generated records himself, using Claude and ChatGPT as writing helpers;
|
| 26 |
+
- no text was copied from articles, websites or other datasets;
|
| 27 |
+
- the `@` handles in synthetic text are invented placeholders;
|
| 28 |
+
- he selected the 344 curated claims himself and rephrased them in his own wording where needed.
|
| 29 |
+
|
| 30 |
+
A release audit supports the curated-claim statement: no curated row contains more than 8 consecutive common-English words, and the texts read as short generic claims rather than article sentences.
|
| 31 |
+
|
| 32 |
+
## Missing provenance (not filled in)
|
| 33 |
+
|
| 34 |
+
- `source_reference = not_recorded` for curated rows. The specific articles and the reference document behind `tang_pdf_facts` were not recorded. **No URLs, publishers, dates or citations have been invented.**
|
| 35 |
+
- `generator = not_recorded`. Which assistant helped with which batch was not logged.
|
| 36 |
+
- 782 IDs were retired before v2.1, and no per-row reasons survive.
|
| 37 |
+
|
| 38 |
+
## Licence and scope
|
| 39 |
+
|
| 40 |
+
Released under **CC BY-NC 4.0** by the dataset author. The licence covers the records in this repository only. The 341 Instagram comments used in the project are third-party content. They are not redistributed and not covered by this licence.
|
docs/ethical_considerations.md
ADDED
|
@@ -0,0 +1,31 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
# Ethical considerations: CodeMixCheck v2.2.1
|
| 2 |
+
|
| 3 |
+
## Synthetic misinformation about real places
|
| 4 |
+
|
| 5 |
+
Synthetic claims combine **real** Tamil Nadu districts, cities, festivals and institution types with **fictional** events, for example a parasite found in a named city's tap water, a festival "cancelled", or a "scheme" discontinued. A label such as `False` or `True` describes the *simulated* world. Risks:
|
| 6 |
+
|
| 7 |
+
- A record taken out of context could circulate as real (mis)information.
|
| 8 |
+
- A model trained on the data could associate real place names with fabricated events.
|
| 9 |
+
|
| 10 |
+
Mitigations: the dataset card states prominently that labels are simulated, and lists real-world fact-checking and statements about real entities as out-of-scope uses. Do not quote individual records out of context.
|
| 11 |
+
|
| 12 |
+
## Privacy
|
| 13 |
+
|
| 14 |
+
- **Public files:** the automated screen found no URLs, e-mail addresses or phone numbers. The `@` handles in the text are 11 template placeholders (for example `@someone`, `@localnews_tn`, `@amma` and typo variants). Generic placeholders like these could coincide with real accounts. They do not refer to anyone.
|
| 15 |
+
- **Unreleased social-media comments:** these are personal expression by third parties. Some address or name individuals (first names or initials), and two contain strong profanity. They are not included in this release.
|
| 16 |
+
|
| 17 |
+
## Offensive content
|
| 18 |
+
|
| 19 |
+
`abuse_detection` contains Tanglish insults and slurs, some masked with emoji (🖕). Some `sentiment` rows are hostile. The content is short and synthetic, but readers may find it offensive.
|
| 20 |
+
|
| 21 |
+
## Representation
|
| 22 |
+
|
| 23 |
+
The generator encodes one author's view of how misinformation, hearsay and sentiment are expressed in Tanglish. Sentiment and abuse conventions (for example, "poda dei" read as playful) are culturally situated and can be contested.
|
| 24 |
+
|
| 25 |
+
## Dual use
|
| 26 |
+
|
| 27 |
+
A corpus of realistic code-mixed misinformation templates could help someone generate convincing rumours. The data is low in uplift (short, templated and clearly labelled), but users must not train generators to produce realistic misinformation (see the out-of-scope uses in the dataset card).
|
| 28 |
+
|
| 29 |
+
## Annotator welfare and compensation
|
| 30 |
+
|
| 31 |
+
All labelling was done by the dataset author. No crowdworkers were involved.
|
docs/limitations.md
ADDED
|
@@ -0,0 +1,17 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
# Known limitations: CodeMixCheck v2.2.1
|
| 2 |
+
|
| 3 |
+
1. **Mostly synthetic.** 6,910 of the 7,254 released rows are template-generated. Their labels are correct *by construction* within a simulated world, and no human checked them row by row. They are not real-world fact-checks.
|
| 4 |
+
2. **No evidence corpus.** `evidence_explanation` states the (simulated) evidence in one sentence. A RAG system cannot retrieve it from anywhere.
|
| 5 |
+
3. **Semantic overlap across splits** (release audit, no rows removed):
|
| 6 |
+
- fact_verification: 84 claim cores (228 rows) recur across splits under different framing (D01). There are 73 near-duplicate cross-split pairs at fuzz.ratio ≥ 90, mostly template siblings with a different entity.
|
| 7 |
+
- sentiment (synthetic): 36 train/validation near-duplicate pairs.
|
| 8 |
+
- abuse_detection: 57 cross-split near-duplicate pairs (train, validation and test are typo/emoji variants of a small set of base comments).
|
| 9 |
+
- Implication: synthetic validation/test scores overestimate generalisation. Use the strict filter (587 of 661 `test_synthetic` rows) and `test_curated`.
|
| 10 |
+
4. **Generator artefacts.** Emoji, hashtags, typo patterns and frame templates repeat. Models may pick up surface cues. Rows with an `unparsed` frame are mostly `True` (589 of 845).
|
| 11 |
+
5. **Small auxiliary tasks.** Public sentiment has 128 rows (train 98 / validation 30, **no test split**; the human-collected test set is not released). Abuse has 122 rows (67 / 27 / 28). Neither is representative of naturally occurring sentiment or abuse.
|
| 12 |
+
6. **Curated test label skew.** Hearsay is 100% `Unverifiable` and health/lifestyle is 90% `True`. Across `test_curated` there are only 30 `False` and 15 `Partially True` rows. Report results per `eval_subset`.
|
| 13 |
+
7. **Missing explanations.** 129 curated rows have no `evidence_explanation` after the v2.2.1 relabel.
|
| 14 |
+
8. **No source references** for curated claims (paraphrased; sources not recorded).
|
| 15 |
+
9. **Incomplete version history.** 782 retired IDs have no recorded reason.
|
| 16 |
+
10. **Narrow coverage.** The data is Tamil Nadu-centric, and Romanisation follows one set of conventions. Sri Lankan, Malaysian, Singaporean and diaspora Tamil are not represented.
|
| 17 |
+
11. **Single annotator.** There is no inter-annotator agreement study.
|
docs/methodology.md
ADDED
|
@@ -0,0 +1,38 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
# Methodology: CodeMixCheck v2.2.1
|
| 2 |
+
|
| 3 |
+
## Task design
|
| 4 |
+
|
| 5 |
+
CodeMixCheck treats fact verification as **claim-level veracity classification with an explicit evidence state**. Each synthetic claim (`proposition`) is assigned a veracity state in a simulated world, and is then rendered through different frames, post formats and levels of noise. This separates:
|
| 6 |
+
|
| 7 |
+
- *what* is claimed (the proposition, with its veracity),
|
| 8 |
+
- *how* it is framed (forwarded message / official attribution / hearsay / report),
|
| 9 |
+
- *how noisy* the surface text is.
|
| 10 |
+
|
| 11 |
+
All four labels occur under every frame family. This is intended to stop a classifier from equating hearsay framing with falsehood.
|
| 12 |
+
|
| 13 |
+
`evidence_explanation` is a short justification (mostly templated) that states the simulated evidence. **No retrievable evidence corpus is included.** RAG experiments therefore need an external or separately built evidence store, and that store must stay consistent with the simulated world.
|
| 14 |
+
|
| 15 |
+
## AI-assisted generation
|
| 16 |
+
|
| 17 |
+
| component | what is recorded | what is not recorded |
|
| 18 |
+
|---|---|---|
|
| 19 |
+
| template rows | `provenance = template_generated`, batch, frame, format, noise | the generating script, model or chat assistant used to write templates/entity pools, prompts, dates |
|
| 20 |
+
| curated rows | `human_curated_llm_assisted`, `news_sourced_and_llm_assisted` | which LLM, which prompts, which sources, how much text the LLM wrote versus the author |
|
| 21 |
+
| silver sentiment | `model_annotated_v1.3` | the model behind "v1.3" |
|
| 22 |
+
|
| 23 |
+
The project used Claude and ChatGPT during dataset construction. Because no per-row or per-batch attribution was stored, this release labels the generator `not_recorded` rather than assigning a model to any record.
|
| 24 |
+
|
| 25 |
+
## Splitting
|
| 26 |
+
|
| 27 |
+
- Fact verification: train 5,337 / validation 662 / synthetic test 661 / curated test 344. The synthetic splits are drawn from the same generator. The curated test is held out by origin.
|
| 28 |
+
- Splits are grouped by `content_group` and `template_group`. Neither spans two splits.
|
| 29 |
+
- v2.1 removed template-family leakage by moving 22 rows.
|
| 30 |
+
- The curated test carries `cv_fold` (0–4; folds of 69/69/69/69/68 rows) for cross-validated evaluation.
|
| 31 |
+
|
| 32 |
+
## Recommended evaluation protocol
|
| 33 |
+
|
| 34 |
+
1. Report macro-F1 and per-class F1 separately for `test_synthetic` and (when available) `test_curated`.
|
| 35 |
+
2. For `test_curated`, also report results per `eval_subset`, because the label distributions differ sharply (hearsay = 100% Unverifiable; health/lifestyle = 90% True).
|
| 36 |
+
3. Report a *strict* `test_synthetic` score that excludes rows flagged D01/D02 (cross-split same-claim or near-duplicate rows).
|
| 37 |
+
4. Do not tune on `test_*`. Sentiment and abuse have very small validation sets, so expect high variance and report confidence intervals.
|
| 38 |
+
5. Do not train on `silver_unverified` and then describe the result as trained on gold.
|
examples/sample_records.json
ADDED
|
Binary file (27.2 kB). View file
|
|
|
scripts/dataset_statistics.py
ADDED
|
@@ -0,0 +1,179 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
#!/usr/bin/env python3
|
| 2 |
+
"""Compute CodeMixCheck statistics directly from the released Parquet files.
|
| 3 |
+
|
| 4 |
+
python scripts/dataset_statistics.py # print markdown
|
| 5 |
+
python scripts/dataset_statistics.py --json stats.json
|
| 6 |
+
python scripts/dataset_statistics.py --data-dir path/to/other/parquet/root
|
| 7 |
+
|
| 8 |
+
Every number in README.md's statistics block is produced by `render_markdown()`
|
| 9 |
+
in this file; scripts/validate_dataset.py re-runs it and checks that the README
|
| 10 |
+
matches byte for byte.
|
| 11 |
+
|
| 12 |
+
Dependencies: pandas, pyarrow. Optional: wordfreq (heuristic English-lexicon share).
|
| 13 |
+
"""
|
| 14 |
+
from __future__ import annotations
|
| 15 |
+
|
| 16 |
+
import argparse
|
| 17 |
+
import json
|
| 18 |
+
import re
|
| 19 |
+
import unicodedata
|
| 20 |
+
from pathlib import Path
|
| 21 |
+
|
| 22 |
+
import pandas as pd
|
| 23 |
+
|
| 24 |
+
ROOT = Path(__file__).resolve().parents[1]
|
| 25 |
+
CONFIGS = ["fact_verification", "sentiment", "abuse_detection"]
|
| 26 |
+
SPLIT_ORDER = ["train", "validation", "test_synthetic", "test_curated", "test_human", "silver_unverified"]
|
| 27 |
+
TAMIL = "-"
|
| 28 |
+
TOKEN_RE = re.compile(f"[A-Za-z{TAMIL}]+")
|
| 29 |
+
TAMIL_RE = re.compile(f"[{TAMIL}]")
|
| 30 |
+
LATIN_RE = re.compile(r"[A-Za-z]")
|
| 31 |
+
EMOJI_RE = re.compile("[\U0001F000-\U0001FAFF☀-➿⬀-⯿️←-⇿⌀-⏿]")
|
| 32 |
+
|
| 33 |
+
|
| 34 |
+
def normalize(text: str) -> str:
|
| 35 |
+
t = unicodedata.normalize("NFC", text).casefold()
|
| 36 |
+
t = EMOJI_RE.sub(" ", t)
|
| 37 |
+
t = re.sub(f"[^a-z0-9{TAMIL}]+", " ", t)
|
| 38 |
+
return re.sub(r"\s+", " ", t).strip()
|
| 39 |
+
|
| 40 |
+
|
| 41 |
+
def load(data_dir: Path) -> dict[str, pd.DataFrame]:
|
| 42 |
+
out = {}
|
| 43 |
+
for cfg in CONFIGS:
|
| 44 |
+
files = sorted((data_dir / cfg).glob("*.parquet"))
|
| 45 |
+
if files:
|
| 46 |
+
out[cfg] = pd.concat([pd.read_parquet(f).assign(_file=f.stem) for f in files], ignore_index=True)
|
| 47 |
+
return out
|
| 48 |
+
|
| 49 |
+
|
| 50 |
+
def _tbl(df: pd.DataFrame) -> str:
|
| 51 |
+
cols = [str(c) for c in df.columns]
|
| 52 |
+
lines = ["| " + " | ".join(cols) + " |", "|" + "|".join(["---"] * len(cols)) + "|"]
|
| 53 |
+
for row in df.itertuples(index=False):
|
| 54 |
+
lines.append("| " + " | ".join(str(v) for v in row) + " |")
|
| 55 |
+
return "\n".join(lines)
|
| 56 |
+
|
| 57 |
+
|
| 58 |
+
def _xtab(df, row, col="_file"):
|
| 59 |
+
t = pd.crosstab(df[row].fillna("(null)"), df[col], margins=True, margins_name="total")
|
| 60 |
+
order = [c for c in SPLIT_ORDER if c in t.columns] + ["total"]
|
| 61 |
+
t = t[order].reset_index().rename(columns={row: row})
|
| 62 |
+
return t
|
| 63 |
+
|
| 64 |
+
|
| 65 |
+
def compute(data: dict[str, pd.DataFrame], with_lexicon: bool = True) -> dict:
|
| 66 |
+
zipf = None
|
| 67 |
+
if with_lexicon:
|
| 68 |
+
try:
|
| 69 |
+
from wordfreq import zipf_frequency as zipf # noqa: F401
|
| 70 |
+
except ImportError:
|
| 71 |
+
zipf = None
|
| 72 |
+
stats = {}
|
| 73 |
+
for cfg, df in data.items():
|
| 74 |
+
s = {}
|
| 75 |
+
s["rows"] = int(len(df))
|
| 76 |
+
s["split_counts"] = {k: int(v) for k, v in df._file.value_counts().items()}
|
| 77 |
+
s["label_by_split"] = _xtab(df, "label").to_dict("records")
|
| 78 |
+
s["provenance_by_split"] = _xtab(df, "provenance_class").to_dict("records")
|
| 79 |
+
s["label_origin_by_split"] = _xtab(df, "label_origin").to_dict("records")
|
| 80 |
+
s["human_validated_by_split"] = _xtab(df, "human_validated").to_dict("records")
|
| 81 |
+
s["label_status_by_split"] = _xtab(df, "label_status").to_dict("records")
|
| 82 |
+
s["script_by_split"] = _xtab(df, "script").to_dict("records")
|
| 83 |
+
r = df.tamil_script_token_ratio.astype(float)
|
| 84 |
+
ntok = df.text.map(lambda t: len(TOKEN_RE.findall(t)))
|
| 85 |
+
s["code_mixing"] = {
|
| 86 |
+
"mean_tokens_per_text": round(float(ntok.mean()), 2),
|
| 87 |
+
"median_tokens_per_text": float(ntok.median()),
|
| 88 |
+
"tamil_script_token_ratio_mean": round(float(r.mean()), 4),
|
| 89 |
+
"tamil_script_token_ratio_mean_over_texts_with_tamil": round(float(r[r > 0].mean()), 4) if (r > 0).any() else "n/a (no Tamil-script tokens)",
|
| 90 |
+
"pct_texts_with_any_tamil_script": round(100 * float((r > 0).mean()), 2),
|
| 91 |
+
"pct_texts_roman_only": round(100 * float((r == 0).mean()), 2),
|
| 92 |
+
"pct_texts_tamil_script_only": round(100 * float((r == 1).mean()), 2),
|
| 93 |
+
"pct_texts_with_emoji": round(100 * float(df.text.str.contains(EMOJI_RE).mean()), 2),
|
| 94 |
+
"pct_texts_with_hashtag": round(100 * float(df.text.str.contains(r"#\w").mean()), 2),
|
| 95 |
+
}
|
| 96 |
+
if zipf is not None:
|
| 97 |
+
from functools import lru_cache
|
| 98 |
+
z = lru_cache(maxsize=None)(zipf)
|
| 99 |
+
stop = {"la", "nu", "da", "ah", "um", "ku", "na", "vera", "illa", "dha", "dhaan", "than", "ra",
|
| 100 |
+
"raa", "ma", "mo", "po", "pa", "ya", "eh", "oh", "ne", "nee", "naa", "naan", "un", "en",
|
| 101 |
+
"ena", "enna", "idhu", "adhu", "aana", "ana", "seri", "sema", "semma", "dei", "poda",
|
| 102 |
+
"machi", "macha", "bro", "broo", "pola", "kooda", "mattum", "thaan", "va", "vaa", "ok",
|
| 103 |
+
"okay", "apo", "ipo", "ippo", "appo", "inga", "anga", "oru", "rendu", "moonu", "mela",
|
| 104 |
+
"kela", "pathi", "paathi", "iru", "irukku", "pannu", "pannunga", "sollu", "sollunga",
|
| 105 |
+
"tha", "the", "of", "a"}
|
| 106 |
+
|
| 107 |
+
def share(t):
|
| 108 |
+
rom = [x.lower() for x in TOKEN_RE.findall(t) if LATIN_RE.search(x)]
|
| 109 |
+
if not rom:
|
| 110 |
+
return None
|
| 111 |
+
return sum(len(x) >= 3 and x not in stop and z(x, "en") >= 3.5 for x in rom) / len(rom)
|
| 112 |
+
|
| 113 |
+
sh = df.text.map(share).dropna()
|
| 114 |
+
s["code_mixing"]["heuristic_english_lexicon_share_of_roman_tokens_mean"] = round(float(sh.mean()), 4)
|
| 115 |
+
# missing values (% null) over all columns
|
| 116 |
+
miss = (df.drop(columns=["_file"]).isna().mean() * 100).round(2)
|
| 117 |
+
s["missing_pct"] = {k: float(v) for k, v in miss.items() if v > 0}
|
| 118 |
+
# duplicates
|
| 119 |
+
norm = df.text.map(normalize)
|
| 120 |
+
s["duplicates"] = {
|
| 121 |
+
"duplicate_ids": int(df.id.duplicated().sum()),
|
| 122 |
+
"exact_duplicate_texts": int(df.text.duplicated().sum()),
|
| 123 |
+
"normalised_duplicate_texts": int(norm.duplicated().sum()),
|
| 124 |
+
"normalised_text_shared_across_splits": int((pd.DataFrame({"n": norm, "f": df._file})
|
| 125 |
+
.groupby("n").f.nunique() > 1).sum()),
|
| 126 |
+
"rows_flagged_near_duplicate_C04": int(df.audit_flags.map(lambda x: "C04" in x).sum()),
|
| 127 |
+
"rows_flagged_cross_split_near_duplicate_D02": int(df.audit_flags.map(lambda x: "D02" in x).sum()),
|
| 128 |
+
"rows_flagged_cross_split_proposition_D01": int(df.audit_flags.map(lambda x: "D01" in x).sum()),
|
| 129 |
+
"is_content_duplicate_true": int(df.is_content_duplicate.sum()),
|
| 130 |
+
}
|
| 131 |
+
if "eval_subset" in df and df.eval_subset.notna().any():
|
| 132 |
+
s["eval_subset_by_label"] = pd.crosstab(df.eval_subset.fillna("(none)"), df.label).reset_index().to_dict("records")
|
| 133 |
+
stats[cfg] = s
|
| 134 |
+
return stats
|
| 135 |
+
|
| 136 |
+
|
| 137 |
+
def render_markdown(data: dict[str, pd.DataFrame], with_lexicon: bool = True) -> str:
|
| 138 |
+
st = compute(data, with_lexicon)
|
| 139 |
+
out = []
|
| 140 |
+
tot = sum(v["rows"] for v in st.values())
|
| 141 |
+
out.append(f"Total records in these files: **{tot}**.\n")
|
| 142 |
+
for cfg, s in st.items():
|
| 143 |
+
out.append(f"#### `{cfg}` ({s['rows']} records)\n")
|
| 144 |
+
df = data[cfg]
|
| 145 |
+
out.append("Label distribution by split:\n")
|
| 146 |
+
out.append(_tbl(_xtab(df, "label")) + "\n")
|
| 147 |
+
out.append("Provenance class by split:\n")
|
| 148 |
+
out.append(_tbl(_xtab(df, "provenance_class")) + "\n")
|
| 149 |
+
out.append("Label origin / human-validation status by split:\n")
|
| 150 |
+
out.append(_tbl(_xtab(df, "label_origin")) + "\n")
|
| 151 |
+
out.append(_tbl(_xtab(df, "human_validated")) + "\n")
|
| 152 |
+
out.append("Script by split:\n")
|
| 153 |
+
out.append(_tbl(_xtab(df, "script")) + "\n")
|
| 154 |
+
cm = s["code_mixing"]
|
| 155 |
+
out.append("Code-mixing / script statistics:\n")
|
| 156 |
+
out.append(_tbl(pd.DataFrame([{"statistic": k, "value": v} for k, v in cm.items()])) + "\n")
|
| 157 |
+
out.append("Duplicate statistics:\n")
|
| 158 |
+
out.append(_tbl(pd.DataFrame([{"check": k, "count": v} for k, v in s["duplicates"].items()])) + "\n")
|
| 159 |
+
out.append("Columns with missing values (% null):\n")
|
| 160 |
+
mp = s["missing_pct"]
|
| 161 |
+
out.append((_tbl(pd.DataFrame([{"column": k, "pct_null": v} for k, v in sorted(mp.items())]))
|
| 162 |
+
if mp else "none") + "\n")
|
| 163 |
+
return "\n".join(out).rstrip() + "\n"
|
| 164 |
+
|
| 165 |
+
|
| 166 |
+
def main():
|
| 167 |
+
ap = argparse.ArgumentParser()
|
| 168 |
+
ap.add_argument("--data-dir", default=str(ROOT / "data"))
|
| 169 |
+
ap.add_argument("--json")
|
| 170 |
+
ap.add_argument("--no-lexicon", action="store_true")
|
| 171 |
+
a = ap.parse_args()
|
| 172 |
+
data = load(Path(a.data_dir))
|
| 173 |
+
if a.json:
|
| 174 |
+
Path(a.json).write_text(json.dumps(compute(data, not a.no_lexicon), indent=1, default=str))
|
| 175 |
+
print(render_markdown(data, not a.no_lexicon))
|
| 176 |
+
|
| 177 |
+
|
| 178 |
+
if __name__ == "__main__":
|
| 179 |
+
main()
|
scripts/load_dataset.py
ADDED
|
@@ -0,0 +1,65 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
#!/usr/bin/env python3
|
| 2 |
+
"""Loading examples for CodeMixCheck with the Hugging Face `datasets` library.
|
| 3 |
+
|
| 4 |
+
python scripts/load_dataset.py # load from this local folder
|
| 5 |
+
python scripts/load_dataset.py --repo <user>/CodeMixCheck # load from the Hub (after upload)
|
| 6 |
+
|
| 7 |
+
For a private or gated Hub repo, log in first (`huggingface-cli login`) and accept
|
| 8 |
+
the access conditions on the dataset page.
|
| 9 |
+
"""
|
| 10 |
+
from __future__ import annotations
|
| 11 |
+
|
| 12 |
+
import argparse
|
| 13 |
+
from collections import Counter
|
| 14 |
+
from pathlib import Path
|
| 15 |
+
|
| 16 |
+
from datasets import load_dataset
|
| 17 |
+
|
| 18 |
+
LOCAL = str(Path(__file__).resolve().parents[1])
|
| 19 |
+
|
| 20 |
+
|
| 21 |
+
def main():
|
| 22 |
+
ap = argparse.ArgumentParser()
|
| 23 |
+
ap.add_argument("--repo", default=LOCAL, help="Hub repo id or local path (default: this folder)")
|
| 24 |
+
repo = ap.parse_args().repo
|
| 25 |
+
|
| 26 |
+
# 1. Load each configuration (all splits)
|
| 27 |
+
fv = load_dataset(repo, "fact_verification")
|
| 28 |
+
sent = load_dataset(repo, "sentiment")
|
| 29 |
+
abuse = load_dataset(repo, "abuse_detection")
|
| 30 |
+
for name, ds in [("fact_verification", fv), ("sentiment", sent), ("abuse_detection", abuse)]:
|
| 31 |
+
print(name, {k: v.num_rows for k, v in ds.items()})
|
| 32 |
+
|
| 33 |
+
# 2. Load an individual split
|
| 34 |
+
train = load_dataset(repo, "fact_verification", split="train")
|
| 35 |
+
print("fact_verification/train:", train.num_rows, "rows")
|
| 36 |
+
|
| 37 |
+
# 3. Access records
|
| 38 |
+
rec = train[0]
|
| 39 |
+
print({k: rec[k] for k in ("id", "text", "label", "label_3way", "evidence_explanation", "provenance_class")})
|
| 40 |
+
|
| 41 |
+
# 4. Inspect labels
|
| 42 |
+
print("train labels:", Counter(train["label"]))
|
| 43 |
+
print("label origins:", Counter(train["label_origin"]))
|
| 44 |
+
|
| 45 |
+
# 5. Synthetic test vs curated test (never merge them when reporting results)
|
| 46 |
+
test_syn = load_dataset(repo, "fact_verification", split="test_synthetic")
|
| 47 |
+
print("test_synthetic:", test_syn.num_rows)
|
| 48 |
+
if "test_curated" in fv:
|
| 49 |
+
cur = fv["test_curated"]
|
| 50 |
+
for subset in sorted(set(cur["eval_subset"])):
|
| 51 |
+
part = cur.filter(lambda r, s=subset: r["eval_subset"] == s)
|
| 52 |
+
print("test_curated /", subset, part.num_rows, Counter(part["label"]))
|
| 53 |
+
else:
|
| 54 |
+
print("test_curated is not available in this copy.")
|
| 55 |
+
|
| 56 |
+
# 6. Optional: drop rows flagged for cross-split overlap to get a stricter evaluation
|
| 57 |
+
strict = test_syn.filter(lambda r: not ({"D01", "D02"} & set(r["audit_flags"])))
|
| 58 |
+
print("test_synthetic without cross-split near-duplicate / same-claim rows:", strict.num_rows)
|
| 59 |
+
|
| 60 |
+
# 7. Reproduce the statistics in README.md
|
| 61 |
+
# python scripts/dataset_statistics.py
|
| 62 |
+
|
| 63 |
+
|
| 64 |
+
if __name__ == "__main__":
|
| 65 |
+
main()
|
scripts/validate_dataset.py
ADDED
|
@@ -0,0 +1,208 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
#!/usr/bin/env python3
|
| 2 |
+
"""Validate the CodeMixCheck release folder.
|
| 3 |
+
|
| 4 |
+
python scripts/validate_dataset.py # checks the public repo
|
| 5 |
+
python scripts/validate_dataset.py --hf # also load every config with `datasets`
|
| 6 |
+
python scripts/validate_dataset.py --report out.md
|
| 7 |
+
|
| 8 |
+
Exit code 0 = every check PASSed (WARN does not fail the run).
|
| 9 |
+
Checks: file integrity (sha256 vs data_manifest.json), row counts, column schema,
|
| 10 |
+
label vocabularies, split validity, provenance completeness, duplicates,
|
| 11 |
+
missing required values, private-data screen, README statistics block,
|
| 12 |
+
CITATION.cff metadata and (optionally) Hugging Face loading.
|
| 13 |
+
"""
|
| 14 |
+
from __future__ import annotations
|
| 15 |
+
|
| 16 |
+
import argparse
|
| 17 |
+
import hashlib
|
| 18 |
+
import json
|
| 19 |
+
import re
|
| 20 |
+
import sys
|
| 21 |
+
from pathlib import Path
|
| 22 |
+
|
| 23 |
+
import pandas as pd
|
| 24 |
+
import pyarrow.parquet as pq
|
| 25 |
+
|
| 26 |
+
ROOT = Path(__file__).resolve().parents[1]
|
| 27 |
+
sys.path.insert(0, str(ROOT / "scripts"))
|
| 28 |
+
from dataset_statistics import load, normalize, render_markdown # noqa: E402
|
| 29 |
+
|
| 30 |
+
VERSION = "2.2.1"
|
| 31 |
+
LABELS = {
|
| 32 |
+
"fact_verification": {"True", "False", "Partially True", "Unverifiable"},
|
| 33 |
+
"sentiment": {"positive", "negative", "neutral"},
|
| 34 |
+
"abuse_detection": {"abusive", "not_abusive"},
|
| 35 |
+
}
|
| 36 |
+
LABEL_3WAY = {"True": "SUPPORTED", "False": "REFUTED", "Unverifiable": "NOT_ENOUGH_INFO", "Partially True": None}
|
| 37 |
+
SPLITS = {
|
| 38 |
+
"fact_verification": {"train", "validation", "test_synthetic", "test_curated"},
|
| 39 |
+
"sentiment": {"train", "validation", "test_human", "silver_unverified"},
|
| 40 |
+
"abuse_detection": {"train", "validation", "test_synthetic"},
|
| 41 |
+
}
|
| 42 |
+
COMMON = ["id", "text", "label", "hf_split", "split_v2_2_1", "eval_subset", "cv_fold", "label_status",
|
| 43 |
+
"label_origin", "human_validated", "label_source", "review_flag", "annotation_note", "content_flag",
|
| 44 |
+
"domain", "register", "tone", "post_format", "noise_level", "script", "tamil_script_token_ratio",
|
| 45 |
+
"provenance", "provenance_class", "data_origin", "source_detail", "source_reference", "generator",
|
| 46 |
+
"generation_batch", "release_tier", "template_group", "content_group", "is_content_duplicate",
|
| 47 |
+
"change_v2_1", "change_v2_2", "change_v2_2_1", "audit_flags", "task"]
|
| 48 |
+
SPECIFIC = {"fact_verification": ["label_3way", "evidence_explanation", "proposition", "frame_family"],
|
| 49 |
+
"sentiment": ["abuse_label", "sentiment_label_suggested"],
|
| 50 |
+
"abuse_detection": ["sentiment_label"]}
|
| 51 |
+
REQUIRED_NON_NULL = ["id", "text", "label", "hf_split", "label_status", "label_origin", "human_validated",
|
| 52 |
+
"script", "provenance", "provenance_class", "release_tier", "content_group", "task"]
|
| 53 |
+
PLACEHOLDER_HANDLES = {"@someone", "@ourvillage_updates", "@localnews_tn", "@classmates_group",
|
| 54 |
+
"@my_friend_circle", "@somone", "@amma", "@smeone", "@office_gang", "@somene", "@SOMEONE"}
|
| 55 |
+
|
| 56 |
+
results: list[tuple[str, str, str]] = []
|
| 57 |
+
|
| 58 |
+
|
| 59 |
+
def check(name: str, ok: bool, detail: str = "", warn: bool = False):
|
| 60 |
+
results.append((("PASS" if ok else ("WARN" if warn else "FAIL")), name, detail))
|
| 61 |
+
|
| 62 |
+
|
| 63 |
+
def main():
|
| 64 |
+
ap = argparse.ArgumentParser()
|
| 65 |
+
ap.add_argument("--root", default=str(ROOT))
|
| 66 |
+
ap.add_argument("--hf", action="store_true", help="also load each config with datasets.load_dataset")
|
| 67 |
+
ap.add_argument("--report")
|
| 68 |
+
ap.add_argument("--allow-withheld", action="store_true",
|
| 69 |
+
help="permit rows whose release_tier is not public (private/full builds only)")
|
| 70 |
+
a = ap.parse_args()
|
| 71 |
+
root = Path(a.root)
|
| 72 |
+
data_dir = root / "data"
|
| 73 |
+
|
| 74 |
+
# ---- manifest / integrity
|
| 75 |
+
man = json.loads((root / "data_manifest.json").read_text())
|
| 76 |
+
files = sorted(data_dir.rglob("*.parquet"))
|
| 77 |
+
listed = {m["path"] for m in man["files"]}
|
| 78 |
+
check("manifest lists exactly the parquet files present",
|
| 79 |
+
listed == {str(f.relative_to(root)) for f in files}, f"{len(files)} files")
|
| 80 |
+
for m in man["files"]:
|
| 81 |
+
p = root / m["path"]
|
| 82 |
+
try:
|
| 83 |
+
pf = pq.ParquetFile(p)
|
| 84 |
+
n = pf.metadata.num_rows
|
| 85 |
+
sha = hashlib.sha256(p.read_bytes()).hexdigest()
|
| 86 |
+
check(f"integrity {m['path']}", sha == m["sha256"], "sha256 match" if sha == m["sha256"] else "sha256 MISMATCH")
|
| 87 |
+
check(f"row count {m['path']}", n == m["rows"], f"{n} rows (manifest {m['rows']})")
|
| 88 |
+
except Exception as e: # noqa: BLE001
|
| 89 |
+
check(f"readable {m['path']}", False, repr(e))
|
| 90 |
+
|
| 91 |
+
data = load(data_dir)
|
| 92 |
+
all_ids, all_text = [], []
|
| 93 |
+
for cfg, df in data.items():
|
| 94 |
+
# ---- schema
|
| 95 |
+
expected = ["id", "text", "label"] + SPECIFIC[cfg] + COMMON[3:]
|
| 96 |
+
cols = [c for c in df.columns if c != "_file"]
|
| 97 |
+
check(f"{cfg}: column schema", cols == expected,
|
| 98 |
+
"ok" if cols == expected else f"missing={set(expected)-set(cols)} extra={set(cols)-set(expected)}")
|
| 99 |
+
types_ok = (str(df.cv_fold.dtype) in ("Int8", "float64", "int8")) and df.tamil_script_token_ratio.dtype.kind == "f" \
|
| 100 |
+
and df.is_content_duplicate.dtype == bool
|
| 101 |
+
check(f"{cfg}: column dtypes", types_ok, f"cv_fold={df.cv_fold.dtype}, ratio={df.tamil_script_token_ratio.dtype}")
|
| 102 |
+
# ---- labels
|
| 103 |
+
bad = df[~df.label.isin(LABELS[cfg])]
|
| 104 |
+
check(f"{cfg}: label vocabulary", bad.empty, f"{len(bad)} invalid")
|
| 105 |
+
check(f"{cfg}: task column", (df.task == cfg).all())
|
| 106 |
+
if cfg == "fact_verification":
|
| 107 |
+
exp3 = df.label.map(LABEL_3WAY)
|
| 108 |
+
ok3 = ((exp3.isna() & df.label_3way.isna()) | (exp3 == df.label_3way)).all()
|
| 109 |
+
check(f"{cfg}: label_3way consistent with label", bool(ok3))
|
| 110 |
+
# ---- splits
|
| 111 |
+
check(f"{cfg}: hf_split matches file name", (df.hf_split == df._file).all())
|
| 112 |
+
check(f"{cfg}: split names valid", set(df._file) <= SPLITS[cfg], str(sorted(set(df._file))))
|
| 113 |
+
syn_in_curated = df[(df._file.isin(["test_curated", "test_human"])) & (df.provenance == "template_generated")]
|
| 114 |
+
nonsyn_in_syn = df[(df._file.isin(["train", "validation", "test_synthetic"])) & (df.provenance != "template_generated")]
|
| 115 |
+
check(f"{cfg}: synthetic and curated/human evaluation subsets not mixed",
|
| 116 |
+
syn_in_curated.empty and nonsyn_in_syn.empty)
|
| 117 |
+
silver_ok = ((df._file == "silver_unverified") == (df.label_status == "silver")).all()
|
| 118 |
+
check(f"{cfg}: silver labels only in silver_unverified", bool(silver_ok))
|
| 119 |
+
if (df.label_status == "silver").any():
|
| 120 |
+
check(f"{cfg}: silver rows never marked human-validated",
|
| 121 |
+
not df[(df.label_status == "silver")].human_validated.isin(["user_labelled", "yes"]).any())
|
| 122 |
+
# ---- provenance / missing
|
| 123 |
+
nulls = {c: int(df[c].isna().sum()) for c in REQUIRED_NON_NULL}
|
| 124 |
+
check(f"{cfg}: required fields non-null", not any(nulls.values()), str({k: v for k, v in nulls.items() if v}))
|
| 125 |
+
check(f"{cfg}: provenance_class consistent with provenance",
|
| 126 |
+
(df.groupby("provenance").provenance_class.nunique() == 1).all())
|
| 127 |
+
if not a.allow_withheld:
|
| 128 |
+
wh = df[~df.release_tier.str.startswith("public")]
|
| 129 |
+
check(f"{cfg}: no withheld records in public files", wh.empty, f"{len(wh)} withheld rows")
|
| 130 |
+
# ---- private data screen
|
| 131 |
+
urls = df.text.str.contains(r"https?://|www\.", regex=True)
|
| 132 |
+
emails = df.text.str.contains(r"[\w.]+@[\w-]+\.[a-z]{2,}", regex=True)
|
| 133 |
+
phones = df.text.str.contains(r"\b\d{10}\b|\+91", regex=True)
|
| 134 |
+
check(f"{cfg}: no URLs / e-mails / phone numbers in text", not (urls | emails | phones).any(),
|
| 135 |
+
f"url={int(urls.sum())} email={int(emails.sum())} phone={int(phones.sum())}")
|
| 136 |
+
handles = {h for t in df.text for h in re.findall(r"@\w+", t)}
|
| 137 |
+
check(f"{cfg}: @handles limited to documented template placeholders", handles <= PLACEHOLDER_HANDLES,
|
| 138 |
+
f"unexpected={sorted(handles - PLACEHOLDER_HANDLES)}")
|
| 139 |
+
priv_cols = [c for c in df.columns if re.search(r"user(name)?_?handle|profile|url|email|phone", c)]
|
| 140 |
+
check(f"{cfg}: no private-metadata columns", not priv_cols, str(priv_cols))
|
| 141 |
+
# ---- duplicates (within config)
|
| 142 |
+
check(f"{cfg}: unique ids", not df.id.duplicated().any())
|
| 143 |
+
check(f"{cfg}: no exact duplicate texts", not df.text.duplicated().any())
|
| 144 |
+
norm = df.text.map(normalize)
|
| 145 |
+
xs = (pd.DataFrame({"n": norm, "f": df._file}).groupby("n").f.nunique() > 1).sum()
|
| 146 |
+
check(f"{cfg}: no normalised-identical text shared across splits", xs == 0, f"{xs} shared")
|
| 147 |
+
nd = int(df.audit_flags.map(lambda x: "D02" in x or "D01" in x).sum())
|
| 148 |
+
check(f"{cfg}: cross-split near-duplicate / same-claim rows are flagged (not removed)", True,
|
| 149 |
+
f"{nd} rows carry D01/D02 flags - see docs/limitations.md", warn=False)
|
| 150 |
+
all_ids += list(df.id)
|
| 151 |
+
all_text += list(df.text)
|
| 152 |
+
check("ids unique across all configs", len(all_ids) == len(set(all_ids)), f"{len(all_ids)} ids")
|
| 153 |
+
check("texts unique across all configs", len(all_text) == len(set(all_text)))
|
| 154 |
+
|
| 155 |
+
# ---- README stats block
|
| 156 |
+
readme = (root / "README.md").read_text()
|
| 157 |
+
m = re.search(r"<!-- STATS:BEGIN -->\n(.*?)<!-- STATS:END -->", readme, re.S)
|
| 158 |
+
if m:
|
| 159 |
+
fresh = render_markdown(data)
|
| 160 |
+
check("README statistics block matches files", m.group(1) == fresh,
|
| 161 |
+
"identical" if m.group(1) == fresh else "README stats are stale - re-run build")
|
| 162 |
+
else:
|
| 163 |
+
check("README statistics block present", False)
|
| 164 |
+
yaml_head = readme.split("---")[1]
|
| 165 |
+
for cfg in data:
|
| 166 |
+
for f in sorted((data_dir / cfg).glob("*.parquet")):
|
| 167 |
+
check(f"README configs reference data/{cfg}/{f.name}", f"data/{cfg}/{f.name}" in yaml_head)
|
| 168 |
+
check("README states version", VERSION in readme)
|
| 169 |
+
|
| 170 |
+
# ---- CITATION.cff
|
| 171 |
+
try:
|
| 172 |
+
import yaml # type: ignore
|
| 173 |
+
cff = yaml.safe_load((root / "CITATION.cff").read_text())
|
| 174 |
+
check("CITATION.cff parses", True)
|
| 175 |
+
check("CITATION.cff version", str(cff.get("version")) == VERSION, str(cff.get("version")))
|
| 176 |
+
check("CITATION.cff type=dataset", cff.get("type") == "dataset")
|
| 177 |
+
check("CITATION.cff has no DOI claimed", "doi" not in cff and "identifiers" not in cff, "", warn=True)
|
| 178 |
+
except Exception as e: # noqa: BLE001
|
| 179 |
+
check("CITATION.cff parses", False, repr(e))
|
| 180 |
+
|
| 181 |
+
# ---- HF loading
|
| 182 |
+
if a.hf:
|
| 183 |
+
try:
|
| 184 |
+
from datasets import load_dataset
|
| 185 |
+
for cfg in data:
|
| 186 |
+
ds = load_dataset(str(root), cfg)
|
| 187 |
+
exp = {k: int(v) for k, v in data[cfg]._file.value_counts().items()}
|
| 188 |
+
got = {k: len(v) for k, v in ds.items()}
|
| 189 |
+
check(f"datasets.load_dataset('{cfg}') split sizes", got == exp, str(got))
|
| 190 |
+
except Exception as e: # noqa: BLE001
|
| 191 |
+
check("datasets.load_dataset", False, repr(e)[:300])
|
| 192 |
+
|
| 193 |
+
width = max(len(r[1]) for r in results)
|
| 194 |
+
lines = [f"{s:4s} {n.ljust(width)} {d}" for s, n, d in results]
|
| 195 |
+
print("\n".join(lines))
|
| 196 |
+
n_fail = sum(s == "FAIL" for s, _, _ in results)
|
| 197 |
+
summary = f"\n{len(results)} checks: {sum(s == 'PASS' for s, _, _ in results)} PASS, " \
|
| 198 |
+
f"{sum(s == 'WARN' for s, _, _ in results)} WARN, {n_fail} FAIL"
|
| 199 |
+
print(summary)
|
| 200 |
+
if a.report:
|
| 201 |
+
Path(a.report).write_text("| status | check | detail |\n|---|---|---|\n" +
|
| 202 |
+
"\n".join(f"| {s} | {n} | {d.replace('|', '/')} |" for s, n, d in results) +
|
| 203 |
+
"\n\n" + summary.strip() + "\n")
|
| 204 |
+
sys.exit(1 if n_fail else 0)
|
| 205 |
+
|
| 206 |
+
|
| 207 |
+
if __name__ == "__main__":
|
| 208 |
+
main()
|