Spaces:
Runtime error
Runtime error
Update analyze.py
Browse files- analyze.py +5 -6
analyze.py
CHANGED
|
@@ -46,11 +46,10 @@ def batched(
|
|
| 46 |
|
| 47 |
|
| 48 |
def mask(text: str) -> str:
|
| 49 |
-
return
|
| 50 |
-
|
| 51 |
-
|
| 52 |
-
|
| 53 |
-
# )
|
| 54 |
|
| 55 |
|
| 56 |
def get_strings(row_content: Any) -> str:
|
|
@@ -101,7 +100,7 @@ def analyze(
|
|
| 101 |
]
|
| 102 |
return [
|
| 103 |
PresidioEntity(
|
| 104 |
-
text=
|
| 105 |
type=recognizer_result.entity_type,
|
| 106 |
row_idx=row_idx,
|
| 107 |
column_name=column_name,
|
|
|
|
| 46 |
|
| 47 |
|
| 48 |
def mask(text: str) -> str:
|
| 49 |
+
return " ".join(
|
| 50 |
+
word[: min(2, len(word) - 1)] + re.sub("[A-Za-z0-9]", "*", word[min(2, len(word) - 1) :])
|
| 51 |
+
for word in text.split(" ")
|
| 52 |
+
)
|
|
|
|
| 53 |
|
| 54 |
|
| 55 |
def get_strings(row_content: Any) -> str:
|
|
|
|
| 100 |
]
|
| 101 |
return [
|
| 102 |
PresidioEntity(
|
| 103 |
+
text=texts[i * len(scanned_columns) + j][recognizer_result.start : recognizer_result.end],
|
| 104 |
type=recognizer_result.entity_type,
|
| 105 |
row_idx=row_idx,
|
| 106 |
column_name=column_name,
|