官术网_书友最值得收藏!

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.
主站蜘蛛池模板: 安顺市| 华蓥市| 偏关县| 繁峙县| 安龙县| 辽阳市| 梅河口市| 南川市| 兰州市| 吉林省| 宁河县| 平阴县| 台北市| 青田县| 郴州市| 汉寿县| 开封县| 华容县| 庆元县| 蒙城县| 红安县| 内黄县| 甘南县| 涿鹿县| 东阳市| 资中县| 浮梁县| 涿鹿县| 望谟县| 石门县| 龙南县| 页游| 房产| 左贡县| 文成县| 延川县| 嵊州市| 元谋县| 丹江口市| 锡林郭勒盟| 洪湖市|