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文本分析
52
2
Response Code 200
Number of comments 30
虽然我们看到上述请求成功了,但是返回的评论只有
30
条。
PyTorch
是一个非常受
欢迎的框架,其支持者和用户非常多。通过浏览器查看存储的议题(
issue
)页面,
就会发现评论的数量远不止
30
条。那么,我们还差什么呢?
2.3.1
分页
许多
API
都使用分页技术来限制返回元素的数量。存储库中的评论数量可能会非常
大,返回所有的评论会消耗大量时间和服务器资源。因此,
GitHub API
实现了分页
的概念,一次只返回一页,在这个例子中,每页包含
30
个结果。返回对象中的“
links
字段提供了具体的页码。
response.links
输出结果:
{'next': {'url': 'https://api.github.com/repositories/65600975/issues/
comments?page=2',
'rel': 'next'},
'last': {'url': 'https://api.github.com/repositories/65600975/issues/
comments?page=1334',
'rel': 'last'}}
段“
next
”提供了指向下一页的
URL
,其中包含接下来的
30
条结果,而字段“
last
则提供了指向最后一页的链接,我们可以从中看出总共有多少条搜索结果。
GitHub
的文档也说明了每页有
30
条结果,且结果数量通常可以在一定范围内自行配置。这
意味着什么?如果想获取所有的结果 ...
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