Skip to main content

polyglot3

PyPI Tests Python

polyglot3 is a maintained, Python 3 only continuation of polyglot, a natural language pipeline for massively multilingual applications. It keeps polyglot's API and models under the package name polyglot3, and removes the native dependencies that made polyglot hard to install. It is maintained by Dcipher Analytics AB.

Features

  • Tokenization: word and sentence segmentation for all languages
  • Language detection: 176 languages
  • Named entity recognition: 25 languages
  • Part of speech tagging: 7 languages
  • Sentiment analysis: 136 languages
  • Word embeddings: 25 languages

See Supported languages for the exact lists.

What changed from polyglot

  • New name. Import polyglot3 instead of polyglot (from polyglot3.text import Text) and run the polyglot3 command. The API is otherwise the same, models and ~/polyglot_data are shared, and polyglot3 can be installed next to the original package.
  • No PyICU. Word and sentence segmentation use a pure-Python port of ICU's break iterators, generated from ICU 78.3's own rules, including the Thai dictionary engine. Outside Chinese, Japanese, Korean, Lao, Khmer and Burmese (which ICU segments with dictionaries that are not bundled), the boundaries match ICU's exactly, so the existing NER and POS models see the tokens they were trained on.
  • No pycld2. Language detection uses fastText's lid.176 model via fasttext-langdetect.
  • Python 3.9 to 3.13 only; Python 2 support and six are gone.
  • New model host. Models are downloaded from a Hugging Face dataset and verified against checksums. The original Stony Brook server is offline.
  • Removed: morphological analysis and transliteration (their models are no longer available), and the TextBlob/NLTK leftovers that never worked.
  • Fixed: tokens after emoji and other non-BMP characters were garbled; the sentiment subcommand did nothing; several downloader bugs.

Quick tutorial

Download the models for the languages you need (once):

polyglot3 download LANG:tr LANG:cs
from polyglot3.text import Text, Word

Language detection

text = Text("Bugün hava çok güzel, parka gidelim.")
print(text.language.code, text.language.name)
tr Turkish

Tokenization

zen = Text(
    "Beautiful is better than ugly. "
    "Explicit is better than implicit. "
    "Simple is better than complex."
)
print(zen.words)
print(zen.sentences)
['Beautiful', 'is', 'better', 'than', 'ugly', '.', 'Explicit', 'is', 'better', 'than', 'implicit', '.', 'Simple', 'is', 'better', 'than', 'complex', '.']
[Sentence("Beautiful is better than ugly."), Sentence("Explicit is better than implicit."), Sentence("Simple is better than complex.")]

Part of speech tagging

text = Text("Petr Novák pracuje v Praze pro společnost Škoda.")
for word, tag in text.pos_tags:
    print("{:<16}{}".format(word, tag))
Petr            PROPN
Novák           PROPN
pracuje         ADJ
v               ADP
Praze           NOUN
pro             ADP
společnost      NOUN
Škoda           PROPN
.               PUNCT

Named entity recognition

text = Text(
    "Mustafa Kemal Atatürk, 1923 yılında Ankara'da Türkiye Cumhuriyeti'ni ilan etti."
)
print(text.entities)
[I-PER(['Mustafa', 'Kemal', 'Atatürk']), I-LOC(['Türkiye'])]

Polarity

text = Text("Bu film harika ama son kısmı berbat.")
for w in text.words:
    print("{:<16}{:>2}".format(w, w.polarity))
Bu               0
film             0
harika           1
ama             -1
son              0
kısmı            0
berbat          -1
.                0

Embeddings

from polyglot3.load import load_embeddings

embeddings = load_embeddings("tr")
print(embeddings.nearest_neighbors("Ankara"))
['İstanbul', 'İzmir', 'Bursa', 'Antalya', 'Adana', 'Trabzon', 'Balıkesir', 'Konya', ...]

Supported languages

Task Languages (ISO 639 codes)
Named entity recognition ar bg cs et fa fi he hi hr hu id ko lv ms no pt ru sk sl sr sv th tr uk vi
Part of speech tagging bg cs fi hu id sl sv
Word embeddings same as named entity recognition
Sentiment 136 languages (see the Sentiment docs)
Language detection 176 languages (see the Detection docs)
Tokenization all languages (see the Tokenization docs)

Credits and citation

polyglot was created by Rami Al-Rfou with contributions from Yingtao Tian and others at the Data Science Lab, Stony Brook University. The models come from their research. If you use them, please cite the papers:

@InProceedings{polyglot:2013:ACL-CoNLL,
  author    = {Al-Rfou, Rami and Perozzi, Bryan and Skiena, Steven},
  title     = {Polyglot: Distributed Word Representations for Multilingual NLP},
  booktitle = {Proceedings of the Seventeenth Conference on Computational Natural Language Learning},
  month     = {August},
  year      = {2013},
  address   = {Sofia, Bulgaria},
  publisher = {Association for Computational Linguistics},
  pages     = {183--192},
  url       = {https://aclanthology.org/W13-3520}
}

@inproceedings{polyglotner,
  author    = {Al-Rfou, Rami and Kulkarni, Vivek and Perozzi, Bryan and Skiena, Steven},
  title     = {{Polyglot-NER}: Massive Multilingual Named Entity Recognition},
  booktitle = {Proceedings of the 2015 {SIAM} International Conference on Data Mining},
  month     = {April},
  year      = {2015},
  publisher = {SIAM}
}

@inproceedings{chen2014building,
  title     = {Building sentiment lexicons for all major languages},
  author    = {Chen, Yanqing and Skiena, Steven},
  booktitle = {Proceedings of the 52nd Annual Meeting of the Association for Computational Linguistics (Short Papers)},
  pages     = {383--389},
  year      = {2014}
}

Segmentation is derived from ICU (Unicode License V3) and language detection uses fastText's lid.176 model.

polyglot3 is maintained by Dcipher Analytics AB (info@dcipheranalytics.com). This repository has been updated by the Dcipher Analytics dev team with help from Claude Opus. Many thanks to the original polyglot authors for their work.

Metadata

Release files for polyglot3 2026.10.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 polyglot3 2026.10.1
File Size Uploaded Provenance
polyglot3-2026.10.1.tar.gz 1.0 MB With provenance Details

Built distribution (wheel)

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

Total release size: 1.2 MB

Release files / polyglot3-2026.10.1.tar.gz

Download URL polyglot3-2026.10.1.tar.gz
Size 1.0 MB
Tags Source
SHA-256 checksum
How to use checksums
0fd8716c8a152a29e93ebfad4cc9d6a2b01caacb35741c9f89511354f99a415e
BLAKE2b-256 checksum
How to use checksums
2c426c022dd19faf6ee46a9d45c2c5a9dd6811eb88c13da8a9094e5e8e407bde
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

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 Oct 22, 2026.

Transparency log

Release files / polyglot3-2026.10.1-py3-none-any.whl

Download URL polyglot3-2026.10.1-py3-none-any.whl
Size 211.1 kB
Tags Python 3
SHA-256 checksum
How to use checksums
6b49513bf5b148f1596a0d1417577fcfa4bc0942f5004191a77fb412ccbbb65a
BLAKE2b-256 checksum
How to use checksums
26bf312a8a7c21b11f97d724027da76a9fae7eba7e5f22ab4d245cc1796728f0
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

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 Oct 22, 2026.

Transparency log

Security for polyglot3 2026.10.1

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.

Full provenance

All 2 files in this release have been uploaded with provenance metadata.

Select from 2 files

Attestation for polyglot3-2026.10.1.tar.gz

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 Oct 22, 2026.

Transparency log

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

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