Metadata-Version: 2.4
Name: egyptian-arabizi-franco
Version: 0.1.0
Summary: Egyptian Arabizi (Franco-Arabic) to Arabic, offline and lightweight: 3amel eh -> عامل ايه
Author: Mohamed Hossam
License-Expression: MIT
Project-URL: Homepage, https://github.com/BackendNeuron/egyptian-arabizi-franco
Project-URL: Issues, https://github.com/BackendNeuron/egyptian-arabizi-franco/issues
Keywords: arabizi,franco-arabic,egyptian-arabic,transliteration,arabic,onnx,nlp
Classifier: Programming Language :: Python :: 3
Classifier: Natural Language :: Arabic
Classifier: Topic :: Text Processing :: Linguistic
Classifier: Operating System :: OS Independent
Requires-Python: >=3.9
Description-Content-Type: text/markdown
Requires-Dist: onnxruntime>=1.16
Requires-Dist: numpy>=1.21

# egyptian-arabizi-franco

Egyptian **Arabizi** (Franco-Arabic, "Franco") → **Arabic**, offline, on a CPU:

```
ezayak 3amel eh       →  ازيك عامل ايه
3andy el meeting bokra →  عندي الmeeting بكرة
```

A small character-level transformer (about 3M parameters, bundled with the package, no internet needed) plus a
few rules around it: English work and tech words stay in Latin letters, numbers, punctuation and emojis pass
through, and stretched letters (`awyyyy`) are shortened before conversion.

## Install

```bash
pip install egyptian-arabizi-franco
```

Python 3.9+. Depends only on `onnxruntime` and `numpy` (no PyTorch).

## Use

```python
from egyptian_arabizi_franco import convert

convert("ezayak 3amel eh")                       # 'ازيك عامل ايه'
convert(["yalla bina", "el meeting bokra"])      # a list in, a list out (faster than one by one)
```

The first call loads the model (a second or so); later calls reuse it. For more control, keep your own
converter:

```python
from egyptian_arabizi_franco import Converter

c = Converter(threads=2)            # limit CPU threads
c.convert("msh fahem 7aga")

raw = Converter(raw=True)           # the model alone, without the rules around it
```

From the command line:

```bash
egyptian-arabizi-franco "ezayak 3amel eh"
cat chat.txt | egyptian-arabizi-franco          # one line in, one line out
```

## How good is it?

On held-out, human-written Egyptian Arabizi: about **74% of words** and **37% of whole sentences** exactly right
(version 0.1.0). Typical mistakes are long vowels (`fahem` → فهم instead of فاهم) and letters Arabizi writes the
same way (`s` for both س and ص). Results, charts and the training code:
[github.com/BackendNeuron/egyptian-arabizi-franco](https://github.com/BackendNeuron/egyptian-arabizi-franco).

## Licence

MIT. The model was pre-trained on text from the Egyptian Arabic Wikipedia (CC BY-SA 4.0).
