简体   繁体   中英

Watson Conversation dialog for large number of entities?

I currently have a chat bot that has an entity for each stock symbol. There are over 3,000. For my dialog I want to be able to detect questions like #get @price @stockSymbol. Is there a way to deal with a large number of entities without writing an if statement for each one?

I am sorry to say there is no process within the Conversation Service UI that has an automatic dialog creation method. In cases like this, many teams create an external script that can read a file with your entities in it, and then creates a workspace json file with the required dialog nodes. The workspace json file is a relatively simple format, and I have found you can easy merge any new json file into an already created workspace. In fact with the new API's it even possible to load the new elements into a running workspace. ( although if new to this, create a duplicate ws, and merge into this one, or download and merge via a good editor. )

You are only allowed to have 100 entities in a single workspace. However those entities can have 100,000 values.

So you could create an entity called @StockSymbol and then each value would be the Stock identifier (eg. IBM).

So you would only need one IF statement to determine it is a stock, then pass back the entity information to your calling application to take action on the value.

To put this in programatically, if it is a one time thing you can create a CSV file like the following:

StockSymbol,IBM
StockSymbol,MSFT
StockSymbol,APPL

and so on. Then import that entity file. Alternatively you can use the workspace API to update an already deployed workspace.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM