OCR + Moderation

OCR Content Moderation

Hive offers an end-to-end API that provides content moderation for text within images by first extracting all text in the image and passing that information through our text moderation models. Our response will return the localization information of all text in the image, confidence scores across our moderated classes for the extracted text, and all profanity/pattern-matched information found in the extracted text. Possible use-cases include detecting the misuse of personal details in profile pictures and hateful/sexual text in memes. We currently support the following languages in our OCR moderation endpoints:

  • English
  • Spanish
  • French
  • German
  • Italian
  • Mandarin
  • Russian
  • Portuguese
  • Arabic
  • Korean
  • Japanese
  • Hindi

For a list of what moderation classes are supported for each of the above languages, see our Text Moderation Supported Languages table.

We also now support OCR Moderation on emojis. Major use cases here include emojis being used to convey hateful, racist, and sexual content.

Note: our OCR models are optimized for images with 150 words or fewer. If you submit images with more words than that, we recommend you split the image into multiple segments and submit them separately. For in-depth information on our OCR technology and moderated classes, please refer to the Text Recognition (OCR) page and Text Content Moderation Classes page. To try our demo, please refer to: https://hivemoderation.com/text-moderation.

Request Format

The request format for this API includes a field for the media being submitted, either as a local file path or as a url. For more information about submitting a task, see our API reference guides to synchronous and asynchronous submissions.

# submit a task with media with url
curl --request POST \
  --url https://api.thehive.ai/api/v2/task/sync \ # this is a sync example, see API reference for async
  --header 'accept: application/json' \
  --header 'authorization: token <API_KEY>' \
  --form 'url=http://hive-public.s3.amazonaws.com/demo_request/gun1.jpg'

# submit a task with media with local media file
 curl --request POST \
     --url https://api.thehive.ai/api/v2/task/sync \ # this is a sync example, see API reference for async
     --header 'Authorization: Token <token>' \
     --form 'media=@"<absolute/path/to/file>"'

Supported File Types

Image Formats:
gif
jpg
png
webp

Video Formats:
mp4
webm
avi
mkv
wmv
mov