Instructions to use GAD01/svm-language-detector with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Scikit-learn
How to use GAD01/svm-language-detector with Scikit-learn:
from huggingface_hub import hf_hub_download import joblib model = joblib.load( hf_hub_download("GAD01/svm-language-detector", "sklearn_model.joblib") ) # only load pickle files from sources you trust # read more about it here https://skops.readthedocs.io/en/stable/persistence.html - Notebooks
- Google Colab
- Kaggle
Language Detector (TF-IDF char n-grams + linear SVM Classifier)
Module 1 of the RAG-Based Mental Health Support Chatbot. Predicts the language
code of a short text (e.g. en, fr, ar).
Files
vectorizer.joblibโ fittedTfidfVectorizer(character n-grams)classifier.joblibโ fitted linear classifier
Usage
import joblib
from huggingface_hub import hf_hub_download
vec = joblib.load(hf_hub_download("GAD01/svm-language-detector", "vectorizer.joblib"))
clf = joblib.load(hf_hub_download("GAD01/svm-language-detector", "classifier.joblib"))
print(clf.predict(vec.transform(["Bonjour, comment allez-vous ?"]))[0]) # -> "fr"
Trained on papluca/language-identification.
- Downloads last month
- -