detect_dialect
Classify Arabic text into dialects (Egyptian, Levantine, Gulf, Maghrebi, MSA) using a keyword heuristic. Returns predicted dialect, confidence, and per-dialect scores.
Instructions
Guess the Arabic dialect using a transparent keyword heuristic.
This is a rule-based heuristic, NOT a trained classifier. It counts
hand-picked marker words per dialect (Egyptian, Levantine, Gulf, Maghrebi,
MSA) and returns the best match with a crude confidence. See
:func:arabic_tools.detect_dialect for the full documented limitations.
Args: text: The Arabic text to classify.
Returns: A dict with the predicted dialect, label, crude confidence, per-dialect scores, and a note documenting that this is a heuristic.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| text | Yes |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| result | Yes |