TopicNet icon indicating copy to clipboard operation
TopicNet copied to clipboard

Custom needs more custom handling

Open Alvant opened this issue 1 year ago • 0 comments

What is the problem

There is an error if one uses custom regularizers:

# Create some custom regularizer
# regularizer = ...

topic_model._fit(
    dataset.get_batch_vectorizer(),
    num_iterations=10,
    custom_regularizers={
        regularizer.name: regularizer
    },
)

image

image ... image

How to fix

In the file ~/lib/miniconda3/envs/topicnet/lib/python3.8/site-packages/topicnet/cooking_machine/models/topic_model.py:289, wrap meta stuff in list:

attached_rwt = pd.DataFrame(data=nd_array, columns=list(meta.topic_name), index=list(meta.token))

Environment

topicnet==0.8.0
pandas==2.0.0
protobuf==3.20.3

Alvant avatar Apr 24 '23 10:04 Alvant