ali121300 commited on
Commit
c9fa0f9
1 Parent(s): 989668b

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +2 -1
app.py CHANGED
@@ -97,12 +97,13 @@ def handle_userinput(user_question:str):
97
  #return(full_text)
98
  #################################################################################################################
99
  def get_pdf_text(pdf_docs):
100
- translator = GoogleTranslator(source='persian', target='english')
101
  text = ""
102
  for pdf in pdf_docs:
103
  pdf_reader = PdfReader(pdf)
104
  for page in pdf_reader.pages:
105
  txt_page=page.extract_text()
 
106
  result = translator.translate(txt_page)
107
  text += result
108
  return text
 
97
  #return(full_text)
98
  #################################################################################################################
99
  def get_pdf_text(pdf_docs):
100
+
101
  text = ""
102
  for pdf in pdf_docs:
103
  pdf_reader = PdfReader(pdf)
104
  for page in pdf_reader.pages:
105
  txt_page=page.extract_text()
106
+ translator = GoogleTranslator(source='persian', target='english')
107
  result = translator.translate(txt_page)
108
  text += result
109
  return text