suolyer's picture
Update README.md
4875e62
|
raw
history blame
5.64 kB
metadata
license: apache-2.0
tags:
  - classification
  - zero-shot

Erlangshen-Albert-235M-UniMC-English

简介 Brief Introduction

将自然语言理解任务转化为multiple choice任务,并且使用14个机器阅读理解数据进行预训练

Convert natural language understanding tasks into multiple choice tasks, and use 14 machine reading comprehension data for pre-training

模型分类 Model Taxonomy

需求 Demand 任务 Task 系列 Series 模型 Model 参数 Parameter 额外 Extra
通用 General 自然语言理解 NLU 二郎神 Erlangshen Albert 235M English

模型信息 Model Information

我们为零样本学习者提出了一种与输入无关的新范式,从某种意义上说,它与任何格式兼容并适用于一系列语言任务,例如文本分类、常识推理、共指解析、情感分析。我们的方法将零样本学习转化为多项选择任务,避免常用的大型生成模型(如 FLAN)中的问题。它不仅增加了模型的泛化能力,而且显着减少了对参数的需求。我们证明了这种方法可以在通用语言基准上取得最先进的性能,并在自然语言推理和文本分类等任务上产生令人满意的结果。

We propose an new paradigm for zero-shot learners that is input-agnostic, in the sense that it is compatible with any format and applicable to a list of language tasks, such as text classification, commonsense reasoning, coreference resolution, sentiment analysis. Our approach converts zero-shot learning into multiple choice tasks, avoiding problems in commonly used large generative models such as FLAN. It not only adds generalization ability to the models, but also reduces the needs of parameters significantly. We demonstrate that this approach leads to state-of-the-art performance on common language benchmarks, and produces satisfactory results on tasks such as natural language inference and text classification.

下游效果 Performance

Zero-Shot Classification

Model T0 11B GLaM 60B FLAN 137B PaLM 540B UniMC 235M
ANLI R1 43.6 40.9 47.7 48.4 52
ANLI R2 38.7 38.2 43.9 44.2 44.4
ANLI R3 41.3 40.9 47 45.7 47.8
CB 70.1 33.9 64.1 51.8 75.7

使用 Usage

import argparse
from fengshen import UniMCPiplines


total_parser = argparse.ArgumentParser("TASK NAME")
total_parser = UniMCPiplines.piplines_args(total_parser)
args = total_parser.parse_args()

args.pretrained_model_path = 'IDEA-CCNL/Erlangshen-Albert-235M-UniMC-English'
args.language=='english'

train_data = []
dev_data = []
test_data = [
        {"texta": "Linguistics is the scientific study of language, and involves an analysis of language form, language meaning, and language in context. The earliest activities in the documentation and description of language have been attributed to the 4th century BCE Indian grammarian Pāṇini, who wrote a formal description of the Sanskrit language in his Aṣṭādhyāyī .", 
         "textb": "", 
         "question": "Based on the paragraph", 
         "choice": [
            "we can infer that Form and meaning are the only aspects of language linguistics is concerned with.", 
            "we can not infer that Form and meaning are the only aspects of language linguistics is concerned with.", 
            "it is difficult for us to infer that Form and meaning are the only aspects of language linguistics is concerned with."
            ], 
         "answer": "we can not infer that Form and meaning are the only aspects of language linguistics is concerned with.", 
         "label": 1, 
         "id": 0},
    ]

model = UniMCPiplines(args)

if args.train:
    model.fit(train_data, dev_data)
result = model.predict(test_data)
for line in result[:20]:
    print(line)



引用 Citation

如果您在您的工作中使用了我们的模型,可以引用我们的论文

If you are using the resource for your work, please cite the our paper:

@article{fengshenbang,
  author    = {Junjie Wang and Yuxiang Zhang and Lin Zhang and Ping Yang and Xinyu Gao and Ziwei Wu and Xiaoqun Dong and Junqing He and Jianheng Zhuo and Qi Yang and Yongfeng Huang and Xiayu Li and Yanghan Wu and Junyu Lu and Xinyu Zhu and Weifeng Chen and Ting Han and Kunhao Pan and Rui Wang and Hao Wang and Xiaojun Wu and Zhongshen Zeng and Chongpei Chen and Ruyi Gan and Jiaxing Zhang},
  title     = {Fengshenbang 1.0: Being the Foundation of Chinese Cognitive Intelligence},
  journal   = {CoRR},
  volume    = {abs/2209.02970},
  year      = {2022}
}

也可以引用我们的网站:

You can also cite our website:

@misc{Fengshenbang-LM,
  title={Fengshenbang-LM},
  author={IDEA-CCNL},
  year={2021},
  howpublished={\url{https://github.com/IDEA-CCNL/Fengshenbang-LM}},
}