CoolFace
Modelpublic

windlx/url-classifier-lora

sourceHugging Facemitupdated 7mo agoView on Hugging Face
1likes12downloads
Model Card

URL Page Type Classifier (LoRA)

基于 Qwen2.5-1.5B + LoRA 微调的URL类型分类模型,用于判断URL是列表页还是详情页。

模型信息

项目详情
基础模型Qwen/Qwen2.5-1.5B
微调方法LoRA (r=16, alpha=32)
可训练参数~18M (1.18%)

性能测试

测试集样本数准确率
训练数据100100%
随机生成URL1000100%

使用方法

python
from transformers import AutoTokenizer, AutoModelForCausalLM
from peft import PeftModel

# 加载基础模型
base_model = AutoModelForCausalLM.from_pretrained("Qwen/Qwen2.5-1.5B", device_map="auto", trust_remote_code=True)
tokenizer = AutoTokenizer.from_pretrained("Qwen/Qwen2.5-1.5B", trust_remote_code=True)

# 加载LoRA
model = PeftModel.from_pretrained(base_model, "windlx/url-classifier-lora")
model.eval()

# 推理
url = "https://example.com/product/12345"
# ... (推理代码)

相关链接

  • Merged模型: https://huggingface.co/windlx/url-classifier-model
  • GitHub: https://github.com/xiuxiu/url-classifier