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 LanguageDetector
that will set two spacy extensions
- doc._.language = ISO code of the detected language or
xx
as a fallback - doc._.language_score = confidence
from spacy_fastlang import LanguageDetector
nlp = spacy.load("...")
nlp.add_pipe(LanguageDetector())
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-0.4.2.tar.gz
(782.6 kB
view hashes)
Built Distribution
spacy_fastlang-0.4.2-py3-none-any.whl
(780.2 kB
view hashes)
Close
Hashes for spacy_fastlang-0.4.2-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 6d0ce5719021c5832c29e14c8d646f0f7558727740730d5c6c17301dcf46ace0 |
|
MD5 | 781dbb293d8c7149cbdd5d0cfa87e0fb |
|
BLAKE2b-256 | bf54014616d7f808a8441577b81a922e349fe6fcc215c43c920f17fff5ae1f95 |