goendalf666/sales-conversations-2
收藏资源简介:
--- dataset_info: features: - name: '0' dtype: string - name: '1' dtype: string - name: '2' dtype: string - name: '3' dtype: string - name: '4' dtype: string - name: '5' dtype: string - name: '6' dtype: string - name: '7' dtype: string - name: '8' dtype: string - name: '9' dtype: string - name: '10' dtype: string - name: '11' dtype: string - name: '12' dtype: string - name: '13' dtype: string - name: '14' dtype: string - name: '15' dtype: string - name: '16' dtype: string - name: '17' dtype: string - name: '18' dtype: string - name: '19' dtype: string splits: - name: train num_bytes: 6821725 num_examples: 3412 download_size: 2644154 dataset_size: 6821725 configs: - config_name: default data_files: - split: train path: data/train-* --- # Dataset Card for "sales-conversations-2" # Dataset Card for "sales-conversations" This dataset was created for the purpose of training a sales agent chatbot that can convince people. The initial idea came from: textbooks is all you need https://arxiv.org/abs/2306.11644 gpt-3.5-turbo was used for the generation See the main model or github for more information salesGPT_v2: https://huggingface.co/goendalf666/salesGPT_v2 github: https://github.com/tom813/salesGPT_foundation # Structure The conversations have a customer and a salesman which appear always in changing order. customer, salesman, customer, salesman, etc. The customer always starts the conversation Who ends the conversation is not defined. # Generation Note that a textbook dataset is mandatory for this conversation generation. This examples rely on the following textbook dataset: https://huggingface.co/datasets/goendalf666/sales-textbook_for_convincing_and_selling The data generation code can be found here: https://github.com/tom813/salesGPT_foundation/blob/main/data_generation/textbook_and_conversation_gen.py The following prompt was used to create a conversation ``` def create_random_prompt(chapter, roles=["Customer", "Salesman"], range_vals=(3, 7), industries=None): if industries is None: industries = ["tech", "health", "finance"] # default industries; replace with your default list if different x = random.randint(*range_vals) y = 0 for i in reversed(range(3, 9)): # Generalized loop for range of values if i * x < 27: y = i break conversation_structure = "" for i in range(1, x+1): conversation_structure += f""" {roles[0]}: #{i}. sentence of {roles[0].lower()} {roles[1]}: #{i}. sentence of {roles[1].lower()}""" prompt = f"""Here is a chapter from a textbook about convincing people. The purpose of this data is to use it to fine tune a llm. Generate conversation examples that are based on the chapter that is provided and would help an ai to learn the topic by examples. Focus only on the topic that is given in the chapter when generating the examples. Let the example be in the {random.choice(industries)} industry. Follow this structure and put each conversation in a list of objects in json format. Only return the json nothing more: {conversation_structure} Generate {y} lists of those conversations Chapter:{chapter}""" return prompt ``` [More Information needed](https://github.com/huggingface/datasets/blob/main/CONTRIBUTING.md#how-to-contribute-to-the-dataset-cards)
## 数据集信息 特征列表: - 字段名:'0',数据类型:字符串 - 字段名:'1',数据类型:字符串 - 字段名:'2',数据类型:字符串 - 字段名:'3',数据类型:字符串 - 字段名:'4',数据类型:字符串 - 字段名:'5',数据类型:字符串 - 字段名:'6',数据类型:字符串 - 字段名:'7',数据类型:字符串 - 字段名:'8',数据类型:字符串 - 字段名:'9',数据类型:字符串 - 字段名:'10',数据类型:字符串 - 字段名:'11',数据类型:字符串 - 字段名:'12',数据类型:字符串 - 字段名:'13',数据类型:字符串 - 字段名:'14',数据类型:字符串 - 字段名:'15',数据类型:字符串 - 字段名:'16',数据类型:字符串 - 字段名:'17',数据类型:字符串 - 字段名:'18',数据类型:字符串 - 字段名:'19',数据类型:字符串 数据集划分: - 划分名称:训练集(train),占用字节数:6821725,样本数量:3412 下载大小:2644154,数据集总存储大小:6821725 配置项: - 配置名称:默认(default),数据文件: - 对应划分:训练集,文件路径:data/train-* # "sales-conversations-2"数据集卡片 # "sales-conversations"数据集卡片 本数据集专为训练可用于说服用户的销售智能体聊天机器人(sales agent chatbot)而构建。 其初始灵感来源于论文《Textbooks Is All You Need》(https://arxiv.org/abs/2306.11644)。 数据集生成使用了gpt-3.5-turbo模型。 如需了解更多信息,请查阅关联模型或GitHub仓库。 关联模型salesGPT_v2:https://huggingface.co/goendalf666/salesGPT_v2 GitHub仓库:https://github.com/tom813/salesGPT_foundation ## 对话结构 本数据集包含的对话始终由客户与销售人员交替登场,顺序不定,即客户、销售人员、客户、销售人员……以此类推。对话始终由客户发起,但未定义对话的结束方。 ## 数据生成 请注意,本对话生成任务必须依赖教科书类数据集。本次示例所依托的教科书数据集为:https://huggingface.co/datasets/goendalf666/sales-textbook_for_convincing_and_selling 数据生成代码可在此处获取:https://github.com/tom813/salesGPT_foundation/blob/main/data_generation/textbook_and_conversation_gen.py 以下为用于生成对话的提示词模板: python def create_random_prompt(chapter, roles=["Customer", "Salesman"], range_vals=(3, 7), industries=None): if industries is None: industries = ["tech", "health", "finance"] # 默认行业列表;如需自定义请替换为对应列表 x = random.randint(*range_vals) y = 0 for i in reversed(range(3, 9)): # 通用数值范围循环逻辑 if i * x < 27: y = i break conversation_structure = "" for i in range(1, x+1): conversation_structure += f""" {roles[0]}: #{i}. sentence of {roles[0].lower()} {roles[1]}: #{i}. sentence of {roles[1].lower()}""" prompt = f"""Here is a chapter from a textbook about convincing people. The purpose of this data is to use it to fine tune a llm. Generate conversation examples that are based on the chapter that is provided and would help an ai to learn the topic by examples. Focus only on the topic that is given in the chapter when generating the examples. Let the example be in the {random.choice(industries)} industry. Follow this structure and put each conversation in a list of objects in json format. Only return the json nothing more: {conversation_structure} Generate {y} lists of those conversations Chapter:{chapter}""" return prompt 为便于国内读者理解,以下为本地化注释后的代码版本: python def create_random_prompt(chapter, roles=["客户", "销售人员"], range_vals=(3, 7), industries=None): if industries is None: industries = ["科技", "医疗", "金融"] # 默认行业列表;如需自定义请替换为对应列表 # 随机生成对话轮次数量 x = random.randint(*range_vals) y = 0 for i in reversed(range(3, 9)): # 通用数值范围循环逻辑 if i * x < 27: y = i break conversation_structure = "" for i in range(1, x+1): conversation_structure += f""" {roles[0]}: #{i}. {roles[0].lower()}第{i}句 {roles[1]}: #{i}. {roles[1].lower()}第{i}句""" prompt = f"""以下为一篇关于说服沟通的教科书章节。 本数据集的用途为用于微调大语言模型(Large Language Model, LLM)。 请基于提供的章节生成对话示例,以帮助AI通过示例学习对应主题。 生成示例时需严格围绕章节给定的主题展开,并将示例设定在{random.choice(industries)}行业场景中。 请遵循以下结构,将每一组对话以JSON对象列表的形式输出,仅返回JSON内容,无需其他额外信息: {conversation_structure} 请生成{y}组此类对话 章节内容:{chapter}""" return prompt [更多信息需求](https://github.com/huggingface/datasets/blob/main/CONTRIBUTING.md#how-to-contribute-to-the-dataset-cards)
数据集概述
数据集信息
-
特征列表:
- 名称: 0, 数据类型: string
- 名称: 1, 数据类型: string
- 名称: 2, 数据类型: string
- 名称: 3, 数据类型: string
- 名称: 4, 数据类型: string
- 名称: 5, 数据类型: string
- 名称: 6, 数据类型: string
- 名称: 7, 数据类型: string
- 名称: 8, 数据类型: string
- 名称: 9, 数据类型: string
- 名称: 10, 数据类型: string
- 名称: 11, 数据类型: string
- 名称: 12, 数据类型: string
- 名称: 13, 数据类型: string
- 名称: 14, 数据类型: string
- 名称: 15, 数据类型: string
- 名称: 16, 数据类型: string
- 名称: 17, 数据类型: string
- 名称: 18, 数据类型: string
- 名称: 19, 数据类型: string
-
数据分割:
- 名称: train, 字节数: 6821725, 样本数: 3412
-
数据大小:
- 下载大小: 2644154
- 数据集大小: 6821725
-
配置:
- 配置名称: default
- 数据文件:
- 分割: train, 路径: data/train-*
数据集结构
- 对话包含客户和销售员,顺序不定,客户总是开始对话,对话结束未定义。
数据生成
-
生成对话需要依赖特定的教科书数据集。
-
生成代码可在以下链接找到: https://github.com/tom813/salesGPT_foundation/blob/main/data_generation/textbook_and_conversation_gen.py
-
生成对话使用的提示如下: python def create_random_prompt(chapter, roles=["Customer", "Salesman"], range_vals=(3, 7), industries=None): if industries is None: industries = ["tech", "health", "finance"] # default industries; replace with your default list if different
x = random.randint(*range_vals) y = 0 for i in reversed(range(3, 9)): # Generalized loop for range of values if i * x < 27: y = i break conversation_structure = "" for i in range(1, x+1): conversation_structure += f""" {roles[0]}: #{i}. sentence of {roles[0].lower()} {roles[1]}: #{i}. sentence of {roles[1].lower()}""" prompt = f"""Here is a chapter from a textbook about convincing people. The purpose of this data is to use it to fine tune a llm. Generate conversation examples that are based on the chapter that is provided and would help an ai to learn the topic by examples. Focus only on the topic that is given in the chapter when generating the examples. Let the example be in the {random.choice(industries)} industry. Follow this structure and put each conversation in a list of objects in json format. Only return the json nothing more: {conversation_structure} Generate {y} lists of those conversations Chapter:{chapter}""" return prompt




