An intent is a category of objectives a user may want an NLP system or chatbot to carry out. A greeting such as “hello” can signal starting a conversation; a question or command can signal a task. section 1.5
A simple recognizer can use keywords to classify a message as a greeting or, otherwise, unknown. This is a starting point, not a full account of user goals; adding intent categories or trying regular expressions can extend it. section 1.5.1
Listing 1.1 Keyword detection using str.split
>>> greetings = "Hi Hello Greetings".split() >>> user_statement = "Hello Joshua" >>> user_token_sequence = user_statement.split() >>> user_token_sequence ['Hello', 'Joshua'] >>> if user_token_sequence[0] in greetings: ... bot_reply = "Thermonuclear War is a strange game. " ... bot_reply += "The only winning move is NOT TO PLAY." >>> else: ... bot_reply = "Would you like to play a nice game of chess?" >>> bot_reply 'Thermonuclear War is a strange game. The only winning move is NOT TO PLAY.'
The example checks whether the first token of a message matches a greeting keyword, then selects a reply. section 1.5.1
Intent recognition helps a chatbot respond to conversational goals. Cooperative conversation also requires maintaining state and generating text that helps users achieve their goals. section 1.5 section 12.9





