File size: 884 Bytes
c91ae9b
 
4c19631
c91ae9b
4c19631
 
 
 
 
 
c91ae9b
 
 
 
4c19631
 
 
 
 
 
 
 
 
c91ae9b
 
 
 
 
 
4c19631
 
 
 
 
c91ae9b
4c19631
 
c91ae9b
4c19631
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
---
license: mit
library_name: transformers
tags:
  - pytorch
  - text-classification
  - sentiment-analysis
  - chinese
pipeline_tag: text-classification
language: zh
---

# Tiny Sentiment Classifier

这是一个非常小的自定义 Transformer 模型,用于**中文情感二分类**(正面/负面)。

## 模型简介

- 架构:小型 Transformer Encoder + 线性分类头
- 隐藏维度:128
- 层数:2
- 词汇表:字符级(支持中文汉字 + ASCII)
- 训练数据:极简玩具数据集(仅用于演示 HF 适配流程)

## 使用方式

```python
from transformers import pipeline

# 加载模型
classifier = pipeline(
    "text-classification",
    model="huiqian/tiny-sentiment-classifier"
)

# 预测
text = "这家店的服务超级好,强烈推荐!"
result = classifier(text)
print(result)
# 示例输出: [{'label': '正面', 'score': 0.98}]