Spaces:
Sleeping
Sleeping
Create app.py
Browse files
app.py
ADDED
@@ -0,0 +1,16 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
import gradio as gr
|
2 |
+
from grobid_client.grobid_client import GrobidClient
|
3 |
+
|
4 |
+
def extract_text(file):
|
5 |
+
client = GrobidClient(config_path="./config.json")
|
6 |
+
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)
|
7 |
+
return information
|
8 |
+
|
9 |
+
#Ask Dr Ahmad about which LLM to use and if we have a token for it
|
10 |
+
with gr.Blocks() as demo:
|
11 |
+
file_input = gr.File(label="Upload a research paper as a pdf file", file_types=["pdf"])
|
12 |
+
text_output = gr.Textbox(label="Extracted Text")
|
13 |
+
|
14 |
+
file_input.change(fn=extract_text, inputs=file_input, outputs=text_output)
|
15 |
+
|
16 |
+
demo.launch()
|