Views
No views yet
1from huggingface_hub import hf_hub_download
2import fasttext
3
4filename = hf_hub_download(
5 repo_id="mesolitica/fasttext-language-detection-v2",
6 filename="fasttext.ftz"
7)
8lang_model = fasttext.load_model(filename)
9lang_model.predict('hello my name', k = 10)1(('__label__standard-english',
2 '__label__local-english',
3 '__label__standard-malay',
4 '__label__socialmedia-indonesian',
5 '__label__local-malay',
6 '__label__other'),
7 array([9.12180483e-01, 4.69220504e-02, 4.03920077e-02, 5.50693308e-04,
8 1.30474637e-05, 1.07987826e-05]))