rameshmoorthy
commited on
Commit
•
7307caf
1
Parent(s):
9f18ee5
Update app.py
Browse files
app.py
CHANGED
@@ -40,7 +40,7 @@ with gr.Blocks() as bm25:
|
|
40 |
|
41 |
|
42 |
#german = gr.Textbox(label="German Text")
|
43 |
-
def confirmation():
|
44 |
if file.name.endswith('.csv'):
|
45 |
df = pd.read_csv(file)
|
46 |
elif file.name.endswith('.xls') or file.name.endswith('.xlsx'):
|
@@ -57,9 +57,7 @@ with gr.Blocks() as bm25:
|
|
57 |
doc = 'File uploaded! Press Cluster button'
|
58 |
return doc # Return the success message
|
59 |
|
60 |
-
|
61 |
-
return doc
|
62 |
-
|
63 |
def download_df():
|
64 |
df1=state.df
|
65 |
print(df1)
|
@@ -67,7 +65,7 @@ with gr.Blocks() as bm25:
|
|
67 |
|
68 |
out = gr.Textbox()
|
69 |
mode=gr.Radio(["Automated clustering", "Manually choose parameters"], label="Type of algorithm", value="Automated clustering",info="Choose any mode u want")
|
70 |
-
inputfile.upload(confirmation,inputs=[],outputs=out)
|
71 |
with gr.Row():
|
72 |
|
73 |
min_cluster_size=gr.Slider(2, 500, value=5, step=1,label="min_cluster_size", info="Choose minimum No. of docs in a cluster. Lower the value ,higher the clusters created")
|
@@ -90,10 +88,6 @@ with gr.Blocks() as bm25:
|
|
90 |
gr.Plot(label="Hierarchy"),
|
91 |
|
92 |
])
|
93 |
-
print('Tuple **************************' ,tup)
|
94 |
-
#[df1, df2, barchart_plot, topics_plot, heatmap_plot, hierarchy_plot] = tup
|
95 |
-
|
96 |
-
|
97 |
llm_btn = gr.Button(value="AI generation ")
|
98 |
llm_btn.click(download_df,inputs=[],outputs=gr.Dataframe(label="Output"))
|
99 |
|
|
|
40 |
|
41 |
|
42 |
#german = gr.Textbox(label="German Text")
|
43 |
+
def confirmation(file):
|
44 |
if file.name.endswith('.csv'):
|
45 |
df = pd.read_csv(file)
|
46 |
elif file.name.endswith('.xls') or file.name.endswith('.xlsx'):
|
|
|
57 |
doc = 'File uploaded! Press Cluster button'
|
58 |
return doc # Return the success message
|
59 |
|
60 |
+
|
|
|
|
|
61 |
def download_df():
|
62 |
df1=state.df
|
63 |
print(df1)
|
|
|
65 |
|
66 |
out = gr.Textbox()
|
67 |
mode=gr.Radio(["Automated clustering", "Manually choose parameters"], label="Type of algorithm", value="Automated clustering",info="Choose any mode u want")
|
68 |
+
inputfile.upload(confirmation,inputs=[inputfile],outputs=out)
|
69 |
with gr.Row():
|
70 |
|
71 |
min_cluster_size=gr.Slider(2, 500, value=5, step=1,label="min_cluster_size", info="Choose minimum No. of docs in a cluster. Lower the value ,higher the clusters created")
|
|
|
88 |
gr.Plot(label="Hierarchy"),
|
89 |
|
90 |
])
|
|
|
|
|
|
|
|
|
91 |
llm_btn = gr.Button(value="AI generation ")
|
92 |
llm_btn.click(download_df,inputs=[],outputs=gr.Dataframe(label="Output"))
|
93 |
|