Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
@@ -176,7 +176,7 @@ uploaded_file = st.file_uploader("Upload a file", type=["pdf", "docx", "txt"])
|
|
176 |
if uploaded_file is not None:
|
177 |
file_contents, pdf_document = process_file(uploaded_file)
|
178 |
if pdf_document:
|
179 |
-
redacted_text =
|
180 |
for pg in pdf_document:
|
181 |
text = pg.get_text()
|
182 |
sentences = sentence_tokenize(text)
|
@@ -190,10 +190,10 @@ if uploaded_file is not None:
|
|
190 |
words_out = [i for i in new if len(i)>2]
|
191 |
# print(words_out)
|
192 |
words_out=sorted(words_out, key=len,reverse=True)
|
193 |
-
|
194 |
-
redacted_text+=[words_out]
|
195 |
print(words_out)
|
196 |
for i in words_out:
|
|
|
197 |
redact_text(pg,i)
|
198 |
st.text_area(redacted_text)
|
199 |
|
|
|
176 |
if uploaded_file is not None:
|
177 |
file_contents, pdf_document = process_file(uploaded_file)
|
178 |
if pdf_document:
|
179 |
+
redacted_text = ''
|
180 |
for pg in pdf_document:
|
181 |
text = pg.get_text()
|
182 |
sentences = sentence_tokenize(text)
|
|
|
190 |
words_out = [i for i in new if len(i)>2]
|
191 |
# print(words_out)
|
192 |
words_out=sorted(words_out, key=len,reverse=True)
|
193 |
+
|
|
|
194 |
print(words_out)
|
195 |
for i in words_out:
|
196 |
+
redacted_text+=i+'|||'
|
197 |
redact_text(pg,i)
|
198 |
st.text_area(redacted_text)
|
199 |
|