Skip to content
Masso edited this page Jan 20, 2022 · 16 revisions

NLP-Classifier Wiki

A simple text classifier that uses similarities between the text and the database to tell which entity is responsible.
This classifier was created specifically for Karen Virtual Assistent

simpleclassifier.Classifier(self, acceptable: int = 50)

Return the classifier class.

 Args:
     acceptable (int, optional): Acceptable percentage of similarity.

Classifier.predict(self, patterns: dict, input: set)

Process patterns and check input similarities.

Args:
    patterns (dict): Patterns generated by `trainer.py`.
    input (set): Input processed by `simpleclassifier.processText`.

Returns:
    Boolean/Tuple: Returns a tuple with the probable answer and similarity.

simpleclassifier.processText(text: str)

Process the text by removing punctuation and stopwords.

Args:
    text (str): User input text.

Returns:
    [set]: Returns a set with the processed text.
Clone this wiki locally