partial_fit for Bertopic #1047
Unanswered
econinomista
asked this question in
Q&A
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
I want to use the bertopic module in Spyder to analyze the topic of tweets. Furthermore, I want to use splits of my original data set to reduce running time since my data set is very large. I use the code underneath to first train my model and then use it to predict probabilities. However, Spyder for me always returns
ValueError: In order to use .partial_fit, the cluster model should have a .partial_fit function.
. I have not found any discussions on this topic, since I also found that in fact there is a partial_fit function for bertopic. Did anyone have the same experiences and could help me? Thank you in advance!`import os
from bertopic import BERTopic
import numpy as np
import pandas as pd
N_SPLITS = 10
def train_model(corpus_df, n_splits=N_SPLITS):
df_splits = np.array_split(corpus_df, N_SPLITS)
def predict_data(df, model, n_splits=N_SPLITS):
df_splits = np.array_split(df, N_SPLITS)
Beta Was this translation helpful? Give feedback.
All reactions