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文本分析
295
第 10 章
通过单词嵌入探索语义关系
相似性的概念是所有机器学习任务的基础。在第
5
章中,我们介绍了如何根据词袋
模型计算文本的相似性。根据两个文档的
TF-IDF
向量计算余弦相似性非常简单,
而且我们可以利用这个信息来搜索、聚类或分类相似的文档。
然而,词袋模型中的相似性概念完全基于两个文档中共有的单词数量。如果文档之
间没有共享任何单词,则文档向量的点积,也就是余弦相似性为
0
。考虑下面两则
有关某个新电影的评论(来自某个社交平台):
“
What a wonderful movie.
”
“
The film is great
.”
很显然,尽管这两个评论使用的单词完全不同,但它们的意思非常相似。在本章中,
我们将介绍单词嵌入,这种方式能够捕捉到单词的语义,并利用它们探索语料库中
的语义相似性。
10.1
本章内容概要
假设我们都是市场研究人员,希望通过有关车辆的文本,更好地理解车辆市场中的
一些关系。具体来讲,我们想探索车辆品牌与车型之间的相似性。例如,品牌
A
中
的哪个车型与品牌
B
的某个车型最为相似?
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