Language detection using FastText and Spacy
Project description
spacy_fastlang
Install
Assuming you have a working python environment, you can simply install it using
pip install spacy_fastlang
Usage
The library exports a pipeline component called language_detector
that will set two spacy extensions
- doc._.language = ISO code of the detected language or
xx
as a fallback - doc._.language_score = confidence
import spacy_fastlang
nlp = spacy.load("...")
nlp.add_pipe("language_detector")
doc = nlp(en_text)
doc._.language == "..."
doc._.language_score >= ...
Options
Check the tests to see more examples and available options
License
Everythin is under MIT
except the default model which is distributed under Creative Commons Attribution-Share-Alike License 3.0 by facebook here
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
spacy_fastlang-1.0.0.tar.gz
(782.8 kB
view hashes)
Built Distribution
spacy_fastlang-1.0.0-py3-none-any.whl
(780.3 kB
view hashes)
Close
Hashes for spacy_fastlang-1.0.0-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 7cdfd889fb1803d4d9715a2e5e4cc62fa7b9d5b265162cb2988a85f9f22b0449 |
|
MD5 | a1d730ba9ff096b1210066ddde3980bd |
|
BLAKE2b-256 | 0b787ffdd40799f0e2654d4a4c78d398f2bbeedda3186165b9bbde7c2eab2e75 |