File size: 1,245 Bytes
c680313
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
6018f49
c680313
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
import gradio as gr
from fetch_data import fetch_data
from tools import reset_datafiles

theme = gr.themes.Soft(
    primary_hue="purple",
    secondary_hue="cyan",
    neutral_hue="slate",
    font=[
        gr.themes.GoogleFont('Syne'), 
        gr.themes.GoogleFont('Poppins'), 
        gr.themes.GoogleFont('Poppins'), 
        gr.themes.GoogleFont('Poppins')
    ],
)

with gr.Blocks(theme=theme, title="Fetch Research Paper IDS") as app:
    with gr.Row():
        with gr.Column():
            user_access_key = gr.Textbox(label="Access Key", placeholder="Enter your access key", type="password")
            with gr.Row():
                fetch_data_btn = gr.Button(value="Fetch Data")
                reset_files = gr.Button(value="Reset Files")
        raw_data = gr.Textbox(lines=15, label="Raw IDs Data", interactive=False, placeholder="IDs starting with PMC are PMC IDs and rest all are Arxiv IDs", show_copy_button=True)
    fetch_data_btn.click(fn=fetch_data, inputs=[user_access_key], outputs=[raw_data], api_name="fetch_paper_ids")
    reset_files.click(fn=reset_datafiles, inputs=[user_access_key], outputs=[raw_data], show_api=False)

app.queue(default_concurrency_limit=25).launch(max_threads=5000)