pyconversations.ld

pyconversation.ld is the language detection sub-module of the PyConversation package. Many portions of PyConversation allow for the enabling of language detection, which currently uses the langid package.

Want to see other language detection support? Submit a feature request or feel free to contribute!

class pyconversations.ld.BaseLangDetect[source]

Container for what a language detection module should take as input and should return as output

get(text)[source]

Uses the language detection module to detect a language

Parameters

text (str) – The raw text to detect the language of

Returns

tuple(str, float) – The detected language and confidence of detection

class pyconversations.ld.LangidLangDetect[source]

Language detection using the langid package

get(text)[source]

Uses langid module to detect a language

Parameters

text (str) – The raw text to detect the language of

Returns

tuple(str, float) – The detected language and confidence of detection