gamingflexer commited on
Commit
2e9acdc
1 Parent(s): 44adb4d

Fixes & Fetch data working

Browse files
Files changed (1) hide show
  1. src/app.py +14 -10
src/app.py CHANGED
@@ -51,9 +51,21 @@ def plagiarism_checker(authors_name: str,number_of_results=5, progress=gr.Progre
51
  return "Fetched Latest Papers"
52
 
53
  def fetch_papers_data_df(authors_name: str, progress=gr.Progress()):
54
- return pd.DataFrame(fetch_papers_data(authors_name))
 
 
 
55
 
56
  with gr.Blocks() as demo:
 
 
 
 
 
 
 
 
 
57
 
58
  with gr.Tab("Arxiv Plagiarism Fetcher & Save to DB"):
59
  with gr.Row():
@@ -63,14 +75,6 @@ with gr.Blocks() as demo:
63
  with gr.Row():
64
  completed = gr.Textbox(label="Completed")
65
 
66
- with gr.Tab("Get Papers Data"):
67
- with gr.Row():
68
- authors_name = gr.Textbox(label="Enter Author's Name")
69
- submit_button_tab_2 = gr.Button("Start")
70
- with gr.Row():
71
- dataframe_output = gr.Dataframe(headers=['doi_no', 'title', 'summary', 'authors', 'year', 'pdf_link',
72
- 'references', 'categories', 'comment', 'journal_ref', 'source',
73
- 'primary_category', 'published'])
74
 
75
  with gr.Tab("Arxiv Plagiarism Checker"):
76
  with gr.Row():
@@ -80,6 +84,6 @@ with gr.Blocks() as demo:
80
 
81
 
82
  submit_button_tab_1.click(fn=plagiarism_checker,inputs=[authors_name, number_of_results] ,outputs= completed)
83
- submit_button_tab_2.click(fn=fetch_papers_data_df,inputs=[authors_name] ,outputs=dataframe_output)
84
 
85
  demo.launch()
 
51
  return "Fetched Latest Papers"
52
 
53
  def fetch_papers_data_df(authors_name: str, progress=gr.Progress()):
54
+ progress(0.2, desc="Fetching Papers")
55
+ fetched_data = fetch_papers_data(authors_name,all=True)
56
+ progress(0.8, desc="Making DataFrame")
57
+ return pd.DataFrame(fetched_data[1])
58
 
59
  with gr.Blocks() as demo:
60
+
61
+ with gr.Tab("Get Papers Data"):
62
+ with gr.Row():
63
+ authors_name_paper = gr.Textbox(label="Enter Author's Name")
64
+ submit_button_tab_2 = gr.Button("Start")
65
+ with gr.Row():
66
+ dataframe_output = gr.Dataframe(headers=['doi_no', 'title', 'summary', 'authors', 'year', 'pdf_link',
67
+ 'references', 'categories', 'comment', 'journal_ref', 'source',
68
+ 'primary_category', 'published','author_name'])
69
 
70
  with gr.Tab("Arxiv Plagiarism Fetcher & Save to DB"):
71
  with gr.Row():
 
75
  with gr.Row():
76
  completed = gr.Textbox(label="Completed")
77
 
 
 
 
 
 
 
 
 
78
 
79
  with gr.Tab("Arxiv Plagiarism Checker"):
80
  with gr.Row():
 
84
 
85
 
86
  submit_button_tab_1.click(fn=plagiarism_checker,inputs=[authors_name, number_of_results] ,outputs= completed)
87
+ submit_button_tab_2.click(fn=fetch_papers_data_df,inputs=[authors_name_paper] ,outputs=dataframe_output)
88
 
89
  demo.launch()