Skip to content

Commit b99d0f1

Browse files
Update hsse_filter.py
1 parent 4f14afc commit b99d0f1

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

backend/hsse_filter.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,8 @@ 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.expanduser("~"), "ShellPrivacyFilterDemo", "data", attachment_docx.split(".")[0] + "_text.txt"), "r") as file:
55+
name = os.path.basename(os.path.normpath(attachment_docx))
56+
with open(os.path.join(os.path.expanduser("~"), "ShellPrivacyFilterDemo", "data", name.split(".")[0] + "_text.txt"), "r") as file:
5657
text = file.read()
5758
ner_result = self.ner.test(text)
5859

0 commit comments

Comments
 (0)