Hi Svetozar,
It was a long time ago since we discussed adding/removing topics from an existing model in BigARTM, but finally there is a solution (at master branch):
model = artm.ARTM(topic_names=...)
topic_names = list(model.topic_names)
del topic_names[5] # Delete, let's say, topic at 5th position
model.reshape_topics(topic_names)
This will exclude column at 5th position from phi matrix. You may also use reshape_topics() to add or reorder columns. If you add columns they will be initialized with zeros.
Note that there is also a setter for ARTM.topic_names field, but it only allows you to rename existing topic names -- e.g. the list of topic names must be of the same length, and the will be set as new labels for existing columns (no add/delete or reorder in phi matrix).
This is documented here:
And here:
If you add new columns you'll have to initialized them manually via
model.master.attach_model() . So, there still is no out-of-the-box solution in BigARTM to infer new topics from new documents, but I know few people who are looking into this and hopefully came up with solution.
Kind regards,
Alex