HARCHAtelier
Skip to main content
HARCHAtelier
Sign inPricing
Request a demo
← Back to blog
Methodology

Sentiment Analysis in Arabic: Why Most Tools Fail on Darija

A technical deep dive on Arabic NLP, code-switching between Darija, French and MSA, and the trilingual approach HarchIQ uses to reach 88% accuracy on Moroccan conversation.

KA
Karim Alaoui
AI Engines Lead, Harch Atelier
April 24, 2026·13 min read

Most commercial sentiment-analysis tools were trained on English, fine-tuned on Modern Standard Arabic, and shipped to the Middle East. Applied to Moroccan conversation — where a single tweet can mix Darija, French, MSA and Latin-script Arabizi — they fail predictably and expensively. This is a technical deep dive on why, and on the trilingual approach HarchIQ uses to reach 88% sentiment accuracy on Moroccan text.

The three failure modes

Off-the-shelf Arabic sentiment models fail on Moroccan text in three characteristic ways. The first is dialect mismatch: a model trained on Levantine or Egyptian Arabic misreads Darija vocabulary ('dbg' = 'now', 'shi' = 'some') and produces neutral or wrong labels. The second is code-switching: a sentence like 'Le service de la banque est l3q, wallah je vais changer' switches from French to Darija mid-sentence, and most models tag the whole sentence by the dominant-script language. The third is script: Arabizi (Arabic in Latin characters, with numbers for emphatic consonants) is invisible to models that expect Arabic script.

Sentiment accuracy by language across five tools (%)
91%
English
84%
French
78%
MSA
41%
Darija

The Darija gap is stark. A tool that scores 91% on English and 78% on MSA drops to 41% on Moroccan Darija — barely better than random. For a Moroccan bank monitoring Twitter, this means the majority of customer complaints in Darija are either missed or mislabelled neutral, leaving the reputation-risk signal invisible until it has already migrated to French-language press.

Tool-by-tool comparison

ToolFRAR (MSA)ENDarijaNotes
Tool A (off-the-shelf)82%76%91%39%Trained on Gulf + Levantine
Tool B (off-the-shelf)79%71%88%34%No dialect handling
Tool C (cloud API)85%78%90%44%Generic multilingual
Tool D (regional vendor)80%74%83%52%MSA + Egyptian tuning
HarchIQ (trilingual)89%85%92%88%Darija-native + code-switch
Sentiment accuracy on a 2,000-sentence hand-labelled Moroccan benchmark, January 2026.

The code-switching problem in detail

Moroccan corporate conversation is not monolingual. A single customer-service thread on X routinely contains French for the formal complaint, Darija for the emotional register, and English loanwords for product names. A sentiment model that classifies by document language mislabels the thread as 'French' and applies a French-language model to the Darija segments. The result is a false neutral — the most dangerous label in reputation monitoring, because it hides a signal rather than corrupting it.

⚠
The false-neutral problem
A mislabelled-negative is noisy but visible. A mislabelled-neutral is invisible. In our benchmark, 38% of Darija-negative sentences were labelled neutral by off-the-shelf tools — meaning more than a third of complaints never trigger an alert.

How HarchIQ handles it

HarchIQ is trilingual by design. The pipeline runs three parallel passes — French, MSA, and a Darija-native model trained on 1.4 million hand-labelled Moroccan sentences — and a code-switching detector that segments a sentence by language span before classification. Arabizi is normalised to Arabic script via a rule-based transliteration layer before the Darija model sees it. The three passes are reconciled by a confidence-weighted ensemble that prefers the Darija model on Darija-dominant spans.

88%
HarchIQ Darija sentiment accuracy
vs. 41% average for off-the-shelf tools

What 'Darija-native' means

A Darija-native model is not an MSA model with a dialect adapter. It is a model trained from scratch on Moroccan text, with a vocabulary that includes the French loanwords ('facture', 'service', 'recharge') that are syntactically Darija, the Berber substrate vocabulary, and the emphatic consonants that MSA models handle inconsistently. The training corpus spans customer-service transcripts, social platforms, and press comments — the registers where Moroccan corporate reputation actually lives.

The Souk test

We benchmark every model release against the 'Souk test' — 500 hand-labelled Moroccan sentences drawn from real customer-service and social conversation, balanced across positive, neutral and negative. A model that passes the Souk test handles the registers that matter for reputation monitoring: the frustrated customer, the ironic compliment, the Berber-inflected complaint, the French-formal request. Off-the-shelf models score 41% on the Souk test; HarchIQ scores 88%.

“We were missing every other Darija complaint. The reputation dashboard looked green while Twitter was red. That is how a crisis surprises a bank that thought it was monitoring.”
— Head of Digital, Moroccan bank (anonymised)

Practical implications

  1. 1Ask any sentiment vendor for a Darija-specific accuracy number on a hand-labelled benchmark. If they cannot produce one, the tool is not fit for Moroccan monitoring.
  2. 2Audit the false-neutral rate, not just the overall accuracy. A high false-neutral rate is the silent failure mode.
  3. 3Cover Arabizi. Roughly 30% of Moroccan social conversation about brands is in Latin script; a script-only Arabic model is blind to it.
  4. 4Test on your own customer-service transcripts before buying. Vendor benchmarks are often MSA-heavy.
  5. 5Re-benchmark quarterly. Darija evolves fast — new loanwords, new slang — and a static model degrades.

HarchIQ's trilingual sentiment engine is the foundation of Harch Atelier's reputation monitoring. The Darija-native model is retrained quarterly on fresh Moroccan text, and the Souk test is published in our methodology documentation.

Tags
#sentiment analysis#Arabic NLP#Darija#code-switching#HarchIQ#trilingual NLP#Moroccan Arabic#natural language processing
KA
Written by

Karim Alaoui

AI Engines Lead, Harch Atelier

Karim leads Harch Atelier's AI-engine visibility practice and the NLP work on Moroccan Darija. He previously built multilingual sentiment systems for a European news-monitoring group.

Get your reputation audit →

A board-ready audit of how your company is perceived across 30+ media sources, 8 AI engines and the social conversation — in Darija, French and English. 5 minutes to request. 7 days to deliver.

Request my free audit →
Related articles

Keep reading.

Methodology11 min read

The Harch 100 Methodology: How We Rank Morocco's Top Companies

The scoring formula, the pillar extraction, the data sources and the expert review — with a worked sample scoring for Bank of Africa at 72/100.

Read →
Methodology8 min read

The Moroccan Media Landscape: 20+ Sources to Monitor

Hespress dominates online audience, TelQuel and Medias24 structure the French-language debate, Le360 and H24Info set the pace of the flow. An operational map of the sources a reputation-intelligence platform must cover in Morocco.

Read →
Methodology8 min read

Darija Sentiment Analysis: The Challenges of Multilingualism

An average Moroccan tweet mixes Darija, French, MSA and anglicisms. Academic corpora (Samih 2016, Chabbaki 2025) have started equipping research. On the production side, the road remains open. State of the art and operational methodology.

Read →
Checking…
Initializing…
HARCH|Atelier

AI Reputation Intelligence — Africa & the French-speaking world.

atelier@harchcorp.com·+212 684 440 682
→ harchcorp.com
Navigation
ProductsSolutionsDecision AugmentationPricingRequest demoAbout
Products
Reputation Intelligence PlatformAPI & MCP IntegrationsInsight ReportsAdvanced DashboardsNewsletters & Briefings
Tools
★ Flagship Report 2026Harch 100 RankingRisk TrackerConsoleReport TemplatesInstitutional Audit
Resources
All resourcesFlagship Report 20262026 Media ReportCase studiesMethodologyFAQ
Company
About usCareersPartnersContactTrust CenterResilience MatrixLegal
8 francophone markets covered
FR
France
Paris · Lyon · Marseille
MA
Morocco
Casablanca · Rabat · Marrakech
BE
Belgium
Brussels · Antwerp
CH
Switzerland
Geneva · Lausanne · Zurich
QC
Quebec
Montreal · Quebec City
TN
Tunisia
Tunis · Sfax
LB
Lebanon
Beirut
SN
Senegal
Dakar
Building in Public, since 2026 · Casablanca, Morocco
Harch Atelier is a Harch Corp venture · Bank transfer