Registry / ai-ml / polyglot

polyglot

JSON →
library16.7.4pypypiunverified

Polyglot is a natural language pipeline supporting massive multilingual applications. Version 16.7.4 (latest) provides tokenization, language detection, named entity recognition, sentiment analysis, and word embeddings for over 130 languages. Release cadence is irregular; last update was April 2021.

pip install polyglot
INSTALL
IMPORT
SIG · POLYGLOT
P
polyglot
ai-mlpythonv16.7.4
Install
2.7s avg
Import
Disk
17MB
Pass rate
10/ 10
Env Coverage10 / 10
glibc
3.93.13
musl
3.93.13
Install & Compatibility
Where this runs
tested against v16.7.4 · pip install
no network on importno background threads
Install × environment matrix
Each cell = how many times install + import succeeded across repeated harness runs. Partial = flaky.
glibc = Debian/Ubuntu slim · musl = Alpine Linux
musl
py 3.103.95 runs
installs and imports cleanly · install 0.0s · import 0.000s · 19.6MB
glibc
py 3.103.95 runs
installs and imports cleanly · install 2.7s · import 0.000s · 20MB
17MB installed
● package 17MB
Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

Text
from polyglot.text import Text
from polyglot.text import Text

Basic usage: detect language of a string.

from polyglot.text import Text text = Text("Hello, world!") print(text.language) # Language detected
polyglot --version
Debug
Known issues
breakingPolyglot requires ICU (pyicu) and CLD2 (pycld2) to be installed. Without them, imports fail or produce cryptic errors.
fix
Install system packages: libicu-dev, libcld2-dev; then pip install pyicu pycld2.
affects: all
gotchaText object's .words, .sentences, .entities are lazy and may raise if downloaded models are missing. Run polyglot.downloader to get required models.
fix
Run: python -m polyglot download embeds en
affects: all
deprecatedSentiment analysis using the Text.sentiment attribute is deprecated in favor of using the explicit polyglot.sentiment module.
fix
Use polyglot.sentiment.SentimentAnalyzer instead.
affects: >=16.0.0
Upgrade
Version history
16.7.4latest on PyPI · released Jul 3, 2016
Audit
Dependencies
numpyrequiredRequired for numerical operations
pyicurequiredICU bindings for Unicode support
pycld2requiredLanguage detection via CLD2
Agent activity
6 hits · last 30 days
node
6
Resources
polyglot — pip install polyglot · libregistry