PubNub Integration

Two Hat’s Community Sift - Content Moderation Platform

In-app chat

In-app chat

Bots & AI

Bots & AI

Chat & Social

Chat & Social

External APIs

External APIs

Multiuser Spaces

Multiuser Spaces

Last Updated:

2016/10/18

Author:

SiftNinja

APISign-upDocumentation

Enterprise-level AI-powered content moderation platform

Enterprise-level AI-powered content moderation platform with a full suite of customizable tools, including chat filter, username, image and video that automatically removes bullying, harassment, hate speech, adult content, and other disruptive behavior from your platform

Two Hat is an AI-powered content moderation platform that classifies, filters, and escalates messages, usernames, images, and videos, all in real-time. Powered by Two Hat, Community Sift is an all-in-one enterprise level content moderation solution that surfaces online harms including cyberbullying, abuse, hate speech, violent threats, and child exploitation.

Two Hat’s Community Sift - Content Moderation Platform

Setup:

  1. Sign-up for a Two Hat Community Sift account and setup the API.

  2. Sign-up for a PubNub account, if you don't have one already.

  3. Import the Integration Block into your PubNub account. You can choose to add this to an existing application or create a new one.

  4. Configure the Integration Block module code, connecting it to your Two Hat Community Sift account:

    1. Set the API_URL parameter to the hostname from the Community Sift API setup step above.

    2. Create a Secret in PubNub Vault, named COMMUNITY_SIFT_APIKEY, with value equal to your Two Hat Community Sift API Key for this service, retrieved as part of step 1 above.

  5. Start the Integration Block module.

  6. Try a test message (you can click on Publish to do this).

Walkthrough:

This Integration Block is setup to listen to a specific PubNub channel (CHANNEL-to-community-sift-moderate) but you can configure it to listen to all channels or a subset, using wildcards, e.g. chat.*. Thus, you can add content moderation even in private chats and other secure communication channels. The Integration Block is flexible in that it can be used both as part of a PubNub messaging flow, i.e. as part of publishing data, as well as accessed separately through a REST endpoint. Additionally, customization of capabilities can be done through publish message metadata or REST query parameters. In publish metadata, the customization properties are set as part of a JSON object specific for the function named communitysift-moderate-text.

  1. TEXT_LOCATION_ID: json dot notation for locating the text field in the message payload.

  2. OUTPUT_LOCATION_ID: json dot notation for locating the output data in the final message payload. Specify meta if you want the output data to be part of the metadata property of the message payload.

Input

Publish message containing message body to input channel. Input Channel: CHANNEL-to-community-sift-moderate. You can change this channel in the PubNub Administration Portal, using the Block's Function editor.

{
	"content": {
		"type": "text",
		"body": "Hello, Ninja! This is a vulgar-severe phrase."
	},
	"sender": "user_4205ea2b9cc549048d4b2e9da389c348"
}

Output

The response from Community Sift is included in the payload, or in the meta property of the published message.

{
	"content": {
		"type": "text",
		"body": "Hello, Ninja! This is a vulgar-severe phrase"
	},
	"sender": "user_4205ea2b9cc549048d4b2e9da389c348",
	"sentiment": {
		"sift": {
			"response": false,
			"risk": 6,
			"language": "en",
			"events": [{
				"id": "CONTEXTSKIPPED",
				"message": "Context was skipped"
			}],
			"hashed": "#####################",
			"hashes": [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20],
			"trust": 4
		}
	}
}

Feedback & Support

Need help? Contact PubNub Support.

More integrations for you

Two Hat’s Sift Ninja - Profanity Filter

    Two Hat’s Sift Ninja - Profanity Filter

    Simple but yet powerful profanity filter for chat and comments

    Learn more
    Tisane Labs NLP - Realtime Text Analysis in 27 Languages

      Tisane Labs NLP - Realtime Text Analysis in 27 Languages

      Detect abusive content, sentiment analysis, and tagging/categorization in...

      Learn more
      Sightengine: Image Moderation and Censoring

        Sightengine: Image Moderation and Censoring

        Analyze, detect, and censor images for adult content, validation and format

        Learn more

        Talk to an expert

        Contact Sales