Tree and Graph Data Structures

Chatbot Recommendations

Tree and Graph Data Structures

Check out a free preview of the full Tree and Graph Data Structures course

The "Chatbot Recommendations" Lesson is part of the full, Tree and Graph Data Structures course featured in this preview video. Here's what you'd learn in this lesson:

Bianca discusses how the recommendations should be structured within the chatbot tree.

Preview
Close

Transcript from the "Chatbot Recommendations" Lesson

[00:00:00]
>> Bianca Gandolfo: We created our data structure. We have an ability to insert nodes, build our tree, build up our recommendations and questions, right? Maybe, we could get there.
>> Bianca Gandolfo: No, still confused?
>> Bianca Gandolfo: All right, we'll keep going, unless you stop me, all right. So we have our data structure, we need to do something useful with it, right?

[00:00:33]
So we built it, now let's run an algorithm on it. Seems reasonable, seems like the logical next step. We have the thing, now let's do something with it. So I think a good starting point for this is just to count the number of recommendations that our chat-bot can recommend.

[00:00:54]
How might we differentiate a recommendation from a question?
>> Speaker 2: It wouldn't have any children.
>> Bianca Gandolfo: Yeah, yeah, so if we get to a node that doesn't have any children, that can be a recommendation. So just like we had to go down a path, we have our recommendation. Any other ways that we can do it?

[00:01:24]
>> Speaker 3: Depends on the tree, right? Cuz if it's binary, then you could just assume that it's only two, right or no?
>> Bianca Gandolfo: Well, so our recommendation is binary, actually cuz we have yes and no. So each question will only have two options, yes and no.
>> Speaker 3: So each node would be the same, you could extrapolate then from the nodes the recommendation, the number of recommendations?

[00:01:49]
>> Bianca Gandolfo: But how?
>> Speaker 3: You can look for the yes or no keys in the object.
>> Bianca Gandolfo: So maybe if it's a recommendation we don't have a yes or no option?
>> Speaker 3: Yes.
>> Bianca Gandolfo: Cool, cool, all reasonable.
>> Bianca Gandolfo: So here's our tree, we have our questions and then we have our recommendations, so,

[00:02:17]
>> Bianca Gandolfo: This looks familiar, right? So if you were to adapt your tree with insert child, what would be the different?
>> Bianca Gandolfo: You guys just did the exercise, what are the different about building this? All right, let's take a look.

Learn Straight from the Experts Who Shape the Modern Web

  • In-depth Courses
  • Industry Leading Experts
  • Learning Paths
  • Live Interactive Workshops
Get Unlimited Access Now