从零开始大模型开发与微调:Ag_news数据集介绍和数据清洗

本文介绍了大模型微调的重要性,特别是针对Ag_news数据集的预处理,包括数据清洗的必要性、核心概念如大模型与迁移学习、微调流程,以及数据清洗的具体步骤,如去除HTML标签、分词、词形还原等,为后续模型训练提供高质量数据。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

从零开始大模型开发与微调:Ag_news数据集介绍和数据清洗

1. 背景介绍

1.1 大模型与微调的重要性

近年来,随着深度学习技术的快速发展,大规模预训练语言模型(Pre-trained Language Models,PLMs)已经成为自然语言处理(Natural Language Processing,NLP)领域的研究热点。这些大模型通过在海量无标注文本语料上进行预训练,可以学习到丰富的语言知识和通用语义表示。在实际应用中,我们通常采用微调(Fine-tuning)的方式,在特定任务的标注数据上对预训练模型进行二次训练,使其能够快速适应下游任务。微调已经成为利用大模型解决实际NLP问题的主流范式。

1.2 Ag_news数据集简介

Ag_news是一个用于文本分类任务的经典数据集。它来源于AG新闻语料库,包含了大约12万篇英文新闻文章,分属4个类别:World、Sports、Business和Sci/Tech。每个类别各有3万篇文章,数据集总共约1.2GB。Ag_news常被用作文本分类任务的基准数据集,用于评估各种分类算法的性能。

1.3 数据清洗的必要性

原始的Ag_news数据集中存在一些噪声数据和不规范的格式,直接将其用于模型训练可能会影响模型的性能。因此,在使用该数据集进行大模型微调之前,我们需要对其进行必要的清洗和预处理,包括去除无效样本、统一数据格式、分词、构建词表等。高质量的训练数

496,835 条来自 AG 新闻语料库 4 大类别超过 2000 个新闻源的新闻文章,数据集仅仅援用了标题描述字段。每个类别分别拥有 30,000 个训练样本及 1900 个测试样本。 README: AG's News Topic Classification Dataset Version 3, Updated 09/09/2015 ORIGIN AG is a collection of more than 1 million news articles. News articles have been gathered from more than 2000 news sources by ComeToMyHead in more than 1 year of activity. ComeToMyHead is an academic news search engine which has been running since July, 2004. The dataset is provided by the academic comunity for research purposes in data mining (clustering, classification, etc), information retrieval (ranking, search, etc), xml, data compression, data streaming, and any other non-commercial activity. For more information, please refer to the link http://www.di.unipi.it/~gulli/AG_corpus_of_news_articles.html . The AG's news topic classification dataset is constructed by Xiang Zhang (xiang.zhang@nyu.edu) from the dataset above. It is used as a text classification benchmark in the following paper: Xiang Zhang, Junbo Zhao, Yann LeCun. Character-level Convolutional Networks for Text Classification. Advances in Neural Information Processing Systems 28 (NIPS 2015). DESCRIPTION The AG's news topic classification dataset is constructed by choosing 4 largest classes from the original corpus. Each class contains 30,000 training samples and 1,900 testing samples. The total number of training samples is 120,000 and testing 7,600. The file classes.txt contains a list of classes corresponding to each label. The files train.csv and test.csv contain all the training samples as comma-sparated values. There are 3 columns in them, corresponding to class index (1 to 4), title and description. The title and description are escaped using double quotes ("), and any internal double quote is escaped by 2 double quotes (""). New lines are escaped by a backslash followed with an "n" character, that is "\n".
AG's News Topic Classification Dataset Version 3, Updated 09/09/2015 ORIGIN AG is a collection of more than 1 million news articles. News articles have been gathered from more than 2000 news sources by ComeToMyHead in more than 1 year of activity. ComeToMyHead is an academic news search engine which has been running since July, 2004. The dataset is provided by the academic comunity for research purposes in data mining (clustering, classification, etc), information retrieval (ranking, search, etc), xml, data compression, data streaming, and any other non-commercial activity. For more information, please refer to the link http://www.di.unipi.it/~gulli/AG_corpus_of_news_articles.html . The AG's news topic classification dataset is constructed by Xiang Zhang (xiang.zhang@nyu.edu) from the dataset above. It is used as a text classification benchmark in the following paper: Xiang Zhang, Junbo Zhao, Yann LeCun. Character-level Convolutional Networks for Text Classification. Advances in Neural Information Processing Systems 28 (NIPS 2015). DESCRIPTION The AG's news topic classification dataset is constructed by choosing 4 largest classes from the original corpus. Each class contains 30,000 training samples and 1,900 testing samples. The total number of training samples is 120,000 and testing 7,600. The file classes.txt contains a list of classes corresponding to each label. The files train.csv and test.csv contain all the training samples as comma-sparated values. There are 3 columns in them, corresponding to class index (1 to 4), title and description. The title and description are escaped using double quotes ("), and any internal double quote is escaped by 2 double quotes (""). New lines are escaped by a backslash followed with an "n" character, that is "\n".
【资源说明】 1、该资源包括项目的全部源码,下载可以直接使用! 2、本项目适合作为计算机、数学、电子信息等专业的课程设计、期末大作业毕设项目,作为参考资料学习借鉴。 3、本资源作为“参考资料”如果需要实现其他功能,需要能看懂代码,并且热爱钻研,自行调试。 基于textCNN卷积神经网络的英文新闻数据集分类(AG_news)算法源码.zip 基于textCNN卷积神经网络的英文新闻数据集分类(AG_news)算法源码.zip 基于textCNN卷积神经网络的英文新闻数据集分类(AG_news)算法源码.zip 基于textCNN卷积神经网络的英文新闻数据集分类(AG_news)算法源码.zip 基于textCNN卷积神经网络的英文新闻数据集分类(AG_news)算法源码.zip 基于textCNN卷积神经网络的英文新闻数据集分类(AG_news)算法源码.zip 基于textCNN卷积神经网络的英文新闻数据集分类(AG_news)算法源码.zip 基于textCNN卷积神经网络的英文新闻数据集分类(AG_news)算法源码.zip 基于textCNN卷积神经网络的英文新闻数据集分类(AG_news)算法源码.zip 基于textCNN卷积神经网络的英文新闻数据集分类(AG_news)算法源码.zip 基于textCNN卷积神经网络的英文新闻数据集分类(AG_news)算法源码.zip 基于textCNN卷积神经网络的英文新闻数据集分类(AG_news)算法源码.zip 基于textCNN卷积神经网络的英文新闻数据集分类(AG_news)算法源码.zip 基于textCNN卷积神经网络的英文新闻数据集分类(AG_news)算法源码.zip 基于textCNN卷积神经网络的英文新闻数据集分类(AG_news)算法源码.zip 基于textCNN卷积神经网络的英文新闻数据集分类(AG_news)算法源码.zip 基于textCNN卷积神经网络的英文新闻数据集分类(AG_news)算法源码.zip 基于textCNN卷积神经网络的英文新闻数据集分类(AG_news)算法源码.zip 基于textCNN卷积神经网络的英文新闻数据集分类(AG_news)算法源码.zip 基于textCNN卷积神经网络的英文新闻数据集分类(AG_news)算法源码.zip 基于textCNN卷积神经网络的英文新闻数据集分类(AG_news)算法源码.zip 基于textCNN卷积神经网络的英文新闻数据集分类(AG_news)算法源码.zip 基于textCNN卷积神经网络的英文新闻数据集分类(AG_news)算法源码.zip 基于textCNN卷积神经网络的英文新闻数据集分类(AG_news)算法源码.zip 基于textCNN卷积神经网络的英文新闻数据集分类(AG_news)算法源码.zip 基于textCNN卷积神经网络的英文新闻数据集分类(AG_news)算法源码.zip 基于textCNN卷积神经网络的英文新闻数据集分类(AG_news)算法源码.zip 基于textCNN卷积神经网络的英文新闻数据集分类(AG_news)算法源码.zip 基于textCNN卷积神经网络的英文新闻数据集分类(AG_news)算法源码.zip 基于textCNN卷积神经网络的英文新闻数据集分类(AG_news)算法源码.zip 基于textCNN卷积神经网络的英文新闻数据集分类(AG_news)算法源码.zip 基于textCNN卷积神经网络的英文新闻数据集分类(AG_news)算法源码.zip 基于textCNN卷积神经网络的英文新闻数据集分类(AG_news)算法源码.zip 基于textCNN卷积神经网络的英文新闻数据集分类(AG_news)算法源码.zip 基于textCNN卷积神经网络的英文新闻数据集分类(AG_news)算法源码.zip 基于textCNN卷积神经网络的英文新闻数据集分类(AG_news)算法源码.zip 基于textCNN卷积神经网络的英文新闻数据集分类(AG_news)算法源码.zip 基于textCNN卷积神经网络的英文新闻数据集分类(AG_news)算法源码.zip 基于textCNN卷积神经网络的英文新闻数据集分类(AG_news)算法源码.zip 基于textCNN卷积神经网络的英文新闻数据集分类(AG_news)算法源码.zip 基于textCNN卷积神经网络的英文新闻数据集分类(AG_news)算法源码.zip 基于textCNN卷积神经网络的英文新闻数据集分类(AG_news)算法源码.zip 基于textCNN卷积神经网络的英文新闻数据集分类(AG_news)算法源码.zip 基于textCNN卷积神经网络的英文新闻数
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

AI天才研究院

你的鼓励将是我创作的最大动力

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值