---
title: nlp_structbert_emotion-classification_chinese-tiny
canonical_url: "https://www.modelscope.cn/models/damo/nlp_structbert_emotion-classification_chinese-tiny"
md_url: "https://www.modelscope.cn/models/damo/nlp_structbert_emotion-classification_chinese-tiny.md"
repository: damo/nlp_structbert_emotion-classification_chinese-tiny
chinese_name: "StructBERT情绪分类-中文-七分类-tiny"
last_updated: 2023-08-15
license: "Apache License 2.0"
pipeline_tag: text-classification
tasks:
  - text-classification
  - sentiment-classification
model_type:
  - sbert
architectures:
  - BertForSequenceClassification
library_name:
  - pytorch
frameworks:
  - pytorch
language:
  - cn
domain:
  - nlp
inference_backends:
  - "deploy_task emb"
  - "sglang 0.5.2"
  - "vllm 0.9.2"
downloads: 4168
stars: 10
tags:
  - transformer
  - AliceMind
  - Alibaba
  - sentiment-analysis
  - "情绪分类"
---

# nlp_structbert_emotion-classification_chinese-tiny

> nlp_structbert_emotion-classification_chinese-tiny - damo 在 ModelScope 开源的模型。StructBERT中文情绪分类模型介绍

damo/nlp_structbert_emotion-classification_chinese-tiny 是 ModelScope 魔搭社区上的text-classification、sentiment-classification模型，采用 Apache License 2.0 许可，可用 deploy_task emb、sglang 0.5.2、vllm 0.9.2 部署。

- **Repository**: damo/nlp_structbert_emotion-classification_chinese-tiny
- **License**: Apache License 2.0
- **Tasks**: text-classification, sentiment-classification
- **Inference backends**: deploy_task emb, sglang 0.5.2, vllm 0.9.2
- **Tags**: transformer, AliceMind, Alibaba, sentiment-analysis, 情绪分类
- **Downloads**: 4168
- **Stars**: 10
- **Last updated**: 2023-08-15

Source: https://www.modelscope.cn/models/damo/nlp_structbert_emotion-classification_chinese-tiny

---

# StructBERT中文情绪分类模型介绍

情绪分类任务，通常为输入一段句子或一段话，识别该句话情绪类别的模型。 在用户评价、观点抽取、意图识别中往往起到重要作用。

## 模型描述

模型基于Structbert-tiny-chinese，在情绪分类的数据集上fine-tune得到。 模型可识别的情绪包含（恐惧、愤怒、厌恶、喜好、悲伤、高兴、惊讶）七种类别。

![模型结构](model.jpg)

## 期望模型使用方式以及适用范围

你可以使用StructBERT中文情绪分类模型，对通用领域的中文情绪分类任务进行推理。 输入自然语言文本，模型会给出该文本的情绪分类标签以及相应的概率。

### 如何使用

在安装完成ModelScope之后即可使用

#### 推理代码范例

```python
from modelscope.pipelines import pipeline
from modelscope.utils.constant import Tasks

semantic_cls = pipeline(Tasks.text_classification, 'damo/nlp_structbert_emotion-classification_chinese-tiny', model_revision='v1.0.0')
semantic_cls(input='新年快乐！')
```

### 模型局限性以及可能的偏差

模型训练数据有限，效果可能存在一定偏差。

## 训练数据介绍

使用数据集分布情况如下：

|   | 高兴   | 悲伤   | 厌恶   | 喜好 | 恐惧  | 惊讶   | 愤怒 | 无明显情绪 |
|-------|-------|-------|------|----------|------|------|------|-------|
| 训练集 | 10610 | 13418 | 6909  | 8236 | 820 | 1664 | 5312 | 32071 |
| 验证集 | 1326 | 1677 | 863  | 1029 | 102 | 207 | 663 | 4008 |

## 数据评估及结果
 
该模型在验证集上的f1为0.4732。

## 数据评估及结果
```bib
@article{wang2019structbert,
  title={Structbert: Incorporating language structures into pre-training for deep language understanding},
  author={Wang, Wei and Bi, Bin and Yan, Ming and Wu, Chen and Bao, Zuyi and Xia, Jiangnan and Peng, Liwei and Si, Luo},
  journal={arXiv preprint arXiv:1908.04577},
  year={2019}
}
```
