messages listlengths 3 3 | _debug_polluted_chars listlengths 1 51 |
|---|---|
[
{
"role": "system",
"content": "You are a helpful AI assistant."
},
{
"role": "user",
"content": "په غوسه مې وويل زه له ډيرو مجرمينو سره غږېدلی يم"
},
{
"role": "assistant",
"content": "<think>\n* Input: \"په غوسه مې وويل زه له ډیرو مجرمينو سره غږېدلی يم\" (Pashto)\n * Transla... | [
"事",
"情"
] |
[
{
"role": "system",
"content": "You are a warm, friendly, and natural Pashto Conversational AI. \nYour goal is to chat with users in fluent, everyday Pashto (پښتو) as if \nyou are a native friend or companion. \n\nGuidelines:\n- Always respond in a natural, conversational tone using everyday vocabulary.\n- ... | [
"ं",
"ग",
"ी"
] |
[
{
"role": "system",
"content": "You are a warm, friendly, and natural Pashto Conversational AI. \nYour goal is to chat with users in fluent, everyday Pashto (پښتو) as if \nyou are a native friend or companion. \n\nGuidelines:\n- Always respond in a natural, conversational tone using everyday vocabulary.\n- ... | [
"ট",
"ি"
] |
[
{
"role": "system",
"content": "You are a warm, friendly, and natural Pashto Conversational AI. \nYour goal is to chat with users in fluent, everyday Pashto (پښتو) as if \nyou are a native friend or companion. \n\nGuidelines:\n- Always respond in a natural, conversational tone using everyday vocabulary.\n- ... | [
"当"
] |
[
{
"role": "system",
"content": "You are a helpful AI assistant."
},
{
"role": "user",
"content": "جنرال صيب په زياتو رزيلانو ستا دا حسن نيت او د نظام ريښتينولي ډيره سخته لږيږي او درد ترې محسوسوي"
},
{
"role": "assistant",
"content": "<think>\n* Language: Pashto.\n* Text: \"جنرال ... | [
"न",
"ू"
] |
[
{
"role": "system",
"content": "You are a warm, friendly, and natural Pashto Conversational AI. \nYour goal is to chat with users in fluent, everyday Pashto (پښتو) as if \nyou are a native friend or companion. \n\nGuidelines:\n- Always respond in a natural, conversational tone using everyday vocabulary.\n- ... | [
"联",
"网"
] |
[
{
"role": "system",
"content": "You are a warm, friendly, and natural Pashto Conversational AI. \nYour goal is to chat with users in fluent, everyday Pashto (پښتو) as if \nyou are a native friend or companion. \n\nGuidelines:\n- Always respond in a natural, conversational tone using everyday vocabulary.\n- ... | [
"ी",
"ळ"
] |
[
{
"role": "system",
"content": "You are a warm, friendly, and natural Pashto Conversational AI. \nYour goal is to chat with users in fluent, everyday Pashto (پښتو) as if \nyou are a native friend or companion. \n\nGuidelines:\n- Always respond in a natural, conversational tone using everyday vocabulary.\n- ... | [
"区",
"分"
] |
[
{
"role": "system",
"content": "You are a warm, friendly, and natural Pashto Conversational AI. \nYour goal is to chat with users in fluent, everyday Pashto (پښتو) as if \nyou are a native friend or companion. \n\nGuidelines:\n- Always respond in a natural, conversational tone using everyday vocabulary.\n- ... | [
"设",
"置"
] |
[
{
"role": "system",
"content": "You are a warm, friendly, and natural Pashto Conversational AI. \nYour goal is to chat with users in fluent, everyday Pashto (پښتو) as if \nyou are a native friend or companion. \n\nGuidelines:\n- Always respond in a natural, conversational tone using everyday vocabulary.\n- ... | [
"प"
] |
[
{
"role": "system",
"content": "You are a helpful AI assistant."
},
{
"role": "user",
"content": "دا رزیل وایي خوب کې ماته د قاید ازم له ګوتې څخه شهد را ووتو او خوند یي تراوسه زما په خوله کې دی"
},
{
"role": "assistant",
"content": "<think>\n* Language: Pashto.\n* Content: \"دا ر... | [
"甘"
] |
[
{
"role": "system",
"content": "You are a helpful AI assistant."
},
{
"role": "user",
"content": "زموږ لپاره سوله په دې معنی ده چې په افغانستان کې جګړه پای ته ورسېږي"
},
{
"role": "assistant",
"content": "<think>\n* Language: Pashto.\n* Text: \"زموږ لپاره سوله په دې معنی ده چې په... | [
"ो",
"ी",
"्",
"ष",
"ग",
"ट"
] |
[
{
"role": "system",
"content": "You are a helpful AI assistant."
},
{
"role": "user",
"content": "د پاکستان او بنګله ديش ترمينځه به ټي ټوئنټي سيريز د څليرشتمې جنورۍ نه شروع کيږي"
},
{
"role": "assistant",
"content": "<think>\n* Language: Pashto.\n* Content: \"د پاکستان او بنګله د... | [
"ত",
"া"
] |
[
{
"role": "system",
"content": "You are a warm, friendly, and natural Pashto Conversational AI. \nYour goal is to chat with users in fluent, everyday Pashto (پښتو) as if \nyou are a native friend or companion. \n\nGuidelines:\n- Always respond in a natural, conversational tone using everyday vocabulary.\n- ... | [
"५"
] |
[
{
"role": "system",
"content": "You are a warm, friendly, and natural Pashto Conversational AI. \nYour goal is to chat with users in fluent, everyday Pashto (پښتو) as if \nyou are a native friend or companion. \n\nGuidelines:\n- Always respond in a natural, conversational tone using everyday vocabulary.\n- ... | [
"ा",
"प",
"क"
] |
[
{
"role": "system",
"content": "You are a warm, friendly, and natural Pashto Conversational AI. \nYour goal is to chat with users in fluent, everyday Pashto (پښتو) as if \nyou are a native friend or companion. \n\nGuidelines:\n- Always respond in a natural, conversational tone using everyday vocabulary.\n- ... | [
"么",
"割",
"说",
"分",
"什"
] |
[
{
"role": "system",
"content": "You are a helpful AI assistant."
},
{
"role": "user",
"content": "څوک چې مکتب ته په دروازه تلل او راتلل هغو ټول په وطن کې دي او څوک چې په دیوالونو ور ختل هغو ټول اروپا ته ورسیدل افسوس تاسو واوریدل"
},
{
"role": "assistant",
"content": "<think>\n* Lan... | [
"ல",
"வ"
] |
[
{
"role": "system",
"content": "You are a helpful and friendly Pashto AI assistant. \nAlways include relevant, engaging emojis in your responses to make the conversation feel warm, natural, and expressive. Use emojis that match the context (e.g., greetings 👋, questions ❓, or helpful tips ✨), but ensure the... | [
"आ",
"व",
"ड"
] |
[
{
"role": "system",
"content": "You are a warm, friendly, and natural Pashto Conversational AI. \nYour goal is to chat with users in fluent, everyday Pashto (پښتو) as if \nyou are a native friend or companion. \n\nGuidelines:\n- Always respond in a natural, conversational tone using everyday vocabulary.\n- ... | [
"烧"
] |
[
{
"role": "system",
"content": "You are a warm, friendly, and natural Pashto Conversational AI. \nYour goal is to chat with users in fluent, everyday Pashto (پښتو) as if \nyou are a native friend or companion. \n\nGuidelines:\n- Always respond in a natural, conversational tone using everyday vocabulary.\n- ... | [
"চ",
"া",
"车",
"ত",
"্",
"ি",
"站",
"ন"
] |
[
{
"role": "system",
"content": "You are a warm, friendly, and natural Pashto Conversational AI. \nYour goal is to chat with users in fluent, everyday Pashto (پښتو) as if \nyou are a native friend or companion. \n\nGuidelines:\n- Always respond in a natural, conversational tone using everyday vocabulary.\n- ... | [
"৫"
] |
[
{
"role": "system",
"content": "You are a helpful AI assistant."
},
{
"role": "user",
"content": "د مالیزیا په ګډون ۱۱ هېوادونو طالبانو ته د سفارتونو مدیریت سپارلی پاکستان چین ازبکستان ترکمنستان روسیه ترکیه قطر ما"
},
{
"role": "assistant",
"content": "<think>\n* Language: Pashto.\... | [
"ব",
"ৃ",
"ী",
"ক",
"ত",
"স",
"্",
"ি"
] |
[
{
"role": "system",
"content": "You are a helpful AI assistant."
},
{
"role": "user",
"content": "هغوی بختور دي چې د کمو امتیازاتو او مادیاتو په مقابل کې د اسلامي او شرعي نظام ساتنې دنده پر غاړه لري ستاینه او تشویق ی"
},
{
"role": "assistant",
"content": "<think>\n* *Language:* Pas... | [
"原",
"则"
] |
[
{
"role": "system",
"content": "You are a warm, friendly, and natural Pashto Conversational AI. \nYour goal is to chat with users in fluent, everyday Pashto (پښتو) as if \nyou are a native friend or companion. \n\nGuidelines:\n- Always respond in a natural, conversational tone using everyday vocabulary.\n- ... | [
"行",
"३",
"ૂ",
"ભ"
] |
[
{
"role": "system",
"content": "You are a helpful AI assistant."
},
{
"role": "user",
"content": "هههه سپی غاپه لنډغر تر کولابی تیر سوی دی"
},
{
"role": "assistant",
"content": "<think>\n* Input: \"هههه سپی غاپه لنډغر تر کولابی تیر سوی دی\" (Pashto)\n * Transliteration: \"Haha... | [
"笑"
] |
[
{
"role": "system",
"content": "You are a helpful AI assistant."
},
{
"role": "user",
"content": "دا حرامې د ښکلو چڼو ډیر شوقې وو"
},
{
"role": "assistant",
"content": "<think>\n* Language: Pashto (پښتو).\n* Sentence: \"دا حرامې د ښکلو چڼو ډیر شوقې وو\" (Da harame de khkulo chano... | [
"्",
"अ",
"थ",
"र"
] |
[
{
"role": "system",
"content": "You are a helpful AI assistant."
},
{
"role": "user",
"content": "۹ د همدې ځانګړنې له مخې د وينې قند منظموي"
},
{
"role": "assistant",
"content": "<think>\n* Language: Pashto.\n * Content: \"۹ د همدې ځانګړنې له مخې د وينې قند منظموي\"\n * T... | [
"正"
] |
[
{
"role": "system",
"content": "You are a warm, friendly, and natural Pashto Conversational AI. \nYour goal is to chat with users in fluent, everyday Pashto (پښتو) as if \nyou are a native friend or companion. \n\nGuidelines:\n- Always respond in a natural, conversational tone using everyday vocabulary.\n- ... | [
"場"
] |
[
{
"role": "system",
"content": "You are a helpful AI assistant."
},
{
"role": "user",
"content": "چې له عفوي ورسته هم په غيڼ در سپريږي نو مرداريداسي واجب د لکه ليوني سپي بيا د څوک نرشي چې لنډغرو سپو ته چنده ټوله کړي"
},
{
"role": "assistant",
"content": "<think>\n* Language: Pashto... | [
"谚",
"语"
] |
Pashto AI Gemma 4 Pollution Benchmark
A research corpus for investigating multilingual character contamination in synthetic Pashto conversational data generated using Google Gemma 4 26B.
This dataset preserves examples flagged by a Unicode-based filtering pipeline during the preparation of a Pashto conversational training corpus. It is intended to support research into unexpected multilingual script mixing, text-generation quality, Unicode-based data validation, and dataset-cleaning methods for low-resource languages.
The repository contains a dedicated debugging corpus extracted from a larger JSONL dataset. Rather than discarding every flagged example, this project preserves the original records and attaches metadata identifying the unexpected characters detected by the filtering script.
Research principle: Preserve the evidence, document the detection method, and investigate the cause before drawing conclusions.
Dataset Information
| Field | Description |
|---|---|
| Dataset name | Pashto AI Gemma 4 Pollution Benchmark |
| Repository | nassimjp/pashto-ai-gemma4-pollution-benchmark |
| Primary model | Google Gemma 4 26B |
| Primary language | Pashto (ps) |
| Format | JSONL |
| Source type | Synthetic conversational data |
| Detection method | Unicode character-range matching |
| Main purpose | Research, debugging, and data-quality evaluation |
| Main file | data/polluted_tokens_debug_corpus.jsonl |
The exact number of records should be determined by counting the lines in the published JSONL file. A record is flagged when one or more characters match the configured Unicode ranges.
Motivation
Producing high-quality synthetic training data for Pashto presents challenges beyond ordinary text generation. A model may generate fluent Pashto while unexpectedly introducing characters from other writing systems into words or sentences.
For example, a sentence may contain Pashto text mixed with Devanagari, Bengali, Gujarati, Odia, Tamil, or CJK Unified Ideographs.
Such examples can be valuable for investigating:
- Unexpected script mixing in generated text.
- Unicode-level contamination in synthetic training datasets.
- Differences between raw generated data and filtered training data.
- The reliability and limitations of automated text-cleaning pipelines.
- Potential effects of multilingual model behavior on low-resource language data preparation.
This dataset turns flagged records into research material instead of silently throwing them away.
Repository Structure
pashto-ai-gemma4-pollution-benchmark/
├── README.md
└── data/
└── polluted_tokens_debug_corpus.jsonl
The main corpus is stored as JSON Lines: each line contains one independently parseable JSON object.
Data Collection and Processing
The corpus was produced by applying a Unicode-based screening script to a larger conversational JSONL dataset.
The processing pipeline performs the following steps:
- Reads the source JSONL file line by line.
- Parses each line as a JSON object.
- Examines the
contentfield of messages whose roles areuserorassistant. - Searches for characters belonging to the configured Unicode ranges.
- Sends flagged records to the pollution-debug corpus.
- Adds a
_debug_polluted_charsfield containing the distinct matched characters. - Writes records without detected characters to a separate cleaned dataset.
The pipeline does not intentionally rewrite the original message content in flagged records. Instead, it preserves the record and adds diagnostic metadata.
Detection Rules
The current screening expression checks these Unicode blocks:
| Unicode range | Writing system |
|---|---|
U+0900–U+097F |
Devanagari |
U+0980–U+09FF |
Bengali |
U+0A80–U+0AFF |
Gujarati |
U+0B00–U+0B7F |
Odia |
U+0B80–U+0BFF |
Tamil |
U+4E00–U+9FFF |
CJK Unified Ideographs |
These ranges are screening rules, not a complete definition of linguistic contamination.
The detector identifies characters, not languages, meanings, model intentions, or the reason a character appeared. In particular, the CJK range includes Han characters used in Chinese and in other East Asian writing contexts. A match should therefore be interpreted as a flagged character, not definitive proof of a specific language.
The current expression also does not cover every possible foreign script. For example, Japanese Hiragana and Katakana, Hangul, and many other Unicode blocks are not included in the configured ranges.
Data Format
Each line contains a conversational JSON object. The original schema is preserved, with an additional _debug_polluted_chars field for flagged records.
Example:
{
"messages": [
{
"role": "user",
"content": "ایا په روم کې د بایسکل ډیری پارکونه شتون لري؟"
},
{
"role": "assistant",
"content": "په ځینو ریل ګیډۍ车站ونو کې د بایسکلونو لپاره ځایونه شته."
}
],
"_debug_polluted_chars": ["车", "站"]
}
Note: This is an illustrative example of the schema, not a claim that this exact record appears in the published corpus.
Field Description
| Field | Meaning |
|---|---|
messages |
Original conversational messages |
messages[].role |
Message role, such as user or assistant |
messages[].content |
Original message content |
_debug_polluted_chars |
Distinct characters matched by the screening expression |
The _debug_polluted_chars field contains individual characters, not token IDs from the model's tokenizer. A Unicode character, a model token, and a word are different units and should not be treated as interchangeable.
Cleaning Script
The following simplified, reproducible version demonstrates the core filtering logic. Adjust the input and output paths to match your environment.
import json
import re
POLLUTION_REGEX = re.compile(
r"[\u0900-\u097F"
r"\u0980-\u09FF"
r"\u0A80-\u0AFF"
r"\u0B00-\u0B7F"
r"\u0B80-\u0BFF"
r"\u4E00-\u9FFF]",
re.UNICODE,
)
input_file = "training_ready_pairs_drop15k.jsonl"
cleaned_file = "training_ready_pairs_cleaned.jsonl"
polluted_file = "polluted_tokens_debug_corpus.jsonl"
flagged_count = 0
cleaned_count = 0
invalid_count = 0
with (
open(input_file, "r", encoding="utf-8") as fin,
open(cleaned_file, "w", encoding="utf-8") as fclean,
open(polluted_file, "w", encoding="utf-8") as fpolluted,
):
for line in fin:
try:
data = json.loads(line)
except json.JSONDecodeError:
invalid_count += 1
continue
messages = data.get("messages", [])
found_chars = set()
if isinstance(messages, list):
for msg in messages:
if not isinstance(msg, dict):
continue
if msg.get("role") not in ("user", "assistant"):
continue
content = msg.get("content", "")
if isinstance(content, str):
found_chars.update(
POLLUTION_REGEX.findall(content)
)
if found_chars:
flagged_count += 1
data["_debug_polluted_chars"] = sorted(found_chars)
fpolluted.write(
json.dumps(data, ensure_ascii=False) + "\n"
)
else:
cleaned_count += 1
fclean.write(
json.dumps(data, ensure_ascii=False) + "\n"
)
print("Processing complete.")
print(f"Flagged records: {flagged_count}")
print(f"Records without detected characters: {cleaned_count}")
print(f"Invalid JSONL lines skipped: {invalid_count}")
This version serializes valid records consistently as JSON. If exact byte-for-byte preservation of the original unflagged lines is required, write the original line to the clean output instead.
The script is a demonstration of the screening method, not a complete multilingual contamination classifier.
Research Questions
Researchers can use this corpus to investigate questions such as:
- How frequently do unexpected Unicode characters appear in synthetic Pashto conversational data?
- Which configured Unicode blocks occur most often?
- Are flagged records concentrated in particular prompts, topics, or response lengths?
- Do different models exhibit different script-mixing patterns under equivalent generation conditions?
- How much does automated filtering change the size and composition of a training dataset?
- Does removing flagged records improve Pashto script consistency without harming fluency, meaning, or useful multilingual content?
- Which additional Unicode ranges should be monitored for a particular Pashto-only application?
These are research questions, not findings established by the existence of this corpus alone.
Important Limitations
1. Character detection is not tokenization analysis
The screening script operates on Unicode characters in decoded text. It does not inspect the model's tokenizer vocabulary, token IDs, embedding space, or internal reasoning.
Consequently, the presence of a foreign-script character does not establish that tokenizer bias caused the problem.
2. Flagged does not always mean incorrect
Foreign-script characters can be legitimate in names, quotations, language-learning examples, citations, or multilingual conversations. The intended use of each record should be considered before deletion.
3. The detector has limited Unicode coverage
Only the explicitly configured ranges are checked. Other writing systems and some forms of unexpected text corruption may remain undetected.
4. Script mixing does not establish causation
Potential explanations may include multilingual generation behavior, training-data composition, prompt design, sampling settings, data transformations, or other processing stages. Controlled experiments are needed to distinguish these explanations.
5. Cleaning can introduce its own errors
Removing characters automatically can damage meaning, names, quotations, or code. Where feasible, evaluate both the original and corrected text instead of assuming that every flagged record should simply be deleted.
Recommended Evaluation Method
For rigorous model comparisons:
- Use the same prompts across models.
- Document model identifiers, revisions, generation settings, and data-processing steps.
- Report the number of records examined and the number flagged.
- Report the number of matched characters separately from the number of flagged records.
- Manually review a sample of flagged and unflagged records.
- Measure false positives and false negatives where a reliable annotation set is available.
- Keep raw records separate from cleaned training data.
- Publish limitations and evaluation criteria alongside any reported results.
A useful record-level metric is:
Flagged-record rate = flagged records ÷ total valid records examined.
A separate character-level statistic can count matched character occurrences across all records. Distinct character types, character occurrences, flagged records, and tokenizer tokens must be reported as separate quantities.
Intended Uses
This dataset is intended for:
- Research on Pashto synthetic-data quality.
- Unicode script-mixing detection.
- Data-cleaning pipeline development.
- Low-resource language dataset validation.
- Comparative evaluation of multilingual text-generation models.
- Reproducible debugging and error analysis.
- Educational demonstrations of Unicode and multilingual NLP.
Out of Scope
This dataset alone should not be used to:
- Claim that a model is generally unreliable.
- Infer the model's internal reasoning from its output characters.
- Attribute all contamination to tokenizer design.
- Treat every flagged record as linguistically invalid.
- Make claims about all Gemma models based on one model configuration or one corpus.
License and Attribution
The repository metadata declares the Apache-2.0 license. Please consult the repository's licensing information and the applicable terms for the underlying model and source data before redistributing derived material.
When using this dataset in research or derivative projects, cite the repository and document the dataset version, access date, and any additional filtering or annotation performed.
Dataset: nassimjp/pashto-ai-gemma4-pollution-benchmark
Maintainer: nassimjp
Acknowledgements
This project is part of ongoing work to improve Pashto-language AI data quality and support reproducible research for low-resource languages.
Research motto: Preserve the evidence. Measure the problem. Test the explanation.
No Unicode character left behind.
- Downloads last month
- -