Skip to Content
Python文本分析
book

Python文本分析

by Jens Albrecht, Sidharth Ramachandran, Christian Winkler
August 2022
Intermediate to advanced
441 pages
11h 26m
Chinese
China Electric Power Press Ltd.
Content preview from Python文本分析
248
|
第
8
章
为了可视化结果,
pyLDAvis
通过主成分分析(
Principal components analysis
,简称
PCA
,这是一种标准的降维方法),将主题从原来的维度(单词数量)映射到了二维。
这一步会针对每个主题生成一个点,我们添加了一个圆是为了展示主题的相对大小。
我们可以使用
T-SNE
来代替
PCA
,只需要在准备阶段将
mds="tsne"
作为参数传递
进去。这会改变主题间的距离图,而且还可以减少互相重叠的主题泡。然而,这只
是为了可视化,将多个单词维度映射成二维的产物。因此,你应该看一看主题的单
词分布,不要只相信低维可视化。
我们看到
Topics 4
、
6
和
10
有很大一块重叠的部分(“
international
”),而
Topics
3
(“
general assembly
”)似乎距离其他主题都很远。将鼠标放在其他主题泡上,
或点击这些主题泡,你就能在右边看到它们各自的单词分布。尽管并非所有主题都
完全分离,但有一些(比如
Topics 1
和
Topics 7
)与其他主题都相距很远。将鼠标
放在它们上,你就会看到它们的单词有很大的不同。对于这样的主题,最好提取最
有代表性的文档,并作为监督学习的训练集。
pyLDAvis
是一款很好用的工具,非常适合作为屏幕截图放在演示文稿中。尽管看起
来它可以用于探索,然而如果真的想探索主题模型,还需要修改特征以及算法的超
参数。
使用
pyLDAvis
,可以让我们很好地理解主题之间的组织方式以及每个单词的重要程
度。然而,如果我们需要对主题有进一步的定性理解, ...
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

工程战略的制定

工程战略的制定

Will Larson
Python实用技能学习指南

Python实用技能学习指南

Posts & Telecom Press, Robert Smallshire, Austin Bingham
精益AI

精益AI

Lomit Patel
Excel金融建模

Excel金融建模

Posts & Telecom Press, Shmuel Oluwa

Publisher Resources

ISBN: 9787519864446