thomasthiebaud / spacy-fastlang Goto Github PK
View Code? Open in Web Editor NEWLanguage detection using Spacy and Fasttext
License: MIT License
Language detection using Spacy and Fasttext
License: MIT License
Hi,
source: https://spacy.io/universe/project/spacy_fastlang
This is what I entered in the Google Colab notebook but I get the following error
!pip install spacy_fastlang
ERROR: Could not find a version that satisfies the requirement spacy_fastlang (from versions: none) ERROR: No matching distribution found for spacy_fastlang
How can I fi this? Thank you.
Currently the required spaCy version is set to 3.6.0 or higher. However, AFAIK the LanguageDetector
does not use any spaCy features specific to that version so the version constraint can safely be relaxed to a lower version (probably >= 3.0.0)
I personally tried it with spaCy 3.4.4 and it worked without any issues
french word for number are not detected as 'fr' language
small test program below yield result:
Text: ceci est du francais LANG: fr SCORE: 0.8692260980606079
Text: donnez quarante cinq cinquante euros LANG: xx SCORE: 0.44422411918640137
Text: donnez 45 50 euros LANG: en SCORE: 0.20330046117305756
import spacy
import spacy_fastlang
nlp_lang = spacy.blank('xx')
nlp_lang.add_pipe('language_detector', config={"supported_languages": ["fr","en"]})
texts = ["ceci est du francais","donnez quarante cinq cinquante euros", "donnez 45 50 euros"]
for t in texts:
doc = nlp_lang(t)
print( "Text: {} LANG: {} SCORE: {}".format( t, doc._.language, doc._.language_score))
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.