- Voice User Interface Projects
- Henry Lee
- 445字
- 2021-07-23 17:17:12
Role of NLP in VUIs
In 1950, Alan Turing published his famous paper entitled Computing Machinery and Intelligence. The paper proposed a way to test whether machines are artificially intelligent. Turing stated that if a machine could trick a human into thinking that they were talking to another human, then that machine is artificially intelligent. Today, this test is known as the Turing Test (https://plato.stanford.edu/entries/turing-test/). In order to pass the Turing Test, machines must understand and speak a human language, and this is known as Natural Language Processing (NLP).
The role of NLP in VUIs is paramount because NLP parses human language so that machines can understand it. In this book, you will be using Node.js, which is, in a sense, a language that machines understand, but Node.js does not understand the human language. This is where NLP comes in, translating spoken language into a language that machines can understand, which in this case is Node.js.
The following is a question and answer, which NLP will be applied to in order to parse it into a language the machine can understand:
Question: When is my son's birthday?
Answer: Your son's birth is on January 1st, 1968.
The following JSON is the result of parsing the preceding question and answer using NLP:
{
"responseId": "a48eecdd-a9d9-4378-8100-2eeec1d95367",
"queryResult": {
"queryText": "When is my son's birthday?",
"parameters": {
"family": "son"
},
"allRequiredParamsPresent": true,
"fulfillmentText": "Your son's birth is on January 1st, 1968.",
"fulfillmentMessages": [{
"text": {
"text": [ "Your son's birth is on January 1st, 1968."]
}
}],
"intent": {
"name": "projects/test-34631/agent/intents/376d04d6-c929-4485-b701-b6083948a054",
"displayName": "birthday"
},
"intentDetectionConfidence": 1,
"diagnosticInfo": { },
"languageCode": "en"
}
}
Note that Google's NLP platform, Dialogflow, parses the question and sends a JSON request that can be processed in a Node.js middle-tier server, as shown previously. In the preceding JSON request, there is the intent.displayName field, which describes the type of question the user asked, and in the Node.js middle-tier server, you can use the intent name to process the request accordingly and respond to the user with the answer.
Furthermore, in the preceding JSON request, there is the queryResult.parameters[0].family field, which describes whose birthday the user was asking about. In NLP combined with ML, you can create a template for the question, allowing the machine to learn variations of possible questions that the user might ask. This is useful because there are many ways to ask about someone's birthday. For example, refer to the italicized words, which will create a template matching pattern for the machine to learn:
- Do you know my son's birthday?
- Can you tell me when my son's birthday is?
- Tell me the birthday of my son.
- Learning Java Functional Programming
- Mastering ServiceStack
- Java面向對象思想與程序設計
- JavaScript 網頁編程從入門到精通 (清華社"視頻大講堂"大系·網絡開發視頻大講堂)
- AngularJS Web Application Development Blueprints
- ASP.NET動態網頁設計教程(第三版)
- Learning Python by Building Games
- 大數據分析與應用實戰:統計機器學習之數據導向編程
- INSTANT Yii 1.1 Application Development Starter
- SQL Server 2008 R2數據庫技術及應用(第3版)
- Django 3.0應用開發詳解
- SQL Server 2016 從入門到實戰(視頻教學版)
- Appcelerator Titanium:Patterns and Best Practices
- Java RESTful Web Service實戰
- MongoDB Administrator’s Guide