srijaydeshpande commited on
Commit
e65eb2d
·
1 Parent(s): 3f2ec24
Files changed (1) hide show
  1. app.py +3 -1
app.py CHANGED
@@ -134,10 +134,12 @@ def pdf_to_text(files, output_folder, prompt="", maxtokens=600, temperature=1.2,
134
  pdftext = page2content[1]
135
  if(pdftext):
136
  anonymized_text = deidentify_doc(pdftext, prompt, maxtokens, temperature, top_probability)
 
 
137
  # html = txt_to_html(display_text)
138
  # with open('out.html', "w", encoding="utf-8") as file:
139
  # file.write(html)
140
- with open(os.path.join(output_folder, file_name_splt[0]+'.txt'), 'w') as file:
141
  # Write some text to the file
142
  file.write(anonymized_text)
143
  display_text = "All selected reports are anonymized and results are saved in "
 
134
  pdftext = page2content[1]
135
  if(pdftext):
136
  anonymized_text = deidentify_doc(pdftext, prompt, maxtokens, temperature, top_probability)
137
+ filename = file_name_splt[0]+'.txt'
138
+ filename = filename.replace(' ','')
139
  # html = txt_to_html(display_text)
140
  # with open('out.html', "w", encoding="utf-8") as file:
141
  # file.write(html)
142
+ with open(os.path.join(output_folder, filename), 'w') as file:
143
  # Write some text to the file
144
  file.write(anonymized_text)
145
  display_text = "All selected reports are anonymized and results are saved in "