Login

Generate named entities

Named entity recognition, or NER, is a natural language processing (NLP) technique that identifies specific entities in text, such as names of people, places, organizations, dates, etc. By tagging these entities, NER turns unstructured text into structured data, making it easier to analyze and use in various applications.

The Named Entities feature extracts and ranks key named entities from video transcripts, optimizing them for better Natural Language Processing (NLP) search and content analysis. This feature enhances the accuracy of NLP-based search and enables more effective content indexing, making it easier to retrieve relevant information. It's ideal for content analysts, search engine developers, media platforms, marketers, and researchers who are looking for improved content search and analysis through NER.


Example of named entity recognition

This feature identifies names and gives them meaning in a given context. For example, in the sentence “Apple announced its latest product in California,” NER identifies Apple as a company, not the fruit, and California as a location.


What categories NER can identify?

NER typically focuses on recognizing common categories such as:

  • People (e.g., “John Smith”)
  • Organizations (e.g., “UNICEF”)
  • Locations (e.g., “Mount Everest”)
  • Dates and times (e.g., “July 4, 1776”)
  • Miscellaneous entities like product names (e.g., “iPhone 14”) or monetary values (e.g., “$1,000”)

Read more details in our recent blog.


Getting started

To begin using the Named Entities feature, you can use FastPix’s create media from URL or upload media from device API endpoints. These endpoints analyze video or audio files and generate named entities automatically when uploading new media.

If you want to enable named entity generation in your existing content that was previously uploaded, use the generate named entities API endpoint. See how.


Generate named entities for new media

Step 1: Collect the URLs of the media files to upload to FastPix (using pull via URL method) for which you want to generate named entities.

Step 2: Create a JSON request and send a POST request to the /on-demand endpoint.


In the JSON configuration for the FastPix API request, the following parameters are required:

  • type: Specify whether the media is a video or audio file.
  • url: Provide the HTTPS URL of the file for named entity generation.
  • namedEntities: Set this to true to enable named entity extraction.
  • accessPolicy: (Optional) Set to public or private based on your needs.
  • maxResolution: (Optional) Specify a resolution limit, e.g., 1080p.

Request body (Creating new media from URL)

{
  "inputs": [
    {
      "type": "video",
      "url": "https://static.fastpix.io/sample.mp4"
    }
  ],
  "namedEntities": true,
  "accessPolicy": "public",
  "maxResolution": "1080p"
}

Request body (Creating new media by direct upload)

If you are uploading media directly, the inputs section will contain the relevant upload details, and the structure will look like this:

{
  "corsOrigin": "*",
  "pushMediaSettings": {
    "metadata": {
      "key1": "value1"
    },
    "namedEntities": true,
    "accessPolicy": "public",
    "maxResolution": "1080p"
  }
}

Generate named entities for existing media

If you wish to generate named entities for media that has already been uploaded, use the generate named entity endpoint and follow these steps:

Step 1: Collect the mediaId for the media you want to generate named entities for.

Step 2: Create a JSON request and send a PATCH request to the /on-demand/<mediaId>/named-entities endpoint. Replace <mediaId> with the actual mediaId of the already existing media.


Example request body

{    
  "namedEntities": true    
}  

Accessing named entity results

To retrieve the generated named entities for your media (video/audio), you can find the data in the video.mediaAI.namedEntities.ready event.


Example of the event data:

{
  "type": "video.mediaAI.namedEntities.ready",
  "object": {
    "type": "mediaAI",
    "id": "69f82b00-151c-45d4-942c-6eab719143b2"
  },
  "id": "449ffaa5-ba84-452a-b368-53da62d4641e",
  "workspace": {
    "id": "fd717af6-a383-4739-8d8c-b49aa732a8c0"
  },
  "data": {
    "isNamedEntitiesGenerated": true,
    "namedEntities": [
      "Zebra (Animal)",
      "Gravy (Food)",
      "Plain Zebra (Animal)",
      "Mountain Zebra (Animal)",
      "Africa (Geography)",
      "Foals (Animal)"
    ]
  }
}

In this event, the namedEntities field contains a list of the extracted named entities, along with their types (e.g., Technology, Organization, Person, etc.). You can access this data after the named entity extraction process is completed.


General considerations

  • Ensure that the mediaId is correctly obtained for existing media when using the /on-demand/<mediaId>/named-entities endpoint.\
  • The accessPolicy and maxResolution parameters are optional but help manage access and media quality, depending on your needs