rameshmoorthy
commited on
Commit
•
169a56e
1
Parent(s):
23ef1a0
Update functions.py
Browse files- functions.py +4 -4
functions.py
CHANGED
@@ -13,7 +13,7 @@ import plotly.express as px
|
|
13 |
from wordcloud import WordCloud
|
14 |
|
15 |
|
16 |
-
def process_file_bm25(file,mode,min_cluster_size,top_n_words,ngram
|
17 |
# Read the Excel sheet or CSV file
|
18 |
|
19 |
if file.name.endswith('.csv'):
|
@@ -47,7 +47,7 @@ def process_file_bm25(file,mode,min_cluster_size,top_n_words,ngram,state):
|
|
47 |
# Visualize all graphs
|
48 |
|
49 |
topics_info=topic_model.get_topic_info()
|
50 |
-
|
51 |
#print(topics)
|
52 |
try:
|
53 |
barchart = topic_model.visualize_barchart(top_n_topics=10)
|
@@ -66,10 +66,10 @@ def process_file_bm25(file,mode,min_cluster_size,top_n_words,ngram,state):
|
|
66 |
df['topic_number_encoded'] = label_encoder.fit_transform(df['topic_number'])
|
67 |
temp_file = NamedTemporaryFile(delete=False, suffix=".xlsx")
|
68 |
df.to_excel(temp_file.name, index=False)
|
69 |
-
|
70 |
#print(df)
|
71 |
|
72 |
-
return df,temp_file.name,topics_info ,barchart,topics_plot, heatmap, hierarchy
|
73 |
|
74 |
|
75 |
def process_file_bert(file,mode,min_cluster_size,top_n_words,ngram):
|
|
|
13 |
from wordcloud import WordCloud
|
14 |
|
15 |
|
16 |
+
def process_file_bm25(file,mode,min_cluster_size,top_n_words,ngram):
|
17 |
# Read the Excel sheet or CSV file
|
18 |
|
19 |
if file.name.endswith('.csv'):
|
|
|
47 |
# Visualize all graphs
|
48 |
|
49 |
topics_info=topic_model.get_topic_info()
|
50 |
+
df_topics_bm25= topics_info
|
51 |
#print(topics)
|
52 |
try:
|
53 |
barchart = topic_model.visualize_barchart(top_n_topics=10)
|
|
|
66 |
df['topic_number_encoded'] = label_encoder.fit_transform(df['topic_number'])
|
67 |
temp_file = NamedTemporaryFile(delete=False, suffix=".xlsx")
|
68 |
df.to_excel(temp_file.name, index=False)
|
69 |
+
df_bm25=df
|
70 |
#print(df)
|
71 |
|
72 |
+
return df,temp_file.name,topics_info ,barchart,topics_plot, heatmap, hierarchy
|
73 |
|
74 |
|
75 |
def process_file_bert(file,mode,min_cluster_size,top_n_words,ngram):
|