{"id":45011,"library":"gcld3","title":"gcld3","description":"Python binding for Google's Compact Language Detector v3 (CLD3), a neural network model for language identification. Version 3.0.13 is the current release; the library is stable but no longer actively developed by Google. It is typically used as a drop-in replacement for the deprecated `cld2-cffi`.","status":"active","version":"3.0.13","language":"python","source_language":"en","source_url":"https://github.com/google/cld3","tags":["language-detection","cld3","nlp"],"install":[{"cmd":"pip install gcld3","lang":"bash","label":"Install from PyPI"}],"dependencies":[],"imports":[{"note":"gcld3 is a module; the module itself is the class factory. The typical pattern is `import gcld3; detector = gcld3.NNetLanguageIdentifier(min_num_bytes, max_num_bytes)`.","wrong":"from gcld3 import gcld3","symbol":"gcld3","correct":"import gcld3"}],"quickstart":{"code":"import gcld3\n\ndetector = gcld3.NNetLanguageIdentifier(min_num_bytes=0, max_num_bytes=1000)\ntext = \"This is an example sentence in English.\"\nresult = detector.FindLanguage(text)\nprint(result.language, result.probability, result.is_reliable, result.proportion)\n# Output: en 0.9999 True 1.0","lang":"python","description":"Minimal example: instantiate a language identifier and call FindLanguage on a text string."},"warnings":[{"fix":"Consider using `fasttext-langdetect` or `langdetect` as alternatives if accuracy is critical.","message":"The underlying CLD3 model from Google is no longer updated. It may perform poorly on short texts or mixed-language inputs.","severity":"deprecated","affected_versions":"all"},{"fix":"Always use `pip install gcld3` for this binding.","message":"The `gcld3` package on PyPI (version 3.0.13) is a community-maintained fork. The official Google code lives in the `cld3` repository but the pip package `cld3` is different (a different binding). Do not confuse `gcld3` with `cld3`.","severity":"gotcha","affected_versions":"all"},{"fix":"Use `result.language` and `result.probability` instead of `result[0]` and `result[1]`.","message":"`FindLanguage` returns a namedtuple with fields: language, probability, is_reliable, proportion. Access them as attributes, not by index.","severity":"gotcha","affected_versions":"all"}],"env_vars":null,"search_vec":"'3.0.13':20 'activ':32 'bind':3 'cffi':51 'cld2':50 'cld2-cffi':49 'cld3':11,55 'compact':7 'current':23 'deprec':48 'detect':54 'detector':9 'develop':33 'drop':43 'drop-in':42 'gcld3':1 'googl':5,35 'identif':18 'languag':8,17,53 'language-detect':52 'librari':26 'longer':31 'model':15 'network':14 'neural':13 'nlp':56 'python':2 'releas':24 'replac':45 'stabl':28 'typic':38 'use':39 'v3':10 'version':19","created_at":"2026-06-07T12:52:56.027135+00:00","updated_at":"2026-06-07T12:52:56.027135+00:00","problems":[{"fix":"Use `import gcld3` and then call `gcld3.NNetLanguageIdentifier(...)`.","cause":"Incorrect import statement: trying to import a submodule that doesn't exist.","error":"ImportError: cannot import name 'gcld3' from 'gcld3' (unknown location)"},{"fix":"Upgrade to the latest version: `pip install --upgrade gcld3`. If issues persist, report to the package maintainers.","cause":"The shared library may not have been compiled correctly, or a very old version is installed.","error":"AttributeError: module 'gcld3' has no attribute 'NNetLanguageIdentifier'"}],"ecosystem":"pypi","meta_description":null,"install_score":null,"quickstart_score":null,"quickstart_tag":null,"pypi_latest":null,"cli_name":null,"cli_version":null,"type":"library","homepage":"https://github.com/google/cld3","github":"https://github.com/google/cld3","docs":null,"changelog":null,"pypi":null,"npm":null,"openapi_spec":null,"status_page":null,"smithery":null,"categories":["ai-ml"],"base_url":null,"auth_type":null,"provenance":{"verified_status":"passing","verified_at":"2026-06-29","last_verified":"2026-06-29","next_check":"2026-07-29","install_tag":null}}