官术网_书友最值得收藏!

Using JSON to create entities

In the previous section, only two presidents were added to the president-number entity. For the FaqChatBot, you would need to add 45 entries, and adding one by one using the Dialogflow graphical user interface would be time consuming. Dialogflow provides an easier mechanism, where JSON content can be copied and pasted into the textbox. In the president-number intent, change from editor mode to raw mode.

The following screenshot shows editor mode in the entity editor:
   

Editor mode in the entity editor

The following screenshot shows raw mode in the entity editor:

Raw mode in entity editor

Once in raw mode, copy and paste the JSON, similar to the following format. I have not included a JSON that contains 45 entries, but you can find a JSON that contains all 45 President entries on my GitHub.

The following code shows the JSON data of the president-number entity:

[
{
"value": "George Washington",
"synonyms": ["first president","1st president"]
},
{
"value": "John Adams",
"synonyms": ["second president","2nd president"]
},
{
"value": "Thomas Jefferson",
"synonyms": ["third president","3rd president"]
},
{
"value": "James Madison",
"synonyms": ["fourth president","4th president"]
}
]
主站蜘蛛池模板: 水富县| 扎赉特旗| 宝兴县| 曲阜市| 拜泉县| 重庆市| 阿克苏市| 额济纳旗| 微山县| 霍邱县| 新乡市| 云南省| 梧州市| 嫩江县| 东兰县| 湛江市| 长沙市| 湛江市| 丰顺县| 青冈县| 甘孜| 广安市| 仪陇县| 南城县| 岳普湖县| 台山市| 梅河口市| 肥东县| 汨罗市| 十堰市| 逊克县| 安泽县| 盐池县| 新乡市| 和田县| 金山区| 绥江县| 利辛县| 梁平县| 扶余县| 濮阳市|