Emanuele
Emanuele

Reputation: 21

Using a dataset in Watson

I'm working on an university project with IBM Cloud Services. Me and my team have created our virtual assistant through the Watson Assistant service and now we want to use a kinda huge dataset with the assistant. We actually don't know how to implement this dataset and how to use the informations the user gives us to make a SELECT FROM our dataset. I hope for your replies

Upvotes: 2

Views: 281

Answers (1)

Jackson Vaughan
Jackson Vaughan

Reputation: 662

Here's one general way to accomplish what you're trying to do:

You'll need to collect context variables to determine what song information to send back to the user. One effective way to do this is with slots; here's a guide on that.

An example of context variables collected could look like this:

{
    genre: "hiphop",
    mood: "upbeat",
    instrumental: false
}

So the bot knows from this info to return hiphop songs, with an upbeat tempo, that is not instrumental.

I think you might already have gotten this far, but the next step is going back to your data set to query it and return those list of songs.

There are a few different ways to accomplish that:

  1. You could house the data set within Watson assistant as preset context variables; this probably wouldn't make sense because it's a large dataset. Would only really make sense if it was a few options.

  2. You could query the dataset in an orchestration layer. A message would get sent back from Watson Assistant with an action to query the dataset, before it gets returned to the end user the orchestration layer would make that query and fill in the information returned. This is a little more complex because you need to build and manage that orchestration layer - though there are some services out there that can help with this. Here's a diagram of an orchestration layer with watson assitant: watson assistant orchestration

  3. You could make a query to the dataset from within Watson Assistant using IBM cloud functions. Once you have collected the information in a node, you instruct Watson Assistant to call a cloud function that queries your dataset. What's nice about this method is that everything is housed within WA and cloud functions (no need for an orchestration layer), though there are some limitations like timeouts because Watson Assistant as an API needs to respond "immediately." Here is some more information on making programmatic calls from a dialog node.

Hope this is helpful.

Upvotes: 1

Related Questions