king007 commited on
Commit
7359e6c
1 Parent(s): 792832a

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +2 -4
app.py CHANGED
@@ -43,7 +43,7 @@ def pdf_to_text(path, start_page=1, end_page=None):
43
  text_len = text_len + word_count0(text)
44
  doc.close()
45
  print(text_len)
46
- if(text_len>10):
47
  pdf_parse_status = 0
48
  return [], pdf_parse_status
49
  return text_list, pdf_parse_status
@@ -69,9 +69,7 @@ def text_to_chunks(texts, word_length=150, start_page=1):
69
  chunk = f'[Page no. {idx+start_page}]' + ' ' + '"' + chunk + '"'
70
  chunks.append(chunk)
71
  text_len = text_len + word_count0(chunk)
72
- if(text_len>10):
73
- pdf_parse_status = 0
74
- # return [], pdf_parse_status
75
  return chunks
76
 
77
 
 
43
  text_len = text_len + word_count0(text)
44
  doc.close()
45
  print(text_len)
46
+ if(text_len>2000):
47
  pdf_parse_status = 0
48
  return [], pdf_parse_status
49
  return text_list, pdf_parse_status
 
69
  chunk = f'[Page no. {idx+start_page}]' + ' ' + '"' + chunk + '"'
70
  chunks.append(chunk)
71
  text_len = text_len + word_count0(chunk)
72
+
 
 
73
  return chunks
74
 
75