Zaheer commited on
Commit
0aeb1a2
1 Parent(s): 99b0035

Updated the code

Browse files
Files changed (2) hide show
  1. app.py +18 -0
  2. requirements.txt +3 -0
app.py ADDED
@@ -0,0 +1,18 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ import gradio as gr
2
+ import pdfminer
3
+ from pdfminer.high_level import extract_text
4
+
5
+ def read_pdf(file):
6
+ text = extract_text(file.name)
7
+ return text
8
+
9
+ iface = gr.Interface(
10
+ read_pdf,
11
+ gr.inputs.File(label="Upload a PDF file"),
12
+ gr.outputs.Textbox(label="Extracted text"),
13
+ title="PDF Text Extractor",
14
+ description="A simple app that extracts text from PDF files using pdfminer.",
15
+ theme="huggingface"
16
+
17
+ )
18
+ iface.launch()
requirements.txt ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ PyPDF2
2
+ pdfminer
3
+ pdfminer.six