Closed vkunal1996 closed 4 years ago
By detect_lang(), do you mean this call? https://github.com/Mimino666/langdetect/blob/d0c8e85622abe3d67e763d9377f707e51c4a7217/langdetect/detector_factory.py#L133
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.
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?