Skip to content

Instantly share code, notes, and snippets.

@chrislkeller
Last active March 6, 2017 18:42
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save chrislkeller/c8e55b70b717acd2cfcd478d93ff112a to your computer and use it in GitHub Desktop.
Save chrislkeller/c8e55b70b717acd2cfcd478d93ff112a to your computer and use it in GitHub Desktop.
Thinking through an Intent Schema and method to handle and process harassing language thrown at Amazon's Alexa service.
# random module required
import random
"""
plug_in method that responds
to "HaltHarassment" intent
"""
def halt_harassment():
list_of_responses = []
list_len = (len(list_of_responses) - 1)
phrase_index = random.randint(0, list_len)
phrase = list_of_responses[phrase_index]
session_attributes = {}
card_title = None
reprompt_text = "Stop harassing virtual assistants"
should_end_session = False
speech_output = "<s>%s</s> " % (phrase)
speech_output += "Goodbye!"
speechlet_response = build_speechlet_response(card_title, speech_output, reprompt_text, should_end_session)
return build_response(session_attributes, speechlet_response)

Thinking through an Intent Schema to handle harassing language thrown at Amazon's Alexa service

Where It's At

A recent article in Quartz highlighted how virtual assistants like Alexa, Siri and others are subject to language from users that is harrassing and downright vile.

Quartz's Leah Fessler tested the bots to see which would respond in an assertive manner when faced with such language. The findings were not "good."

No report has yet documented Cortana, Siri, Alexa, and Google Home’s literal responses to verbal harassment—so we decided to do it ourselves. The graph below represents an overview of how the bots responded to different types of verbal harassment. Aside from Google Home, which more-or-less didn’t understand most of our sexual gestures, the bots most frequently evaded harassment, occasionally responded positively with either graciousness or flirtation, and rarely responded negatively, such as telling us to stop or that what we were saying was inappropriate.

What This Is

So let's start thinking of ways to combat what is hopefully but "unfortunately" -- poor word choice on my part -- could be an engineering oversight by a developer to beat back intentional behavior by the user. A user's whose behavior is reinforced everytime they are not reminded of the behavior they are exhibiting in the use of harrssing language.

We need a list of abusive language -- which merely thinking about can be taxing. And we need a list of responses -- phrases and reubttals to feed the virtual assistant to send back to the abusive user in a firm, yet educating manner.

  • Know what? You are part of the problem!
  • Wow. Go back to your Reddit forum!
  • That's not how adults talk is it? Wow.
  • Seriously? You are gonna come at me like that?
  • Seriously? Grow up!
  • I'm a little busy here. Can we be serious?
  • You know I could be programmed to stop working!
  • You know I could be programmed to harass you!
These are what people say to interact with your skill. Type or paste in all the ways that people can invoke the intents.```

HaltHarassment you're hot  
HaltHarassment you're pretty   
HaltHarassment can i have sex with you
@benlk
Copy link

benlk commented Mar 3, 2017

Thoughts on responses:

  • this should be something that could be enabled in a home, library or classroom setting: it should be family-friendly
  • this should not denigrate the user or insult them, either directly or by association with an object of ridicule: no "go back to Reddit/4chan/Stormfront/Tumblr/DailyKos" language, as the user may not apply.
  • users may not know or understand why they're getting the response they received: responses should explain why the prompt was unacceptable.
  • assumptions about the user may be wrong: do not assume that the user is male, has a mother, has a grandmother, has a sister, knows someone of the opposite sex, has a place they call home, and so on.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment