Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
|
@@ -133,12 +133,6 @@ def mask_patterns(text):
|
|
| 133 |
phones = re.findall(phone_pattern, text)
|
| 134 |
for phone in phones:
|
| 135 |
masks[phone] = "<PHONE>"
|
| 136 |
-
|
| 137 |
-
# Address pattern (basic example, can be enhanced)
|
| 138 |
-
address_pattern = r"\d{1,5}\s\w+(\s\w+)*" # Simplified address pattern
|
| 139 |
-
addresses = re.findall(address_pattern, text)
|
| 140 |
-
for address in addresses:
|
| 141 |
-
masks[address] = "<ADDRESS>"
|
| 142 |
|
| 143 |
# Replace patterns in text
|
| 144 |
for word, replacement in masks.items():
|
|
|
|
| 133 |
phones = re.findall(phone_pattern, text)
|
| 134 |
for phone in phones:
|
| 135 |
masks[phone] = "<PHONE>"
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 136 |
|
| 137 |
# Replace patterns in text
|
| 138 |
for word, replacement in masks.items():
|