Views
No views yet
1First_Name_Prediction/
2├── .gitattributes
3├── README.md
4├── config.json
5├── model.safetensors
6├── requirements.txt
7├── special_tokens_map.json
8├── tokenizer.json
9├── tokenizer_config.json
10└── vocab.txtgit clone https://github.com/Vishodi/First-Name-Classification.gitpip install -r requirements.txt1from transformers import pipeline
2
3# Replace with your model repository
4model_dir = "vishodi/First-Name-Classification"
5
6# Load the model pipeline with authentication
7classifier = pipeline(
8 "text-classification",
9 model=model_dir,
10 tokenizer=model_dir,
11)
12
13# Test the model
14test_names = ["Mark", "vcbcvb", "uhyhu", "elon"]
15for name in test_names:
16 result = classifier(name)
17 label = result[0]['label']
18 score = result[0]['score']
19 print(f"Name: {name} => Prediction: {label}, Score: {score:.4f}")Name: Mark => Prediction: LABEL_1, Score: 0.9994
Name: vcbcvb => Prediction: LABEL_0, Score: 0.9985
Name: uhyhu => Prediction: LABEL_0, Score: 0.9982
Name: elon => Prediction: LABEL_1, Score: 0.9987