HuggyMonkey commited on
Commit
e94b148
·
1 Parent(s): 1c41806

Enhance app.py with detailed component description and usage instructions for SimpleTextExtractFromPDF demo

Browse files
Files changed (1) hide show
  1. app.py +22 -2
app.py CHANGED
@@ -9,8 +9,28 @@ demo = gr.Interface(
9
  fn=first_200_chars,
10
  inputs=SimpleTextExtractFromPDF(label="Upload a PDF file"),
11
  outputs="text",
12
- title="First 200 Characters",
13
- description="Enter some text and see the first 200 characters.",
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
14
  )
15
 
16
  demo.launch()
 
9
  fn=first_200_chars,
10
  inputs=SimpleTextExtractFromPDF(label="Upload a PDF file"),
11
  outputs="text",
12
+ title="SimpleTextExtractFromPDF Demo - First 200 Characters",
13
+ description="""
14
+ ## Component Description
15
+
16
+ This space is to demo the usage of the SimpleTextExtractFromPDF component.
17
+
18
+ This component provides a simple interface to extract text from a PDF file. The extracted text can be submitted as a string input to a function for further processing.
19
+
20
+ - **Text Extraction Only:** Only the text content is extracted from the PDF. Images and table structures are not preserved.
21
+ - **Flexible Upload Options:** Users can upload a PDF file from their device or provide a URL to the PDF.
22
+ - **Input Component:** The component is primarily designed to be used as an input, allowing users to submit the extracted text to other functions.
23
+ - **Output Display:** When used as an output component, the extracted string content is displayed in a textarea.
24
+
25
+ The demo app here uses the SimpleTextExtractFromPDF component as an input component to extract the text from a PDF file and then show the first 200 characters of the extracted text.
26
+ """,
27
+ article="""
28
+ <p>
29
+ <code>pip install gradio-simpletextextractfrompdf</code>
30
+ <br>
31
+ <a href="https://pypi.org/project/gradio-simpletextextractfrompdf/"> https://pypi.org/project/gradio-simpletextextractfrompdf/</a>
32
+ </p>
33
+ """,
34
  )
35
 
36
  demo.launch()