Difference between revisions of "Google Semantic Reactor"
| Line 15: | Line 15: | ||
A tool for experimenting with natural language understanding (NLU) models via a [http://www.google.com/sheets/about/ Google Sheets] add-on that allows the user to sort lines of text in a sheet using a variety of machine-learning models. Beyond ranking lists, Semantic Reactor can help write dialog for a chatbot, such as a customer service chatbot, using semantic similarity. Specifically, it can quickly add new question/answer pairs and test different phrasings, enabling developers to see how the model reacts to them. Semantic Reactor can also search through text using input-response, meaning it can examine a list of potential responses and rank each according to which the model thinks is the most likely. In input-response mode, the model predicts the most conversational response to an input, and in semantic similarity mode, it returns the answer that’s semantically closest to the input. | A tool for experimenting with natural language understanding (NLU) models via a [http://www.google.com/sheets/about/ Google Sheets] add-on that allows the user to sort lines of text in a sheet using a variety of machine-learning models. Beyond ranking lists, Semantic Reactor can help write dialog for a chatbot, such as a customer service chatbot, using semantic similarity. Specifically, it can quickly add new question/answer pairs and test different phrasings, enabling developers to see how the model reacts to them. Semantic Reactor can also search through text using input-response, meaning it can examine a list of potential responses and rank each according to which the model thinks is the most likely. In input-response mode, the model predicts the most conversational response to an input, and in semantic similarity mode, it returns the answer that’s semantically closest to the input. | ||
| − | Why use the Semantic Reactor? | + | = Why use the Semantic Reactor? = |
There are a lot of interesting things you can do with the Semantic Reactor, but let’s look at the following two: | There are a lot of interesting things you can do with the Semantic Reactor, but let’s look at the following two: | ||
* Writing dialogue for a bot that exists within a well-defined environment and has a clear purpose (like a customer service bot) using semantic similarity. | * Writing dialogue for a bot that exists within a well-defined environment and has a clear purpose (like a customer service bot) using semantic similarity. | ||
* Searching within large collections of text, like from a message board. For that, we will use input-response. | * Searching within large collections of text, like from a message board. For that, we will use input-response. | ||
| + | = Writing Dialogue for a Bot Using Semantic Similarity = | ||
| + | For the sake of an example, let’s say you are writing dialogue for a bot that answers questions about a product, in this case, cookies. | ||
| + | |||
| + | If you’ve been running a cookie hotline for a while, you probably can list the most common cookie questions. With that data, you can create your cookie bot. Start by opening a Google Sheet and writing the common questions and answers (questions in the A column, answers in the B). | ||
| + | |||
| + | Here is the start of what that Sheet might look like. Make a copy of the Sheet, which will allow you to use the Semantic Reactor Add-on. Use the tool to experiment with new QA pairs and how each model reacts to them. | ||
| + | |||
| + | Here are a few queries to try, using the semantic similarity rank method: | ||
| + | |||
| + | Query: What are cookie ingredients? | ||
| + | Returns: What are cookies made of? | ||
| + | |||
| + | Query: Are cookies biscuits? | ||
| + | Returns: Are cookies also called biscuits? | ||
| + | |||
| + | Query: What should I serve with cookies? | ||
| + | Returns: What drinks go well with cookies? | ||
| + | |||
| + | |||
| + | = Searching Through Text Using Input-Response = | ||
| + | |||
| + | Sometimes you can’t anticipate what users are going to ask, and sometimes you might be dealing with a lot of potential responses, maybe thousands. In cases like that, you should use the input-response ranking method. That means the model will examine the list of potential responses and then rank each one according to what it thinks is the most likely response. | ||
| + | |||
| + | Here is a Sheet containing a list of simple conversational responses. Using the input-response ranking method, try a few generic conversational openers like “Hello” or “How’s it going?” | ||
| + | |||
| + | Note that in input-response mode, the model is predicting the most likely conversational response to an input and not the most semantically similar response. | ||
| + | |||
| + | Note that “Hello,” in input-response mode, returns “Nice to meet you.” In semantic similarity mode, “Hello” returns what the model thinks is semantically closest to “Hello,” which is “What’s up?” | ||
= Mystery of the Three Bots = | = Mystery of the Three Bots = | ||
Revision as of 21:50, 28 March 2020
Youtube search... ...Google search
- Google offerings
- Natural Language Tools & Services
- Semantic Reactor: A tool for experimenting with NLU models | B. Pietrzak, S. Pucci, & A. Cohen — Google AI
- Google releases Semantic Reactor for natural language understanding experimentation | Kyle Wiggers - VentureBeat
A tool for experimenting with natural language understanding (NLU) models via a Google Sheets add-on that allows the user to sort lines of text in a sheet using a variety of machine-learning models. Beyond ranking lists, Semantic Reactor can help write dialog for a chatbot, such as a customer service chatbot, using semantic similarity. Specifically, it can quickly add new question/answer pairs and test different phrasings, enabling developers to see how the model reacts to them. Semantic Reactor can also search through text using input-response, meaning it can examine a list of potential responses and rank each according to which the model thinks is the most likely. In input-response mode, the model predicts the most conversational response to an input, and in semantic similarity mode, it returns the answer that’s semantically closest to the input.
Contents
Why use the Semantic Reactor?
There are a lot of interesting things you can do with the Semantic Reactor, but let’s look at the following two:
- Writing dialogue for a bot that exists within a well-defined environment and has a clear purpose (like a customer service bot) using semantic similarity.
- Searching within large collections of text, like from a message board. For that, we will use input-response.
Writing Dialogue for a Bot Using Semantic Similarity
For the sake of an example, let’s say you are writing dialogue for a bot that answers questions about a product, in this case, cookies.
If you’ve been running a cookie hotline for a while, you probably can list the most common cookie questions. With that data, you can create your cookie bot. Start by opening a Google Sheet and writing the common questions and answers (questions in the A column, answers in the B).
Here is the start of what that Sheet might look like. Make a copy of the Sheet, which will allow you to use the Semantic Reactor Add-on. Use the tool to experiment with new QA pairs and how each model reacts to them.
Here are a few queries to try, using the semantic similarity rank method:
Query: What are cookie ingredients? Returns: What are cookies made of?
Query: Are cookies biscuits? Returns: Are cookies also called biscuits?
Query: What should I serve with cookies? Returns: What drinks go well with cookies?
Searching Through Text Using Input-Response
Sometimes you can’t anticipate what users are going to ask, and sometimes you might be dealing with a lot of potential responses, maybe thousands. In cases like that, you should use the input-response ranking method. That means the model will examine the list of potential responses and then rank each one according to what it thinks is the most likely response.
Here is a Sheet containing a list of simple conversational responses. Using the input-response ranking method, try a few generic conversational openers like “Hello” or “How’s it going?”
Note that in input-response mode, the model is predicting the most likely conversational response to an input and not the most semantically similar response.
Note that “Hello,” in input-response mode, returns “Nice to meet you.” In semantic similarity mode, “Hello” returns what the model thinks is semantically closest to “Hello,” which is “What’s up?”
Mystery of the Three Bots
To dispel some of the intimidation of using NLU, and to demonstrate how it can be easily used with pre-trained, generic models, Google has released a tool for creating dialog-based games, the Semantic Reactor, and open-sourced example code, The Mystery of the Three Bots that allows you to experiment with machine-learned language models...
This simple dialog-based game is an example of using a machine-learning model inside of a web application. The model it uses is called Universal Sentence Encoder Lite and is available at Tensorflow Hub. To learn more, go to the Google Cloud AI Workshop Page.
- Play Here <<<<<<<<
Mystery of the Three Bots is a simple dialog-based game utilizing machine learning to enable you to communicate with three characters. The goal is to determine which of several guests stole the precious MacGuffin Diamond. You interrogate the butler, the maid and the chef--three robot servants who were present during the crime.
The game is built as an Angular app in Typescript. The machine learning model uses a Javascript implementation of the Universal Sentence Encoder Lite, which it preloads using JSON files that were generated from CSV files (butler.csv, maid.csv, chef.csv) for each of the characters (see generate_models.js).
The game works by matching a representation of the player's input to precomputed representations of candidate strings and calculates a similarity score. For example, if the player types "Where'd the diamond go?", the game might determine that it has a similarity of 0.86 to "Where is the diamond?", and if that's a greater score than the other candidates, the game will use that as the question to the bot and return the corresponding response. See getResponse() in BotResponseService for implementation.