【发布时间】:2018-05-28 23:16:57
【问题描述】:
我当前的Json 在下面共享,这是我在node.js 中的request.get 的响应,它在body,我想要的只是json 的一部分,用于进一步处理也共享如下:
{
"query": "THIS IS MY JSON",
"topScoringIntent": {
"intent": "INTENT",
"score": 0.9796973
},
"intents": [
{
"intent": "INTENT",
"score": 0.9796973
},
{
"intent": "None",
"score": 0.0332397744
},
{
"intent": "ANOTHER INTENT",
"score": 0.0205348358
},
{
"intent": "YET ANOTHER INTENT",
"score": 0.0141741727
},
],
"entities": [
{
"entity": "FIRST ENTITY",
"type": "FIRST TYPE ENTITY",
"startIndex": 38,
"endIndex": 47,
"score": 0.5666461
},
{
"entity": "SECOND ENTITY",
"type": "SECOND TYPE ENTITY",
"startIndex": 20,
"endIndex": 32,
"resolution": {
"values": [
{
"timex": "2017-12-14T04",
"type": "datetime",
"value": "2017-12-14 04:00:00"
}
]
}
}
]
}
我想提取对象entities。
【问题讨论】:
标签: javascript json node.js parsing