日本熟妇hd丰满老熟妇,中文字幕一区二区三区在线不卡 ,亚洲成片在线观看,免费女同在线一区二区

快速拉起X2I召回服務

本文檔為您展示一個示例,在本例中,我們將準備一份X2I召回數據(假設數據表的表名為aime_example_x2i),一份物品詳情數據(假設數據表的表名為aime_example_detail),及一份行為表(假設行為表的表名為aime_example_expose),然后在智能召回引擎控制臺上注冊數據,最后用這兩份數據拉起一個X2I召回服務。

數據準備

準備X2I召回表

在MaxCompute客戶端中準備離線數據

-- 創建數據表
CREATE TABLE IF NOT EXISTS aime_example_x2i (
  trigger_id STRING COMMENT "召回字段",
  item_id STRING COMMENT "物品ID",
  score DOUBLE COMMENT "召回分"
) PARTITIONED BY (
  ds STRING COMMENT "分區字段"
);

-- 寫入X2I數據,實際業務場景下,具體的寫入數據由您的算法邏輯產出
INSERT OVERWRITE TABLE aime_example_x2i PARTITION (ds = '20210822')
SELECT 'A' AS trigger_id, '10001' AS item_id, 1.12 AS score UNION
SELECT 'A' AS trigger_id, '10002' AS item_id, 1.07 AS score UNION
SELECT 'B' AS trigger_id, '10001' AS item_id, 0.98 AS score UNION
SELECT 'C' AS trigger_id, '10003' AS item_id, 0.87 AS score;

-- 寫入標識分區
INSERT OVERWRITE TABLE aime_example_x2i PARTITION (ds = '20210822.done')
SELECT NULL, NULL, NULL UNION;

在智能召回引擎控制臺上注冊數據

進入實例詳情-數據管理頁面,點擊“注冊數據”

image.png

配置基礎信息:

image.png

點擊“下一步”,開始聲明數據結構

image.png

點擊“下一步”,配置全量調度方式

image.png

點擊“配置完成并上線”,完成注冊并發布

image.png

?

準備物品詳情表(可選)

在MaxCompute客戶端中準備數據

-- 創建數據表
CREATE TABLE IF NOT EXISTS aime_example_detail (
  nid STRING COMMENT "物品ID",
  title STRING COMMENT "物品名稱",
  price DOUBLE COMMENT "物品價格"
) PARTITIONED BY (
  ds STRING COMMENT "分區字段"
);

-- 寫入物品數據,實際業務場景下,具體應該寫入您實際的物品詳情數據
INSERT OVERWRITE TABLE aime_example_detail PARTITION (ds = '20210822')
SELECT '10001' AS nid, '甜美泡泡袖蝴蝶結寶藏連衣裙' AS title, 269.00 AS price UNION
SELECT '10002' AS nid, '亞麻法式小黑裙連衣裙' AS title, 259.00 AS price UNION
SELECT '10003' AS nid, '法式西裝裙收腰襯衫裙子' AS title, 599.00 AS price;

-- 寫入標識分區
INSERT OVERWRITE TABLE aime_example_detail PARTITION (ds = '20210822.done')
SELECT NULL, NULL, NULL UNION;

在智能召回引擎控制臺上注冊數據

進入實例詳情-數據管理頁面,按照如下方式填寫:

image.png

點擊“下一步”,開始配置索引

image.png

點擊“下一步”,開始配置全量調度方式

image.png

點擊“配置完成并上線”,完成注冊并發布

image.png

準備行為表(可選)

在MaxCompute客戶端中準備數據

DROP TABLE IF EXISTS aime_example_expose;

-- 創建數據表
CREATE TABLE IF NOT EXISTS aime_example_expose (
  user_id STRING COMMENT "用戶ID",
  item_id STRING COMMENT "物品ID",
  time BIGINT COMMENT "行為時間"
) PARTITIONED BY (
  ds STRING COMMENT "分區字段"
);

-- 寫入向量數據,實際業務場景下,具體的寫入數據由您的算法邏輯產出
INSERT OVERWRITE TABLE aime_example_expose PARTITION (ds = '20210822')
SELECT 'u0001' AS user_id, '10001' AS item_id, 1640275200 AS time UNION -- 20211224
SELECT 'u0001' AS user_id, '10002' AS item_id, 1640275200 AS time UNION -- 20211224
SELECT 'u0002' AS user_id, '10003' AS item_id, 1640275200 AS time UNION -- 20211224
SELECT 'u0002' AS user_id, '10004' AS item_id, 1640275200 AS time UNION -- 20211224
SELECT 'u0003' AS user_id, '10001' AS item_id, 1640275200 AS time UNION -- 20211224
SELECT 'u0003' AS user_id, '10002' AS item_id, 1640188800 AS time UNION -- 20211223
SELECT 'u0003' AS user_id, '10003' AS item_id, 1640102400 AS time UNION -- 20211222
SELECT 'u0003' AS user_id, '10004' AS item_id, 1640016000 AS time UNION -- 20211221
SELECT 'u0003' AS user_id, '10005' AS item_id, 1639929600 AS time UNION -- 20211220
SELECT 'u0003' AS user_id, '10006' AS item_id, 1639843200 AS time UNION -- 20211219
SELECT 'u0003' AS user_id, '10007' AS item_id, 1639756800 AS time UNION -- 20211218
SELECT 'u0003' AS user_id, '10008' AS item_id, 1639670400 AS time UNION -- 20211217
SELECT 'u0003' AS user_id, '10009' AS item_id, 1639584000 AS time UNION -- 20211216
SELECT 'u0003' AS user_id, '10010' AS item_id, 1639497600 AS time;      -- 20211215

-- 寫入標識分區
INSERT OVERWRITE TABLE aime_example_expose PARTITION (ds = '20210822.done')
SELECT NULL, NULL, NULL;

在智能召回引擎控制臺上注冊數據

進入實例詳情-數據管理頁面,按照如下方式填寫:

image.png

點擊“下一步”,開始配置索引

image.png

點擊“下一步”,開始配置全量調度方式

image.png

點擊“配置完成并上線”,完成注冊并發布

image.png

服務注冊

在實例詳情-服務管理中,點擊“創建召回服務”按鈕,開始創建召回服務。

image.png

服務類型選擇“X2I召回”

image.png

配置服務基礎信息

image.png

配置數據,選擇我們剛才準備好的數據

image.png

配置完成并上線

image.png

進入服務管理,可以看到我們剛才創建的召回服務,等待其發布完成,就可以使用了。