Mimino666 / langdetect

Port of Google's language-detection library to Python.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Can i get top 5 confidence ?

vkunal1996 opened this issue · comments

By using detect_lang() we get a variable number of language confidence. Is there any way to get the top 5 language confidence? for a particular string?

By detect_lang(), do you mean this call?

def detect_langs(text):

Yes, @RasmusEdvardsen By Any means if I can get the top 5 confidence languages. It will be helpful.

From what I understand, when you call detect_langs(text), the result is a list of all languages (that has a profile), sorted by highest probability - detect_langs(spacy_object.text)[0] giving you the highest probability, and so on.

Is that not what you want, or?

Oh, I see, I thought it will return output similar to langid tool, which gives the top language with their confidence. My Question is answered. Thanks for your help.