HeshamHaroon/Arabic_Function_Calling

Dataset

Arabic Function Calling Dataset (50K+ Samples)

60

6 commits

1 linked in READMEs

updated Dec 14, 2025

See the code

README

Arabic Function Calling Dataset (50K+ Samples)

مجموعة بيانات استدعاء الدوال العربية

أول وأكبر مجموعة بيانات عربية متخصصة في استدعاء الدوال (Function Calling) تغطي جميع اللهجات العربية الرئيسية والمجالات الحياتية المهمة.

Dataset Description

This is the first comprehensive Arabic function calling dataset designed for training and evaluating LLMs on Arabic tool use capabilities. The dataset covers:

  • 5 Arabic Dialects: MSA (Modern Standard Arabic), Egyptian, Gulf, Levantine, and Maghrebi
  • 8 Real-World Domains: Islamic services, government services, banking/finance, e-commerce, travel, healthcare, weather, and utilities
  • 36+ Functions: Covering practical Arabic-world use cases

Key Features

  • 50,810 total samples (45,734 positive + 5,076 negative examples)
  • Multi-dialect coverage reflecting real Arabic usage patterns
  • Culturally authentic - designed for Arab world use cases, not translated from English
  • GPT-4o generated with quality validation
  • OpenAI-compatible format for easy fine-tuning

Dataset Statistics

By Dialect

DialectArabic NameSamplesPercentage
MSAالفصحى14,07530.8%
Gulfالخليجية11,93926.1%
Egyptianالمصرية10,92123.9%
Levantineالشامية6,91315.1%
Maghrebiالمغاربية1,8864.1%

By Domain

DomainSamplesPercentage
Government Services6,04513.2%
Islamic Services6,01413.1%
Healthcare5,74612.6%
Banking/Finance5,70212.5%
Weather5,62912.3%
Utilities5,57812.2%
Travel5,57112.2%
E-commerce5,44911.9%

Sample Types

TypeSamplesDescription
Positive45,734 (90%)Queries that require function calls
Negative5,076 (10%)General queries that don't need functions

Dataset Structure

Each sample contains:

{
  "id": "gen_00001",
  "query_ar": "عايز أعرف مواعيد الصلاة في القاهرة النهارده",
  "query_en": "I want to know the prayer times in Cairo today",
  "function_name": "get_prayer_times",
  "arguments": {"city": "القاهرة", "date": "today"},
  "dialect": "Egyptian",
  "domain": "islamic_services",
  "requires_function": true
}

Fields Description

FieldTypeDescription
idstringUnique identifier
query_arstringArabic query (in dialect)
query_enstringEnglish translation
function_namestringTarget function to call
argumentsobjectFunction parameters
dialectstringArabic dialect (MSA/Egyptian/Gulf/Levantine/Maghrebi)
domainstringDomain category
requires_functionboolWhether query needs a function call

Available Functions

Islamic Services (الخدمات الإسلامية)

  • get_prayer_times - مواقيت الصلاة
  • calculate_zakat - حساب الزكاة
  • get_qibla_direction - اتجاه القبلة
  • search_quran - البحث في القرآن
  • get_hadith - البحث في الأحاديث
  • calculate_inheritance - حساب المواريث

Government Services (الخدمات الحكومية)

  • check_visa_status - حالة التأشيرة
  • check_iqama_status - صلاحية الإقامة
  • check_traffic_violations - المخالفات المرورية
  • book_government_appointment - حجز موعد حكومي
  • calculate_end_of_service - مكافأة نهاية الخدمة

Banking & Finance (البنوك والمالية)

  • convert_currency - تحويل العملات
  • get_gold_price - سعر الذهب
  • calculate_loan - حساب القرض
  • transfer_money - تحويل الأموال

E-commerce (التجارة الإلكترونية)

  • track_shipment - تتبع الشحنة
  • compare_prices - مقارنة الأسعار
  • calculate_customs - حساب الجمارك
  • order_food - طلب طعام

Travel (السفر)

  • search_flights - البحث عن رحلات
  • search_hotels - البحث عن فنادق
  • search_umrah_packages - باقات العمرة

Healthcare (الصحة)

  • book_doctor_appointment - حجز موعد طبي
  • search_medications - البحث عن الأدوية
  • check_insurance_coverage - تغطية التأمين

Weather (الطقس)

  • get_weather - حالة الطقس
  • get_air_quality - جودة الهواء

Utilities (الأدوات)

  • translate_text - الترجمة
  • calculate_math - العمليات الحسابية
  • set_reminder - إنشاء تذكير
  • get_current_time - الوقت الحالي

Usage

Loading with Datasets Library

from datasets import load_dataset

# Load the dataset
dataset = load_dataset("HeshamHaroon/Arabic_Function_Calling")

# Access splits
train_data = dataset["train"]
test_data = dataset["test"]

# Example usage
for sample in train_data.select(range(5)):
    print(f"Query: {sample['query_ar']}")
    print(f"Function: {sample['function_name']}")
    print(f"Dialect: {sample['dialect']}")
    print("---")

Fine-tuning Example

from transformers import AutoTokenizer, AutoModelForCausalLM
from datasets import load_dataset

dataset = load_dataset("HeshamHaroon/Arabic_Function_Calling")

def format_for_training(example):
    system = "أنت مساعد ذكي يفهم اللغة العربية. عند تلقي طلب، قم باستدعاء الدالة المناسبة."

    if example['requires_function']:
        response = f'{{"name": "{example["function_name"]}", "arguments": {example["arguments"]}}}'
    else:
        response = "لا حاجة لاستدعاء دالة"

    return {
        "messages": [
            {"role": "system", "content": system},
            {"role": "user", "content": example['query_ar']},
            {"role": "assistant", "content": response}
        ]
    }

formatted_dataset = dataset.map(format_for_training)

Evaluation Results

Validated on GPT-4o with function calling:

MetricScore
Overall Accuracy70.3%
Positive (Function Required)68.1%
Negative (No Function)90.0%

By Dialect Performance

DialectAccuracy
Egyptian77.6%
Gulf75.8%
Maghrebi67.2%
Levantine66.7%
MSA64.6%

Dataset Creation

Methodology

This dataset was created using a hybrid approach combining:

  1. Seed Generation: 500 hand-crafted samples across all domains and dialects
  2. Self-Instruct: GPT-4o expansion of seeds to 5,000 samples
  3. Dialect Multiplication: Expanding across 5 Arabic dialects
  4. Quality Filtering: Validation and deduplication

Why Native Arabic (Not Translation)?

Based on QCRI's research on Arabic Tool Calling:

  • Pure translation introduces "Anglocentric biases"
  • Bilingual (EN+AR) training achieves 0.99 recall vs 0.69 for single-language
  • Native Arabic datasets capture cultural context better

Generation Details

  • Model: Azure OpenAI GPT-4o
  • Concurrency: 20 parallel requests with exponential backoff
  • Temperature: 0.9 for diversity
  • Validation: GPT-4o function calling with 36 tools

Limitations and Biases

Known Limitations

  1. Synthetic Data: Generated by GPT-4o, may have model biases
  2. Dialect Imbalance: Maghrebi dialect underrepresented (4.1%)
  3. Domain Coverage: Limited to 8 domains, doesn't cover all use cases
  4. Argument Values: Some generated values may be fictional
  • Fine-tuning Arabic LLMs for function calling
  • Benchmarking Arabic tool use capabilities
  • Research on multilingual function calling
  • Developing Arabic AI assistants
  • Direct use in production without validation
  • Legal or medical advice applications
  • Financial decision-making systems

Citation

If you use this dataset, please cite:

@dataset{arabic_function_calling_2024,
  title={Arabic Function Calling Dataset},
  author={Hesham Haroon},
  year={2024},
  publisher={Hugging Face},
  url={https://huggingface.co/datasets/HeshamHaroon/Arabic_Function_Calling}
}

License

This dataset is released under the Apache 2.0 License.

Contact


arabic
dialects
function-calling
synthetic
tool-use

HeshamHaroon/Arabic_Function_Calling

Dataset

Arabic Function Calling Dataset (50K+ Samples)

60

6 commits

1 linked in READMEs

updated Dec 14, 2025

See the code

README

Arabic Function Calling Dataset (50K+ Samples)

مجموعة بيانات استدعاء الدوال العربية

أول وأكبر مجموعة بيانات عربية متخصصة في استدعاء الدوال (Function Calling) تغطي جميع اللهجات العربية الرئيسية والمجالات الحياتية المهمة.

Dataset Description

This is the first comprehensive Arabic function calling dataset designed for training and evaluating LLMs on Arabic tool use capabilities. The dataset covers:

  • 5 Arabic Dialects: MSA (Modern Standard Arabic), Egyptian, Gulf, Levantine, and Maghrebi
  • 8 Real-World Domains: Islamic services, government services, banking/finance, e-commerce, travel, healthcare, weather, and utilities
  • 36+ Functions: Covering practical Arabic-world use cases

Key Features

  • 50,810 total samples (45,734 positive + 5,076 negative examples)
  • Multi-dialect coverage reflecting real Arabic usage patterns
  • Culturally authentic - designed for Arab world use cases, not translated from English
  • GPT-4o generated with quality validation
  • OpenAI-compatible format for easy fine-tuning

Dataset Statistics

By Dialect

DialectArabic NameSamplesPercentage
MSAالفصحى14,07530.8%
Gulfالخليجية11,93926.1%
Egyptianالمصرية10,92123.9%
Levantineالشامية6,91315.1%
Maghrebiالمغاربية1,8864.1%

By Domain

DomainSamplesPercentage
Government Services6,04513.2%
Islamic Services6,01413.1%
Healthcare5,74612.6%
Banking/Finance5,70212.5%
Weather5,62912.3%
Utilities5,57812.2%
Travel5,57112.2%
E-commerce5,44911.9%

Sample Types

TypeSamplesDescription
Positive45,734 (90%)Queries that require function calls
Negative5,076 (10%)General queries that don't need functions

Dataset Structure

Each sample contains:

{
  "id": "gen_00001",
  "query_ar": "عايز أعرف مواعيد الصلاة في القاهرة النهارده",
  "query_en": "I want to know the prayer times in Cairo today",
  "function_name": "get_prayer_times",
  "arguments": {"city": "القاهرة", "date": "today"},
  "dialect": "Egyptian",
  "domain": "islamic_services",
  "requires_function": true
}

Fields Description

FieldTypeDescription
idstringUnique identifier
query_arstringArabic query (in dialect)
query_enstringEnglish translation
function_namestringTarget function to call
argumentsobjectFunction parameters
dialectstringArabic dialect (MSA/Egyptian/Gulf/Levantine/Maghrebi)
domainstringDomain category
requires_functionboolWhether query needs a function call

Available Functions

Islamic Services (الخدمات الإسلامية)

  • get_prayer_times - مواقيت الصلاة
  • calculate_zakat - حساب الزكاة
  • get_qibla_direction - اتجاه القبلة
  • search_quran - البحث في القرآن
  • get_hadith - البحث في الأحاديث
  • calculate_inheritance - حساب المواريث

Government Services (الخدمات الحكومية)

  • check_visa_status - حالة التأشيرة
  • check_iqama_status - صلاحية الإقامة
  • check_traffic_violations - المخالفات المرورية
  • book_government_appointment - حجز موعد حكومي
  • calculate_end_of_service - مكافأة نهاية الخدمة

Banking & Finance (البنوك والمالية)

  • convert_currency - تحويل العملات
  • get_gold_price - سعر الذهب
  • calculate_loan - حساب القرض
  • transfer_money - تحويل الأموال

E-commerce (التجارة الإلكترونية)

  • track_shipment - تتبع الشحنة
  • compare_prices - مقارنة الأسعار
  • calculate_customs - حساب الجمارك
  • order_food - طلب طعام

Travel (السفر)

  • search_flights - البحث عن رحلات
  • search_hotels - البحث عن فنادق
  • search_umrah_packages - باقات العمرة

Healthcare (الصحة)

  • book_doctor_appointment - حجز موعد طبي
  • search_medications - البحث عن الأدوية
  • check_insurance_coverage - تغطية التأمين

Weather (الطقس)

  • get_weather - حالة الطقس
  • get_air_quality - جودة الهواء

Utilities (الأدوات)

  • translate_text - الترجمة
  • calculate_math - العمليات الحسابية
  • set_reminder - إنشاء تذكير
  • get_current_time - الوقت الحالي

Usage

Loading with Datasets Library

from datasets import load_dataset

# Load the dataset
dataset = load_dataset("HeshamHaroon/Arabic_Function_Calling")

# Access splits
train_data = dataset["train"]
test_data = dataset["test"]

# Example usage
for sample in train_data.select(range(5)):
    print(f"Query: {sample['query_ar']}")
    print(f"Function: {sample['function_name']}")
    print(f"Dialect: {sample['dialect']}")
    print("---")

Fine-tuning Example

from transformers import AutoTokenizer, AutoModelForCausalLM
from datasets import load_dataset

dataset = load_dataset("HeshamHaroon/Arabic_Function_Calling")

def format_for_training(example):
    system = "أنت مساعد ذكي يفهم اللغة العربية. عند تلقي طلب، قم باستدعاء الدالة المناسبة."

    if example['requires_function']:
        response = f'{{"name": "{example["function_name"]}", "arguments": {example["arguments"]}}}'
    else:
        response = "لا حاجة لاستدعاء دالة"

    return {
        "messages": [
            {"role": "system", "content": system},
            {"role": "user", "content": example['query_ar']},
            {"role": "assistant", "content": response}
        ]
    }

formatted_dataset = dataset.map(format_for_training)

Evaluation Results

Validated on GPT-4o with function calling:

MetricScore
Overall Accuracy70.3%
Positive (Function Required)68.1%
Negative (No Function)90.0%

By Dialect Performance

DialectAccuracy
Egyptian77.6%
Gulf75.8%
Maghrebi67.2%
Levantine66.7%
MSA64.6%

Dataset Creation

Methodology

This dataset was created using a hybrid approach combining:

  1. Seed Generation: 500 hand-crafted samples across all domains and dialects
  2. Self-Instruct: GPT-4o expansion of seeds to 5,000 samples
  3. Dialect Multiplication: Expanding across 5 Arabic dialects
  4. Quality Filtering: Validation and deduplication

Why Native Arabic (Not Translation)?

Based on QCRI's research on Arabic Tool Calling:

  • Pure translation introduces "Anglocentric biases"
  • Bilingual (EN+AR) training achieves 0.99 recall vs 0.69 for single-language
  • Native Arabic datasets capture cultural context better

Generation Details

  • Model: Azure OpenAI GPT-4o
  • Concurrency: 20 parallel requests with exponential backoff
  • Temperature: 0.9 for diversity
  • Validation: GPT-4o function calling with 36 tools

Limitations and Biases

Known Limitations

  1. Synthetic Data: Generated by GPT-4o, may have model biases
  2. Dialect Imbalance: Maghrebi dialect underrepresented (4.1%)
  3. Domain Coverage: Limited to 8 domains, doesn't cover all use cases
  4. Argument Values: Some generated values may be fictional
  • Fine-tuning Arabic LLMs for function calling
  • Benchmarking Arabic tool use capabilities
  • Research on multilingual function calling
  • Developing Arabic AI assistants
  • Direct use in production without validation
  • Legal or medical advice applications
  • Financial decision-making systems

Citation

If you use this dataset, please cite:

@dataset{arabic_function_calling_2024,
  title={Arabic Function Calling Dataset},
  author={Hesham Haroon},
  year={2024},
  publisher={Hugging Face},
  url={https://huggingface.co/datasets/HeshamHaroon/Arabic_Function_Calling}
}

License

This dataset is released under the Apache 2.0 License.

Contact


arabic
dialects
function-calling
synthetic
tool-use