Skip to content

Codex & Spectrum

Codex & Spectrum overview

Codex Documentation and API

Recommendation Endpoint configuration for Spectrum

When defining endpoints in PEACH Lab you need to add spectrum config section to your endpoint definition in order to have them displayed in Spectrum.

  url: /sirtv-related
    organisation: sirtv
    title: Content-based recommendations by ID
    type: content
    item_type: episode
    media_type: video
      episode_id: id
Attribute Description
organisation Identifier of the organisation, should match to one used in Codex
title Display name of the endpoint
type Input type needed. content, user or text
item_type Type of returned items. article, program, episode, list, clip
media_type Media type of the returned items. audio, video or text
parameters Map of parameters. Here, id property of the item in Spectrum should be sent as the episode_id to the endpoint

What does Spectrum display ?

Spectrum Item

(* mandatory, + optional)

Attribute Description
title * Name or title of the item
description * Text content of an item (synopsis for an episode, text for an article...)
link * Absolute link to the content on the broadcaster's website
image * Thumbnail or preview
publishDate * Publication date of the item
itemType * Type of the item. article, program, episode, list, clip
mediaType * Media type of the item. audio, video or text
transcript + Transcript of the item's media or the item itself
duration + Duration of the media

When pushing to CODEX, using those field names will allow Spectrum to directly understand and display them. If field names are different, a mapping can be defined for a specific organisation on Spectrum side.

Storing topics in Codex

It is possible to store topics in Codex and then Spectrum will display them if they are stored in following format:

topics: {
  name_of_topic_extractor: [
      id: 0001,
      title: "Boktjuven (film)", 
      link: "",
      source: "title",
      score: 0.456 
  name_of_topic_extractor2: [...]  

name_of_topic_extractor is a string to identify how the set of topics was created. The value related to this key will be an array of topics that can be defined like this :

(* mandatory, + optional)

Attribute Description
id * A unique id for the topic
title * The name of the topic
link + External link related to the topic (Wikipedia page for example)
source + From which part of the item this topic was extracted. title, text or transcript
score + How much the topic is related to the article. Value between 0 and 1