gretelai/synthetic_pii_finance_multilingual
Viewer • Updated • 55.9k • 3.26k • 83
LinearSVC (scikit-learn, $C=0.1$) baseline trained to detect Personally Identifiable Information (PII) in financial texts (contracts, SWIFT messages, invoices) using window-based hand-crafted features (word surface, $\pm 2$ context window, 3-char prefix/suffix, word shapes) and FeatureHasher ($2^{20}$ features).
gretelai/synthetic_pii_finance_multilingual (30,545 training chunks, 17 BIO tags across 8 PII categories).| chunks | entity micro-F1 | token macro-F1 | entity precision | entity recall | missed PII rate |
|---|---|---|---|---|---|
| 3,903 | 0.7631 | 0.7672 | 0.8019 | 0.7279 | 27.2% |
| PHONE | DATE | NAME | ID | ACCOUNT | ADDRESS | COMPANY | |
|---|---|---|---|---|---|---|---|
| 0.9397 | 0.8541 | 0.8127 | 0.8083 | 0.7839 | 0.7245 | 0.6823 | 0.6330 |
Trained with scikit-learn==1.9.1 and joblib. Because .joblib serializations are sensitive to library internals, ensure your environment uses a matching scikit-learn version to prevent deserialization and load errors:
pip install scikit-learn==1.9.1 joblib seqeval
## Use
```python
import joblib
from huggingface_hub import hf_hub_download
from features import sentence_features
# Download and load model artifacts
model_path = hf_hub_download(repo_id="elifsudayi/svm-ner", filename="svm.joblib")
model_data = joblib.load(model_path)
clf = model_data["model"]
hasher = model_data["hasher"]
# Example inference on financial text
tokens = ["Please", "transfer", "$500", "to", "John", "Doe", "IBAN", "DE89370400440532013000"]
features = sentence_features(tokens)
X = hasher.transform(features)
predictions = clf.predict(X)
print(list(zip(tokens, predictions)))
# [('Please', 'O'), ('transfer', 'O'), ('$500', 'O'), ('to', 'O'), ('John', 'B-NAME'), ('Doe', 'I-NAME'), ('IBAN', 'O'), ('DE89370400440532013000', 'B-ACCOUNT')]