All Products
Search
Document Center

Artificial Intelligence Recommendation:Content industry

Last Updated:Apr 01, 2026

This page defines the data schema for the content industry — including articles, videos, audio, and images. Follow these specifications when uploading historical data and real-time data to Artificial Intelligence Recommendation (AIRec).

Data tables

AIRec requires three data tables for content industry scenes.

TablePurposeIdentity rule
Item tableAll recent items available for recommendation. "Item" means content in this context.item_id + item_type together uniquely identify an item
User tableAll recently registered usersimei alone, or user_id + imei together, uniquely identify a user
Behavior tableRecent user behavior in the current scene

Before uploading:

  • Items and users each have a quota limit. Deduplicate both tables before upload.

  • Provide behavior data from the last one to two weeks. If historical behavior data is unavailable (new scene or technical constraints), use the AIRec test data — expect up to two weeks of suboptimal results while the model accumulates real data.

  • Fill in as many optional fields as possible. The more complete your data, the better the recommendation results.

Important

All fields listed in the tables below must be present in your MaxCompute table, even if optional fields are left blank. See CREATE TABLE statements for the full schema.

Item table

Each row represents one piece of content (article, video, audio, image, and so on).

FieldTypeRequiredDescriptionValid valuesNotesExample
item_idstringRequiredUnique item IDCustomLetters and digits only; max 50 characters. item_id + item_type together identify an item. Record all item IDs for later reference.34513
item_typestringRequiredContent typeimage, article, video, shortvideo, item, recipe, audioUploaded data must match the declared type — mismatches disable mixed sorting. Contact support for additional types.article
statusstringRequiredRecommendation eligibility0, 11 = eligible; 0 = not eligible. Changes take effect immediately.1
scene_idstringRequiredScene IDCustomUse letters and digits (acronyms work well). Do not use colons (:). Do not use -102 (reserved — this is an internal value reserved by the system). For a single scene, use 1. Separate multiple scene IDs with commas (,).a101,b102
durationstringRequired for video; optional otherwiseVideo length in secondsCustomMust be ≥ 0 and < 36,000.1000
pub_timestringRequiredPublication timeUNIX timestamp (seconds)Used to identify new items and support timeliness-based ranking.1520327038
expire_timestringRecommendedExpiration timeUNIX timestamp (seconds)If the current server time exceeds this value, the item stops being recommended. If all items expire, the service cannot start. Leave blank for no expiration. If starting via data source import, this field cannot be blank — set it to a far-future timestamp.1520327038
last_modify_timestringOptionalLast modification timeUNIX timestamp (seconds)Update this field after major content changes to treat the item as new, similar to pub_time.1520327038
titlestringRecommendedItem titleCustomUsed for in-depth semantic analysis. Missing titles reduce algorithm coverage. We recommend that you set this field.The Digital Era Provides the Greatest Opportunity
weightstringRecommendedItem boost weight1, 100100 = boosted (more likely to be recommended); 1 = standard. Keep boosted items at ≤ 10% of total items. Other values are invalid. Defaults to 1 if blank.1
category_levelstringRecommendedCategory depth levelCustomMust match category_path depth. Mismatch disables discretization.3
category_pathstringRecommendedCategory hierarchyCustomSeparate levels with underscores (_). Commas (,) and colons (:) are not allowed. Used in discretization policies.12_1024_56
tagsstringRecommendedContent tagsCustomSeparate multiple tags with commas (,). Max 100 tags per item; max 50,000 tags per tag pool. If tags are sensitive business data, convert them to numeric codes before uploading.digitalization,artificial intelligence,AI
authorstringRecommendedAuthor name(s)CustomSeparate multiple authors with commas (,). Max 100 authors per item. Enables author-based discretization.Tom
contentstringOptionalBody text or key excerptCustomMax 5,000 characters. Used for semantic analysis.
channelstringRecommendedContent channel (e.g., Economy)CustomOne item belongs to exactly one channel.
organizationstringOptionalOrganizationsCustomSeparate multiple values with commas (,).
pv_cntstringOptionalExposures in the past monthCustomNon-real-time data is acceptable. Useful during service startup when scene behavior data is sparse — supplement with data from other scenes.100000
click_cntstringOptionalClicks in the past monthCustomNon-real-time data is acceptable.1000
like_cntstringOptionalLikes in the past monthCustomNon-real-time data is acceptable.100
unlike_cntstringOptionalDislikes in the past monthCustomNon-real-time data is acceptable.100
comment_cntstringOptionalComments in the past monthCustomNon-real-time data is acceptable.100
collect_cntstringOptionalFavorites in the past monthCustomNon-real-time data is acceptable.100
share_cntstringOptionalShares in the past monthCustomNon-real-time data is acceptable.100
download_cntstringOptionalDownloads in the past monthCustomNon-real-time data is acceptable.100
tip_cntstringOptionalRewards in the past monthCustomNon-real-time data is acceptable.100
subscribe_cntstringOptionalFollows in the past monthCustomNon-real-time data is acceptable.100
source_idstringOptionalPlatform that published the itemCustomFor example, 1 for Taobao, 2 for Tmall.1
countrystringOptionalCountry codeISO 3166-1 alpha-3CHN
citystringOptionalCity nameCustomHangzhou
featuresstringOptionalString item characteristicsCustomSeparate multiple values with commas (,). Values should be descriptive.
num_featuresstringOptionalNumeric item characteristicsCustomSeparate multiple values with commas (,). All items must have the same number of comma-separated values in this field.

Sample data row (item table):

item_id,item_type,status,scene_id,pub_time,expire_time,title,tags,channel,weight,category_level,category_path
34513,article,1,"a101,b102",1520327038,1620000000,"The Digital Era Provides the Greatest Opportunity","digitalization,AI",economy,1,3,12_1024_56

User table

Each row represents one user.

FieldTypeRequiredDescriptionValid valuesNotesExample
user_idstringRequired for logged-on usersUnique user IDCustomRequired for registered users. Uniquely identifies a user.1234567
user_id_typestringOptionalAccount type1, 2, 3, 41 = app account; 2 = mobile phone number; 3 = WeChat account; 4 = other.2
imeistringRequired for users who have not logged onDevice identifierMD5 hash valueAndroid: MD5 hash of International Mobile Equipment Identity (IMEI). iOS: MD5 hash of Identifier for Advertisers (IDFA). Required for anonymous users. If the MAC address or device number is invalid, only the exposure blocking feature is retained.74f25e604e1a9dde7471fe2e25ae54d0
third_user_namestringOptionalThird-party usernameCustomjack
third_user_typestringOptionalThird-party platform nameCustomwechat
phone_md5stringOptionalMD5 hash of mobile number32-character stringd41d8cd98f00b204e9800998ecf8427e
genderstringOptionalGendermale, female, unknownUse digits if gender data is sensitive: 0 = male, 1 = female, 2 = unknown.male
agestringOptionalAgeCustom22
age_groupstringOptionalAge groupCustom20-25
countrystringOptionalCountry codeISO 3166-1 alpha-3CHN
citystringOptionalCity nameCustomHangzhou
ipstringOptionalLast logon IP addressCustom202.113.XX.XX
device_modelstringOptionalDevice modelCustomiphoneX
tagsstringOptionalUser interest tagsCustomSeparate multiple tags with commas (,). Use tags to describe the user's interests.football,fitness,outdoor
sourcestringOptionalUser acquisition sourceCustomToutiao
contentstringOptionalUser descriptionCustom
register_timestringOptionalRegistration timeUNIX timestamp (seconds)1520007038
last_login_timestringOptionalLast logon timeUNIX timestamp (seconds)1520017038
last_modify_timestringOptionalLast profile update timeUNIX timestamp (seconds)1520327038
featuresstringOptionalString user characteristicsCustomSeparate values with commas (,). Useful for customer portrait data.
num_featuresstringOptionalNumeric user characteristicsCustomSeparate values with commas (,). All users must have the same number of comma-separated values.

Identifying users:

  • Logged-on users: use user_id

  • Anonymous users: use imei

  • Mixed scenarios: use user_id for logged-on users and imei for anonymous users

Make sure all user records are unique. When requesting recommendation results, specify the correct user identifier — otherwise personalized recommendations cannot be generated.

Behavior table

Each row represents one user interaction with an item.

FieldTypeRequiredDescriptionValid valuesNotesExample
item_idstringRequiredItem IDCustomMust match item_id in the item table.34513
item_typestringRequiredItem typeimage, article, video, shortvideo, item, recipe, audioMust match item_type in the item table.image
bhv_typestringRequiredBehavior typeexpose, click (and others — see behavior type table below)expose and click entries are required. Click count must be less than expose count — a higher ratio signals abnormal data and prevents service startup.expose
trace_idstringRequiredRecommendation engine sourceAlibaba, selfholdAlibaba = item recommended by AIRec; selfhold = item from a self-developed recommendation system. Used for A/B testing reports in the console.Alibaba
trace_infostringRequiredRequest tracking informationCustomIf trace_id is selfhold, set to 1. If trace_id is Alibaba, use the trace_info value returned in the recommendation result.1
scene_idstringRequiredScene where the behavior occurredCustomMust match one of the scene IDs in the item's scene_id field. Only one scene ID per behavior entry. If the scene cannot be determined, use -102. Default: 1.a101
bhv_timestringOptionalTime of the behaviorUNIX timestamp (seconds)Set to the time when the user performed the action.1520327038
bhv_valuestringRequiredBehavior detailCustomFor expose, click, and share: set to 1. For stay: set to time spent in seconds. For other types, contact support.500
user_idstringRequired for logged-on usersUser IDCustomMust match user_id in the user table. Leave blank for anonymous users.1234567
platformstringOptionalClient platformios, android, h5ios
imeistringRequired for users who have not logged onDevice identifierMD5 hash value (32 characters)Required for anonymous users.e2fcdb0f4dce45e35fe2823d797333ec
app_versionstringOptionalApp versionCustom4.1.10
net_typestringOptionalNetwork type2G, 3G, 4G, WIFI4G
ipstringOptionalClient IP addressCustom234.45.13.14
loginstringOptionalLogon status0, 10 = not logged on; 1 = logged on.1
report_srcstringOptionalReport source1, 21 = server; 2 = client.2
device_modelstringOptionalDevice modelCustomiphoneX
longitudestringOptionalLongitudeCustom128.4
latitudestringOptionalLatitudeCustom78.1
module_idstringOptionalModule IDCustom114
page_idstringOptionalPage IDCustom4
positionstringOptionalItem position on the pageCustom5
message_idstringOptionalUnique behavior entry IDCustomIf blank, the system deduplicates using item_id, item_type, user_id, imei, bhv_type, and bhv_time.5

Behavior types

bhv_typeDescriptionRequired
exposeItem shown to the user (impression)Required — expose count must exceed click count
clickUser clicked the itemRequired
likeUser liked the itemOptional
unlikeUser disliked the itemOptional
commentUser commented on the itemOptional
collectUser favorited the itemOptional
stayUser stayed on the item pageOptional
shareUser shared the itemOptional
downloadUser downloaded the itemOptional
tipUser rewarded the itemOptional
subscribeThe "follow" behavior on an itemOptional
dislikeUser provided negative feedbackOptional — see Negative feedback
page_nextUser turned to the next pageOptional — set bhv_value to 1
Important

The number of click entries must always be less than the number of expose entries. A ratio of clicks ≥ exposures signals abnormal data and prevents service startup.

CREATE TABLE statements

Use these MaxCompute statements to create the tables required for starting an AIRec instance. Optional fields can be left blank, but all fields must be present in the schema.

--- Create a behavior table in the content industry.
DROP TABLE IF EXISTS behavior_table;
CREATE TABLE IF NOT EXISTS `behavior_table`
(
    trace_id STRING COMMENT "Request tracking ID"
    ,trace_info STRING COMMENT "Request tracking information"
    ,platform STRING COMMENT "Client platform"
    ,device_model STRING COMMENT "Device model"
    ,imei STRING COMMENT "Device ID"
    ,app_version STRING COMMENT "App version number"
    ,net_type STRING COMMENT "Network type"
    ,longitude STRING COMMENT "Longitude"
    ,latitude STRING COMMENT "Latitude"
    ,ip STRING COMMENT "Client IP address"
    ,login STRING COMMENT "Whether the user has logged on"
    ,report_src STRING COMMENT "Source of the report"
    ,scene_id STRING COMMENT "Scene ID"
    ,user_id STRING COMMENT "User ID"
    ,item_id STRING COMMENT "Item ID"
    ,item_type STRING COMMENT "Type of the item"
    ,module_id STRING COMMENT "Module ID"
    ,page_id STRING COMMENT "Page ID"
    ,position STRING COMMENT "Position of the item"
    ,bhv_type STRING COMMENT "Behavior type"
    ,bhv_value STRING COMMENT "Behavior details"
    ,bhv_time STRING COMMENT "Time at which the behavior occurs"
)
PARTITIONED BY
(
    ds STRING
)
LIFECYCLE 30
;


--- Create a user table in the content industry.
DROP TABLE IF EXISTS user_table;
CREATE TABLE IF NOT EXISTS `user_table`
(
    user_id STRING COMMENT "Unique user ID"
    ,user_id_type STRING COMMENT "Registration type of the user"
    ,third_user_name STRING COMMENT "Name of the third-party user"
    ,third_user_type STRING COMMENT "Name of the third-party platform"
    ,phone_md5 STRING COMMENT "MD5 hash value of the mobile phone number of the user."
    ,imei STRING COMMENT "Device ID of the user"
    ,content STRING COMMENT "User content"
    ,gender STRING COMMENT "Gender"
    ,age STRING COMMENT "Age"
    ,age_group STRING COMMENT "Age group"
    ,country STRING COMMENT "Country"
    ,city STRING COMMENT "City"
    ,ip STRING COMMENT "Last logon IP address"
    ,device_model STRING COMMENT "Device model"
    ,register_time STRING COMMENT "Registration time"
    ,last_login_time STRING COMMENT "Last logon time"
    ,last_modify_time STRING COMMENT "Last modification time of user information"
    ,tags STRING COMMENT "User tags"
    ,source STRING COMMENT "Source of the user"
    ,features STRING COMMENT "Additional user characteristics, which are strings"
    ,num_features STRING COMMENT "Additional user characteristics, which are numerical values"
)
PARTITIONED BY
(
    ds STRING
)
LIFECYCLE 30
;


--- Create an item table in the content industry.
DROP TABLE IF EXISTS item_table;
CREATE TABLE IF NOT EXISTS `item_table`
(
    item_id STRING COMMENT "Unique ID of the item"
    ,item_type STRING COMMENT "Type of the item"
    ,title STRING COMMENT "Item title"
    ,content STRING COMMENT "Body part of the item"
    ,pub_time STRING COMMENT "Release time"
    ,status STRING COMMENT "Whether the item can be recommended"
    ,expire_time STRING COMMENT "Time at which the item expires"
    ,last_modify_time STRING COMMENT "Last modification time of the item information"
    ,scene_id STRING COMMENT "Scene ID"
    ,duration STRING COMMENT "Duration, in seconds"
    ,category_level STRING COMMENT "Category level"
    ,category_path STRING COMMENT "Category path"
    ,tags STRING COMMENT "Tags"
    ,channel STRING COMMENT "Channels"
    ,organization STRING COMMENT "Organizations"
    ,author STRING COMMENT "Authors"
    ,pv_cnt STRING COMMENT "Number of exposures"
    ,click_cnt STRING COMMENT "Number of clicks"
    ,like_cnt STRING COMMENT "Number of likes"
    ,unlike_cnt STRING COMMENT "Number of dislikes"
    ,comment_cnt STRING COMMENT "Number of comments"
    ,collect_cnt STRING COMMENT "Number of favorites"
    ,share_cnt STRING COMMENT "Number of shares"
    ,download_cnt STRING COMMENT "Number of downloads"
    ,tip_cnt STRING COMMENT "Number of rewards"
    ,subscribe_cnt STRING COMMENT "Number of follows"
    ,source_id STRING COMMENT "Item source"
    ,country STRING COMMENT "Country"
    ,city STRING COMMENT "City"
    ,features STRING COMMENT "Additional characteristics"
    ,num_features STRING COMMENT "Additional characteristics, which are numerical values"
    ,weight STRING COMMENT "Weight of the item, default value: 1"
)
PARTITIONED BY
(
    ds STRING
)
LIFECYCLE 30
;

What's next