text_quality.language.classifier

Module Contents

Classes

LanguageClassifier

Abstract class for implementing different language classifiers.

class text_quality.language.classifier.LanguageClassifier[source]

Bases: abc.ABC

Abstract class for implementing different language classifiers.

REMOVE_CHARACTERS[source]
abstract classify(text: str) tuple[str, float][source]

Classify a text string.

Parameters:

text – The text to classify.

Returns:

A tuple with the language and the confidence.

static preprocess(text: str) str[source]