Emotions Are Clasifications, Not Functions

Or exploring human emotion by their behaviours.

We need to think about a slightly different way of approaching programming for machine learning, when it comes to building chat bots. Specifically, it's no longer effective to just program emotions based on making different feelings a specific function in a classification of person.

Rather is far better to think of Anger, Happiness, Sadness, Confusion, Excitement, and so on as classifications in their own right. Then different behavioral within this emotional classifications will function in the way that the chat bot (and eventually human-like AI) will behave to those that interact with them.

For example:

class Anger def cold_shoulder # Action for doing cold shoulder. end

def insult # Action for saying insults. end

And so on.

end

The reason for this approach, is human emotions is often a form of non-verbal communication, and simply can't be boiled down to a singular phrase a chat bot makes. Otherwise you end up with only one way of displaying human-like emotion, which isn't always universal for every single person you interact with.

Then one can simply do a machine learning algorithm in order to reference those specific actions.

a = Anger.new

require 'decisiontree'

attributes = ['Emotion']

training = [ [3.7, 'cold shoulder'], [4.6, 'insult'] ]

dec_tree = DecisionTree::ID3Tree.new(attribute, training, 'cold shoulder', :continuous) dec_tree.train

train = ['cold shoulder', 'insult']

prediction = dec_tree.predict(test)

puts 'Prediction: #{prediction}'