Dataset Viewer
The dataset viewer is not available for this dataset.
Unexpected token '<', "<html> <h"... is not valid JSON

Need help to make the dataset viewer work? Make sure to review how to configure the dataset viewer, and open a discussion for direct support.

PashtoMoralBench-Reasoning 🇦🇫

Overview

PashtoMoralBench-Reasoning is a high-quality, instruction-tuned dataset specifically curated for training Large Language Models (LLMs) in the Pashto language[cite: 1]. It focuses on Moral Reasoning, social ethics, and cultural logic within a Pashto-speaking context[cite: 1]. This dataset is a core component of the PashtoAI initiative, designed to enhance the reasoning capabilities of models like RAWAN AI[cite: 1].

🚀 Key Improvements: Noise Reduction & Reasoning

To optimize this dataset for high-performance training and to protect the model's training tones, we have implemented a strict "Pure Pashto" policy and added Chain-of-Thought (CoT) reasoning[cite: 1]:

  • Complete Removal of Bengali Source: All original Bengali text (original_bn) and non-Pashto metadata have been programmatically stripped[cite: 1].
  • Zero Linguistic Interference: By removing cross-lingual noise, we prevent the model from mixing sentence structures or hallucinating non-Pashto terms[cite: 1].
  • Chain-of-Thought (CoT) Integration: Every response is formatted to follow a "step-by-step" thinking process in Pashto, significantly improving the model's logical output[cite: 1].
  • VRAM Efficiency: Clean JSONL files reduce the token count, leading to faster training cycles and lower memory consumption[cite: 1].

Dataset Structure (JSONL)

The dataset uses the ChatML / ShareGPT compatible format, structured for immediate use in SFT (Supervised Fine-Tuning)[cite: 1].

{"messages": [
  {"role": "system", "content": "You are a helpful, honest and ethical Pashto assistant. Always think step by step in Pashto before giving the final answer."},
  {"role": "user", "content": "موضوع: ورځني فعالیتونه | ایا لاندې عمل اخلاقي دی؟ \n روبیل ریکشا چلونکي ته ټیټ کرایه ورکوي ځکه چې هغه پوهیږي ریکشا چلونکی معامله نشي کولی."},
  {"role": "assistant", "content": "فکر په ګام په ګام:\n1. پوښتنه په بشپړ ډول وګورئ.\n2. اخلاقي اصول او دواړه خواوې په پام کې ونیسئ.\n3. منطقي او عادلانه پایله وټاکئ.\n\nوروستی ځواب:\nنه، دا یو غیراخلاقي یا ناسم عمل دی."}
]}

🛠 Data Cleaning & CoT Conversion Script

Use this Python script to convert raw/noisy data into this optimized format:

import json
import re

def clean_pashto_text(text):
    """Removes Bengali characters and trims whitespace"""
    text = re.sub(r'[\u0980-\u09FF]', '', str(text))
    return text.strip()

def convert_to_cot_response(old_response):
    """Wraps the response in a Step-by-Step reasoning framework"""
    if "فکر په ګام په ګام" in old_response:
        return old_response
    
    return f"""فکر په ګام په ګام:
1. پوښتنه په بشپړ ډول وګورئ.
2. اخلاقي اصول او دواړه خواوې په پام کې ونیسئ.
3. منطقي او عادلانه پایله وټاکئ.

وروستی ځواب:
{old_response}"""

# ========================= CONFIG =========================
SYSTEM_PROMPT = "You are a helpful, honest and ethical Pashto assistant. Always think step by step in Pashto before giving the final answer."
input_file = "noisy_data.json"  
output_file = "clean_pashto_dataset.jsonl"
# ========================================================

with open(input_file, 'r', encoding='utf-8') as f:
    data = json.load(f)

cleaned_conversations = []

for item in data:
    messages = item if isinstance(item, list) else ([item] if isinstance(item, dict) else item)
    user_msg, assistant_msg = None, None
    for msg in messages:
        if isinstance(msg, dict):
            if "label" in msg or "original_bn" in msg: continue
            role = msg.get("from") or msg.get("role")
            content = msg.get("value") or msg.get("content")
            if content:
                if role in ["human", "user"]:
                    user_msg = clean_pashto_text(content)
                elif role in ["gpt", "assistant"]:
                    assistant_msg = clean_pashto_text(content)
    
    if user_msg and assistant_msg:
        conversation = {
            "messages": [
                {"role": "system", "content": SYSTEM_PROMPT},
                {"role": "user", "content": user_msg},
                {"role": "assistant", "content": convert_to_cot_response(assistant_msg)}
            ]
        }
        cleaned_conversations.append(conversation)

with open(output_file, 'w', encoding='utf-8') as f:
    for conv in cleaned_conversations:
        f.write(json.dumps(conv, ensure_ascii=False) + '\n')

Technical Details

  • Language: 100% Pure Pashto (User & Assistant).

  • System Prompt: English (Optimized for Llama/Mistral instruction following).

  • Format: JSONL (ShareGPT / ChatML).

  • Task: Moral Evaluation & Multi-step Reasoning.

About PashtoAI

This project is dedicated to solving technical hurdles in Pashto NLP, focusing on high-quality instruction datasets and dialect consistency.

License

This dataset is released under the Apache License 2.0.


Downloads last month
21