Skip to main content

You are viewing Agora Docs forBeta products and features. Switch to Docs

Hive

Hive content moderation enables you to monitor images and videos in near real-time, for inappropriate content such as nudity, violence, and hate imagery. This page shows you how to use Hive Visual Moderation API in Video SDK for accurate content moderation of live video streams.

Understand the tech

Hive Visual Moderation API and Agora SDK work together as follows:

  1. The video stream from the channel is encrypted and transmitted to the Agora proxy server.
  2. The proxy server encapsulates the video stream information, encrypts it, and transmits it to Hive, a third-party moderation service provider.
  3. The moderation service provider returns the audio and video stream information and review results to your callback server.
  4. You implement your own business logic based on the review results.

The server-server transmission scheme simplifies monitoring and ensures security of the service. In addition, it gives you complete control over the business logic. When your business server receives a review result indicating content violation, you can close the channel, show a prompt in the UI, ban the user, or deduct points for the client. The intercepted content from the channel is stored using OSS storage services provided by the moderation service provider.

Prerequisites

In order to set up Hive content moderation you must have:

  • Implemented SDK quickstart for Interactive Live Streaming using Video SDK 4.0.1, special edition. To download this release, contact support@agora.io
  • Activated Hive Visual Moderation API on Agora Console.
  • Configured Hive Visual Moderation API by sending an email to support@agora.io with the following information:
    • App ID: Your App ID from Agora Console.
    • Detection interval: The time interval between capturing content from a video stream and submitting it for review.
    • Content preservation preference: Whether to store all the content submitted for review for later manual review. The default setting is storage for 7 days.
    • Callback server address: The address of your HTTPS callback server that you use to receive review results from Hive. The review effect starts automatically when the user joins the channel and continues for the duration of the call.

Receive review results from Hive

To use Hive, you set up an HTTPS business server that receives review result callbacks from the moderation service provider. Hive returns review results to your callback URL in the form of an HTTPS request. The request body contains the classes array under output, showing the likelihood score for each type of content. The following is an example of a review result callback from Hive:


_77
{
_77
"id": "dd52c0d0-9ec7-11ea-98a3-4b92424b8366",
_77
"project_id": 18416,
_77
"metadata": null,
_77
"status": [
_77
{
_77
"status": {
_77
"code": "0",
_77
"message": "SUCCESS"
_77
},
_77
"response": {
_77
"input": {
_77
"hash": "a71690e72e5cabafc73dc2717818fc6d",
_77
"inference_client_version": "4.0.8",
_77
"model": "textmod_svs_2langs_release_test2",
_77
"model_type": "TEXT_CLASSIFICATION",
_77
"model_version": 1,
_77
"text": "test data",
_77
"id": "2846b170-a079-11ea-b023-6bfe10549ae0",
_77
"created_on": "2020-05-28T00:21:21.543Z",
_77
"user_id": 6994,
_77
"project_id": 18416,
_77
"charge": "0.00100",
_77
"media": {
_77
"mimetype": null
_77
},
_77
"config_version": 1,
_77
"config_tag": "default"
_77
},
_77
"output": [
_77
{
_77
"time": 0,
_77
"classes": [
_77
{
_77
"class": "suggestive",
_77
"score": 0.0010710965501463823
_77
},
_77
{
_77
"class": "sexual",
_77
"score": 0.0027024835147116755
_77
},
_77
{
_77
"class": "no_sexual",
_77
"score": 0.9962264199351419
_77
},
_77
{
_77
"class": "self_harm",
_77
"score": 0.0002235677990901144
_77
},
_77
{
_77
"class": "violence",
_77
"score": 0.0007041907670250179
_77
},
_77
{
_77
"class": "no_violence",
_77
"score": 0.999072241433885
_77
},
_77
{
_77
"class": "yes_spam",
_77
"score": 0.000881996410983426
_77
},
_77
{
_77
"class": "no_spam",
_77
"score": 0.9991180035890167
_77
}
_77
],
_77
"start_char_index": 0,
_77
"end_char_index": 16
_77
}
_77
]
_77
}
_77
}
_77
],
_77
"resent_on": "2020-05-28T00:28:02.718Z",
_77
"resent_by": "api",
_77
"from_cache": false
_77
}