Skip to content

Classifier

Luiz Miguel edited this page Aug 6, 2023 · 6 revisions

A simple text classifier that uses similarities between the text and the database to tell which entity is responsible.

Args:

model (Model): The model that will be used for classify.

Methods

predict(input: set) Predict the entity responsible for the input by comparing the patterns
getSimilarities(input: set) Performs the process of filtering patterns similarities

Exemple:

from simpleclassifier import Classifier, Model, processText

model = Model.read("model.pkl") # This model needs to be pre-trained
classifier = Classifier(model)

input = processText("What time is it")
result = classifier.predict(input)
print(result)
Clone this wiki locally