亮数据,适合大模型数据准备的可视化高效率数据采集工具。

一、大模型训练需要数据

大模型数据处理的流程,分为数据采集、数据清洗、数据评估和指令数据标注四个主要阶段,而这些阶段中最重要的就是数据采集阶段,需要海量的数据才能让大模型涌现智能。

访问点击: 亮数据加速数据采集。

file

数据采集

涉及多种数据源,包括点云、图像、文本和语音,数据来源涵盖公开数据集、百科数据、电子书、Common Crawl数据集、新闻数据和行业数据。

数据清洗

通过结合专家知识、大数据和AI,实现一键数据清洗,步骤包括数据去重、网页语言过滤、特殊符号过滤和图像裁剪。基于模型反馈对数据清洗质量进行评估。

数据评估

包括人工评估和基于模型的自动评估,确保数据的高灵敏度和高质量。

指令数据标注

利用语言模型(LM)自动生成和标注指令数据,显著降低行业数据标注成本,提高效率。包括种子指令编写、指令扩增和数据集自动生成与标注。

二、亮数据高效率采集工具介绍

亮数据是一家提供全方位网络数据服务的公司,专注于商用代理和数据采集。在数据采集方面,亮数据提供了一系列强大的工具和服务:

  • 代理服务:亮数据提供动态住宅代理、静态住宅代理、机房代理和移动代理,覆盖全球195个国家,拥有超过7200万个IP。 亮数据加速数据采集。
    file
  • 数据采集工具:亮数据提供Web Scraper IDE、亮数据浏览器和SERP API等工具,帮助用户自动采集和解锁网站数据。 亮数据加速数据采集。
    file
  • 数据集:提供现成可用的大数据集和基于机器学习的电商数据分析,满足客户多样化的数据需求。 亮数据
    亮数据:高效率数据采集,加速大模型训练!-小白菜博客
    亮数据通过这些全面的服务,确保用户能够高效、精准地采集和利用网络数据。

访问点击: 亮数据

三、亮数据采集数据可视化实战

亮数据加速数据采集。

3.1 注册后,点击侧边栏 - 数据收集器

file

3.2 点击Web Scraper IDE 可视化爬虫IDE

亮数据:高效率数据采集,加速大模型训练!-小白菜博客
亮数据

3.3 可以选择自定义爬取,也可以参照模版

亮数据:高效率数据采集,加速大模型训练!-小白菜博客
亮数据

3.4 点击运行数据采集器

亮数据:高效率数据采集,加速大模型训练!-小白菜博客
亮数据

3.5 获得爬取结果,可导出为Json

file

访问点击: 亮数据加速数据采集。

四、采集的数据后处理转化为大模型课训练指令实战

按照章节三我们获得了一批Ebay的商品数据,如何用来生成指令呢?

4.1 大模型训练的指令一般格式

[
    {
        "instruction": "",
        "input": "",
        "output": ""
    }
]

4.2 将亮数据获得的数据转化为训练指令

下面将商品信息转换为微调指令的Python代码示例,同时生成了相应的微调指令(可以根据你需要的内容,设置各种场景):

import json

# 读取商品信息
with open('/mnt/data/lines.json', 'r') as file:
    products = json.load(file)

# 定义函数生成微调指令
def generate_fine_tuning_instructions(product):
    instructions = []

    # 指令1:生成商品简介
    instructions.append({
        "instruction": "Generate a brief description for the product.",
        "input": product['title'],
        "output": f"The {product['title']} is available for {product['price']['value']} {product['price']['currency']}. It is in {product['condition']} condition."
    })

    # 指令2:生成商品标题优化建议
    instructions.append({
        "instruction": "Suggest an optimized title for the product listing.",
        "input": product['title'],
        "output": f"Brand New {product['title']} at Only {product['price']['value']} {product['price']['currency']}!"
    })

    # 指令3:生成商品价格及运费信息
    instructions.append({
        "instruction": "Combine product price and shipping cost into a single string.",
        "input": f"Price: {product['price']['value']} {product['price']['currency']}, Shipping: {product['shipping_price']['value']} {product['shipping_price']['currency']}",
        "output": f"The total cost is {product['price']['value'] + product['shipping_price']['value']} {product['price']['currency']}."
    })

    # 指令4:生成商品链接的简短描述
    instructions.append({
        "instruction": "Create a short description including the product title and the URL.",
        "input": "",
        "output": f"Check out this {product['title']} here: {product['product_url']}"
    })

    # 指令5:生成商品分类描述
    instructions.append({
        "instruction": "Generate a description for the product category.",
        "input": product['category'],
        "output": f"This product belongs to the {product['category']} category, perfect for enhancing your style."
    })

    return instructions

# 生成所有商品的微调指令
all_instructions = []
for product in products:
    all_instructions.extend(generate_fine_tuning_instructions(product))

# 保存生成的微调指令
with open('/mnt/data/fine_tuning_instructions.json', 'w') as outfile:
    json.dump(all_instructions, outfile, indent=4)

# 输出生成的微调指令
for instruction in all_instructions:
    print(json.dumps(instruction, indent=4))

该代码从 lines.json 文件中读取商品信息,然后为每个商品生成多个微调指令。这些指令包括生成商品简介、优化商品标题、组合商品价格和运费信息、创建商品链接的简短描述以及生成商品分类描述。最后,将这些微调指令保存到一个新的 JSON 文件 fine_tuning_instructions.json 中。

生成如下:
生成的微调指令内容如下:

[
    {
        "instruction": "Generate a brief description for the product.",
        "input": "Polo Ralph Lauren Short Sleeve Solid Classic Fit Mesh Polo Shirt Navy Medium M",
        "output": "The Polo Ralph Lauren Short Sleeve Solid Classic Fit Mesh Polo Shirt Navy Medium M is available for 12.5 GBP. It is in Brand new condition."
    },
    {
        "instruction": "Suggest an optimized title for the product listing.",
        "input": "Polo Ralph Lauren Short Sleeve Solid Classic Fit Mesh Polo Shirt Navy Medium M",
        "output": "Brand New Polo Ralph Lauren Short Sleeve Solid Classic Fit Mesh Polo Shirt Navy Medium M at Only 12.5 GBP!"
    },
    {
        "instruction": "Combine product price and shipping cost into a single string.",
        "input": "Price: 12.5 GBP, Shipping: 3.99 GBP",
        "output": "The total cost is 16.49 GBP."
    },
    {
        "instruction": "Create a short description including the product title and the URL.(Polo Ralph Lauren Short Sleeve Solid Classic Fit Mesh Polo Shirt )",
        "input": "",
        "output": "Check out this Polo Ralph Lauren Short Sleeve Solid Classic Fit Mesh Polo Shirt Navy Medium M here: https://www.ebay.co.uk/itm/266810855159?itmmeta=01HYDB4599C0YG15YV26AMNVTC&hash=item3e1f2a8ef7%3Ag%3AIjoAAOSw3B5mAG0Q&itmprp=enc%3AAQAJAAAA8Py7UNHWp81cjXj6NBwvlndwuF2KS5n8yYBa8wTC0YfKuEhF4mCKkp7hqmBldzj%2FYlsbvOk4avfTViDIAjKX03asNCkz2edAuumM7ZSTrMKRxgyMfpeuRwSqEZ5MgpmfXmYaoUfBSPhDCiha%2FO7VON9bq9EuKZz9F3veWK16TvY8qgWR6sBDsWbMbbOpQbvPcMp4pEwqDOIUN7Wb8ufImjyBDjN8Ec066CmRz9QmgsuaCPSOI1jT8tv4MRjFiPjCK6vrmxhB4ARdOHwLhTrzHKpKHXeOxsO5GiyM%2BDGXAnbBphio%2Fd%2BkkiVvjmjmX6y4PA%3D%3D%7Ctkp%3ABk9SR97UkKvzYw&LH_ItemCondition=1000"
    },
    {
        "instruction": "Generate a description for the product category.(Polo Ralph Lauren Short Sleeve Solid Classic Fit Mesh Polo Shirt Navy Medium M)",
        "input": "Clothes, Shoes & Accessories",
        "output": "This product belongs to the Clothes, Shoes & Accessories category, perfect for enhancing your style."
    },...]

4.3 也可以使用大模型来转换指令

比如使用ChatGPT,prompt如下:

你需要将lines.json文件中的多条商品信息,生成如下格式的多条可供大模型训练的微调指令,这个里面你要根据商品信息,根据自己的知识来找各种角度生成有价值的微调指令,让大模型更加智能。格式如下:[
    {
        "instruction": "",
        "input": "",
        "output": ""
    },
]

五、亮数据,加速大模型数据采集。

亮数据,加速大模型数据采集,为用户提供全面的数据采集服务。Web Scraper IDE、亮数据浏览器和SERP API,帮助用户高效自动化地采集和解锁网站数据。通过这些先进的技术和服务,亮数据能够显著加速大模型的数据采集过程,为企业和研究机构提供高质量、精准的数据支持。

访问点击: 亮数据

file

如有帮助,请多关注
TeahLead KrisChang,10+年的互联网和人工智能从业经验,10年+技术和业务团队管理经验,同济软件工程本科,复旦工程管理硕士,阿里云认证云服务资深架构师,上亿营收AI产品业务负责人。