Archive

LangChain Arabic

A published Python package that repairs Arabic model output for speech — restoring diacritics and reading numbers as words — as a drop-in LangChain parser.

Context
Independent open-source project
Services
Open-source engineering, Applied NLP, Developer tooling
Technology
Python, LangChain, num2words, PyPI
<5ms
Dictionary latency
5
Number contexts
2
Dialects supported
The langchain-arabic parser composed into a LangChain chain
01

What had to change

Arabic text-to-speech mispronounces undiacritised words and reads figures digit by digit, and language models return Arabic without diacritics most of the time. Every Arabic voice product ends up rewriting the same repair layer before a single word can be spoken.

02

What Louay built

Louay extracted that layer from a production Arabic RAG system, rebuilt it on LangChain's streaming parser base, and published it to PyPI. Deterministic longest-match diacritics replacement and context-aware number-to-word conversion, composed into a chain like any other parser.

03

What the work enabled

An installable package that drops into any chain as ArabicTextOutputParser and inherits streaming, batching and composition for free — filling a gap an ecosystem of hundreds of integrations had left open.

Open the package