我正在用Python编写关键字提取器。我想使用雅虎内容API。问题是,雅虎内容API有Python2.7 (甚至3.x)包装吗?我找不到一个做正常搜索的。
同时,我正在尝试alchemyAPI,OpenCalais,DBPedia聚光灯。我想做一个比较,找出在生产中使用哪一种。
如有任何指导,将不胜感激。
谢谢
发布于 2015-04-04 20:24:47
我也对答案感兴趣。这是一个可能的解决办法:
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)发布于 2013-10-10 19:33:11
根据文档,您可以将请求发布到Yahoo并获得JSON。Python有urllib2、请求和json库,所有这些库都有很好的文档和易于使用。
https://stackoverflow.com/questions/19284541
复制相似问题