Skip to main content
 首页 » 编程设计

雅虎内容分析 API 的 Python 包装器

2025年05月04日6zdz8207

我正在使用 Python 编写关键字提取器。我想使用 Yahoo Content API。问题是,是否有 Yahoo Content API 的 Python2.7(甚至 3.x)包装器?我找不到进行正常搜索的人。

与此同时,我正在尝试 alchemyAPI、OpenCalais、DBPedia Spotlight。我很乐意进行比较,以确定在生产中使用哪一个。

任何指导将不胜感激。

谢谢

请您参考如下方法:

我也对答案很感兴趣。这是一个可能的解决方案:

import requests 
 
text = """ 
Italian sculptors and painters of the renaissance favored the Virgin Mary for inspiration 
""" 
 
payload = {'q': "select * from contentanalysis.analyze where text='{text}'".format(text=text)} 
r = requests.post("http://query.yahooapis.com/v1/public/yql", data=payload) 
print(r.text)