YAML Metadata
Warning:
empty or missing yaml metadata in repo card
(https://huggingface.co/docs/hub/model-cards#model-card-metadata)
import fasttext
import issai_lang_id as lang_id
# load
model = fasttext.load_model("issai_language_identification_model.bin")
print(model.labels)
# get
sentence = "Coca Cola сатып алды"
label, probability = model.predict(sentence,k=2)
label =label[0].replace('__label__','')
label = lang_id.get(sentence,label,probability[0])
print(f"after Predicted language: {label}")