-2
私はこのデータをAPI経由で取得しており、そこにあるすべての「信頼」スコアを引き出したいと考えています。どのように私はそれをやって行くだろう:この(json looking)データをどのように照会しますか?
{
"time": 765,
"annotations": [
{
"start": 106,
"end": 115,
"spot": "customers",
"confidence": 0.7198,
"id": 234206,
"title": "Customer",
"uri": "h''ttp://en.wikipedia.org/wiki/Customer",
"label": "Customer"
},
{
"start": 116,
"end": 122,
"spot": "online",
"confidence": 0.6313,
"id": 41440,
''"title": "Online and offline",
"uri": "http://en.wikipedia.org/wiki/Online_and_offline",
"label": "Online"
},
{
"start": 138,
"end": 143,
"s''pot": "small",
"confidence": 0.7233,
"id": 276495,
"title": "Small business",
"uri": "http://en.wikipedia.org/wiki/Small_business",
"label''": "Small business"
}
]
}
私はdata["confidence"]
のようなものをやってみましたが、自信の数字を引っ張っていないようでした。 Pythonで信頼度を引き出すにはどうすればよいですか?前もって感謝します。
これは、データを取得するコードです:
import requests
api_key = INSERT API KEY
content_urls = "http://www.startupdonut.co.uk/sales-and-marketing/promote-your-business/using-social-media-to-promote-your-business"
url = "https://api.dandelion.eu/datatxt/nex/v1/?lang=en &url="+content_urls+"&token=" + api_key
request = requests.get(url)
for data in request:
print (data)
このデータを取得するコードを表示してください。 –
[JSONファイルの値の解析?](https://stackoverflow.com/questions/2835559/parsing-values-from-a-json-file) –
jsonではありません。それは最初に "b '"を持っています。 – semiflex