Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
@@ -42,11 +42,22 @@ topics, probs = fit_transform(topic_model, tiktok)
|
|
42 |
|
43 |
#placeholder = st.empty()
|
44 |
#text_input = placeholder.text_area("Enter product topic here", height=300)
|
45 |
-
text_input = st.text_area("Enter product topic here", value = "motor")
|
46 |
-
|
47 |
top_n = st.sidebar.slider("Select a number of topics", 1, 30, 5, 1)
|
48 |
|
49 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
50 |
|
51 |
if similar_topics != []:
|
52 |
most_similar = similar_topics[0]
|
|
|
42 |
|
43 |
#placeholder = st.empty()
|
44 |
#text_input = placeholder.text_area("Enter product topic here", height=300)
|
45 |
+
#text_input = st.text_area("Enter product topic here", value = "motor")
|
46 |
+
ebay_topic= form.selectbox("eBay Products Topic Selection", ["Motor", "Bicycle", "Beauty", "Basketball", "Fitness"])
|
47 |
top_n = st.sidebar.slider("Select a number of topics", 1, 30, 5, 1)
|
48 |
|
49 |
+
if ebay_topic == "Motor":
|
50 |
+
similar_topics, similarity = topic_model.find_topics("Motor", top_n=top_n)
|
51 |
+
elif ebay_topic == "Bicycle":
|
52 |
+
similar_topics, similarity = topic_model.find_topics("Bicycle", top_n=top_n)
|
53 |
+
elif ebay_topic == "Beauty":
|
54 |
+
similar_topics, similarity = topic_model.find_topics("Beauty", top_n=top_n)
|
55 |
+
elif ebay_topic == "Basketball":
|
56 |
+
similar_topics, similarity = topic_model.find_topics("Basketball", top_n=top_n)
|
57 |
+
elif ebay_topic == "Fitness":
|
58 |
+
similar_topics, similarity = topic_model.find_topics("Fitness", top_n=top_n)
|
59 |
+
else:
|
60 |
+
similar_topics, similarity = topic_model.find_topics("Motor", top_n=top_n)
|
61 |
|
62 |
if similar_topics != []:
|
63 |
most_similar = similar_topics[0]
|