lang_identification / README.md
mamyrbek's picture
Update README.md
84eb443 verified
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}")