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

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"]
}
]
主站蜘蛛池模板: 祥云县| 公主岭市| 清镇市| 兴国县| 开化县| 长宁区| 仪陇县| 徐闻县| 唐河县| 迁安市| 吴川市| 建水县| 沈阳市| 武冈市| 分宜县| 武乡县| 清新县| 汉阴县| 寻乌县| 启东市| 红安县| 尤溪县| 沾益县| 会理县| 黄浦区| 宁夏| 香河县| 瑞丽市| 和平县| 青川县| 时尚| 扎鲁特旗| 遵化市| 平塘县| 蚌埠市| 桐庐县| 襄城县| 桂平市| 栾川县| 焦作市| 元朗区|