---
title: Erlangshen-BERT-120M-IE-Chinese
canonical_url: "https://www.modelscope.cn/models/Fengshenbang/Erlangshen-BERT-120M-IE-Chinese"
md_url: "https://www.modelscope.cn/models/Fengshenbang/Erlangshen-BERT-120M-IE-Chinese.md"
repository: Fengshenbang/Erlangshen-BERT-120M-IE-Chinese
chinese_name: "二郎神-BERT-120M-IE-中文"
last_updated: 2023-02-20
license: "Apache License 2.0"
pipeline_tag: fill-mask
tasks:
  - fill-mask
model_type:
  - bert
architectures:
  - UniEXModel
library_name:
  - pytorch
frameworks:
  - pytorch
downloads: 210
stars: 3
---

# Erlangshen-BERT-120M-IE-Chinese

> Erlangshen-BERT-120M-IE-Chinese - Fengshenbang 在 ModelScope 开源的模型。本模型基于大规模信息抽取数据进行预训练，可支持few-shot、zero-shot场景下的实体识别、关系三元组抽取任务。

Fengshenbang/Erlangshen-BERT-120M-IE-Chinese 是 ModelScope 魔搭社区上的fill-mask模型，采用 Apache License 2.0 许可。

- **Repository**: Fengshenbang/Erlangshen-BERT-120M-IE-Chinese
- **License**: Apache License 2.0
- **Tasks**: fill-mask
- **Downloads**: 210
- **Stars**: 3
- **Last updated**: 2023-02-20

Source: https://www.modelscope.cn/models/Fengshenbang/Erlangshen-BERT-120M-IE-Chinese

---

# Erlangshen-BERT-120M-IE-Chinese

* Github: [GTS-Engine](https://github.com/IDEA-CCNL/GTS-Engine)
* Documentation: [GTS-Engine](https://gts-engine-doc.readthedocs.io/en/latest/docs/quick_start.html)

## 简介 Brief Introduction

本模型基于大规模信息抽取数据进行预训练，可支持few-shot、zero-shot场景下的实体识别、关系三元组抽取任务。

This model is pre-trained on large-scale information extraction data, to better support Named Entity Recognition (NER) and Relation Extraction (RE) tasks in few-shot/zero-shot scenarios.

## 模型分类 Model Taxonomy

| 需求 Demand  | 任务 Task    | 系列 Series      | 模型 Model | 参数 Parameter | 额外 Extra |
| ---------- | ---------- | -------------- | -------- | ------------ | -------- |
| 通用 General | 信息抽取 Information Extraction | 二郎神 Erlangshen | BagualuIEModel  | 120M         | Chinese  |

## 下游效果 Performance

Erlangshen-BERT-120M-IE-Chinese在多个信息抽取任务下进行测试。

其中，zh_weibo/MSRA/OntoNote4/Resume为NER任务，其中MSRA在原始数据下进行测试；SanWen/FinRE作为实体关系联合抽取任务进行测试，非单一关系分类任务。

部分参数设置如下：
```
batch_size=16
precision=16
max_epoch=50
lr=2e-5
weight_decay=0.1
warmup=0.06
max_length=512
```

我们分别在随机种子123/456/789下进行测试，并以[MacBERT-base, Chinese](https://github.com/ymcui/MacBERT)作为预训练模型保持相同参数进行训练作为对比baseline，得到效果计算平均，效果如下：

| Dataset   | Training epochs | Test precision | Test recall | Test f1 | Baseline f1 |
| --------- | --------------- | -------------- | ----------- | ------- | ----------- |
| zh_weibo  | 10.3            | 0.7282         | 0.6447      | 0.6839  | 0.6778      |
| MSRA      | 5               | 0.9374         | 0.9299      | 0.9336  | 0.8483      |
| OntoNote4 | 9               | 0.8640         | 0.8634      | 0.8636  | 0.7996      |
| Resume    | 15              | 0.9568         | 0.9658      | 0.9613  | 0.9479      |
| SanWen    | 6.7             | 0.3655         | 0.2072      | 0.2639  | 0.2655      |
| FinRE     | 7               | 0.5190         | 0.4274      | 0.4685  | 0.4559      |

## 使用 Usage

GTS引擎（GTS-Engine）是一款开箱即用且性能强大的自然语言理解引擎，能够仅用小样本就能自动化生产NLP模型。GTS Engine包含两个训练引擎：乾坤鼎和八卦炉。

本模型为可在GTS-Engine八卦炉引擎信息抽取任务中，作为预训练模型进行finetune。

GTS-Engine文档参考：[GTS-Engine](https://gts-engine-doc.readthedocs.io/en/latest/docs/about.html)

## 示例代码
```python
from modelscope.pipelines import pipeline
from modelscope.utils.constant import Tasks

pipeline_ins = pipeline(
                'fill-mask', 
                model='Fengshenbang/Erlangshen-BERT-120M-IE-Chinese',
                model_revision='v1.0.0'
)

print(pipeline_ins('西湖的景色'))
```

## 引用

如果您在您的工作中使用了我们的模型，可以引用我们的[网站](https://github.com/IDEA-CCNL/GTS-Engine):

You can also cite our website:

```
@misc{GTS-Engine,
  title={GTS-Engine},
  author={IDEA-CCNL},
  year={2022},
  howpublished={\url{https://github.com/IDEA-CCNL/GTS-Engine}},
}
```
