Skip to content

Kind Bot API - Detect Insults and prevent CyberBullying, Pixels Camp Hackathon 2019

Notifications You must be signed in to change notification settings

vascosilvaa/kind-api

 
 

Repository files navigation

Kind

This project was made at Pixels Camp in under 48 hours, we took on a challenge proposed by the Gulbenkian foundation, Hack For Good.

The Challenge

A growing body of evidence indicates that children are accessing the internet at increasingly younger ages. Smartphones are fuelling a ‘bedroom culture’, with online access for many children becoming more personal, more private and less supervised. At the same time, digital technologies are bringing opportunities for learning and education to children, especially in remote regions and during humanitarian crises.

Technological solutions to prevent and intervene in cyberbullying incidents.

Which turned into a chat bot, that should be seen as a kind buddy to prevent cyberbullying and social harassment in network acting in between the bully and his victim.

The Algorithm

We designed a custom Machine Learning webservice, using Azure Cognitive Services, processing the text messages as n-grams and trained a model for the probability of being a message with a "bully" feeling to it. We published this as a web service for consumption from our backend.

This custom service took an input from the Microsoft Text Analytics API aswell to optimize the output.

machine-learning

The Product

This was intendend to be used for chat rooms where the main audience are children, that's how the product was designed.

Kind

king-logo

Read all about our product here.

Built With

Given the 48 hour time constraint we tried to use the technologies we knew better as a team and that provided out of the box solutions.

machine-learning

Documentation

We only have one endpoint and that's it.

Kindnesss of message

Returns an analysis of the message, the sentiment, kindness and determines if its kind or not, when not kind we suppose it as an insult.

  • URL

    /is

  • Method:

    POST

  • Data Params

    Required:

    message=[string]

  • Success Response:

    • Code: 200
      Content:

      Message: Hey

      {
        "success": "true",
        "data": {
          "isKind": true,
          "kindness": 1,
          "sentiment": 0.9869865775108337,
          "insult": "0",
          "message": "kind"
        }
      }

      Message: You are dumb

      {
        "success": "true",
        "data": {
          "isKind": false,
          "kindness": 0,
          "sentiment": 0.011714428663253784,
          "insult": "1",
          "message": "insult"
        }
      }

Commands

Run in the development environment

npm run dev

Clean up the code

npm run eslint

Deployment

This project was setup to deploy with the Global Serverless Deployments of Now.

Make sure your src/config.js file is setup with your API keys, find an example at src/config.example.js

Build the project with

npm run build

Start the production server

npm run start

Deploy, install Now CLI now

Authors

About

Kind Bot API - Detect Insults and prevent CyberBullying, Pixels Camp Hackathon 2019

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • JavaScript 100.0%