mrungta8 commited on
Commit
2db34c0
·
1 Parent(s): 6fefca9

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +38 -7
app.py CHANGED
@@ -98,10 +98,20 @@ def compute_output(ssid_paper_id):
98
 
99
  return output_num_ref, output_maoc, oldest_paper_list, gr.update(value=plot_maoc)
100
 
101
-
102
- with gr.Blocks() as demo:
103
- ss_paper_id = gr.Textbox(label='Semantic Scholar ID',placeholder="Enter the Semantic Scholar ID here and press enter...", lines=1)
104
- submit_btn = gr.Button("Generate")
 
 
 
 
 
 
 
 
 
 
105
  with gr.Row():
106
  num_ref = gr.Textbox(label="Number of references")
107
  mAoc = gr.Textbox(label="Mean AoC")
@@ -109,15 +119,36 @@ with gr.Blocks() as demo:
109
  oldest_paper_list = gr.Textbox(label="Top 5 oldest papers cited:",lines=5)
110
  with gr.Row():
111
  mAocPlot = gr.Plot(label="Plot")
112
-
113
- clear_btn = gr.Button("Clear")
114
 
115
  submit_btn.click(fn = compute_output, inputs = [ss_paper_id], outputs = [num_ref, mAoc, oldest_paper_list, mAocPlot])
116
  # clear_btn.click(lambda: None, None, None, queue=False)
117
  clear_btn.click(fn = return_clear, inputs=[], outputs=[ss_paper_id, num_ref, mAoc, oldest_paper_list, mAocPlot])
118
-
 
119
  demo.launch()
120
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
121
  # import openai
122
  # import gradio
123
 
 
98
 
99
  return output_num_ref, output_maoc, oldest_paper_list, gr.update(value=plot_maoc)
100
 
101
+ with gr.Blocks(theme=gr.themes.Soft()) as demo:
102
+ with gr.Row():
103
+ gr.Markdown(
104
+ """
105
+ <center><h2>Citational Amnesia</h2></center>
106
+ <br>
107
+ <center>Demo to predict the number of references, mean age of citation(mAoC), and comparison of mAoC with all the papers in the ACL Anthology. </center>
108
+ <center>Kindly provide the Semantic Scholar ID of the paper to retrieve the results. </center>
109
+ """
110
+ )
111
+ with gr.Row():
112
+ ss_paper_id = gr.Textbox(label='Semantic Scholar ID',placeholder="Enter the Semantic Scholar ID here and press enter...", lines=1)
113
+ with gr.Row():
114
+ submit_btn = gr.Button("Generate")
115
  with gr.Row():
116
  num_ref = gr.Textbox(label="Number of references")
117
  mAoc = gr.Textbox(label="Mean AoC")
 
119
  oldest_paper_list = gr.Textbox(label="Top 5 oldest papers cited:",lines=5)
120
  with gr.Row():
121
  mAocPlot = gr.Plot(label="Plot")
122
+ with gr.Row():
123
+ clear_btn = gr.Button("Clear")
124
 
125
  submit_btn.click(fn = compute_output, inputs = [ss_paper_id], outputs = [num_ref, mAoc, oldest_paper_list, mAocPlot])
126
  # clear_btn.click(lambda: None, None, None, queue=False)
127
  clear_btn.click(fn = return_clear, inputs=[], outputs=[ss_paper_id, num_ref, mAoc, oldest_paper_list, mAocPlot])
128
+
129
+ demo.queue(concurrency_count=3)
130
  demo.launch()
131
 
132
+
133
+ # with gr.Blocks() as demo:
134
+ # ss_paper_id = gr.Textbox(label='Semantic Scholar ID',placeholder="Enter the Semantic Scholar ID here and press enter...", lines=1)
135
+ # submit_btn = gr.Button("Generate")
136
+ # with gr.Row():
137
+ # num_ref = gr.Textbox(label="Number of references")
138
+ # mAoc = gr.Textbox(label="Mean AoC")
139
+ # with gr.Row():
140
+ # oldest_paper_list = gr.Textbox(label="Top 5 oldest papers cited:",lines=5)
141
+ # with gr.Row():
142
+ # mAocPlot = gr.Plot(label="Plot")
143
+
144
+ # clear_btn = gr.Button("Clear")
145
+
146
+ # submit_btn.click(fn = compute_output, inputs = [ss_paper_id], outputs = [num_ref, mAoc, oldest_paper_list, mAocPlot])
147
+ # # clear_btn.click(lambda: None, None, None, queue=False)
148
+ # clear_btn.click(fn = return_clear, inputs=[], outputs=[ss_paper_id, num_ref, mAoc, oldest_paper_list, mAocPlot])
149
+
150
+ # demo.launch()
151
+
152
  # import openai
153
  # import gradio
154