ONNX 模型库
返回模型

说明文档

Home Life Improved Classifier (ONNX)

改进的生活类别分类模型 (ONNX 版本)

模型描述

该模型是一个基于 BERT 的分类模型,用于将韩语生活相关问题分类到 8 个类别中。

类别

  1. 生活经济/合同
  2. 生活维修/DIY
  3. 智能家居/家电
  4. 烹饪/食品管理
  5. 育儿/宠物
  6. 搬家/室内装修
  7. 清洁/洗衣
  8. 环境/健康

性能

  • 测试准确率: 87.5% (7/8 案例)
  • 相比之前的模型: +37.5% 提升 (50% → 87.5%)

改进事项

  • 使用 Hard Negative Learning 学习困难案例
  • 复合关键词数据增强 (例如: "空调滤网清洁")
  • 应用 Focal Loss (α=0.75, γ=1.5)
  • 使用 Early Stopping 防止过拟合

使用方法

import onnxruntime as ort
import numpy as np
from transformers import BertTokenizer

# 加载模型
tokenizer = BertTokenizer.from_pretrained("MongsangGa/home_life_improved-onnx")
session = ort.InferenceSession("model.onnx")

# 推理
text = "김치찌개 맛있게 끓이는 방법"
inputs = tokenizer(text, truncation=True, padding="max_length", max_length=128, return_tensors="np")
ort_inputs = {
    "input_ids": inputs["input_ids"].astype(np.int64),
    "attention_mask": inputs["attention_mask"].astype(np.int64)
}
logits = session.run(None, ort_inputs)[0]

训练详情

  • 基础模型: klue/roberta-small
  • 学习率: 1e-5
  • 批次大小: 32
  • Focal Loss: α=0.75, γ=1.5
  • Early Stopping: patience=3
  • 训练数据: 270,465 条 (原始 + 增强)

许可证

Apache 2.0

MongsangGa/home_life_improved-onnx

作者 MongsangGa

text-classification
↓ 1 ♥ 0

创建时间: 2025-10-29 18:32:36+00:00

更新时间: 2025-10-30 06:19:33+00:00

在 Hugging Face 上查看

文件 (8)

.gitattributes
README.md
config.json
metadata.json
model.onnx ONNX
special_tokens_map.json
tokenizer_config.json
vocab.txt