module mokadi.mokadi_action_emotion

Inheritance diagram of botadi.mokadi.mokadi_action_emotion

Short summary

module botadi.mokadi.mokadi_action_emotion

Defines an action for Mokadi.

source on GitHub

Classes

class

truncated documentation

MokadiActionEmotion

Action. Emotion. Takes a picture and analyses it.

Methods

method

truncated documentation

__init__

Constructor.

analyse_emotion

Returns the emotion as text.

can_do

Tells if the class can process the message.

get_picture_name

return a picture name

process_interpreted_message

Processes the interpreted message.

Documentation

Defines an action for Mokadi.

source on GitHub

class botadi.mokadi.mokadi_action_emotion.MokadiActionEmotion(subkey, folder, fLOG=None)

Bases: botadi.mokadi.mokadi_action.MokadiAction

Action. Emotion. Takes a picture and analyses it.

source on GitHub

Constructor.

Parameters
  • subkey – subscription key

  • folder – where to save the picture (must exist)

  • fLOG – logging function

source on GitHub

__init__(subkey, folder, fLOG=None)

Constructor.

Parameters
  • subkey – subscription key

  • folder – where to save the picture (must exist)

  • fLOG – logging function

source on GitHub

analyse_emotion(scores)

Returns the emotion as text.

Parameters

scores – dictionary

Returns

string

Example for scores:

'scores': {'anger': 0.000243422386, 'contempt': 0.00207486819,
           'disgust': 2.390567e-05, 'fear': 2.512976e-07,
           'happiness': 3.5321933e-05, 'neutral': 0.9925101,
           'sadness': 0.00510106329, 'surprise': 1.10992869e-05}}]

source on GitHub

can_do(interpreted, message)

Tells if the class can process the message.

Parameters
  • interpreted – interpreted message

  • message – message

Returns

true if the class can process the message

source on GitHub

get_picture_name()

return a picture name

source on GitHub

process_interpreted_message(interpretation, message)

Processes the interpreted message.

Parameters
  • interpretation – interpretation

  • message – original message

Returns

iterator on Info

source on GitHub