John P
Make changes to code
265e21f
raw
history blame
865 Bytes
import gradio as gr
from grobid_client.grobid_client import GrobidClient
def extract_text(file):
client = GrobidClient(config_path="./config.json")
information = client.process_pdf(
"processFulltextDocument",
file.name,
generateIDs=False,
consolidate_header=False,
consolidate_citations=False,
include_raw_citations=False,
include_raw_affiliations=False,
tei_coordinates=False,
segment_sentences=False,
)
return information
# Ask Dr Ahmad about which LLM to use and if we have a token for it
with gr.Blocks() as demo:
file_input = gr.File(
label="Upload a research paper as a pdf file", file_types=[".pdf"]
)
text_output = gr.Textbox(label="Extracted Text")
file_input.upload(fn=extract_text, inputs=file_input, outputs=text_output)
demo.launch()