模型介绍
模型描述
EcomGPT是使用大量电商领域任务数据集指令微调得到的模型,在电商领域任务上表现出更好的零样本效果。 相关技术可以参考论文:EcomGPT: Instruction-tuning Large Language Models with Chain-of-Task Tasks for E-commerce
github: https://github.com/Alibaba-NLP/EcomGPT
期望模型使用方式以及适用范围
本模型可用于任何自然语言理解任务。用户只需给定类型标签即可。不同任务的标签给定方式可以参考以下例子(加粗部分为模版, response之后为模型输出):
评论主题分类
Below is an instruction that describes a task.
Write a response that appropriately completes the request.
### Instruction:
This place has the best pizza.
Select category for the above sentences from the following topics: Service, Anecdotes/Miscellaneous, Food, Price, Ambience.
### Response: Food
阅读理解-抽取
Below is an instruction that describes a task.
Write a response that appropriately completes the request.
### Instruction:
Context: Need help finding a game? It was a game i played when i was about 10 now im 16 On the cover it had a dark side and a light One had a light angle and the other a dark on the light side their was grass and some kind of archers on the dark it has orc type characters It had lava on the dark side and grass and water on the light i also think it was an RTS game plz HELP ME ITS KILLING ME\nQuestion: How old is the author now?
Extract spans from context to answer the question.
### Response: 16
实体识别
Below is an instruction that describes a task.
Write a response that appropriately completes the request.
### Instruction:
So HP designed a unit that looks like a stackable component for your home-theater system .
Detect all named entity about Attribute, Brand, Component, Product in the sentence.
### Response: HP
类目预测
Below is an instruction that describes a task.
Write a response that appropriately completes the request.
### Instruction:
小茶几简约现代家用小户型客厅沙发小圆桌北欧ins风卧室简易桌子\t安装方式#:#组装#;#款式定位#:#经济型#;#人造板种类#:#细木工板#;#是否可伸缩#:#否#;#人造板饰面工艺#:#木皮饰面#;#出租车是否可运输#:#是#;#风格#:#北欧#;#饰面材质#:#人造板#;#饰面工艺#:#人造板工艺#;#木质结构工艺#:#其他#;#是否带滚轮#:#否#;#结构工艺#:#木质工艺#;#茶几角形状#:#方形#;#包装体>积#:#包装体积#;#省份#:#山东省#;#材质#:#人造板#;#是否可预售#:#否#;#门数量#:#无门#;#是否可定制#:#否#;#是否组装#:#是#;#地市#:#菏泽市#;#形状#:#方形#;#区县#:#曹县#;#是否带储物空间#:#是#;#品牌#:#FAJOFIEL/法乔菲#;#型号#:#AM-203
Categorize product items. Candidates: 美妆洗护, 大百货, 消费电子, 食品, 大服饰
### Response: 大百货
如何使用
- 在安装ModelScope完成之后即可使用。
代码范例
from modelscope.utils.constant import Tasks
from modelscope.pipelines import pipeline
inputs = {
'instruction':
'Classify the sentence, select from the candidate labels: product, brand',
'text': '照相机'
}
# PROMPT_TEMPLATE保持不变
PROMPT_TEMPLATE = 'Below is an instruction that describes a task. ' + \
'Write a response that appropriately completes the request.\n\n' + \
'### Instruction:\n{text}\n{instruction}\n\n### Response:'
prompt = PROMPT_TEMPLATE.format(**inputs)
pipeline_ins = pipeline(task=Tasks.text_generation, model='damo/nlp_ecomgpt_multilingual-7B-ecom',model_revision = 'v1.0.1')
print(pipeline_ins(prompt))
训练数据介绍
为了提高模型在电商任务上的泛化能力,我们构造了一个电商指令数据集EcomInstruct,包括122个训练任务/数据集(held-in),约150万条数据,以及12个评估任务(held-out)。整体任务情况如图所示。
EcomInstruct包括两个主要组成部分,公开任务数据和基于公开任务数据构造的原子任务数据。 首先,我们从学术论文或竞赛平台等开放数据源收集了共65个各种电商任务数据集,包括命名实体识别、评论问答、商品类目预测、多轮对话等传统的自然语言处理任务。这些开源数据集的任务都是由领域专家设计,然后由受过培训的人工标注,数据质量很高。 其次,虽然电商领域的实体和概念每天都在增加(比如新品牌、新品类),但电商数据的类型相对稳定,包括产品信息、用户对话、用户评论和搜索查询等。我们认为,无论下游具体应用是什么,对基础数据类型的全面理解对于提高模型的泛化能力至关重要。出于这个动机,我们进一步围绕这些基础数据(来自于以上开源数据集)构建了大量的原子任务,比如实体片段识别,实体分类等。这些原子任务涵盖了各种基本的语义理解能力,在模型解决原始任务的中间阶段广泛应用,这些原子任务可以看做任务链任务(Chain of tasks)。原子任务的标注答案尽可能从公开任务原始的标注构造,以保证准确性。实在无法构造的,借助ChatGPT帮助生成。
数据评估及结果
注:以上评估数据集均未出现在训练数据中。
引用信息
@misc{li2023ecomgpt,
title={EcomGPT: Instruction-tuning Large Language Models with Chain-of-Task Tasks for E-commerce},
author={Yangning Li and Shirong Ma and Xiaobin Wang and Shen Huang and Chengyue Jiang and Hai-Tao Zheng and Pengjun Xie and Fei Huang and Yong Jiang},
year={2023},
eprint={2308.06966},
archivePrefix={arXiv},
primaryClass={cs.CL}
}
评论