2017-06-16 4 views
2

私は対話の中でワトソン対話を使っています。 1つのエンティティのすべての値を配列コンテキスト変数に戻したいとします。ワトソン対話ダイアログからすべてのエンティティ値を返します

次作品

{ 
"context": { 
    "toppings_array":["@toppings[0]","@toppings[1]"] works. 
    ... 
} 
上記のサンプルは、エンティティの最初の要素にtoppings_array値を設定など

{ 
"context": { 
    "toppings_array":["@toppings"] 
    ... 
} 

私は、一般的な解決策を見つけるしたいと思います

、(例えば@トッピング[0])。

Thx。

答えて

1

は、次の操作を行うことができます。

[ 
    { 
    "entity": "toppings", 
    "location": [ 
     4, 
     13 
    ], 
    "value": "pepperoni", 
    "confidence": 1 
    }, 
    { 
    "entity": "toppings", 
    "location": [ 
     14, 
     23 
    ], 
    "value": "sprinkles", 
    "confidence": 1 
    } 
] 
0

使お@ Topping.values:

{ 
"context": { 
    "toppings_array": "<? entities['toppings'] ?>" 
    ... 
} 

次のようなもので終わるでしょう。コンテキスト変数の配列の形ですべての値を返します。

関連する問題