srijaydeshpande commited on
Commit
63d511f
1 Parent(s): c61dd39

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +1 -1
app.py CHANGED
@@ -123,7 +123,7 @@ def deidentify_doc(llm, pdftext, maxtokens, temperature, top_probability):
123
 
124
  last_text_to_find = ' '.join(pdftext.split()[-2:])
125
  last_index = output.rfind(last_text_to_find)
126
- if last_index != -1:
127
  output = output[:last_index+len(last_text_to_find)].strip()
128
 
129
  return output
 
123
 
124
  last_text_to_find = ' '.join(pdftext.split()[-2:])
125
  last_index = output.rfind(last_text_to_find)
126
+ if last_index != -1 and last_index>(len(pdftext)/2):
127
  output = output[:last_index+len(last_text_to_find)].strip()
128
 
129
  return output