🚀 名字分类模型
这是一个基于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 |
任务类型 |
文本分类 |