Closed 2507779542 closed 5 years ago
Let's say the data is like below in pandas dataframe df: doc_id, text id_for_document_1, text_for_document_1 id_for_document_2, text_for_document_2
n_features = 1000 tf_vectorizer = TfidfVectorizer( stop_words='english', max_df=0.9, min_df=0.1, max_features=n_features) tf = tf_vectorizer.fit_transform(list(df['text']))
model = guidedlda.GuidedLDA(n_topics=5, n_iter=100, random_state=7, refresh=20) model.fit(tf) # This will fail as it doesn't support tf-idf
I have the same scenario. Pandas df with id and text in columns. Not sure how to have it as a DTM. Can you please help?
@JeevaGanesan @sunnyc89 Has anyone figured out if we can use tfidf in guidedLDA?
This model runs on document term matrix. Not sure if it will work with TFIDF. Can you share a few rows and columns, so I can check if it can be made to work.
@vi3k6i5 Were you able to find a way if we can use tfidf as input to model.fit() ?
This model runs on document term matrix. Not sure if it will work with TFIDF. Can you share a few rows and columns, so I can check if it can be made to work.