"Kreyòl merite zouti tou · Kreyòl deserves tools too"
If you like this project, a star ⭐️ would mean a lot :)
Overview / Apèsi
Haitian Creole is spoken by millions of people, but it still lacks many of the language resources and tools available for larger languages. This project aims to build an open-source Ayiti NLP ecosystem focused on creating useful Natural Language Processing tools for Haitian Creole.
Most NLP progress has focused on high-resource languages, while Haitian Creole remains underrepresented. Creating better tools for Haitian Creole can help preserve the language, improve accessibility, and allow more Haitian developers and researchers to build AI applications.
Installation / Enstalasyon
pip install kreyolib -U
Usage / Itilizasyon
Alphabet / Alfabèt
The package exposes the full Haitian Creole alphabet as frozen sets for phonology and tokenization work:
from kreyolib import (
ORAL_VOWELS,
NASAL_VOWELS,
CONSONANTS,
SEMI_VOWELS,
ALPHABET,
)
ORAL_VOWELS # frozenset({'a', 'e', 'è', 'i', 'o', 'ò', 'ou'})
NASAL_VOWELS # frozenset({'an', 'en', 'on', 'oun', 'in'})
CONSONANTS # frozenset({'b', 'ch', 'd', 'f', 'g', 'h', 'j', 'k', 'l', 'm', 'n', 'ng', 'p', 'r', 's', 't', 'v', 'z'})
SEMI_VOWELS # frozenset({'w', 'y', 'ui'})
ALPHABET # ORAL_VOWELS | NASAL_VOWELS | CONSONANTS | SEMI_VOWELS
Normalization
Orthography (API)
Standardizes chat slang, archaic spellings, clitics, and article usage into modern IPN orthography.
from kreyolib.normalize.orthography import standardize_text
# -- Chat slang & abbreviations --
standardize_text("Bjr! Mw tap tann ou sou ban an, svp cheri ou knn c fèt mwen jodi a.")
# Bonjou! Mwen tap tann ou sou ban an, silvouplè cheri ou konn se fèt mwen jodi a.
# -- Article correction --
standardize_text("Mwen chita sou ban a. Mwen ap manje bannann la ki te sou tab lan.")
# Mwen chita sou ban an. Mwen ap manje bannann nan ki te sou tab la.
# -- Capitalization fixes --
standardize_text("mwen renmen bondye")
# Mwen renmen Bondye
With aggressive=True, older historical variations and non-standard spellings are folded in as well:
standardize_text("Nan lé monn mouin té pèdu nan péché; Min Jézu té sové-m.", aggressive=True)
# Nan le mond mwen te pèdi nan peche; Men Jezi te sovem.
Contractions (API)
Expands colloquial clitics (m'ap, y'ap, n') into formal standalone words.
from kreyolib.normalize.contractions import expand_contractions
expand_contractions("M'ap ale lakay nou paske yap tann nou pou n' al travay.")
# Mwen ap ale lakay nou paske yo ap tann nou pou nou al travay.
Diacritics (API)
Removes accent marks — useful for search indexes or legacy systems that expect plain ASCII.
from kreyolib.normalize.diacritics import strip_diacritics
strip_diacritics("Abèy yo ap vole sou òganizasyon an lè yo ale nan fèt la.")
# Abey yo ap vole sou oganizasyon an le yo ale nan fet la.
Tokenization
Sentence Splitter (API)
Splits text into sentences, respecting abbreviations, quotes, and parenthesized boundaries. Powered by yasbd-lib, with Haitian Creole rules extended with French abbreviations and sentence starters.
from kreyolib.tokenize.sentence import sent_tokenize
sent_tokenize("Alo mond. Koman ou ye? Mwen byen.")
# ['Alo mond.', 'Koman ou ye?', 'Mwen byen.']
sent_tokenize("M. Dupont est un professeur. Li travay nan lekòl la. Li di: \"Mwen pral vini demen.\" Apre sa, li ale.")
# ['M. Dupont est un professeur.', 'Li travay nan lekòl la.', 'Li di: "Mwen pral vini demen."', 'Apre sa, li ale.']
Word Tokenizer (API)
Splits text into word-level tokens while preserving abbreviations, hashtags, mentions, and URLs.
from kreyolib.tokenize.word import word_tokenize
word_tokenize("Dr. Jean-Louis t'ap travay U.S.A nan Yahoo!")
# ['Dr.', 'Jean-Louis', 't', "'", 'ap', 'travay', 'U.S.A', 'nan', 'Yahoo!']
word_tokenize("@Jhon Sak genla? ##myboy")
# ['@Jhon', 'Sak', 'genla', '?', '##myboy']
word_tokenize("www.google.com avèk Jhon@gmail.com.")
# ['www.google.com', 'avèk', 'Jhon', '@gmail.com', '.']
Conversion
Number to Text (API)
Converts an integer or decimal into its Kreyòl word form. It also supports negative numbers and ordinal numbers.
from kreyolib.convert.num_to_text import num_to_text
print(num_to_text(223)) # 'de san venntwa'
print(num_to_text(1_000_000)) # 'yon milyon'
print(num_to_text(12.4)) # 'douz pwen kat'
print(num_to_text(-5)) # 'mwens senk'
print (num_to_text(400_034)) # 'kat san mil trannkat'
print(num_to_text(0.17)) # 'zewo pwen disèt'
print(num_to_text(0.014)) # 'zewo pwen zewo katòz'
print(num_to_text(42, ordinal=True)) # 'san vennkatryèm'
print(num_to_text(124, ordinal=True)) # 'karanndezyèm'
Text to Number (API)
Converts Kreyòl number words back into an integer or float. The converter supports negative numbers and decimals and tolerates minor spelling variations through fuzzy matching.
from kreyolib.convert.text_to_num import text_to_num
print(text_to_num("de san venntwa")) # 223
print(text_to_num("yon milyon san uit")) # 1000008
print(text_to_num("douz pwen kat")) # 12.4
print(text_to_num("mwens de san")) # -200
print(text_to_num("de mil de san")) # 200200
print(text_to_num("de san de mil")) # 202000
print(text_to_num("zewo pwen zewo uit")) # 0.08
print(text_to_num("kat milyon de san karanntwa")) # 4_000_243
Advanced Models & Intelligence
POS Tagger (API)
Built on Universal Dependencies treebanks (Autogramm, Adolphe) with custom preprocessing and French-based proper noun handling. See the Tagger Source Code for training details.
Tag a raw sentence:
from kreyolib.tagger.pos import tag
tag("Map vini demen nan maten pou n al travay ansanm.")
# [('M', 'PRON'), ('ap', 'AUX'), ('vini', 'VERB'), ('demen', 'NOUN'), ('nan', 'ADP'),
# ('maten', 'NOUN'), ('pou', 'ADP'), ('n', 'PRON'), ('al', 'VERB'), ('travay', 'VERB'),
# ('ansanm', 'ADV'), ('.', 'PUNCT')]
Or a pre-tokenized list:
tag(["Mwen", "rele", "Jan", ",", "e", "mwen", "abite", "Okay", "."])
# [('Mwen', 'PRON'), ('rele', 'VERB'), ('Jan', 'PROPN'), (',', 'PUNCT'), ('e', 'CCONJ'),
# ('mwen', 'PRON'), ('abite', 'VERB'), ('Okay', 'NOUN'), ('.', 'PUNCT')]
Roadmap & Progress / Plan Travay
- 1. Normalization & Preprocessing
- Text standardization and modernization
- Contraction expansion
- Diacritics remover
- 2. Conversion
- Number-to-text conversion in Kreyòl with bidirectional support
- Date and time formatters
- 3. Corpus & Datasets
- Stop words
- Chat/informal abbreviations
- Sentences and words
- 4. Advanced Models & Intelligence
- Part-of-Speech (POS) tagging engine (ml)
- Named Entity Recognition for Haitian entities (ml)
- Lexicon-based sentiment analysis engine
- Sentence/Next-word predictor
- 5. Tokenization & Segmentation
- Context-aware Word tokenizer
- Sentence boundary splitter (with support for mention, and hashtag)
- Subword tokenization via Byte-Pair Encoding and rules
- 6. Phonetics & Syntax
- Text-to-phonetics and IPA generation
- CV syllabification engine
- 7. Spelling & Error Correction
- Spell-checking engine
- 8. Core Architecture & Pipeline
- Sequential execution pipeline runner
How People Can Contribute
For ways to contribute, see Contributing Guide.
This is a community-driven project to give Haitian Creole a stronger place in the AI and NLP ecosystem.
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file kreyolib-0.2.0.tar.gz.
File metadata
- Download URL: kreyolib-0.2.0.tar.gz
- Upload date:
- Size: 278.3 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via:
twine/7.0.0 CPython/3.13.14
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
361cf528a0d12c8fd747d545730359e6a304adf41b5235151b21cae3b03e5de2
|
|
| MD5 |
bc561431f8928a33169c0e214d7101c3
|
|
| BLAKE2b-256 |
3f16b84d2c9cc688ffb7b5687bbb71b1c965b4a0087c401c63858b122deb32d5
|
Provenance
The following attestation bundles were made for kreyolib-0.2.0.tar.gz:
Publisher:
publish.yml on AyitiDev/kreyolib
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
kreyolib-0.2.0.tar.gz -
Subject digest:
361cf528a0d12c8fd747d545730359e6a304adf41b5235151b21cae3b03e5de2 - Sigstore transparency entry: 2647228095
- Sigstore integration time:
-
Permalink:
AyitiDev/kreyolib@f10dfb5c5154ec3029873746302a0dcd7979b0b5 -
Branch / Tag:
refs/tags/v0.2.0 - Owner: https://github.com/AyitiDev
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@f10dfb5c5154ec3029873746302a0dcd7979b0b5 -
Trigger Event:
push
-
Statement type:
File details
Details for the file kreyolib-0.2.0-py3-none-any.whl.
File metadata
- Download URL: kreyolib-0.2.0-py3-none-any.whl
- Upload date:
- Size: 268.7 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via:
twine/7.0.0 CPython/3.13.14
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
41ebd000a3219974bd6f79b840c9e8e3a38e8f9c5b90b2fe848a370052c7c719
|
|
| MD5 |
afea927952567164acafadb69c077322
|
|
| BLAKE2b-256 |
8286bf55473a3cc3ab7a3e05db4df9e47042930d87777a14dd148c3c0a250c15
|
Provenance
The following attestation bundles were made for kreyolib-0.2.0-py3-none-any.whl:
Publisher:
publish.yml on AyitiDev/kreyolib
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
kreyolib-0.2.0-py3-none-any.whl -
Subject digest:
41ebd000a3219974bd6f79b840c9e8e3a38e8f9c5b90b2fe848a370052c7c719 - Sigstore transparency entry: 2647228098
- Sigstore integration time:
-
Permalink:
AyitiDev/kreyolib@f10dfb5c5154ec3029873746302a0dcd7979b0b5 -
Branch / Tag:
refs/tags/v0.2.0 - Owner: https://github.com/AyitiDev
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@f10dfb5c5154ec3029873746302a0dcd7979b0b5 -
Trigger Event:
push
-
Statement type: