Language detection using FastText and Spacy
Project description
spacy-language
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 >= ...
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.1.0.tar.gz
(782.5 kB
view hashes)
Built Distribution
spacy_fastlang-0.1.0-py3-none-any.whl
(780.0 kB
view hashes)
Close
Hashes for spacy_fastlang-0.1.0-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 973551b4613595abb1a102de332d8a42a299a2df04db0fbfd88863300d757e43 |
|
MD5 | 6f810d83b577b2d16e6fcf4f8f6ac2cd |
|
BLAKE2b-256 | f9ddea42614a96ffa530ed1b6fa4776a78cb47565ee4c137a361263da4a20920 |