Skip to main content

Amharic Segmenter and tokenizer

This is a simple script that split an Amharic document into different sentences and tokenes. If you find an issue, please let us know in the GitHub Issues

The Segmenter is part of the Semantic Models for Amharic Project image0

Usage

Install the segmenter: pip install amseg

Tokenization and Segmentation

Use the following code for sentence segmentation and word tokenization

from amseg.amharicSegmenter import AmharicSegmenter
sent_punct = []
word_punct = []
segmenter = AmharicSegmenter(sent_punct,word_punct)
words = segmenter.amharic_tokenizer("እአበበ በሶ በላ።")
sentences = segmenter.tokenize_sentence("እአበበ በሶ በላ። ከበደ ጆንያ፤ ተሸከመ፡!ለምን?")

Outputs

words = [‘እአበበ’, ‘በሶ’, ‘በላ’, ‘።’]

sentences = [‘እአበበ በሶ በላ።’, ‘ከበደ ጆንያ፤ ተሸከመ፡!’, ‘ለምን?’]

Romanization and Normalization

The following code show cases how to normalize and romanize a given Amharic text

from amseg.amharicNormalizer import AmharicNormalizer as normalizer
from amseg.amharicRomanizer import AmharicRomanizer as romanizer
normalized = normalizer.normalize('ሑለት ሦስት')
romanized = romanizer.romanize('ሑለት ሦስት')
Outputs

> normalized = ‘ሁለት ሶስት’ > romanized = ‘ḥulat śosət’

Transliteration to Amharic Fidel

The following code show cases how to transliterate a given latin script text to Amahric Fidel script text

from amseg.amharicTranslitrator import AmharicTranslitrator as  transliterator
transliterated = transliterator.transliterate('misa belah')
Outputs

> transliterated = ‘ሚሳ በላህ’

Publications

To cite the Amharic segmenter/tokenizer tool, use the following paper

@Article{fi13110275,
AUTHOR = {Yimam, Seid Muhie and Ayele, Abinew Ali and Venkatesh, Gopalakrishnan and Gashaw, Ibrahim and Biemann, Chris},
TITLE = {Introducing Various Semantic Models for Amharic: Experimentation and Evaluation with Multiple Tasks and Datasets},
JOURNAL = {Future Internet},
VOLUME = {13},
YEAR = {2021},
NUMBER = {11},
ARTICLE-NUMBER = {275},
URL = {https://www.mdpi.com/1999-5903/13/11/275},
ISSN = {1999-5903},
DOI = {10.3390/fi13110275}
}

Metadata

Release files for amseg 2.3

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

Source distribution (sdist)

Source distribution for amseg 2.3
File Size Uploaded
amseg-2.3.tar.gz 11.5 kB Details

Release files / amseg-2.3.tar.gz

Download URL amseg-2.3.tar.gz
Size 11.5 kB
Tags Source
SHA-256 checksum
How to use checksums
1d51cce1ca9b00b365b33fad5089e2660547be258750efbfb2e9658c53cff599
BLAKE2b-256 checksum
How to use checksums
b1664f9442687a9a0f7c3d7a7e0013e60b8d400ad758903690f6535f31490f75
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/3.4.2 importlib_metadata/4.10.1 pkginfo/1.7.1 requests/2.26.0 requests-toolbelt/0.9.1 tqdm/4.62.3 CPython/3.7.10

Release history Release notifications | RSS feed

This release

2.3 This release

1 release file

1.7

1 release file

1.5

1 release file

1.4

1 release file

1.2

1 release file

0.1

1 release file

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