Skip to main content

Gherbal

FastText-based multilingual language identification with HuggingFace Hub integration.

Supports 200+ languages including fine-grained Arabic dialect detection.

Installation

pip install gherbal

Quick Start

from gherbal import Gherbal

# Load from HuggingFace Hub
model = Gherbal.from_pretrained("omarkamali/gherbal")

# Predict language
model.predict("Hello, how are you?")
# => [('eng_Latn', 0.99)]

model.predict("مرحبا كيف حالك")
# => [('arb_Arab', 0.95)]

Loading a Local Model

model = Gherbal.from_pretrained("./path/to/model")

Training

import pandas as pd
from gherbal import Gherbal

df = pd.DataFrame({"text": [...], "label": [...]})
model = Gherbal.train(df, save_path="./my_model")

Preprocessing

from gherbal import preprocess_text, create_clean_script_function

text = preprocess_text("Hello @user https://example.com 🎉")
# => "hello"

# Script-aware cleaning
clean = create_clean_script_function()
clean("Latn", "Hello World 123")
# => "Hello World"

Pushing to HuggingFace Hub

model.push_to_hub("username/my-gherbal-model")

License

MIT

Metadata

Release files for gherbal 1.0.1

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for gherbal 1.0.1
File Size Uploaded
gherbal-1.0.1.tar.gz 21.7 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for gherbal 1.0.1
File Interpreter ABI Platform
gherbal-1.0.1-py3-none-any.whl Python 3 none any Details

Total release size: 35.1 kB

Release files / gherbal-1.0.1.tar.gz

Download URL gherbal-1.0.1.tar.gz
Size 21.7 kB
Tags Source
SHA-256 checksum
How to use checksums
0cff6694f84b11315ead028e965f1e46cf59fb9ea64bafed5788e07f15b84b2c
BLAKE2b-256 checksum
How to use checksums
45e1c8f3b2d1fa8c0a6c063259a22df9c4faf22b1e84d3b1912d11a005521d28
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/6.1.0 CPython/3.13.7

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Mar 14, 2026.

Transparency log

Release files / gherbal-1.0.1-py3-none-any.whl

Download URL gherbal-1.0.1-py3-none-any.whl
Size 13.4 kB
Tags Python 3
SHA-256 checksum
How to use checksums
c8e1b47fc3a697d9bc54dcaa07fab18101595a14fe1f55ebfac0c62953587cb9
BLAKE2b-256 checksum
How to use checksums
15162ef3e70254d50ba63aebcc4d096b0723f0e84261560e7dd1875c6bea90bb
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/6.1.0 CPython/3.13.7

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Mar 14, 2026.

Transparency log

Release history Release notifications | RSS feed

This release

1.0.1 This release

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page