Remove unused code
Browse files- Pages/Models.py +0 -29
Pages/Models.py
CHANGED
@@ -51,17 +51,6 @@ def output_keybert(text, n):
|
|
51 |
tagger_component(f"Tags from cluster {i+1}:", tags)
|
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
|
66 |
def output_bertopic(text, n):
|
67 |
new_review = text
|
@@ -122,24 +111,6 @@ def unsupervised_page_keybert():
|
|
122 |
output_keybert(text, n)
|
123 |
|
124 |
|
125 |
-
# Display the unsupervised model using bertopic page of the app
|
126 |
-
def unsupervised_page_mmr():
|
127 |
-
st.header("Unsupervised Model Using BERTopic Model")
|
128 |
-
text = st.text_area(
|
129 |
-
"Enter text to assign tags", height=200, key="unsupervised_text_mmr"
|
130 |
-
)
|
131 |
-
text = clean_text(text)
|
132 |
-
n = st.number_input(
|
133 |
-
"Enter number of tags to assign", value=5, key="unsupervised_n_mmr"
|
134 |
-
)
|
135 |
-
if st.button("Assign tags", key="unsupervised_button_mmr"):
|
136 |
-
if text == "":
|
137 |
-
st.error("Please enter some text to assign tags")
|
138 |
-
else:
|
139 |
-
with st.spinner("Assigning tags..."):
|
140 |
-
output_mmr(text, n)
|
141 |
-
|
142 |
-
|
143 |
# Display the model page of the app
|
144 |
def model_page():
|
145 |
stype_for_page = """
|
|
|
51 |
tagger_component(f"Tags from cluster {i+1}:", tags)
|
52 |
|
53 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
54 |
# Find the most similar topics for the input text using the BERTopic model
|
55 |
def output_bertopic(text, n):
|
56 |
new_review = text
|
|
|
111 |
output_keybert(text, n)
|
112 |
|
113 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
114 |
# Display the model page of the app
|
115 |
def model_page():
|
116 |
stype_for_page = """
|