Last Name Classification Model
A Transformer-based classifier that checks if a provided last name is likely to be real (LABEL_1) or fake (LABEL_0). This can be helpful in validating contact form submissions, preventing bot entries, or for general name classification tasks.
Table of Contents
Project Structure
Last_Name_Prediction/
βββ .gitattributes
βββ README.md
βββ config.json
βββ model.safetensors
βββ requirements.txt
βββ special_tokens_map.json
βββ tokenizer.json
βββ tokenizer_config.json
βββ vocab.txt
Installation
- Clone the Repository:
git clone https://github.com/Vishodi/Last-Name-Classification.git
- Set Up the Environment: Install the required packages using pip:
pip install -r requirements.txt
Usage
from transformers import pipeline
# Replace with your model repository
model_dir = "vishodi/Last-Name-Classification"
# Load the model pipeline with authentication
classifier = pipeline(
"text-classification",
model=model_dir,
tokenizer=model_dir,
)
# Test the model
test_names = ["musk", "zzzzzz", "uhyhu", "trump"]
for name in test_names:
result = classifier(name)
label = result[0]['label']
score = result[0]['score']
print(f"Name: {name} => Prediction: {label}, Score: {score:.4f}")
Output:
Name: musk => Prediction: LABEL_1, Score: 0.9167
Name: zzzzzz => Prediction: LABEL_0, Score: 0.9991
Name: uhyhu => Prediction: LABEL_0, Score: 0.9944
Name: trump => Prediction: LABEL_1, Score: 0.9998
Support Us
License
This project is licensed under the MIT License.
- Downloads last month
- 35
Inference Providers
NEW
This model is not currently available via any of the supported Inference Providers.
The model cannot be deployed to the HF Inference API:
The model has no library tag.
Model tree for vishodi/Last-Name-Classification
Base model
distilbert/distilbert-base-uncased