Skip to content
This repository has been archived by the owner on Jul 22, 2024. It is now read-only.
Sanjeev Ghimire edited this page Oct 3, 2018 · 5 revisions

Short Name

Cognitive moderator chatbot

Short Description

Build a cognitive moderator chatbot for anger detection, natural language understanding and explicit images removal

Offering Type

AI

Introduction

Build a microservice that will monitor messages and images. This monitoring can be used into a chat room like Slack, or a website that allows reviews. It will be able to remove for example explicit images or sentences

Author

By Pino Ciano and Sanjeev Ghimire

Code

https://github.com/IBM/cognitive-moderator-service

Demo

https://youtu.be/z91RYXgU9CI

Video

https://youtu.be/9c7NuamK8JA

Overview

In this code pattern, we will create a chatbot using IBM functions and Watson services. The chatbot flow will be enhanced by using Visual Recognition and Natural Language Understanding to identify and remove explicit images and or detect anger and ugly messages

When the reader has completed this journey, they will understand how to:

  • Create a chatbot that integrates with Slack via IBM Functions
  • Use Watson Visual Recognition to detect explicit images (in beta)
  • Use Watson Natural Understanding to detect emotions in a conversation
  • Identify entities with Watson Natural Language Understanding

Flow

Architecture diagram

  1. The user interacts from the Slack app and either sends a text or uploads an image.
  2. The text or image that is used in the Slack for conversation is then passed to an IBM function API by a bot.
  3. The API is a call to an IBM Function that categorizes the text or images based on the response of Watson Visual Recognition or Watson Natural Language Processing.
  4. Watson Visual Recognition categorizes the uploaded image using default and explicit classifier.
  5. Watson Natural Language Processing categorizes the text, if text is send as part of slack communication.
  6. IBM function then gets the response and if the text is not polite, a message is sent by the bot to the Slack user to be more polite using Slack post message API. If the image used is explicit, the image will be deleted by the IBM function using Slack files delete API.

Included components

  • IBM Functions: IBM Cloud Functions (based on Apache OpenWhisk) is a Function-as-a-Service (FaaS) platform which executes functions in response to incoming events and costs nothing when not in use.
  • IBM Watson Visual Recognition: Quickly and accurately tag, classify and train visual content using machine learning.
  • IBM Watson Natural Language Understanding: Analyze text to extract meta-data from content such as concepts, entities, keywords, categories, sentiment, emotion, relations, semantic roles, using natural language understanding.

Featured technologies

  • Slack Apps Customize functionality for your own workspace or build a beautiful bot to share with the world.
  • Slack Bots Enable conversations between users and apps in Slack by building bots.

Blog

TODO

Links