Querying Using the Discovery Tools2:56 with Ben Jakuben
The Discovery tools include a powerful query interface that we can explore right in the browser. We'll use these tools to explore the AirBnb data we just added.
Ben, what a great opportunity for 0:00 us to now query the Airbnb documents that we put in. 0:01 And I'm noticing right there that there are 7% 0:06 of negative sentiment happened with all of the documents that we have uploaded. 0:11 Let's explore that further. 0:17 >> That sounds good. 0:19 So I'm gonna go back into the query editor, and 0:21 we're gonna pick our reviews again, get started. 0:24 And yeah, you were saying that we can use some natural language here and 0:27 search for sentiments themselves, like negative or bad. 0:31 >> Absolutely. 0:35 >> So yeah, let's just see what happens if we search for bad. 0:35 Certainly, a negative sentiment. 0:38 >> Let's try the JSON. 0:40 >> Okay, yeah, it looks like we got one matching document. 0:41 >> We got one matching document. 0:43 >> And it certainly is a negative review. 0:45 I can see a very bad experience, impossible to sleep, etc, right. 0:47 Okay, but they were seven percent. 0:52 So what I found when I was playing around with this, 0:53 I'm gonna go back to the data set itself because we can drill in here and 0:57 we can view these things in the schema and 1:02 that allows us to understand how to query it a little bit better. 1:04 >> Excellent. 1:08 >> So if we click view in schema, we can see that it brings out the sentiment and 1:08 it has a bunch of different example values, positive and negative. 1:13 And if we scroll through, we can see a bunch of different values And 1:18 that means we can query this string right here, 1:23 enriched_text.sentiment.document.score. 1:26 So if we go into the query- >> Or maybe even the label. 1:30 >> Right, the label, it would be great. 1:33 We could choose positive- >> Or negative, yes. 1:34 >> Negative, or neutral, right. 1:36 So let's hop back in, and this time we wanna use the discovery query language, 1:37 and as I use this more I see how powerful it can be. 1:43 So I'm gonna start typing because it will auto complete for me. 1:47 I wanted one of the sentiments, and like you mentioned, you want to use the label. 1:50 And if we select the is operator, we can search for a specific one and 1:55 it will prefill the ones that it detected. 1:59 So we wanna see what the negative ones look like. 2:01 And if we run this we should see the seven percent of documents. 2:03 >> Fantastic. >> So yeah, look at that 7 out of 101. 2:07 So there's our seven percent. 2:09 And it highlights in the results, it drills down for us. 2:12 You can see this matches the query syntax enriched_text.entities.sentiment.label. 2:14 And we can see the score that it got. 2:20 >> Yes. 2:23 >> And in the description we can see what things were positive and 2:24 what things were negative. 2:27 >> Yes, yes. >> And 2:28 some of that may be in the review itself. 2:29 Some of it may be in other things that users comment on. 2:31 >> Absolutely. 2:35 >> Cool, so this is, again, a powerful tool. 2:37 It's very interesting to take a look and work in it here and the web. 2:40 But I want to see how to do this with our chat bot again, right. 2:44 How do we flip from our conversation over to the discovery service itself? 2:47 So let's take a short break and then we'll check that out. 2:51 >> Wonderful, thank you, Ben, yes. 2:54
You need to sign up for Treehouse in order to download course files.Sign up