Content Moderation API featured

You might have an application with a huge amount of user-generated content coming daily and need to moderate content automatically. It’s a pain to moderate content manually because it takes lots of man-hours. How about using artificial intelligence with IDE Software for that? It will instantly detect inappropriate content prevent form going public.

What is the Content Moderation API by DeepAI?

DeepAI is a very popular source among artificial intelligence content seekers. It provide researches, guides, news and APIs of artificial intelligence. You can easily grab an API key by creating an account and access all of their artificial intelligence APIs. Just visit this link, create an account and then go to the dashboard and you will have your API key.

https://deepai.org/

Is it free to use Deep.ai automated content moderation?

When you register, you will have $5 USD free credit which is equivalent to 10,000 requests. No credit card required for the registration. After the registration, you only need to pay $0.50 USD per 1000 requests or there are some enterprise packages you can discuss with them.

What Deep.ai artificial intelligence APIs are available to use in my Delphi application?

They provide numerous amount of APIs. You can check their APIs form this list. Most of them also have a live demo in their product page.

https://deepai.org/apis

One of their powerful API is the “Content Moderation API”. This API give you the all details to moderate the content. Once you supply and image to the API, it will provide you “Not safe for work” score, description about inappropriate content, the rectangle area of the inappropriate content, and the confidence score which is one if 100% confidence. This API can detect adult content, hate symbols, guns and offensive words.

How do I use the Content Moderation API?

We can access all of the DeepAI APIs using a REST client including this content moderation API. A simple curl request for this API is like this:

It’s self-explanatory and you have provide the image URL or local image file as “image” and the API key as a header value. Once you send the request, server will send a JSON response and you can parse it to have all moderation information about the image. Sample moderation would be like this:

You have to parse the JSON array inside the JSON to get the results.

How do I access the Deep.ai Content Moderation API from Delphi?

We can use REST client component to access the this API and easily build a demo application. Let’s make a demo application which will draw a rectangle if one of the restricted content found. First add a TRESTClient, TRESTRequest and TRESTResponse components in to a form. Set the base URL of the client to the following:

Set the method of RESTRequest to rmPOST because we going to securely post the data. Then it’s the coding time. We need to set the image, API key, get the response and JSON parse in the code. In this example we will browse a local file and send the request. Once we parsed the response, we draw a rectangle in the canvas of the TImage.

Here is a Delphi code example for using Deep.ai with a REST API

Parsing JSON results from Deep.ai

In this code we add two parameters, “api-key” and “image”, execute the request, and if success, parse the JSON value. Then if any inappropriate content found, it will draw a red rectangle in the canvas of the TImage. Final result is like this:

Content Moderation API

You can also download the demo application from this link and use with your API key.


Reduce development time and get to market faster with RAD Studio, Delphi, or C++Builder.
Design. Code. Compile. Deploy.
Start Free TrialUpgrade Today

Free Delphi Community EditionFree C++Builder Community Edition