Skip to Content
Python迁移学习
book

Python迁移学习

by Posts & Telecom Press, Dipanjan Sarkar, Raghav Bali, Tamoghna Ghosh
May 2024
Intermediate to advanced
373 pages
6h 6m
Chinese
Packt Publishing
Content preview from Python迁移学习

第7章 文本文档分类

在本章中,我们将讨论迁移学习在文本文档分类中的应用。文本分类是一项非常普遍的自然语言处理任务。关键目标是基于文档的文本内容将文档分配给一个或多个类别或类型。该项任务在行业中具有广泛的应用,包括将电子邮件分类为垃圾邮件或非垃圾邮件、审阅和评级分类、情感分析,以及对电子邮件或事件路由(将电子邮件或事件进行分类,以便可以将其自动分配给相应的人员)。以下是本章涉及的主要主题:

  • 文本分类总述、行业应用和挑战;
  • 文本分类基准数据集和传统模型的性能;
  • 密集向量的单词表示——深度学习模型;
  • CNN文档模型——单词到句子的嵌入,然后进行文档嵌入;
  • 源领域和目标领域分布不同的迁移学习应用,即源领域由重叠较少的类组成,而目标领域具有许多混合类;
  • 源领域和目标领域本身不同的迁移学习应用(例如源领域是新闻,而目标领域是电影评论等);
  • 训练完成的模型完成其他文本分析任务(例如文档摘要)中的应用——解释为什么将评论归类为负面或正面。

我们不仅将专注于现实例子的理论研究,同时也将专注于实际实现。本章中的代码可以从异步社区网站获取。

给定一组文本文档和一组预定义类别,文本分类的目的是将每个文档分配给一个类别。根据实际问题的不同,输出可以是软分配,也可以是硬分配。软分配表示将类别分配定义为所有类别上的概率分布。

文本分类在工业中有广泛的应用。以下是一些示例。

  • 垃圾邮件过滤。给定电子邮件,将其分类为垃圾邮件或非垃圾邮件。
  • 情感分类。给定一段评论文字(如电影评论、产品评论),识别用户的偏向是正向评论、负向评论还是中立评论。
  • 问题故障单分配。通常来说,在任何行业中,只要用户遇到任何有关IT应用程序、软件或硬件产品的问题,第一步就是创建故障单。这些故障单是描述用户面临的问题的文本文档。下一个合乎逻辑的步骤是,必须有人阅读说明并将其分配给专业相当的团队来解决。给定一些历史故障单和解决团队的类别,我们可以构建一个文本分类器以自动对问题故障单进行分类。 ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.

Read now

Unlock full access

More than 5,000 organizations count on O’Reilly

AirBnbBlueOriginElectronic ArtsHomeDepotNasdaqRakutenTata Consultancy Services

QuotationMarkO’Reilly covers everything we've got, with content to help us build a world-class technology community, upgrade the capabilities and competencies of our teams, and improve overall team performance as well as their engagement.
Julian F.
Head of Cybersecurity
QuotationMarkI wanted to learn C and C++, but it didn't click for me until I picked up an O'Reilly book. When I went on the O’Reilly platform, I was astonished to find all the books there, plus live events and sandboxes so you could play around with the technology.
Addison B.
Field Engineer
QuotationMarkI’ve been on the O’Reilly platform for more than eight years. I use a couple of learning platforms, but I'm on O'Reilly more than anybody else. When you're there, you start learning. I'm never disappointed.
Amir M.
Data Platform Tech Lead
QuotationMarkI'm always learning. So when I got on to O'Reilly, I was like a kid in a candy store. There are playlists. There are answers. There's on-demand training. It's worth its weight in gold, in terms of what it allows me to do.
Mark W.
Embedded Software Engineer

You might also like

(Re)Value

(Re)Value

Adam Wallace
深度学习实战手册(R语言版)

深度学习实战手册(R语言版)

Posts & Telecom Press, PKS Prakash, Achyutuni Sri Krishna Rao
Python计算机视觉和自然语言处理

Python计算机视觉和自然语言处理

Posts & Telecom Press, Álvaro Morena Alberolaï, Gonzalo Molina Gallegoï, Unai Garay Maestreï
人工智能技术与大数据

人工智能技术与大数据

Posts & Telecom Press, Anand Deshpande, Manish Kumar

Publisher Resources

ISBN: 9781836205418