vividsd commited on
Commit
ad174f9
1 Parent(s): b16f8b5

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +5 -5
app.py CHANGED
@@ -13,9 +13,9 @@ from gradio import gr
13
  import gradio as gr
14
 
15
  # Now copying my code and adapting it for any PDF
16
- def extract_abstract(paper_filename):
17
- with open(paper_filename, 'rb') as file:
18
- reader = PyPDF2.PdfReader(file)
19
  text = reader.pages[0].extract_text()
20
 
21
  # in order to extract the exact part on the first page that is useful to me,
@@ -33,8 +33,8 @@ def extract_abstract(paper_filename):
33
 
34
  return ""
35
 
36
- paper_filename = '/content/Article_11'
37
- abstract_text = extract_abstract(paper_filename)
38
  print(abstract_text)
39
 
40
  from transformers import pipeline
 
13
  import gradio as gr
14
 
15
  # Now copying my code and adapting it for any PDF
16
+ def extract_abstract(pdf_file_path):
17
+ with open(pdf_file_path, 'rb') as pdf_file:
18
+ reader = PyPDF2.PdfReader(pdf_file)
19
  text = reader.pages[0].extract_text()
20
 
21
  # in order to extract the exact part on the first page that is useful to me,
 
33
 
34
  return ""
35
 
36
+ #to be acessed to any pdf
37
+ abstract_text = extract_abstract(pdf_file_path)
38
  print(abstract_text)
39
 
40
  from transformers import pipeline