Artificial Intelligence 12 min read

Review of Alibaba's Tongyi Qianwen AI Model with Sample Code, Recipe, and SWOT Analysis

This article reviews Alibaba's Tongyi Qianwen large language model, shares personal impressions, provides a fish‑flavored pork recipe, conducts a SWOT analysis, and includes Scala Spark and Java code examples illustrating its capabilities and usage scenarios.

Rare Earth Juejin Tech Community
Rare Earth Juejin Tech Community
Rare Earth Juejin Tech Community
Review of Alibaba's Tongyi Qianwen AI Model with Sample Code, Recipe, and SWOT Analysis

Artificial intelligence is experiencing a resurgence, and domestic AI large models are being released one after another; Alibaba's Tongyi Qianwen model was unveiled at the Cloud Summit on April 11, with plans to integrate it across all Alibaba products, starting with DingTalk and Tmall Genie.

A test URL (https://tongyi.aliyun.com/) is provided for users to try the model.

The author shares personal impressions after applying for access, noting the model's interface differs from Baidu's Wenxin Yiyan and ChatGPT by offering topic‑focused modules and a "Treasure Bag" feature.

I am Tongyi Qianwen, a large model specialized in responding to human commands.

The UI includes a "Treasure Bag" that presents highlighted features; the author explores a "Rainbow Praise Expert" module, finding the responses somewhat stiff.

When asked about "鱼香肉丝" (fish‑flavored shredded pork), the model returns a detailed ingredient list and step‑by‑step cooking instructions.

Ingredients: pork, green and red peppers, scallion, ginger, garlic, salt, soy sauce, cooking wine, light soy sauce, sugar, vinegar, starch, sesame oil, etc.

Steps:

Pork is cleaned, sliced, and marinated with salt, soy sauce, and starch for 15 minutes.

Peppers are sliced; scallion, ginger, and garlic are minced.

Heat oil, sauté aromatics.

Add marinated pork, stir‑fry until color changes, then add peppers.

Season with soy sauce, sugar, vinegar, salt, cooking wine, and water; stir evenly.

Finish with a drizzle of sesame oil and garnish with scallions.

A SWOT analysis of the model’s "Treasure Bag" feature is presented:

Strengths:

Generates diverse textual content for individuals and enterprises, accelerating creation.

Produces high‑quality text across languages and cultures.

Offers personalized services tailored to user needs.

Weaknesses:

Requires precise input information to generate correct output.

All relevant data must be supplied, otherwise results may be incomplete.

Potential copyright infringement if generated text closely resembles existing works.

Opportunities:

AI advancement will make such models widely accessible.

Enterprises can boost productivity and revenue using the model.

High accuracy can improve customer satisfaction and drive sales.

Threats:

Automation may threaten human jobs.

Over‑reliance could diminish creativity and writing skills.

Legal disputes may arise from alleged copyright violations.

An example query about post‑pandemic opportunities for traditional manufacturing is shown.

The article then examines the model’s coding abilities, starting with a Scala Spark example for calculating same‑period and month‑over‑month metrics, noting the initial code does not compute the ratio correctly.

import org.apache.spark.sql.functions._
import org.apache.spark.sql.expressions.Window
import org.apache.spark.sql._

val dateColumn = Seq("date").toDF("date")
val timeWindow = dateColumn.withColumn("end_date", "date").over(
  Window.partitionBy("date").orderBy("date")
)

val df = spark.createDataFrame(Seq(("2019-01-01"), ("2019-01-02"), ... ), Seq("id", "date"))
val resultDF = df.groupBy(dateColumn, "id").agg(first("date"), avg("value").as("value"))

resultDF.show()

After feedback that the code lacks the actual ratio calculation, a revised version adds an index column and joins on date and end_date to compute the correct same‑period and month‑over‑month values.

import org.apache.spark.sql.functions._
import org.apache.spark.sql.expressions.Window
import org.apache.spark.sql.types._

val dateColumn = Seq("date").toDF("date")
val timeWindow = dateColumn.withColumn("end_date", "date").over(
  Window.partitionBy("date").orderBy("date")
)

val df = spark.createDataFrame(Seq(("2019-01-01"), ("2019-01-02"), ... ), Seq("id", "date"))
val resultDF = df.groupBy(dateColumn, "id").agg(first("date"), avg("value").as("value"))

val idxWindow = Seq("date", "end_date").toDF("idx", "end_date")
val resultDF2 = resultDF.join(idxWindow, "left_id", "right_id", "date")
resultDF2.show()

Finally, a Java example of bubble sort (often confused with binary search sort) is provided:

public static void bubbleSort(int[] nums) {
    int n = nums.length;
    for (int i = 0; i < n - 1; i++) {
        for (int j = 0; j < n - i - 1; j++) {
            if (nums[j] > nums[j + 1]) {
                int temp = nums[j];
                nums[j] = nums[j + 1];
                nums[j + 1] = temp;
            }
        }
    }
}

The author concludes that the overall experience is decent, notes the model does not support images, and encourages readers to follow the "1点东西" WeChat public account for more AI resources.

JavaArtificial Intelligencelarge language modelSparkScalabubble sortSWOT Analysis
Rare Earth Juejin Tech Community
Written by

Rare Earth Juejin Tech Community

Juejin, a tech community that helps developers grow.

0 followers
Reader feedback

How this landed with the community

login Sign in to like

Rate this article

Was this worth your time?

Sign in to rate
Discussion

0 Comments

Thoughtful readers leave field notes, pushback, and hard-won operational detail here.