Meet the designer that made a chatbot to flag workplace racism

  • Published
  • Posted in Tech News
  • 5 mins read

I detailed the user flow and visually mapped out the dialog, which helped me mark exit and entry points as well as guide the conversation with suggestion chips so that the recruiter would have a better idea of the type of questions they can ask me. I had other questions listed in my spreadsheet that I didn’t put into any suggestion chips so that it didn’t seem like the chatbot was dependent on them.

Main user flow

DialogFlow is simple to work and there’s a ton of free tutorials and documentation out there. Here are the basics, as well as some tips I picked up along the way:

To begin, create an agent.

Start making your intents, which is each step of what the chatbot will respond to. You should definitely name each intent to stay organized and structured.

Add in training phrases, which are expressions that you expect the user to say. Avoid putting in one-word phrases that could be easily confused with something else you’re going to need them to say on a different intent, i.e. don’t just write “why,” be specific and write out the full phrase “why do you want to work here” as well as some iterations of the phrase. These training phrases are important because it’s what makes the bot smarter, and the more interactions you get with your chatbot, the more it’s able to recognize and connect phrases together.

You can use Entities to define synonyms of certain words and reference options. If you use this, be sure to add your entity to your action and parameters. This will allow your bot to reference user input.

You can write out your custom responses. Each text response can have variants, or you can have multiple text responses at once. Make sure you’re simulating a friendly, human agent-like experience for your users — they know it’s a chatbot, but it’s nice to make it feel like they’re actually talking to you. Plus, it’s a great way to let your personality shine and stand out to recruiters!

Follow-up intents are a great way to make the bot more interactive. That is, setting up an intent to anticipate a yes or no response and putting out a custom response to handle the input without disrupting the flow by interpreting their response as a different phrase. I used these nested intents in my filters to make sure the recruiters would only have access to my answers if they answered that Black lives matter.

On the right side of the DialogFlow interface, there’s an agent test. You can use this to type out a user expression and confirm that the agent is acting the way you want it. I tested my interactions after saving every intent.

When you’re satisfied, you can deploy your bot under the Integrations section. In your embed code, you can edit the HTML and CSS customizations to change its colors to match your own website and add a profile picture for your bot.
Adding custom payloads

I didn’t want my bot to only have basic text responses, and I also wanted to implement special features like suggestion chips, links, etc. It requires a tiny bit of reading and understanding basic code, but DialogFlow’s documentation lists rich response messages, which lets your bot respond with links, images, suggestion chips, accordion text, lists, buttons, info cards, etc. Simply add the code under “Custom Payloads” under “Add new text response.”

Suggestion chips response

Accordion text response

Post-release and improving conversational AI

After my bot went public and I tweeted about it, I got an overwhelming number of user interactions. In DialogFlow, I can see the history of everyone’s interactions as well as any flagged unmatched requests (essentially, where the bot failed to interpret the user’s response). This is where I could learn more about what users were asking my bot that I didn’t anticipate, such as “where are you based?” and “salary requirements.” From looking through these interactions, I knew what other intents I needed to integrate into my bot in order to make it more effectively conversational.

Unfortunately, because of the controversial nature of the bot and the popularity of the tweet, I also got a ton of all lives matter people on my website leaving me hateful comments.

I wanted to make sure that the trolls still got a proper interaction with my bot rather than just the fallback intents. So, I got my bot to out-troll the trolls with some resources that would hopefully provide clarity on the subject.

Educational resources response

The bright side is that, thanks to NLP, the more the user interacts with the bot, the smarter it gets. That means that the more that trolls sent death threats and mean comments to my bot, the more it could recognize these hateful phrases and respond with some resources where the user can educate themselves about the BLM movement. Kill em’ with kindness.

News Article Courtesy Of Rosie Maharjan »