Releases: LlmKira/fast-langdetect
pypi_1.0.0 Reduce implicit fallbacks
⚠️ Breaking change
Please check README for details of the changes.
Keep it simple, keep it stupid.
from fast_langdetect import detect
-result = detect("Olá mundo", low_memory=False)
-print(code_to_english_name(result["lang"])) # Portuguese (Brazil) or Portuguese
+result = detect("Olá mundo", model='full', k=1) # Just use it!
+print(code_to_english_name(result[0]["lang"])) # Portuguese (Brazil) or Portugueseconfig = LangDetectConfig(
-allow_fallback=False, # It introduces unnecessary confusion
custom_model_path=None,
cache_dir=tempfile.gettempdir(),
)I miss allow_fallback...
You can implement the old allow_fallback func through composition, so that you can freely control the error handling logic.
try:
return detect("Olá mundo", model='full', k=1)
except:
return detect("Olá mundo", model='lite', k=1) What's Changed
- fix: wrongly fallback to low memory model when model corrupted by @JackyHe398 in #20
- 🔧 fix: bump version to 0.4.0 for new features and improvements by @sudoskys in #21
- ♻️ refactor(tests/infer): Unify detect functions, make the API more intuitive and avoid implicit fallbacks by @sudoskys in #22
New Contributors
- @JackyHe398 made their first contribution in #20
Full Changelog: pypi_0.3.2...pypi_1.0.0
pypi_0.3.2 Improve predictions for uppercase English input
No breaking changes, but added deprecation warnings
What's Changed
- ✨ feat(app): improve language detection by normalizing input by @sudoskys in #15
- ✨ feat(app): [Compatibility] add input normalization to language detection by @sudoskys in #16
thanks to @benmayersohn
Full Changelog: pypi_0.3.1...pypi_0.3.2
pypi_0.3.1 Optimize model loading
pypi_0.3.0 More user-friendly customization
Breaking Changes in v0.3.0 🔄
A significant update focused on improving Windows compatibility and configuration management.
Major Changes
- Configuration System Overhaul
- Replaced environment variables with a dedicated configuration class
- Please refer to the README or unit tests for migration details
Windows Compatibility Enhancement 🪟
To address FastText's ASCII path limitation on Windows, we've implemented a more robust solution:
- Now using
tempfileto create a temporary copy of the model - Model loading from temp location ensures compatibility regardless of Windows username or path
- This change prevents FastText path-related issues commonly encountered on Windows systems
Migration Required(?) ⚠️
Backwards compatibility implemented.
But if you were using hack methods for operations, please update your implementation to use the new configuration class.
For detailed implementation examples, check our test cases
Full Changelog: pypi_0.2.5...pypi_0.3.0
pypi_0.2.5 support Python313
#10
Full Changelog: pypi_0.2.4...pypi_0.2.5
pypi_0.2.4 logger.warn when MD5 mismatch
What's Changed
Full Changelog: pypi_0.2.3...pypi_0.2.4
pypi_0.2.3 No `numpy` required
What's Changed
thanks to https://github.com/searxng/fasttext-predict
Full Changelog: pypi_0.2.2...pypi_0.2.3
pypi_0.2.2 Support offlilne usage
pypi_0.2.1 numpy <2.0.0
Full Changelog: pypi_0.2.0...pypi_0.2.1