Sentence types
There are four sentence types, classified by their purpose: Declarative, Interrogative, Imperative and Exclamatory. In Dasha platform we classify only Declarative, Interrogative, Imperative, because Exclamatory type mostly is the same as Declarative. So, Declarative could be used with out losses for conversation.
When we are talking we understand sentence type and react according to it. In dialog systems we need to understand it too. Commonly intents are aimed to understand the message meaning and make action. But there are cases when we need to know sentence type additionally to be human-like.
In common sentence type classification is needed for precise definition what to answer back to human. For example if person ask question, but you didn't understand the intent or any entity it's better to answer "Sorry, I don't understand the question". If its a request, answer "Sorry, I can't do it now". Such behavior is much human like then to say "I don't understand. Repeat please." every time. Check black slate app with this use case implemented within commonReactions in dontUnderstand library. And of course you can create your own use case to be more human-like.
NOTE: Available only for EN-us language
To classify a sentence type you need to use #getSentenceType()
built-in function in DashaScript code.
if (#getSentenceType() == "request") { #sayText("Sorry, I can't do it now", repeatMode: "ignore"); } else if (#getSentenceType() == "question") { #sayText("Sorry, I don't understand the question", repeatMode: "ignore"); } else { #sayText("I don't understand. Repeat please.", repeatMode: "ignore"); }
Sentence types
Sentence type | #getSentenceType() | Function | Example sentence |
---|---|---|---|
Declarative | statement | Used to make statements or relay information | I want to know the time. |
Interrogative | question | Used to ask a question | What time is now? |
Imperative | request | Used to make a command or a direct instruction | Say the time. |
Declarative Sentence (statement)
These are the most common type of sentence. Declarative sentences make a statement. They tell us something and give some information.
The usual word order for the declarative sentence is: subject + verb ...
Interrogative Sentence (question)
Interrogative sentences ask a question. They ask us something. They want information, and they always end with a question mark.
The usual word order for the interrogative sentence is: (wh-word +) auxiliary + subject + verb ...
Imperative Sentence (request)
Imperative sentences give a request. They tell us to do something. There is usually no subject—because the subject is understood, it is dialog system.
The usual word order for the imperative sentence is: base verb...