🚀 名字分類模型
這是一個基於Transformer的分類器,用於判斷所提供的名字是真實的(LABEL_1)還是虛假的(LABEL_0)。該模型可用於驗證表單提交信息、防止機器人輸入,或用於一般的名字分類任務。
🚀 快速開始
本模型是一個基於Transformer的分類器,可有效判斷名字的真實性,在表單驗證等場景中發揮重要作用。
✨ 主要特性
- 基於Transformer架構,具備強大的分類能力。
- 可用於驗證表單提交信息,防止機器人輸入。
- 適用於一般的名字分類任務。
📦 安裝指南
- 克隆倉庫:
git clone https://github.com/Vishodi/First-Name-Classification.git
- 環境搭建:
使用pip安裝所需的包:
pip install -r requirements.txt
💻 使用示例
基礎用法
from transformers import pipeline
model_dir = "vishodi/First-Name-Classification"
classifier = pipeline(
"text-classification",
model=model_dir,
tokenizer=model_dir,
)
test_names = ["Mark", "vcbcvb", "uhyhu", "elon"]
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}")
輸出示例
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
📚 詳細文檔
項目結構
First_Name_Prediction/
├── .gitattributes
├── README.md
├── config.json
├── model.safetensors
├── requirements.txt
├── special_tokens_map.json
├── tokenizer.json
├── tokenizer_config.json
└── vocab.txt
支持我們

📄 許可證
本項目採用MIT許可證。
屬性 |
詳情 |
模型類型 |
基於Transformer的文本分類器 |
訓練數據 |
未提及 |
指標 |
準確率97% |
基礎模型 |
distilbert/distilbert-base-uncased |
任務類型 |
文本分類 |