MycroftAI / mycroft-core

Mycroft Core, the Mycroft Artificial Intelligence platform.
https://mycroft.ai
Apache License 2.0
6.53k stars 1.27k forks source link

Feature: attitude #2293

Closed ChanceNCounter closed 4 years ago

ChanceNCounter commented 5 years ago

In the spirit of Nevermind, I've been working on a skill (perhaps to submit to core, probably not) to teach Mycroft to respond to quite a few common queries and statements. None of them are particularly useful, but all are things a person is liable to say to Mycroft at some point, and he should respond conversationally, rather than telling folks to rephrase their mundane chatter.

I started with, "Can you hear me?" and moved on to, "Can you understand me?" Same premise, different answers, and while I was drawing up answers to, "can you understand," I thought of some obvious easter eggs.

So I threw an RNG in there and gave it a 30% chance of cracking wise or telling you what time it is.

Then I went to get a cup of coffee, and it occurred to me that this could be the first, extremely simple step toward giving Mycroft an attitude. I propose we do it like this:

Core settings should include 1-10 scores (or maybe 1-100) for a variety of response types. These would translate to weighted values, and the speak_dialog() skill would just roll a number, and append the relevant response type to the name of the .dialog file:

MycroftSkill.speak_dialog('expected.response')

response_code = # weighted random number generator returns string
if response_code = "flippant":
  # use expected.response.flippant.dialog
else if response_code = "funny":
  # use expected.response.funny.dialog
else:
  # use expected.response.dialog

The weight wouldn't have to be out of 100, either. I'm not too good at that side of things. The idea, though, is for the user to be able to tune it somewhat, so that Mycroft is only sarcastic if they want sarcastic AI in their house. Come to think of it, something along the lines of TARS and CASE: "Mycroft, set sarcasm to 50%" would indeed have exactly that effect, except that it's tuning the odds of a sarcastic remark rather than the nature of remarks.

ChanceNCounter commented 5 years ago

I should add that it would have to fall back to expected.response.dialog in the event that a skill author hasn't included a .dialog file for the desired response type.

krisgesling commented 5 years ago

Hey Chance,

This is a cool idea, I particularly like that the user can modify the chance of getting a particular type of response.

Currently questions like this are handled by the Persona Fallback Skill however we haven't had time to continue development of this lately. The idea behind Persona is that we have a training tool allowing the community to suggest answers to questions. This is particularly helpful in catching missed utterances, ie anything that gets the "I'm learning new things everyday" type responses. These questions and answers are then used as training data for a machine learning model to produce unique responses, not only to the exact input questions, but to similar questions that haven't been seen before.

I like the idea of adding the response types [flippant, funny, whatever] as additional metadata to those responses. It would then be possible to set these weightings either by the user, or on the backend if it was for example a custom Persona for a business.

I think the idea as you describe it, would work perfectly as a Fallback Skill, and could in the future be used as extra training data for Persona, if you were happy for that to happen.

ChanceNCounter commented 4 years ago

Just occurred to me, although I'm not sure if it would be better or worse this way, that Mycroft could periodically roll a "mood" rather than picking an answer every time it spoke. This might make conversation feel more natural, but it might also be annoying, if Mycroft becomes "bored" and stays that way all afternoon.

forslund commented 4 years ago

Should this be closed in favor of the more general #2436?

ChanceNCounter commented 4 years ago

Yes, and I should probably work on it, too 😇