Topik ini menjelaskan cara membuat model pengurutan kustom menggunakan OpenSearch Industry Algorithm Edition.
Prosedur
Di halaman Manajemen Fitur pada konsol OpenSearch Industry Algorithm Edition, buat fitur bidang. Dalam contoh ini, tabel system_item digunakan. Jika fitur yang diperlukan tidak terdaftar di tabel system_item, Anda dapat mendaftarkannya di tabel MaxCompute eksternal. Sebagai contoh, buat fitur berikut untuk bidang judul: custom_title, custom_title_match, dan custom_title_len. Buat fitur untuk bidang lainnya dengan cara serupa. Anda dapat menambahkan fitur sesuai kebutuhan bisnis Anda. Dalam contoh ini, bidang dalam model laju klik-tayang (CTR) digunakan.

Gunakan fitur bawaan yang tercantum di tabel system_internal bersamaan dengan fitur bidang yang dibuat di Langkah 1 untuk melakukan pembuatan fitur.
Dalam contoh ini, proses pembuatan fitur umum dari model CTR digunakan. Anda dapat memanggil operasi CreateFunctionResource untuk mendaftarkan beberapa fitur sekaligus.
Atur parameter ResourceType menjadi feature_generator, dan tentukan informasi berikut untuk parameter Data. Fitur input yang namanya dimulai dengan custom_ harus disiapkan terlebih dahulu. Anda dapat membuat fitur tersebut di halaman Manajemen Fitur pada Langkah 1.
[
{
"input": {
"features": [
{
"type": "user",
"name": "system_raw_q_ultra"
},
{
"type": "item",
"name": "system_item_id"
}
]
},
"generator": "combo",
"output": "comb_q_nid"
},
{
"input": {
"features": [
{
"type": "user",
"name": "system_user_id"
},
{
"type": "item",
"name": "system_item_id"
}
]
},
"generator": "combo",
"output": "comb_uid_nid"
},
{
"input": {
"features": [
{
"type": "user",
"name": "system_user_id"
},
{
"type": "item",
"name": "custom_tags"
}
]
},
"generator": "combo",
"output": "comb_uid_tags"
},
{
"input": {
"features": [
{
"type": "user",
"name": "system_raw_q_ultra"
},
{
"type": "item",
"name": "custom_tags"
}
]
},
"generator": "combo",
"output": "comb_q_tags"
},
{
"input": {
"features": [
{
"type": "user",
"name": "system_exp_time"
}
]
},
"generator": "id",
"output": "exp_time"
},
{
"input": {
"features": [
{
"type": "user",
"name": "system_terms2"
}
]
},
"generator": "id",
"output": "terms2"
},
{
"input": {
"features": [
{
"type": "user",
"name": "system_raw_q_ultra"
}
]
},
"generator": "id",
"output": "raw_q_ultra"
},
{
"input": {
"features": [
{
"type": "user",
"name": "system_user_id"
}
]
},
"generator": "id",
"output": "user_id"
},
{
"input": {
"features": [
{
"type": "item",
"name": "system_item_id"
}
]
},
"generator": "id",
"output": "item_id"
},
{
"input": {
"features": [
{
"type": "item",
"name": "custom_description"
}
]
},
"generator": "id",
"output": "description"
},
{
"input": {
"features": [
{
"type": "item",
"name": "custom_desc_len"
}
]
},
"generator": "id",
"output": "desc_len"
},
{
"input": {
"features": [
{
"type": "item",
"name": "custom_title"
}
]
},
"generator": "id",
"output": "title"
},
{
"input": {
"features": [
{
"type": "item",
"name": "custom_title_len"
}
]
},
"generator": "id",
"output": "title_len"
},
{
"input": {
"features": [
{
"type": "item",
"name": "custom_category"
}
]
},
"generator": "id",
"output": "category"
},
{
"input": {
"features": [
{
"type": "item",
"name": "custom_tags"
}
]
},
"generator": "id",
"output": "tags"
},
{
"input": {
"features": [
{
"type": "item",
"name": "system_all_nid_ctr_30"
}
]
},
"generator": "id",
"output": "all_nid_ctr_30"
},
{
"input": {
"features": [
{
"type": "item",
"name": "system_all_nid_ctr_7"
}
]
},
"generator": "id",
"output": "all_nid_ctr_7"
},
{
"input": {
"features": [
{
"type": "item",
"name": "system_all_nid_ctr_1"
}
]
},
"generator": "id",
"output": "all_nid_ctr_1"
},
{
"input": {
"features": [
{
"type": "item",
"name": "system_all_nid_pv_30"
}
]
},
"generator": "id",
"output": "all_nid_pv_30"
},
{
"input": {
"features": [
{
"type": "item",
"name": "system_all_nid_pv_7"
}
]
},
"generator": "id",
"output": "all_nid_pv_7"
},
{
"input": {
"features": [
{
"type": "item",
"name": "system_all_nid_pv_1"
}
]
},
"generator": "id",
"output": "all_nid_pv_1"
},
{
"input": {
"features": [
{
"type": "item",
"name": "system_all_nid_ipv_30"
}
]
},
"generator": "id",
"output": "all_nid_ipv_30"
},
{
"input": {
"features": [
{
"type": "item",
"name": "system_all_nid_ipv_7"
}
]
},
"generator": "id",
"output": "all_nid_ipv_7"
},
{
"input": {
"features": [
{
"type": "item",
"name": "system_all_nid_ipv_1"
}
]
},
"generator": "id",
"output": "all_nid_ipv_1"
},
{
"input": {
"features": [
{
"role": "map",
"type": "item",
"name": "custom_title_match"
},
{
"role": "key",
"type": "user",
"name": "system_terms2"
}
]
},
"generator": "lookup",
"output": "term_title_match"
},
{
"input": {
"features": [
{
"role": "map",
"type": "item",
"name": "custom_desc_match"
},
{
"role": "key",
"type": "user",
"name": "system_terms2"
}
]
},
"generator": "lookup",
"output": "term_desc_match"
},
{
"input": {
"features": [
{
"role": "map",
"type": "item",
"name": "custom_tags_match"
},
{
"role": "key",
"type": "user",
"name": "system_terms2"
}
]
},
"generator": "lookup",
"output": "term_tags_match"
},
{
"input": {
"features": [
{
"role": "map",
"type": "item",
"name": "system_qterm_match_decay"
},
{
"role": "key",
"type": "user",
"name": "system_terms2"
}
]
},
"generator": "lookup",
"output": "term_os_kw_match"
},
{
"input": {
"features": [
{
"type": "item",
"name": "system_query_cnt"
}
]
},
"generator": "id",
"output": "opensearch_query_cnt"
},
{
"input": {
"features": [
{
"type": "item",
"name": "system_qterm_cnt"
}
]
},
"generator": "id",
"output": "opensearch_qterm_cnt"
},
{
"input": {
"features": [
{
"role": "map",
"type": "item",
"name": "system_query_ctr_decay"
},
{
"role": "key",
"type": "user",
"name": "system_raw_q_ultra"
}
]
},
"generator": "lookup",
"output": "os_q_ctr_decay"
},
{
"input": {
"features": [
{
"role": "map",
"type": "item",
"name": "system_qterm_ctr_decay"
},
{
"role": "key",
"type": "user",
"name": "system_terms2"
}
]
},
"generator": "lookup",
"output": "os_term_ctr_decay"
},
{
"input": {
"features": [
{
"role": "map",
"type": "item",
"name": "system_query_ctr_decay"
},
{
"role": "key",
"type": "user",
"name": "system_raw_q_ultra"
}
]
},
"generator": "lookup",
"output": "os_q_ctr_decay_nokey"
},
{
"input": {
"features": [
{
"role": "map",
"type": "item",
"name": "system_qterm_ctr_decay"
},
{
"role": "key",
"type": "user",
"name": "system_terms2"
}
]
},
"generator": "lookup",
"output": "os_term_ctr_decay_nokey"
},
{
"input": {
"features": [
{
"type": "item",
"name": "system_query_seq_decay"
}
]
},
"generator": "id",
"output": "os_q_seq_decay"
},
{
"input": {
"features": [
{
"type": "item",
"name": "system_qterm_seq_decay"
}
]
},
"generator": "id",
"output": "os_term_seq_decay"
},
{
"input": {
"features": [
{
"role": "query",
"type": "user",
"name": "system_terms2"
},
{
"role": "title",
"type": "item",
"name": "system_qterm_seq_decay"
}
],
"method": "query_common_ratio"
},
"generator": "overlap",
"output": "os_qterm_q_common_ratio"
},
{
"input": {
"features": [
{
"role": "query",
"type": "user",
"name": "system_terms2"
},
{
"role": "title",
"type": "item",
"name": "system_qterm_seq_decay"
}
],
"method": "title_common_ratio"
},
"generator": "overlap",
"output": "os_qterm_title_common_ratio"
},
{
"input": {
"features": [
{
"role": "query",
"type": "user",
"name": "system_terms2"
},
{
"role": "title",
"type": "item",
"name": "custom_title"
}
],
"method": "query_common_ratio"
},
"generator": "overlap",
"output": "title_q_common_ratio"
},
{
"input": {
"features": [
{
"role": "query",
"type": "user",
"name": "system_terms2"
},
{
"role": "title",
"type": "item",
"name": "custom_title"
}
],
"method": "title_common_ratio"
},
"generator": "overlap",
"output": "title_title_common_ratio"
},
{
"input": {
"features": [
{
"role": "query",
"type": "user",
"name": "system_terms2"
},
{
"role": "title",
"type": "item",
"name": "custom_description"
}
],
"method": "query_common_ratio"
},
"generator": "overlap",
"output": "desc_q_common_ratio"
},
{
"input": {
"features": [
{
"role": "query",
"type": "user",
"name": "system_terms2"
},
{
"role": "title",
"type": "item",
"name": "custom_description"
}
],
"method": "title_common_ratio"
},
"generator": "overlap",
"output": "desc_title_common_ratio"
},
{
"input": {
"features": [
{
"type": "user",
"name": "system_term_seq_length"
}
],
"dimension": 1
},
"generator": "raw",
"output": "term_seq_length"
}
]Setelah fitur dibuat, Anda dapat mengonfigurasinya di halaman deskripsi fitur yang sesuai.

Fitur-fitur telah dibuat. Untuk menggunakan fitur-fitur tersebut, Anda harus menentukan fitur-fitur di dalam kode model.
Buat deskripsi model.
Setelah menyelesaikan langkah-langkah yang dijelaskan di bagian Memulai dengan Model Pengurutan Kustom topik "Panduan Pengembang untuk Model Pengurutan Kustom", Anda dapat memodifikasi fitur yang ingin digunakan. Dalam banyak kasus, parameter embedding_columns digunakan.

Tentukan deskripsi fitur dan deskripsi model saat membuat model pengurutan kustom.

Setelah model pengurutan kustom dibuat dan dilatih, Anda dapat menggunakannya di Cava dengan cara yang sama seperti model CTR. Anda dapat menjalankan Uji A/B untuk menguji kinerja model sebelum mempublikasikannya.