huiqian/tiny-sentiment-classifier
0
1---2license: mit3library_name: transformers4tags:5 - pytorch6 - text-classification7 - sentiment-analysis8 - chinese9pipeline_tag: text-classification10language: zh11---12 13# Tiny Sentiment Classifier14 15这是一个非常小的自定义 Transformer 模型,用于**中文情感二分类**(正面/负面)。16 17## 模型简介18 19- 架构:小型 Transformer Encoder + 线性分类头20- 隐藏维度:12821- 层数:222- 词汇表:字符级(支持中文汉字 + ASCII)23- 训练数据:极简玩具数据集(仅用于演示 HF 适配流程)24 25## 使用方式26 27```python28from transformers import pipeline29 30# 加载模型31classifier = pipeline(32 "text-classification",33 model="huiqian/tiny-sentiment-classifier"34)35 36# 预测37text = "这家店的服务超级好,强烈推荐!"38result = classifier(text)39print(result)40# 示例输出: [{'label': '正面', 'score': 0.98}]