{"id":24256,"library":"polyglot","title":"Polyglot","description":"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.","status":"maintenance","version":"16.7.4","language":"python","source_language":"en","source_url":"https://github.com/aboSamoor/polyglot","tags":["nlp","multilingual","language-detection","tokenization","sentiment-analysis"],"install":[{"cmd":"pip install polyglot","lang":"bash","label":"pip install"}],"dependencies":[{"reason":"Required for numerical operations","package":"numpy","optional":false},{"reason":"ICU bindings for Unicode support","package":"pyicu","optional":false},{"reason":"Language detection via CLD2","package":"pycld2","optional":false}],"imports":[{"note":"Common mistake: using bare 'import polyglot' fails because main module has no Text class.","wrong":"import polyglot","symbol":"Text","correct":"from polyglot.text import Text"}],"quickstart":{"code":"from polyglot.text import Text\n\ntext = Text(\"Hello, world!\")\nprint(text.language)  # Language detected","lang":"python","description":"Basic usage: detect language of a string."},"warnings":[{"fix":"Install system packages: libicu-dev, libcld2-dev; then pip install pyicu pycld2.","message":"Polyglot requires ICU (pyicu) and CLD2 (pycld2) to be installed. Without them, imports fail or produce cryptic errors.","severity":"breaking","affected_versions":"all"},{"fix":"Run: python -m polyglot download embeds en","message":"Text object's .words, .sentences, .entities are lazy and may raise if downloaded models are missing. Run polyglot.downloader to get required models.","severity":"gotcha","affected_versions":"all"},{"fix":"Use polyglot.sentiment.SentimentAnalyzer instead.","message":"Sentiment analysis using the Text.sentiment attribute is deprecated in favor of using the explicit polyglot.sentiment module.","severity":"deprecated","affected_versions":">=16.0.0"}],"env_vars":null,"last_verified":"2026-05-01T00:00:00.000Z","next_check":"2026-07-30T00:00:00.000Z","problems":[{"fix":"pip install polyglot","cause":"Polyglot not installed.","error":"ImportError: No module named 'polyglot'"},{"fix":"Install system libicu-dev and run: pip install pyicu","cause":"PyICU not installed or missing system ICU libraries.","error":"ModuleNotFoundError: No module named 'icu'"},{"fix":"Run: python -m polyglot download","cause":"Polyglot uses NLTK-like resource system; required models not downloaded.","error":"LookupError: Resource ... not found. Please use the NLTK Downloader to obtain the resource"}],"ecosystem":"pypi","meta_description":null,"install_score":null,"install_tag":null,"quickstart_score":null,"quickstart_tag":null}