tommy.controller.topic_modelling_controller

Classes

class tommy.controller.topic_modelling_controller.TopicModellingController[source]

Bases: object

Controller that runs the selected topic modelling algorithm on a call of train_model and supplies a topic runner object from which results can be extracted.

__init__() None[source]

Initialize the publisher of the topic-modelling-controller

property calculate_topic_documents_event: EventHandler[list[tuple[Metadata, list[float]]]]
property model_trained_event: EventHandler[TopicRunner]
on_model_swap() None[source]

Notify the graph controller that the topic model has changed :return: None

set_controller_refs(parameters_controller: ModelParametersController, corpus_controller: CorpusController, stopwords_controller: StopwordsController, synonyms_controller: SynonymsController, preprocessing_controller: PreprocessingController) None[source]

Set the reference to the needed controllers

set_model_refs(topic_model: TopicModel, config_model: ConfigModel) None[source]

Set the references to the topic model :return: None

property start_training_model_event: EventHandler[TopicRunner]
property topic_model_switched_event: EventHandler[TopicRunner]
train_model() None[source]

Trains the selected model from on the currently loaded data and notifies the observers that a (new) topic runner is ready when async training is done :raises NotImplementedError: if selected model type is not supported :return: None