Create README.md
Browse files
README.md
ADDED
|
@@ -0,0 +1,84 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
---
|
| 2 |
+
license: mit
|
| 3 |
+
language:
|
| 4 |
+
- en
|
| 5 |
+
metrics:
|
| 6 |
+
- accuracy 97%
|
| 7 |
+
base_model:
|
| 8 |
+
- distilbert/distilbert-base-uncased
|
| 9 |
+
pipeline_tag: text-classification
|
| 10 |
+
---
|
| 11 |
+
# Last Name Classification Model
|
| 12 |
+
[](https://nowpayments.io/donation/Vishodi)
|
| 13 |
+
|
| 14 |
+
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.
|
| 15 |
+
|
| 16 |
+
## Table of Contents
|
| 17 |
+
- [Project Structure](#project-structure)
|
| 18 |
+
- [Installation](#installation)
|
| 19 |
+
- [Usage](#usage)
|
| 20 |
+
- [Support Me](#support-me)
|
| 21 |
+
- [License](#license)
|
| 22 |
+
|
| 23 |
+
## Project Structure
|
| 24 |
+
```plaintext
|
| 25 |
+
Last_Name_Prediction/
|
| 26 |
+
βββ .gitattributes
|
| 27 |
+
βββ README.md
|
| 28 |
+
βββ config.json
|
| 29 |
+
βββ model.safetensors
|
| 30 |
+
βββ requirements.txt
|
| 31 |
+
βββ special_tokens_map.json
|
| 32 |
+
βββ tokenizer.json
|
| 33 |
+
βββ tokenizer_config.json
|
| 34 |
+
βββ vocab.txt
|
| 35 |
+
```
|
| 36 |
+
|
| 37 |
+
## Installation
|
| 38 |
+
1. **Clone the Repository:**
|
| 39 |
+
```bash
|
| 40 |
+
git clone https://github.com/Vishodi/First-Name-Classification.git
|
| 41 |
+
```
|
| 42 |
+
|
| 43 |
+
2. **Set Up the Environment:**
|
| 44 |
+
Install the required packages using pip:
|
| 45 |
+
```bash
|
| 46 |
+
pip install -r requirements.txt
|
| 47 |
+
```
|
| 48 |
+
|
| 49 |
+
## Usage
|
| 50 |
+
```python
|
| 51 |
+
from transformers import pipeline
|
| 52 |
+
|
| 53 |
+
# Replace with your model repository
|
| 54 |
+
model_dir = "vishodi/First-Name-Classification"
|
| 55 |
+
|
| 56 |
+
# Load the model pipeline with authentication
|
| 57 |
+
classifier = pipeline(
|
| 58 |
+
"text-classification",
|
| 59 |
+
model=model_dir,
|
| 60 |
+
tokenizer=model_dir,
|
| 61 |
+
)
|
| 62 |
+
|
| 63 |
+
# Test the model
|
| 64 |
+
test_names = ["Mark", "vcbcvb", "uhyhu", "elon"]
|
| 65 |
+
for name in test_names:
|
| 66 |
+
result = classifier(name)
|
| 67 |
+
label = result[0]['label']
|
| 68 |
+
score = result[0]['score']
|
| 69 |
+
print(f"Name: {name} => Prediction: {label}, Score: {score:.4f}")
|
| 70 |
+
```
|
| 71 |
+
|
| 72 |
+
**Output:**
|
| 73 |
+
```
|
| 74 |
+
Name: Mark => Prediction: LABEL_1, Score: 0.9994
|
| 75 |
+
Name: vcbcvb => Prediction: LABEL_0, Score: 0.9985
|
| 76 |
+
Name: uhyhu => Prediction: LABEL_0, Score: 0.9982
|
| 77 |
+
Name: elon => Prediction: LABEL_1, Score: 0.9987
|
| 78 |
+
```
|
| 79 |
+
|
| 80 |
+
## Support Us
|
| 81 |
+
[](https://nowpayments.io/donation/Vishodi)
|
| 82 |
+
|
| 83 |
+
## License
|
| 84 |
+
This project is licensed under the MIT License.
|