Yahoo API YQL contentanalysis不返回结果

时间:2016-06-06 01:14:43

标签: python yahoo-api

我正在尝试使用Python和Yahoo的ContentAnalysis从文档中提取关键字,但它会为某些句子返回null。

import requests
import json

URI = "https://query.yahooapis.com/v1/public/yql"

def termExtraction(text=None):
    payload = {'q': "select * from contentanalysis.analyze where text='{text}'".format(text=text), 'format': 'json'}
    results = requests.post(URI, data=payload)
    print(results.url)
    print(results.text)
    print(results.json())

text = """Information You Give Us: We receive and store any information you enter on our Web site or give us in any other way. Click Here to see examples of what we collect. You can choose not to provide certain information, but then you might not be able to take advantage of many of our features. We use the information you provide for such purposes as responding to your requests, customizing future shopping for you, improving our stores, and communicating with you."""
termExtraction(text)

有人可以告诉我为什么吗?还可以提交的文本长度有限制吗?

0 个答案:

没有答案