Spaces:
Sleeping
Sleeping
Commit
·
2c76c6c
1
Parent(s):
a973b7e
Update app.py
Browse files
app.py
CHANGED
|
@@ -19,7 +19,7 @@ with gr.Blocks(css="style.css",theme=gr.themes.Soft()) as demo:
|
|
| 19 |
gr.HTML(
|
| 20 |
"""<hr style="border-top: 5px solid white;">"""
|
| 21 |
)
|
| 22 |
-
with gr.Column(scale=0.10, min_width=160):
|
| 23 |
upload_button = gr.UploadButton(
|
| 24 |
"Browse File",file_types=[".txt", ".pdf", ".doc", ".docx",".json",".csv"],
|
| 25 |
elem_classes="filenameshow")
|
|
@@ -29,27 +29,31 @@ with gr.Blocks(css="style.css",theme=gr.themes.Soft()) as demo:
|
|
| 29 |
|
| 30 |
upload_button.upload( extractor._refine_summary,[upload_button],summary)
|
| 31 |
with gr.Tab("Tags"):
|
| 32 |
-
|
| 33 |
-
|
| 34 |
-
|
|
|
|
| 35 |
|
| 36 |
with gr.Tab("Key Values"):
|
| 37 |
-
|
| 38 |
-
|
|
|
|
| 39 |
|
| 40 |
-
|
| 41 |
|
| 42 |
with gr.Tab("Clauses"):
|
| 43 |
-
|
| 44 |
-
|
| 45 |
-
|
| 46 |
-
|
|
|
|
| 47 |
|
| 48 |
with gr.Tab("pdf to json"):
|
| 49 |
-
|
| 50 |
-
|
| 51 |
-
|
| 52 |
-
|
|
|
|
| 53 |
|
| 54 |
|
| 55 |
demo.launch(debug=True)
|
|
|
|
| 19 |
gr.HTML(
|
| 20 |
"""<hr style="border-top: 5px solid white;">"""
|
| 21 |
)
|
| 22 |
+
with gr.Column(class = "col-container",scale=0.10, min_width=160):
|
| 23 |
upload_button = gr.UploadButton(
|
| 24 |
"Browse File",file_types=[".txt", ".pdf", ".doc", ".docx",".json",".csv"],
|
| 25 |
elem_classes="filenameshow")
|
|
|
|
| 29 |
|
| 30 |
upload_button.upload( extractor._refine_summary,[upload_button],summary)
|
| 31 |
with gr.Tab("Tags"):
|
| 32 |
+
with gr.Column(class = "col-container"):
|
| 33 |
+
tags_btn = gr.Button("Tags Extracter")
|
| 34 |
+
tags = gr.Textbox(lines=4,label = "Tags")
|
| 35 |
+
tags_btn.click(Tags.extract_tags,summary,tags)
|
| 36 |
|
| 37 |
with gr.Tab("Key Values"):
|
| 38 |
+
with gr.Column(class = "col-container"):
|
| 39 |
+
key_value_btn = gr.Button("Key Value Extracter")
|
| 40 |
+
key_value = gr.Textbox(label = "Key Value")
|
| 41 |
|
| 42 |
+
key_value_btn.click( KeyValue.extract_key_value_pair,summary,key_value)
|
| 43 |
|
| 44 |
with gr.Tab("Clauses"):
|
| 45 |
+
with gr.Column(class = "col-container"):
|
| 46 |
+
clauses_btn = gr.Button("Clauses Extracter")
|
| 47 |
+
clauses = gr.Textbox(label = "Clauses")
|
| 48 |
+
|
| 49 |
+
clauses_btn.click(Clauses.get_extracted_clauses,summary,clauses)
|
| 50 |
|
| 51 |
with gr.Tab("pdf to json"):
|
| 52 |
+
with gr.Column(class = "col-container"):
|
| 53 |
+
pdf_to_json_btn = gr.Button("pdf to json Extracter")
|
| 54 |
+
pdf_to_json = gr.Textbox(label = "Pdf to Json")
|
| 55 |
+
|
| 56 |
+
pdf_to_json_btn.click(PdftoJson.extract_text_from_pdf,upload_button,pdf_to_json)
|
| 57 |
|
| 58 |
|
| 59 |
demo.launch(debug=True)
|