Summary
I ran into a problem with code that was working fine until recently. I’m trying to run the Top2VEc model and I’m getting an error.
Steps to reproduce
Code snippet:
import pandas as pd
from top2vec import Top2Vec
import streamlit as st
@st.cache_resource()
def topic_modeling(docs):
"""Top2Vec loader."""
model = Top2Vec(docs, embedding_model='universal-sentence-encoder-multilingual')
return (model)
uploaded_file = st.file_uploader("Choose a file", type=['csv'], help='Accept only CSV extenction')
if uploaded_file is not None:
df = pd.read_csv(uploaded_file)
df=df.head(1000)
docs = list(df.loc[:,"myColumn"].values)
model = topic_modeling(docs)
st.write(model)
else:
st.write("upload file")
Expected behavior:
2-3 days ago I could execute this code without any problems.
Actual behavior:
Additional information
To run the top2vec model you need data with a column containing string in a minimum of 50 rows.
Any thoughts on what happened and how to fix it?