rameshmoorthy commited on
Commit
fcc06ed
1 Parent(s): 169a56e

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +9 -8
app.py CHANGED
@@ -5,13 +5,14 @@ from functions import process_file_bm25 , process_file_bert , generate_plot , ge
5
  #------------------------------------------------------
6
 
7
  # Create the state object
8
- state = gr.State()
9
- state.df_bm25 = pd.DataFrame({"Products": [1, 2, 3], "column2": ["A", "B", "C"]})
10
- state.df_bert = pd.DataFrame({"Products": [1, 2, 3], "column2": ["A", "B", "C"]})
11
-
12
- state.df_topics_bert = pd.DataFrame({"Topic": [1, 2, 3], "column2": ["A", "B", "C"]})
13
- state.df_topics_bm25 = pd.DataFrame({"Topic": [1, 2, 3], "column2": ["A", "B", "C"]})
14
 
 
 
 
 
15
 
16
 
17
  with gr.Blocks() as bm25:
@@ -51,7 +52,7 @@ with gr.Blocks() as bm25:
51
 
52
  cluster_btn = gr.Button(value="Cluster")
53
  #[ df,topics_info,barchart,topics_plot,heatmap,hierarchy]
54
- tup=cluster_btn.click(process_file_bm25, inputs=[inputfile,mode,min_cluster_size,top_n_words,ngram,state],
55
  outputs=[
56
  gr.Dataframe(),
57
  gr.File(label="Download CSV"),
@@ -61,7 +62,7 @@ with gr.Blocks() as bm25:
61
  gr.Plot(label="Topics Plot"),
62
  gr.Plot(label="Heatmap"),
63
  gr.Plot(label="Hierarchy"),
64
- gr.State()
65
  ])
66
  print('Tuple **************************' ,tup)
67
  #[df1, df2, barchart_plot, topics_plot, heatmap_plot, hierarchy_plot] = tup
 
5
  #------------------------------------------------------
6
 
7
  # Create the state object
8
+ # state = gr.State()
9
+ # state.df_bm25 = pd.DataFrame({"Products": [1, 2, 3], "column2": ["A", "B", "C"]})
10
+ # state.df_bert = pd.DataFrame({"Products": [1, 2, 3], "column2": ["A", "B", "C"]})
 
 
 
11
 
12
+ # state.df_topics_bert = pd.DataFrame({"Topic": [1, 2, 3], "column2": ["A", "B", "C"]})
13
+ # state.df_topics_bm25 = pd.DataFrame({"Topic": [1, 2, 3], "column2": ["A", "B", "C"]})
14
+ df_bm25=gr.State(value=pd.DataFrame({"column1": [1, 2, 3], "column2": ["A", "B", "C"]}))
15
+ df_topics_bm25 = gr.State(value=pd.DataFrame({"column1": [1, 2, 3], "column2": ["A", "B", "C"]}))
16
 
17
 
18
  with gr.Blocks() as bm25:
 
52
 
53
  cluster_btn = gr.Button(value="Cluster")
54
  #[ df,topics_info,barchart,topics_plot,heatmap,hierarchy]
55
+ tup=cluster_btn.click(process_file_bm25, inputs=[inputfile,mode,min_cluster_size,top_n_words,ngram],
56
  outputs=[
57
  gr.Dataframe(),
58
  gr.File(label="Download CSV"),
 
62
  gr.Plot(label="Topics Plot"),
63
  gr.Plot(label="Heatmap"),
64
  gr.Plot(label="Hierarchy"),
65
+
66
  ])
67
  print('Tuple **************************' ,tup)
68
  #[df1, df2, barchart_plot, topics_plot, heatmap_plot, hierarchy_plot] = tup