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文本分析
100
3
Reporting Jacqueline Tempera in Brookline and Boston, Massachusetts, and
Jonathan Allen in New York; Editing by Frank McGurty and Bill Berkrot'
在这个例子中,输出的结果非常好。在大多数情况下,
python-readability
的效果
都很不错,而且无需考虑太多特殊情况。但是,使用该库的代价是不确定性。它是
否能够始终以预期的方式工作,是否无法提取时间戳、作者之类的结构化数据(尽
管我们可能还有其他启发式的方式)?
3.15.2
总结基于密度的文本提取
基于密度的文本提取方法是一种非常强大的方法,它同时使用了启发式和有关
HTML
页面上信息分布的统计信息。不过请注意,这种方法所得出的结果自然无法
与专用的提取实现相比。然而,如果你需要从许多不同类型的页面提取内容,或者
从某个根本没有固定版式的存档中提取内容,则这种方法值得一试。
与结构化方法相比,在提取之后执行严格的质量保证尤为重要,因为启发式和统计
的方法有时可能会走错方向。
3.16
一体化解决方案
Scrapy
https://scrapy.org
)也是一个
Python
的软件包,它提供了爬虫以及内容提
取的一体化解决方案。尽管
Scrapy
更适合下载整个网站,而不仅仅是网站的一部分,
但这些方法与我们前面介绍的方法相似。
Scrapy
是一个非常出色的、面向对象、整体分析式解决方案,而且代码易于阅读。 ...
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