Harsh502s Poorvi-06 commited on
Commit
0ac0c94
·
1 Parent(s): a70ecf8

- commit (d0da4908a62adbd67e72f6ab7ffd54802ff1a8f2)


Co-authored-by: Poorvi Singh <Poorvi-06@users.noreply.huggingface.co>

Files changed (1) hide show
  1. Pages/Models.py +9 -11
Pages/Models.py CHANGED
@@ -52,14 +52,14 @@ def output_keybert(text, n):
52
 
53
 
54
  # Retrieve the keyphrases from the input text using the Bertopics MMR model
55
- def output_mmr(text, n):
56
- new_review = text
57
- similar_topics, similarity = bertopic_model.find_topics(new_review, top_n=n)
58
- similar_topics = sorted(similar_topics)
59
- for i in range(n):
60
- tags = bertopic_model.get_topic(similar_topics[i], full=True)["MMR"]
61
- tags = [tag[0] for tag in tags]
62
- tagger_component(f"Tags from cluster {i+1}:", tags)
63
 
64
 
65
  # Find the most similar topics for the input text using the BERTopic model
@@ -154,7 +154,7 @@ def model_page():
154
 
155
  st.title("Select a model to use:")
156
  with st.container():
157
- tab1, tab2, tab3, tab4 = st.tabs(
158
  [
159
  "Supervised Using CNN",
160
  "UnSupervised-KeyBERT",
@@ -167,8 +167,6 @@ def model_page():
167
  with tab2:
168
  unsupervised_page_keybert()
169
  with tab3:
170
- unsupervised_page_mmr()
171
- with tab4:
172
  unsupervised_page_bertopic()
173
  with st.container():
174
  st.info("Click on the arrow to expand the example texts.")
 
52
 
53
 
54
  # Retrieve the keyphrases from the input text using the Bertopics MMR model
55
+ # def output_mmr(text, n):
56
+ # new_review = text
57
+ # similar_topics, similarity = bertopic_model.find_topics(new_review, top_n=n)
58
+ # similar_topics = sorted(similar_topics)
59
+ # for i in range(n):
60
+ # tags = bertopic_model.get_topic(similar_topics[i], full=True)["MMR"]
61
+ # tags = [tag[0] for tag in tags]
62
+ # tagger_component(f"Tags from cluster {i+1}:", tags)
63
 
64
 
65
  # Find the most similar topics for the input text using the BERTopic model
 
154
 
155
  st.title("Select a model to use:")
156
  with st.container():
157
+ tab1, tab2, tab3 = st.tabs(
158
  [
159
  "Supervised Using CNN",
160
  "UnSupervised-KeyBERT",
 
167
  with tab2:
168
  unsupervised_page_keybert()
169
  with tab3:
 
 
170
  unsupervised_page_bertopic()
171
  with st.container():
172
  st.info("Click on the arrow to expand the example texts.")