Text Classifier Topics

class TextClassifierTopics

class factfinder.src.text_classifier_topics.TextClassifierTopics(repository_id='Sandrro/text_to_subfunction_v10', number_of_categories=1, device_type=None)[source]

Bases: object

This class is aimed to classify input texts into themes, or structured types of events. It uses a Huggingface transformer model trained on rubert-tiny. In many cases count of messages per theme was too low to efficiently train, so we used synthetic themes based on the categories as upper level (for example, ‘unknown_ЖКХ’)

run(t)[source]

This method takes a text as input and returns the predicted themes and probabilities. :param t: text to classify :return: list of predicted themes and probabilities