Encoding Process – Run

This API is called to invoke the encoding process in the recommendation engine. The goal is to input a CSV file containing the asset viewing information of the users and convert it into corresponding implied rating (as per the chosen rating algorithm). The rated data is stored as a CSV file and the access URL is returned on completion. This encoded CSV file can be used as input to the Recommendation Rating Computation Engine.

POST DATA:

Notes:

  • RatingAlgorithm:
    “explicit”: Do not apply any pre-processing. Data itself has explicit ratings.
    “aggressive”: Computation algorithm requires a low fraction of view time for a high rating.
    “conservative”: Computation algorithm requires a higher fraction of view time for a high rating.
    “tag_aggressive”: This algorithm is used to compute ratings for individual tags as per a user’s viewing patterns. Aggressive rating assignment is used.
    “tag_conservative”: This algorithm is used to compute ratings for individual tags as per a user’s viewing patterns. Conservative rating assignment is used.

  • RatingData:
    This field contains the URL from where the CSV file for the raw data can be retrieved.
    In the CSV File, each row has these fields: userId, itemId, rating
    userId: string
    itemId: string
    rating: float

  • Catalog:
    This is the CSV-formatted info about assets in the system. Note that, it is useful when RatingData has media-ids as itemId and RatingAlgorithm involves computation on tags. The tag-information for differentitemId (specified in the Catalog file), is used by the corresponding algorithm.

    Each row in the CSV file has these fields: itemId, tags, type, seriesId, duration
    itemId: string
    tags: pipe-separated list of tags
    type: string //vod, series, episode
    seriesId: string // in case the asset is an episode, this is the itemId of its series. Otherwise “”
    duration: int // runtime in seconds — for series it will be sum of runtime of all its episodes

  • On successful completion, a callback is made to specified Callback endpoint and following JSON is POSTed:

    The final file is stored at the provided “output_url” with each row in the CSV file having the fields: userId,itemId,rating
    userId: string
    itemId: string
    rating: float

    In case of failure, a JSON with error message is POST to the callback endpoint:

Resource URL

POST - /encode/run

Example Request URL

POST - http://__JTV_HOST__/encode/run

Example Request



Example Return

On success: On error: