Skip to Content
Python和NLTK实现自然语言处理
book

Python和NLTK实现自然语言处理

by Posts & Telecom Press, Nitin Hardeniya
February 2024
Intermediate to advanced
649 pages
9h 58m
Chinese
Packt Publishing
Content preview from Python和NLTK实现自然语言处理

第7章 情感分析——我很高兴

情感分析或情绪生成是在NLP中的其中一个任务。将它定义为确定字符序列背后情绪的过程。可以使用它来确定演讲者或个人是否以一种快乐或悲伤的情绪,或以一种中性的表述方式,来表达文本思想。

本章包括以下主题。

  • 情感分析。
  • 使用NER的情感分析。
  • 使用机器学习的情感分析。
  • NER系统的评价。

将情感分析定义为对自然语言执行的一项任务。此处,在使用自然语言表达的句子或单词上执行计算,确定它们是否表达了正面、负面或中性的情绪。由于情感分析提供了所表达文本的信息,因此这是一种主观的任务。可以将情感分析定义为分类问题,在这个分类问题中,分类可能具有两种类型——二元分类(正或负),也可能是多元分类(正面、负面或中性)。情感分析也称为文本情感分析。这是确定文本背后所蕴含情感或情绪的文本挖掘方法。当情感分析与主题挖掘相结合时,它称为主题-情感分析。也可以使用词典来执行情感分析。词典可以是特定领域的词典,也可以是通用的词典。词典包含正面表达方式、负面表达方式、中性表达方式和停用词列表。当出现测试句子时,可以在词典中执行简单的查找操作。

一个示例单词列表为——英语单词的情感规范(Affective Norms for English Words,ANEW)。这是在佛罗里达大学发现的英文单词列表。这个英文单词列表由表达了优势度(dominance)、评价值(valence)和唤起度(arousal)的1034个单词组成,是由Bradley和Lang制作的。构建这个单词列表出于学术(而非研究)目的。其他变体有DANEW(荷兰语ANEW)和SPANEW(西班牙语ANEW)。

AFINN由2477个单词组成(早期有1468个单词)。这个单词列表是由Finn Arup ...

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

Java持续交付

Java持续交付

Daniel Bryant, Abraham Marín-Pérez
C++语言导学(原书第2版)

C++语言导学(原书第2版)

本贾尼 斯特劳斯特鲁普
软件开发实践:项目驱动式的Java开发指南

软件开发实践:项目驱动式的Java开发指南

Raoul-Gabriel Urma, Richard Warburton
Spark机器学习实战

Spark机器学习实战

Posts & Telecom Press, Siamak Amirghodsi, Meenakshi Rajendran, Broderick Hall, Shuen Mei

Publisher Resources

ISBN: 9781835083451