AI Auto Select
The AI Auto Select algorithm allows one to choose the most appropriate value out of a set of values that is most likely to achieve a desired goal. This algorithm uses CustomContentItems that are inserted using the Content Management API and optimally a developer specified goalAchieved() method.
Scenarios
Button Labels, Banners, Best Image Selection
One could use AIAutoSelect to choose the best option from a list of button labels and/or styling, site banners, or other pieces of content.
One could use AIAutoSelect to determine the best main image to display for a Product Detail Page or a Product Listing Page depending on the optimization goal.
AI Auto Select Algorithm Configuration
AIAutoSelect uses CustomContentItems to choose the best option from and a goal to measure the effectiveness of the choice. Such items are added with a dataset name, which is used to select which items to choose between in a particular bandit request. Any dataset can be selected for any bandit API instance, so it's not necessary to configure each API instance with a specific dataset name.
All AIAutoSelect API instances are configured with the following default configuration: Persistence mode Stays the same for the user's session. Optimization goal Custom via the reward API The developer's code sends a signal / counter when the desired action happens, optionally with an amount for numeric type rewards. This is useful to optimize for short term engagement such as click, navigation to another page, and “add to cart” events.
export enum AIAutoSelectPersistenceMode {
Session = 'Session',
}
export enum AIAutoSelectOptimizationGoal {
RewardApi = 'RewardApi',
}
export interface AIAutoSelectAPIConfiguration extends APIConfiguration {
persistenceMode?: AIAutoSelectPersistenceMode;
optimizationGoal: AIAutoSelectOptimizationGoal;
}
Request And Responses
The datasetName of the CustomContentItems is specified in the request. The id and value of the CustomerContentItem is returned in the response.
export interface AIAutoSelectGetRequest extends DmAlgRequest {
// Which CustomContentItems to choose from
datasetName: string;
}
export interface AIAutoSelectItem {
id: string;
value: string;
}
export interface AIAutoSelectGetResponse extends DmResponse {
item: AIAutoSelectItem;
// Unique id that can be used with the reward API
attributionId: string;
}
notifyAIAutoSelectReward
To indicate that a desired result occurred for AIAutoSelect, we use the notifyAIAutoSelectReward request. The optional name field can be used to indicate a developer provided value to aid in analytics. For example we can use name=”AddToCart”.
The notifyAIAutoSelectReward API allows the developer to manually notify the system of a micro conversion for a specific apiInstanceId. This micro conversion can then be associated with the bandit model. The system will look for the API call followed by the reward to indicate a positive outcome when optimizing.
In some cases it is useful to clarify which specific API response was directly involved in the micro conversion, e.g. clicking on a button that was optimized via the AIAutoSelect API. To do this, supply the attributionId of the choice the bandit made (attributionId from the response) in the custom reward API calls.
export interface NotifyAIAutoSelectRewardRequest extends DmAlgRequest {
// Developer provided info for reporting
name?: string;
// Amount if reward magnitude is applicable. Like the number of items purchased.
magnitude?: number;
// From the AIAutoSelectGetResponse if available.
attributionId?: string;
}
Example choosing best product image
Let’s say we want to pick the best image for a Product Detail Page.
First we would use the Content Management API to add CustomContentItems into the system which would look something like the following table.
Notice how each DatasetName indicates the unique identifier of a product and for each Value we store the information we want to receive when this item is selected on the API.
Once the above CustomContentItems are added to the system via the content management API, the Machine Learning model(s) will be trained and used to determine the best choice for each DatasetName depending on the User’s context..
The APIConfiguration would look like this
For this case the request would look like this:
{
requestType: RequestType.GetAIAutoSelectChoice,
apiInstanceId: '0e4519232da', // for AIAutoSelect
datasetName: 'SKU_FOR_RACKET',
}
The response would look like this.
{
serverVersion: latestVersion,
responseType: RequestType.GetPevContentRanking,
responseCode: HttpStatusCode.OK,
item: {
id: '42',
value: '{imageUrl:”TriangleImage”}',
},
attributionId: '234qafsrqfa',
};
We would then use notifyReward to indicate the goal was achieved when the user clicks the add to cart button.
{
requestType: RequestType.NotifyAIAutoSelectReward,
apiInstanceId: '0e4519232da', // for AIAutoSelect
name: 'AddToCart',
}