Tüm Ürünler
Search
Belge Merkezi

MaxCompute:MaxCompute ile çevrimiçi yorumların duygu durumunu analiz etme

Son Güncelleme:Oct 04, 2026

Bu konuda, MaxCompute'te herkese açık bir model kullanarak çevrimiçi yorumlar üzerinde duygu analizi yapma yöntemi gösterilmektedir.

Senaryo

Sosyal medya ve e-ticaret platformlarının hızlı büyümesi, zengin kamuoyu görüşleri ve fikirler içeren kullanıcı tarafından oluşturulan yorumlarda büyük bir artışa neden olmuştur. Duygu analizi; kamuoyu izleme, marka yönetimi ve ürün optimizasyonu için hayati bir araç haline gelmiştir. Bu konu, qwen3.7-max gibi yerleşik herkese açık büyük modellerle MaxCompute içindeki bir AI Function'ı çağırmak için SQL kullanmanın pratik bir örneğini sunar. Bu yöntem, doğrudan duygu sınıflandırması yapmanıza ve yorumlardan coğrafi bilgileri çıkarmanıza olanak tanır. Bu işlem için model dağıtımı, harici hizmetler veya veri taşımaya gerek yoktur. Analizleri güvenli ve kontrollü bir ortamda yaparak analiz verimliliğini ve kolaylığını önemli ölçüde artırabilirsiniz.

Avantajlar

  • MaxCompute'te herkese açık modelleri ve AI Function'ı kullanarak metin duygu analizi gibi karmaşık veri analizi görevlerini model dağıtmadan veya işlev geliştirmeden tamamlayabilirsiniz.

  • Analiz tamamen platform içinde çalıştığından veri geçişi veya harici hizmet gerektirmez; bu sayede veri güvenliği ve uyumluluğu sağlanır.

  • Bu yaklaşım, giriş bariyerini düşürür ve analiz verimliliğini artırır. Statik eşleme tabloları veya düzenli ifadeler gibi geleneksel veri analizi yöntemlerine kıyasla daha yüksek ölçeklenebilirlik, esneklik ve karmaşık ilişkileri yönetme yeteneği sunar. Ayrıca daha kullanıcı dostudur ve bakım maliyetlerini azaltır.

Önkoşullar

MaxCompute'u etkinleştirdiyseniz ve bir MaxCompute projesi oluşturduysanız bu adımı atlayın.

Veri hazırlama

Bu örnekte komutları çalıştırmak için odpscmd istemcisi kullanılmaktadır.

Tablo oluşturma

Tablo oluşturma hakkında daha fazla bilgi için bkz. Tablo oluşturma ve silme:

CREATE TABLE IF NOT EXISTS emotional_comment
(
    content_id      STRING COMMENT 'Comment ID',
    text            STRING COMMENT 'Comment content',
    publish_time    STRING COMMENT 'Comment time',
    user_id         STRING COMMENT 'User ID',
    user_followers  STRING COMMENT 'User follower count',
    user_region     STRING COMMENT 'User region',
    repost_count    STRING COMMENT 'Repost count',
    comment_count   STRING COMMENT 'Comment count',
    quote_count     STRING COMMENT 'Like count'
);

Veri aktarma

Örnek veri dosyasını indirin: demo_comment.csv.

TUNNEL UPLOAD demo_comment.csv emotional_comment;

SELECT * FROM emotional_comment LIMIT 10;

+------------------+----------------------------------------------------+---------------+------------+----------------+-------------+--------------+---------------+-------------+
| content_id       | text                                               | publish_time  | user_id    | user_followers | user_region | repost_count | comment_count | quote_count |
+------------------+----------------------------------------------------+---------------+------------+----------------+-------------+--------------+---------------+-------------+
| 5087a5a3c22e3f4c | The weather is great today, and I'm in a good mood! The sun is shining, perfect for a walk.         | 2025/5/27 12:49 | user_918561 | 132169         | Xi'an      | 1015         | 3197          | 1300        |
| 299aa8f97b6fee2f | The weather is great today, and I'm in a good mood! The sun is shining, perfect for a walk.         | 2025/5/31 07:46 | user_403208 | 669019         | Hohhot  | 6616         | 4876          | 201         |
| e7ee00dec51b28f6 | Technology is advancing rapidly, and AI is changing our lives.                     | 2025/5/17 11:39 | user_291936 | 840757         | Nanning      | 264          | 3668          | 174         |
| 0c0d61608cabbac3 | The prevention and control measures are very effective. Thumbs up to the healthcare workers!                        | 2025/5/18 03:29 | user_154572 | 925604         | Fuzhou      | 2154         | 652           | 470         |
| 106b979787b580d1 | The weather is great today, and I'm in a good mood! The sun is shining, perfect for a walk.         | 2025/5/28 14:45 | user_528807 | 656952         | Qingdao      | 6617         | 3890          | 1275        |
| 05b0e2ef4636d5c9 | Environmental awareness needs to be further improved to protect our planet.              | 2025/5/16 09:06 | user_693289 | 211093         | Foshan      | 4283         | 1592          | 1792        |
| c9773c4a632a8839 | The service at this restaurant is excellent, and the food is delicious. Highly recommended.           | 2025/5/21 19:19 | user_850376 | 817461         | Shenyang      | 9552         | 3974          | 1740        |
| 089e0c5dddc53198 | Environmental awareness needs to be further improved to protect our planet.              | 2025/5/17 10:58 | user_800324 | 716599         | Harbin    | 5725         | 4437          | 939         |
| 04fd7323a957d978 | Education reform measures need more time to show results.                     | 2025/5/26 01:25 | user_544689 | 416372         | Hefei      | 1440         | 4185          | 416         |
| 04cf4066c5c1e9c7 | The service at this restaurant is excellent, and the food is delicious. Highly recommended.           | 2025/5/27 03:49 | user_373334 | 722353         | Changchun      | 1134         | 3936          | 773         |
+------------------+----------------------------------------------------+---------------+------------+----------------+-------------+--------------+---------------+-------------+

Herkese açık modeli görüntüleme

qwen3.7-max herkese açık modelinin ayrıntılarını görüntülemek için aşağıdaki SQL komutunu çalıştırın.

-- Set the flag.
SET odps.namespace.schema=false;

-- View the details of the public model.
DESC MODEL bigdata_public_modelset.`qwen3.7-max`;

+------------------------------------------------------------------------------------+
|                  Model Information                                                 |
+------------------------------------------------------------------------------------+
| Owner:                    RAM$odps@aliyun-inner.com:maxcompute_bigdata_public      |
| Project:                  bigdata_public_modelset                                  |
| Model Name:               qwen3.7-max                                              |
| Model Type:               LLM                                                      |
| Source Type:              REMOTE                                                   |
| Default Version:          v1                                                       |
| CreateTime:               2026-05-25 14:51:41                                      |
| LastModifiedTime:         2026-05-25 14:51:41                                      |
| Model ID:                 724b2d7984f94f9a9e110969514e23e1                         |
| Comment:                  MaxCompute Public LLM Model qwen3.7-max                  |
+------------------------------------------------------------------------------------+
|                Version Information                                                 |
+------------------------------------------------------------------------------------+
| Owner:                    RAM$odps@aliyun-inner.com:maxcompute_bigdata_public      |
| Project:                  bigdata_public_modelset                                  |
| Model Name:               qwen3.7-max                                              |
| Model Type:               LLM                                                      |
| Source Type:              REMOTE                                                   |
| Version Name:             v1                                                       |
| Version ID:               de37f6e4323346ebbcfbed0789194647                         |
| Path:                                                                              |
| CreateTime:               2026-05-25 14:51:41                                      |
| LastModifiedTime:         2026-05-25 14:51:41                                      |
| default_enable_thinking:  TRUE                                                     |
| modelstudio_model_name:   qwen3.7-max                                              |
| price_tier:               {
    "tier1": [0,1024000]
  }                           |
| reasoning_mode:           TRUE                                                     |
+------------------------------------------------------------------------------------+
| Input           | Type       | Comment                                             |
+------------------------------------------------------------------------------------+
+------------------------------------------------------------------------------------+

Veri analizi

Aşağıdaki kod örneği, tek bir SQL sorgusunda iki farklı AI çıkarım görevini aynı anda yapmak üzere MaxCompute'teki AI_GENERATE işlevini halka açık büyük model (qwen3.7-max) ile nasıl kullanacağınızı göstermektedir:

  1. Coğrafi Bilgi Ayrıştırma: Kullanıcının yorumundaki şehir adına (örneğin, "Xi'an") dayanarak eyaleti (örneğin, "Shaanxi Province") otomatik olarak tahmin eder.

  2. Duygu Sınıflandırması: Yorum metni üzerinde duygu analizi yapar ve standartlaştırılmış bir etiket ("positive", "negative" veya "neutral") çıktısı verir.

Daha fazla bilgi için bkz. AI_GENERATE:

-- Use the AI_GENERATE function to call the built-in qwen3.7-max model and generate the province name and sentiment analysis label.
SELECT 
  AI_GENERATE(
    bigdata_public_modelset.`qwen3.7-max`,
    default_version,
    CONCAT(
      'Provide the province where the following city is located. If the city is a municipality or special administrative region, return the city name itself. Output only the province name. City name:',user_region),
    '{"max_tokens": 1000, "temperature": 0.7}'
  ) as province,
  user_region,
  AI_GENERATE(
    bigdata_public_modelset.`qwen3.7-max`,
    default_version,
    CONCAT(
      'Perform sentiment classification on the following comment. The output must be one of these three options: Positive, Negative, Neutral. Comment to analyze:', text),
    '{"max_tokens": 1000, "temperature": 0.7}'
  ) as sentiment_label,
  text
  FROM emotional_comment limit 20
;

+--------------------+----------------+--------------------+----------------------------------------------------+
| province           | user_region    | sentiment_label    | text                                               |
+--------------------+----------------+--------------------+----------------------------------------------------+
| "Shaanxi Province"            | Xi'an          | "Positive"             | The weather is great today, and I'm in a good mood! The sun is shining, perfect for a walk.           |
| "Inner Mongolia Autonomous Region"       | Hohhot      | "Positive"              | The weather is great today, and I'm in a good mood! The sun is shining, perfect for a walk.           |
| "Guangxi"              | Nanning         | "Positive"              | Technology is advancing rapidly, and AI is changing our lives.                      |
| "Fujian Province"            | Fuzhou         | "Positive"              | The prevention and control measures are very effective. Thumbs up to the healthcare workers!                         |
| "Shandong Province"           | Qingdao         | "Positive"              | The weather is great today, and I'm in a good mood! The sun is shining, perfect for a walk.          |
| "Gansu Province"            | Lanzhou         | "Neutral"              | Education reform measures need more time to show results.                      |
| "Fujian Province"            | Fuzhou         | "Positive"              | Technology is advancing rapidly, and AI is changing our lives.                      |
| "Hunan Province"            | Changsha         | "Negative"              | I strongly protest this measure, it's completely unreasonable!                    |
| "Chongqing"                 | Chongqing         | "Positive"              | The prevention and control measures are very effective. Thumbs up to the healthcare workers!                         |
| "Guangdong Province"            | Guangzhou         | "Positive"              | Food safety cannot be ignored; regulation must be stricter.                    |
| "Shaanxi Province"            | Xi'an         | "Negative"              | The stock market has been very volatile lately, so invest with caution.                         |
| "Shandong Province"            | Jinan         | "Positive"              | The weather is great today, and I'm in a good mood! The sun is shining, perfect for a walk.          |
| "Tianjin"                   | Tianjin         | "Positive"              | The new product launch was very successful, looking forward to future developments.                       |
| "Tianjin"                   | Tianjin         | "Positive"              | The weather is great today, and I'm in a good mood! The sun is shining, perfect for a walk.          |
| "Xinjiang"              | Urumqi      | "Negative"             | Housing prices have gone up again, and the pressure on young people to buy a home is increasing.                     |
| "Guangxi"              | Nanning         | "Positive"             | The new product launch was very successful, looking forward to future developments.                       |
| "Qinghai Province"            | Xining         | "Positive"              | The sporting events are spectacular. Let's cheer for the athletes!                        |
| "Heilongjiang Province"          | Harbin        | "Negative"              | The stock market has been very volatile lately, so invest with caution.                        |
| "Heilongjiang Province"          | Harbin        | "Positive"              | The sporting events are spectacular. Let's cheer for the athletes!                        |
| "Jiangsu Province"            | Nanjing         | "Negative"              | The traffic congestion is terrible. I was half an hour late for work, so annoying.             |
+--------------------+----------------+--------------------+----------------------------------------------------+