Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
@@ -7,6 +7,8 @@ from sentence_transformers import SentenceTransformer
|
|
7 |
from umap import UMAP
|
8 |
from hdbscan import HDBSCAN
|
9 |
from sklearn.feature_extraction.text import CountVectorizer
|
|
|
|
|
10 |
|
11 |
st.set_page_config(page_title='eRupt Topic Trendy (e-Commerce x Social Media)', page_icon=None, layout='centered', initial_sidebar_state='auto')
|
12 |
|
@@ -83,9 +85,12 @@ if similar_topics != []:
|
|
83 |
#print("Similarity Score: {}".format(similarity[0]))
|
84 |
|
85 |
answer_as_string = topic_model.get_topic(most_similar)
|
|
|
86 |
|
87 |
st.info("Extracted Topic")
|
88 |
-
st.text_area("Most Similar Topic List is Here",answer_as_string,key="topic_list")
|
|
|
|
|
89 |
st.image('https://freepngimg.com/download/keyboard/6-2-keyboard-png-file.png',use_column_width=True)
|
90 |
#st.markdown("<h6 style='text-align: center; color: #808080;'>Created By LiHE</a></h6>", unsafe_allow_html=True)
|
91 |
|
|
|
7 |
from umap import UMAP
|
8 |
from hdbscan import HDBSCAN
|
9 |
from sklearn.feature_extraction.text import CountVectorizer
|
10 |
+
import pandas as pd
|
11 |
+
|
12 |
|
13 |
st.set_page_config(page_title='eRupt Topic Trendy (e-Commerce x Social Media)', page_icon=None, layout='centered', initial_sidebar_state='auto')
|
14 |
|
|
|
85 |
#print("Similarity Score: {}".format(similarity[0]))
|
86 |
|
87 |
answer_as_string = topic_model.get_topic(most_similar)
|
88 |
+
answer_as_string = answer_as_string[0]
|
89 |
|
90 |
st.info("Extracted Topic")
|
91 |
+
#st.text_area("Most Similar Topic List is Here",answer_as_string,key="topic_list")
|
92 |
+
keywords = pd.DataFrame(answer_as_string , columns=["Topic", "Relevance"])
|
93 |
+
st.table(keywords)
|
94 |
st.image('https://freepngimg.com/download/keyboard/6-2-keyboard-png-file.png',use_column_width=True)
|
95 |
#st.markdown("<h6 style='text-align: center; color: #808080;'>Created By LiHE</a></h6>", unsafe_allow_html=True)
|
96 |
|