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文本分析
洞悉文本数据
37
非常高,可以实现大型语料库的
KWIC
分析。默认情况下,该函数将返回一个元组
列表,形式为:
(
左上下文,关键字,右上下文
)
。如果
print_samples
大于
0
,则
会随机输出结果的某个样本。
8
在处理大量文档时,采样特别有帮助性,否则列表
的前几个条目就会来自同一个文档或非常少的几个文档。
上述
sdgs
KWIC
列表是通过以下函数调用生成的:
kwic(df[df['year'] == 2015]['text'], 'sdgs', print_samples=5)
1.8
案例:
n
元语法分析
我们仅仅知道“
climate
”(气候)是一个常见的单词,并不能掌握太多
有关大会讨论的话题,因为,比如“
climate change
”(气候变化)和“
political
climate
”(政治气氛)具有完全不同的含义。甚至是“
change climate
”(改变气候)
和“
climate change
”(气候变化)的意思也不相同。因此,我们有必要将频率分析
从一个单词扩展到两个或三个单词的短语。
大致说来,我们需要关注两种类型的单词序列:复合词和词语搭配。复合词
compound
)指的是两个或两个以上单词的组合。在英语中,复合词的呈现形式包
括三种:连写形式(比如“
earthquake
”)、带连字符(比如“
self-confident
”)以
及开放形式(比如“
climate change
”)。因此,我们必须将两个词语当成一个语义单元。
相反,词语搭配(
collocation
)则是指经常一起使用的单词,通常由一个形容词或 ...
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

精益AI

精益AI

Lomit Patel
构建知识图谱

构建知识图谱

Jesus Barrasa, Jim Webber
写给系统管理员的Python脚本编程指南

写给系统管理员的Python脚本编程指南

Posts & Telecom Press, Ganesh Sanjiv Naik

Publisher Resources

ISBN: 9787519864446