Update README.md
Browse files
README.md
CHANGED
@@ -8,24 +8,20 @@ base_model:
|
|
8 |
- distilbert/distilbert-base-uncased
|
9 |
pipeline_tag: text-classification
|
10 |
---
|
|
|
|
|
11 |
|
12 |
-
|
13 |
-
[](https://www.example.com/donate?crypto=YOUR_CRYPTO_ID)
|
14 |
|
15 |
-
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.
|
16 |
-
|
17 |
-
---
|
18 |
## Table of Contents
|
19 |
-
|
20 |
-
- [Project Structure](#project_structure)
|
21 |
- [Installation](#installation)
|
22 |
- [Usage](#usage)
|
23 |
- [Support Me](#support-me)
|
24 |
- [License](#license)
|
25 |
|
26 |
## Project Structure
|
27 |
-
|
28 |
-
```
|
29 |
Last_Name_Prediction/
|
30 |
βββ .gitattributes
|
31 |
βββ README.md
|
@@ -36,72 +32,54 @@ Last_Name_Prediction/
|
|
36 |
βββ tokenizer.json
|
37 |
βββ tokenizer_config.json
|
38 |
βββ vocab.txt
|
39 |
-
|
40 |
```
|
41 |
-
---
|
42 |
|
43 |
## Installation
|
44 |
-
|
45 |
1. **Clone the Repository:**
|
46 |
-
|
47 |
-
|
48 |
-
|
49 |
-
cd name-validation-ai
|
50 |
-
```
|
51 |
|
52 |
2. **Set Up the Environment:**
|
53 |
-
|
54 |
Install the required packages using pip:
|
55 |
-
|
56 |
-
|
57 |
-
|
58 |
-
```
|
59 |
-
---
|
60 |
|
61 |
## Usage
|
62 |
-
Python
|
63 |
```python
|
64 |
from transformers import pipeline
|
65 |
|
66 |
-
# Replace with your model
|
67 |
-
model_dir = "/
|
68 |
|
69 |
-
# Load the model pipeline
|
70 |
classifier = pipeline(
|
71 |
"text-classification",
|
72 |
model=model_dir,
|
73 |
tokenizer=model_dir,
|
74 |
-
framework="pt"
|
75 |
)
|
76 |
|
77 |
# Test the model
|
78 |
-
test_names = ["
|
79 |
for name in test_names:
|
80 |
result = classifier(name)
|
81 |
label = result[0]['label']
|
82 |
score = result[0]['score']
|
83 |
print(f"Name: {name} => Prediction: {label}, Score: {score:.4f}")
|
84 |
```
|
85 |
-
|
|
|
|
|
86 |
Name: musk => Prediction: LABEL_1, Score: 0.9167
|
87 |
Name: zzzzzz => Prediction: LABEL_0, Score: 0.9991
|
88 |
Name: uhyhu => Prediction: LABEL_0, Score: 0.9944
|
89 |
Name: trump => Prediction: LABEL_1, Score: 0.9998
|
90 |
```
|
91 |
-
## Support Me
|
92 |
|
|
|
93 |
If you find this project helpful and would like to support my work, please consider donating using crypto.
|
94 |
-
|
95 |
-
<img src="https://img.shields.io/badge/Support-Me-brightgreen" alt="Support Me">
|
96 |
-
</a>
|
97 |
-
|
98 |
-
---
|
99 |
|
100 |
## License
|
101 |
-
|
102 |
-
This project is licensed under the MIT License. See the [LICENSE](LICENSE) file for details.
|
103 |
-
|
104 |
-
---
|
105 |
-
|
106 |
-
*Contributions, issues, and feature requests are welcome! Feel free to fork the repository and open a pull request.*
|
107 |
-
```
|
|
|
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
|
|
|
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/Last-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/Last-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 = ["kiara", "zzzzzz", "uhyhu", "trump"]
|
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: musk => Prediction: LABEL_1, Score: 0.9167
|
75 |
Name: zzzzzz => Prediction: LABEL_0, Score: 0.9991
|
76 |
Name: uhyhu => Prediction: LABEL_0, Score: 0.9944
|
77 |
Name: trump => Prediction: LABEL_1, Score: 0.9998
|
78 |
```
|
|
|
79 |
|
80 |
+
## Support Me
|
81 |
If you find this project helpful and would like to support my work, please consider donating using crypto.
|
82 |
+
[](https://nowpayments.io/donation/Vishodi)
|
|
|
|
|
|
|
|
|
83 |
|
84 |
## License
|
85 |
+
This project is licensed under the MIT License. See the LICENSE file for details.
|
|
|
|
|
|
|
|
|
|
|
|