This topic describes how to use a MaxCompute remote model to automatically generate E-commerce product descriptions.
Scenario
The rapid growth of E-commerce and live streaming businesses has shortened the photo-to-listing cycle for products. Traditional manual annotation methods rely on the experience and subjective judgment of annotators. These methods are expensive for processing large amounts of data and present challenges in cost and quality control for long-term, large-scale applications. Using AI to process multimodal data is a growing trend. This topic presents a case study on generating image tags and summaries for an E-commerce scenario. This case study demonstrates how to access unstructured data stored in Object Storage Service (OSS) using an Object Table and process the data using a MaxCompute remote model and an AI function.
Advantages
Directly access data stored in OSS using MaxCompute Object Tables, which eliminates the need for complex data migration.
Directly use models that you deploy in Elastic Algorithm Service (EAS) for efficient utilization of model service resources.
Extract and process image data using simple SQL statements with MaxCompute AI functions. This eliminates the need for complex user-defined function (UDF) encapsulation.
Prerequisites
MaxCompute and DataWorks are activated, and a MaxCompute project is created. For more information, see Activate MaxCompute and DataWorks and create a MaxCompute project.
A multimodal large language model (LLM) is deployed in Elastic Algorithm Service (EAS) in the Platform for AI (PAI) console. For more information, see EAS overview.
OSS is activated, and the images to be processed are stored in OSS. For more information, see Activate OSS.
The EAS public endpoint is set as an available external network address for your MaxCompute project. For more information, see Edit external network addresses through project management.
Prepare the data
Upload the E-commerce image data to be processed to OSS. This example uses 50 product poster images from the Alibaba Cloud Tianchi public dataset: Poster Design Text and Image Dataset.
Create an Object Table.
SET odps.namespace.schema=true; -- Enable tenant-level schema syntax. CREATE OBJECT TABLE IF NOT EXISTS image_demo WITH SERDEPROPERTIES ('odps.properties.rolearn'='acs:ram::1393************:role/aliyunodpsdefaultrole') LOCATION 'oss://oss-cn-shanghai-internal.aliyuncs.com/mllm-demo/jpg-test/'; -- Refresh the table to cache the image metadata in MaxCompute. ALTER TABLE image_demo REFRESH METADATA; SELECT COUNT(*) AS ROW_COUNT FROM image_demo; +------------+ | row_count | +------------+ | 50 | +------------+
Create a remote model
Deploy the Omni multimodal model in the PAI console for EAS. Obtain the model service name, access Endpoint, and token.
Register the Omni multimodal remote model in MaxCompute.
CREATE MODEL PAI_EAS_Qwen25_Omni_3B WITH VERSION v1 OPTIONS( MODEL_SOURCE_TYPE = 'REMOTE', MODEL_TYPE = 'MLLM', TASKS = 'text-generation', PAI_EAS_MODEL_NAME = 'Qwen2.5-Omni-3B', PAI_EAS_SERVICE_NAME = 'demo_remote_model', ENDPOINT = 'http://***********.cn-shanghai.pai-eas.aliyuncs.com', APIKEY = 'your-api-key', PAI_EAS_SYNC_MODE = 'true' ) COMMENT "PAI EAS remote model"; ALTER MODEL PAI_EAS_Qwen25_Omni_3B ADD VERSION v2 INPUT(data BINARY, promt STRING) WITH OPTIONS( MODEL_SOURCE_TYPE = 'REMOTE', MODEL_TYPE = 'MLLM', TASKS = 'text-generation', PAI_EAS_MODEL_NAME = 'Qwen2.5-Omni-3B', PAI_EAS_SERVICE_NAME = 'demo_remote_model', ENDPOINT = 'http://************.cn-shanghai.pai-eas.aliyuncs.com', APIKEY = 'your-api-key', PAI_EAS_SYNC_MODE = 'true' ) COMMENT "PAI EAS remote model binary input";View the remote model.
desc model PAI_EAS_Qwen25_Omni_3B; ID = 20250909024319251glhmocwqddl +------------------------------------------------------------------------------------+ | Model Information | +------------------------------------------------------------------------------------+ | Owner: ALIYUN$*********************** | | Project: pd_test_model | | Schema: default | | Model Name: PAI_EAS_Qwen25_Omni_3B | | Model Type: MLLM | | Source Type: REMOTE | | Default Version: v1 | | CreateTime: 2025-09-04 10:29:28 | | LastModifiedTime: 2025-09-09 10:43:11 | | Model ID: 46311b6397494a84ad23c5a4******** | | Comment: PAI EAS remote model url input | +------------------------------------------------------------------------------------+ | Version Information | +------------------------------------------------------------------------------------+ | Owner: ALIYUN$*********************** | | Project: pd_test_model | | Schema: default | | Model Name: PAI_EAS_Qwen25_Omni_3B | | Model Type: MLLM | | Source Type: REMOTE | | Version Name: v1 | | Version ID: c389823cd0324b72b1c0d55*********** | | Path: | | CreateTime: 2025-09-04 10:29:28 | | LastModifiedTime: 2025-09-04 10:29:28 | | apikey: Yzc4*******mNzFkMGM********4YzEwZjY1NTA*********NzkyNw== | | endpoint: http://13933481********.cn-shanghai.pai-eas.aliyuncs.com | | pai_eas_model_name: Qwen2.5-Omni-3B | | pai_eas_service_name: demo_eas_model | | pai_eas_sync_mode: true | | remote_service_type: PAI-EAS | +------------------------------------------------------------------------------------+ | Input | Type | Comment | +------------------------------------------------------------------------------------+ +------------------------------------------------------------------------------------+ OK
Analyze the data
Use the MaxCompute AI_GENERATE function to classify images and generate descriptive summaries.
SET odps.namespace.schema=true;
SELECT
key,
AI_GENERATE(
PAI_EAS_Qwen25_Omni_3B, v1, image_url,
"Recognize and extract the product category from the E-commerce product sales poster. The result must be one of the following six options: Cosmetics, Apparel, Daily Necessities, Food, Other, Electronics. Do not include any other text or information."
) as item_catagory,
AI_GENERATE(
PAI_EAS_Qwen25_Omni_3B, v1, image_url,
"You are a professional E-commerce copywriter. Generate a product description summary based on the provided E-commerce product sales poster. Output requirements: 1. The summary must accurately reflect key information from the poster, such as product features and promotional details. 2. The language must be fluent and readable, without any special symbols or garbled characters, and no longer than 50 characters. 3. The description must be in Chinese, except for English brand names. Do not include any other English words. Example: Limited-time offer on pure cotton T-shirts, buy one get one free, only 3 days left in the event!"
) as item_description
from (
select GET_SIGNED_URL_FROM_OSS(
'pd_test_model.default.image_demo', key, 604800
) as image_url, key as key
from pd_test_model.default.image_demo
) Limit 10;
ID = 2025090909524183gsu********
Log view:
https://logview.alibaba-inc.com/logview/?h=http://server-ip:8008/daily&p=pd_test_model&i=2025********4183gsuq57sqddl&token=********
----------------------------------------------------------------------------------------------
STAGES STATUS TOTAL COMPLETED RUNNING PENDING BACKUP
M1_job_0 ................. TERMINATED 1 1 0 0 0
----------------------------------------------------------------------------------------------
STAGES: 01/01 [==========================>>] 100% ELAPSED TIME: 11.65 s
----------------------------------------------------------------------------------------------
+--------------------+-------------------+---------------------------------------------------------------------------------------------------------------------------------+
| key | item_catagory | item_description |
+--------------------+-------------------+---------------------------------------------------------------------------------------------------------------------------------+
| alimamazszw-1.jpg | Food | Limited-time offer on steakhouse beef. Place an order to receive a gift. Served with fresh basil. A delicious experience not to be missed. |
| alimamazszw-10.jpg | Electronics | New-feature fan on limited-time sale. Lowest price ever. Come and buy now! |
| alimamazszw-11.jpg | Electronics | Cool helmets for sale online with MIPS protection technology. Get an instant discount of CNY 270, bringing the price to CNY 729. Limited-time event. Don't miss out! |
| alimamazszw-12.jpg | Cosmetics | misspiggy "Ultra-fine Silky" eyeliner gel pencil. Soft, smooth, and long-lasting without smudging. Buy two and get CNY 10 off. Limited-time offer. Act now. |
| alimamazszw-13.jpg | Electronics | Special sale on IX35 wipers. Today's special offer. Buy now. |
| alimamazszw-14.jpg | Daily Necessities | Biological tissue glue from Beijing Yoshida Biological Protection Technology Co., Ltd. Can seal wounds. For animal experiments only. Valid for 1 year. |
| alimamazszw-15.jpg | Cosmetics | BodyAid hair growth serum. Awakens hair follicles, nurtures the scalp, and promotes new growth. |
| alimamazszw-16.jpg | Cosmetics | Limited-time offer on 3CE vitality blush. Buy one, get one free. Endless surprises on carnival day. |
| alimamazszw-17.jpg | Cosmetics | La Mer HR skin cream in black and white packaging. Six-piece set with six great gifts. Order now and get gifts worth CNY 2340. SF Express delivery. Limited-time offer. Limited quantity. |
| alimamazszw-18.jpg | Daily Necessities | Listerine mouthwash in various flavors on sale. A CNY 30 coupon is available. Limited quantity. Buy now! |
+--------------------+-------------------+---------------------------------------------------------------------------------------------------------------------------------+
-- If reading BINARY data.
SELECT
key,
AI_GENERATE(
PAI_EAS_Qwen25_Omni_3B, v2, image_binary,
"Recognize and extract the product category from the E-commerce product sales poster. The result must be one of the following six options: Cosmetics, Apparel, Daily Necessities, Food, Other, Electronics. Do not include any other text or information."
) as item_catagory,
AI_GENERATE(
PAI_EAS_Qwen25_Omni_3B, v2, image_binary,
"You are a professional E-commerce copywriter. Generate a product description summary based on the provided E-commerce product sales poster. Output requirements: 1. The summary must accurately reflect key information from the poster, such as product features and promotional details. 2. The language must be fluent and readable, without any special symbols or garbled characters, and no longer than 50 characters. 3. The description must be in Chinese, except for English brand names. Do not include any other English words. Example: Limited-time offer on pure cotton T-shirts, buy one get one free, only 3 days left in the event!"
) as item_description
from (
select GET_DATA_FROM_OSS(
'pd_test_model.default.image_demo', key
) as image_binary, key as key
from pd_test_model.default.image_demo
) Limit 10;