elifsudayi/svm-ner

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).

  • Project Repository: https://github.com/ata-sesli/nlp-project-2
  • Course & Split: Trained for the COE025 NLP course project (Istinye University) on the cleaned English split of gretelai/synthetic_pii_finance_multilingual (30,545 training chunks, 17 BIO tags across 8 PII categories).

Test results (strict IOB2, seqeval)

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%

Per-entity test F1

EMAIL PHONE DATE NAME ID ACCOUNT ADDRESS COMPANY
0.9397 0.8541 0.8127 0.8083 0.7839 0.7245 0.6823 0.6330

Environment & Compatibility

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')]
Downloads last month

-

Downloads are not tracked for this model. How to track
Inference Providers NEW
This model isn't deployed by any Inference Provider. 🙋 Ask for provider support

Dataset used to train elifsudayi/svm-ner