Skip to content

Semantic functions (preview)

The purpose of semantic functions is to give solution partners a fast and easy way to integrate various AI functions into other parts of their solution without the need for DAM, PIM, or other Bizzkit applications.

Info

Please note that semantic functions are in preview. Read more here.

Several endpoints are available on the BAIA API:

  • ImageDescription: Endpoints related to extracting descriptions from images, such as identifying objects, scenes, and activities.
  • ImageSearchableData: Endpoints related to extracting searchable data (themes, colors, categories, etc.) from images to enhance search capabilities.
  • IntentEmbedding: Endpoints related to extracting intents from text, useful for understanding user queries and commands.
  • ProductCategoryPlacement: Endpoints related to categorizing products into appropriate categories based on their attributes.
  • ProductChoice: Endpoints related to recommending products based on user preferences and behavior.
  • ProductEmbedding: Endpoints related to generating product embeddings for similarity searches and recommendations.
  • ProductTextGeneration: Endpoints related to generating product descriptions, titles, and other textual content.
  • SearchSpecialization: Endpoints related to search specialization where context is important, improving search relevance.
  • SemanticTranslation: Endpoints related to translating text while preserving its meaning and context.
  • TypeAhead: Endpoints related to type-ahead functionality, providing real-time suggestions as users type.

Tip

The endpoints mostly consist of two types of functions - asynchronous functions (with start/bulk and status endpoints) and synchronous functions (typically named call-and-wait).

Examples of semantic functions

Here are some simple examples of how to use some of the semantic functions to gain a better understanding of the API.

Image description

The ImageDescription endpoint is used to extract descriptions from images. The following request example shows how to extract descriptions from an image:

{
  "instructions": "create short alt (seo) description for an e-commerce store",
  "languages": [
    {
      "code": "en-GB"
    }
  ],
  "generationMode": "Fast",
  "imageUrl": "https://academy2.cdn.bizzkit.biz//e9aa07a1-7698-4e74-9f8b-dd60868bd94e/_small-preview/bizzkit-bat-tshirt-black-002.webp"
}

Based on an image like this:

T-shirt

the result could be:

1
2
3
4
5
6
7
8
{
  "descriptions": [
    {
      "languageCode": "en-GB",
      "description": "A stylish biker wearing a black B.A.T. t-shirt and holding a helmet, standing next to a classic motorcycle in a modern urban setting during sunset."
    }
  ]
}

Image searchable data

The ImageSearchableData endpoint is used to extract searchable data from images. The following request example shows how to extract searchable data from an image:

1
2
3
4
5
6
7
8
{
  "language": {
    "code": "en-GB"
  },
  "generationMode": "Fast",
  "imageUrl": "https://academy2.cdn.bizzkit.biz//e9aa07a1-7698-4e74-9f8b-dd60868bd94e/_small-preview/bizzkit-bat-tshirt-black-002.webp",
  "productInformation": "product image used in a merchandise e-commerce store"
}

Based on an image like this:

T-shirt

the result could be:

{
  "themes": [
    "motorcycle",
    "safety",
    "gear",
    "riding",
    "fashion"
  ],
  "colors": [
    "Black"
  ],
  "categories": [
    "Clothing",
    "Motorcycle Gear",
    "Helmets",
    "Men's Fashion"
  ],
  "materials": [
    "Polycarbonate",
    "Textile"
  ]
}

Translations

The SemanticTranslation endpoint is used to translate text while preserving its meaning and context. The following request example shows how to translate text:

{
  "languageToTranslateFrom": {
    "code": "en-GB"
  },
  "languagesToTranslateTo": [
    {
      "code": "da-DK"
    }
  ],
  "textToTranslate": [
    "Our adorable Bizzkit baby bodysuit in white is the perfect attire for your little one. Comfortable and cute. "
  ],
  "generationMode": "Fast"
}

The result could be:

{
  "translations": [
    {
      "languageCode": "da-DK",
      "translations": [
        "Vores bedårende Bizzkit baby bodysuit i hvid er det perfekte tøj til din lille. Komfortabelt og sødt."
      ]
    }
  ]
}