Skip to content

Commit 49e242a

Browse files
Update hsse_filter.py
1 parent 7c9f1f3 commit 49e242a

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

backend/hsse_filter.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@ def email_ner(self, text):
5252

5353
def attachment_ner(self, attachment_docx):
5454
self.de.extract_text(attachment_docx, "text")
55-
with open(os.path.join(os.path.extenduser("~"), "ShellPrivacyFilterDemo", "data", attachment_docx.split(".")[0] + "_text.txt"), "r") as file:
55+
with open(os.path.join(os.path.expanduser("~"), "ShellPrivacyFilterDemo", "data", attachment_docx.split(".")[0] + "_text.txt"), "r") as file:
5656
text = file.read()
5757
personal, confidential = self.ner.test(text)
5858

@@ -65,7 +65,7 @@ def attachment_image(self, attachment_docx):
6565
self.de.extract_images(attachment_docx, "images")
6666
predictions = []
6767
for image in self.de.images:
68-
predictions.append(self.keras_model.test(os.path.join(os.path.extenduser("~"), "ShellPrivacyFilterDemo", "data", "images", image)))
68+
predictions.append(self.keras_model.test(os.path.join(os.path.expanduser("~"), "ShellPrivacyFilterDemo", "data", "images", image)))
6969

7070
if "Confidential" in predictions:
7171
return True

0 commit comments

Comments
 (0)