I was shocked by Ali's general meaning and thousands of questions

"A hundred flowers bloom, a hundred schools of thought contend"

Artificial intelligence has set off another upsurge, and recently domestic AI large-scale models have been released. After technology giants such as Baidu, 360, and SenseTime released their respective large models, Alibaba's "Tongyi Qianwen" large model also appeared at the cloud summit on April 11. According to reports, Ali Dharma Institute has started the research and development of Chinese large-scale models in 2019. It has to be said that these big factories stand high and look far away, and they will be left behind if they are not careful.

Zhang Yong, chairman and CEO of Alibaba Group and CEO of Alibaba Cloud Intelligence Group, said that in the future, all Alibaba products will be connected to the large model of "Tongyi Qianwen" for a comprehensive transformation. It is reported that DingTalk and Tmall Genie will take the lead in accessing the Tongyi Qianwen test, and officially release new functions after evaluation and certification.

Let’s test the address of the official website first: tongyi.aliyun.com/

I applied on the same day, and within a few days, the good news came

image.png

Let’s talk about Tongyi Qianwen’s AI experience today

I am Tongyi Qianwen, a large model that responds to human instructions

image.png

The landing page that comes in first has a different layout from Baidu’s Wenxin Yiyan and ChatGPT. It has some more topic-focused modules, allowing users to directly enter this module to get the answers they want. This is one of them, let's look down and there is a treasure bag:

image.png

Here is the bright spot, let’s not talk about whether it is useful or not, anyway, it is quite eye-catching, let’s go to Rainbow Fart Expert to see what kind of "expert" it is

image.png

I can only hehe, it feels very blunt! ! !

image.png

Enter "fish-flavored shredded pork", answer

Fish-flavored shredded pork dishes

所需食材:
-瘦猪肉丝 250克
-青椒 50克
-红椒 50克
-葱 30克
-姜 10克
-大蒜 10克
-盐 适量
-酱油 适量
-料酒 适量
-生抽 适量
-白糖 适量
-香醋 适量
-生姜 适量
-大蒜 适量
-淀粉 适量
-香油 适量

具体步骤:

  1. 猪肉洗净切细丝,加入盐、酱油、淀粉搅拌均匀腌制15分钟。
  2. 青红椒去蒂去籽切细丝,葱姜蒜切末备用。
  3. 热锅冷油加入葱姜蒜爆香。
  4. 加入腌制好的肉丝煸炒至变色,加入青红椒丝翻炒。
  5. 加入生抽、白糖、香醋、盐、料酒、适量清水翻炒均匀。
  6. 最后滴入香油,撒上葱花即可。

完整做法:

  1. 猪肉洗净切细丝,加入盐、酱油、淀粉搅拌均匀腌制15分钟。
  2. 青红椒去蒂去籽切细丝,葱姜蒜切末备用。
  3. 热锅冷油加入葱姜蒜爆香。
  4. 加入腌制好的肉丝煸炒至变色,加入青红椒丝翻炒。
  5. 加入生抽、白糖、香醋、盐、料酒、适量清水翻炒均匀。
  6. 最后滴入香油,撒上葱花即可。

SWOT分析

百宝袋中SWOT分析值得去问问,去跟他聊聊

image.png

优势:

  1. GPT 可以为个人或企业生成各种文本内容,包括文章、广告、电子邮件、网页等。这种自动化工具可以加速文本生成,减少创作时间,同时可以减少错误率。
  2. GPT 可以在语言和文化领域生成高质量的文本,使得文本的语言、文化和主题更加准确。
  3. GPT 可以根据个人或企业的需求生成文本,提供个性化的服务,使得客户更容易接受产品或服务。

劣势:

  1. 在使用 GPT 生成文本时,需要输入相应的信息,否则 GPT 无法生成正确的文本。
  2. 需要将所有的信息输入到 GPT 中,否则 GPT 将无法为用户生成所需的文本。
  3. 如果生成的文本与其他人的文本存在很大的相似性,可能会被视为侵权。

机会:

  1. 随着人工智能技术的不断发展,GPT 将成为一个普及化的工具,使得更多的人可以使用它来生成文本。
  2. 对于企业来说,使用 GPT 可以提高生产效率和生产力,从而增加收益。
  3. 由于 GPT 的生成文本准确度高,因此可以提高客户的满意度,从而促进销售。

威胁:

  1. 由于 GPT 可以快速生成文本,因此可能会对人类的工作造成威胁。
  2. 使用 GPT 可能会导致人们的创造力和创作能力下降,因为人们可能会将生成文本作为一个机械的过程。
  3. 如果 GPT 的生成文本可能会被认为是侵权的,那么使用 GPT 可能会导致法律纠纷

我们用官方的示例,“在疫情后时代中,传统制造业的机会在哪里

image.png

我们再来看下编码能力

这里就不粘贴图片了,我们用对话的形式将编码能力写下来,我们感受下:

Q: scala spark中如何计算同环比

A: 同环比是指在时间范围内,同一组的数值比较,以及环比是指相对于前一个时间的变化。 在 Scala Spark 中,可以通过 `filter()` 函数和 `map()` 函数来实现同环比的计算。 假设有一个数据集是按天分区的,其中有一列是日期。现在想要计算相邻两天的同环比,可以按照以下步骤:

1.  创建一个时间窗口,按照日期分区。
2.  将数据集分成若干个子集,每个子集包含相邻的两天。
3.  对每个子集执行上述计算,得到每组的同环比。

示例代码如下:

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"), ("2019-01-03"), ("2019-01-04"), ("2019-01-05"), ("2019-01-06"), ("2019-01-07"), ("2019-01-08"), ("2019-01-09"), ("2019-01-10"), ("2019-01-11"), ("2019-01-12"), ("2019-01-13"), ("2019-01-14"), ("2019-01-15"), ("2019-01-16"), ("2019-01-17"), ("2019-01-18"), ("2019-01-19"), ("2019-01-20"), ("2019-01-21"), ("2019-01-22"), ("2019-01-23"), ("2019-01-24"), ("2019-01-25"), ("2019-01-26"), ("2019-01-27"), ("2019-01-28"), ("2019-01-29"), ("2019-01-30"), ("2019-01-31")), Seq("id", "date"))
val resultDF = df.groupBy(dateColumn, "id").agg(first("date"), avg("value").as("value"))

resultDF.show()


输出结果:

+---+----------------+---------+
| id|     date       | value|
+---+----------------+---------+
| 2019-01-01| 2019-01-01   |      5|
| 2019-01-02| 2019-01-02   |      5|
| 2019-01-03| 2019-01-03   |      2|
| 2019-01-04| 2019-01-04   |      3|
| 2019-01-05| 2019-01-05   |      3|
| 2019-01-06| 2019-01-06   |      1|
| 2019-01-07| 2019-01-07   |      2|
| 2019-01-08| 2019-01-08   |      1|
| 2019-01-09| 2019-01-09   |      1|
| 2019-01-10| 2019-01-10   |      0|
| 2019-01-11| 2019-01-11   |      0|
| 2019-01-12| 2019-01-12   |      1|
| 2019-01-13| 2019-01-13   |      1|
| 2019-01-14| 2019-01-14   |      0|
| 2019-01-15| 2019-01-15   |      0|
| 2019-01-16| 2019-01-16   |      1|
| 2019-01-17| 2019-01-17   |      0|
| 2019-01-18| 2019-01-18   |      0|
| 2019-01-19| 2019-01-19   |      1|
| 2019-01-20| 2019-01-20   |      1|
| 2019-01-21| 2019-01-21   |      0|
| 2019-01-22| 2019-01-22   |      0|
| 2019-01-23| 2019-01-23   |      1|
| 2019-01-24| 2019-01-24   |      0|
| 2019-01-25| 2019-01-25   |      0|
| 2019-01-26| 2019-01-26   |      1|
| 2019-01-27| 2019-01-27   |      0|
| 2019-01-28| 2019-01-28   |      0|
| 2019-01-29| 2019-01-29   |      0|
| 2019-01-30| 2019-01-30   |      0|
| 2019-01-31| 2019-01-31   |      0|
+---+----------------+---------+
复制代码

发现他并没有计算同环比,接着问:

Q: 并没有计算同环比啊

A: 感谢您指出这个问题。在原来的代码中,我们只计算了相邻两天的差值,没有考虑相邻两天的环比增长。在计算同环比时,需要将每组数据的相邻两天也考虑进去,所以需要加入一个时间窗口来保存每组数据的相邻两天。 修改后的代码如下:


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"), ("2019-01-03"), ("2019-01-04"), ("2019-01-05"), ("2019-01-06"), ("2019-01-07"), ("2019-01-08"), ("2019-01-09"), ("2019-01-10"), ("2019-01-11"), ("2019-01-12"), ("2019-01-13"), ("2019-01-14"), ("2019-01-15"), ("2019-01-16"), ("2019-01-17"), ("2019-01-18"), ("2019-01-19"), ("2019-01-20"), ("2019-01-21"), ("2019-01-22"), ("2019-01-23"), ("2019-01-24"), ("2019-01-25"), ("2019-01-26"), ("2019-01-27"), ("2019-01-28"), ("2019-01-29"), ("2019-01-30"), ("2019-01-31")), 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()
复制代码

在这个代码中,我们在 timeWindow 中新增了一列 idx 表示相邻两天的索引,并将 date 列和 end_date 列进行了索引。然后,我们使用这两个索引进行了 join 操作,以计算同环比。 需要注意的是,由于我们使用的是 date 列作为分区键,所以 end_date 列是按照日期排序的。因此,我们需要在计算同环比之前,先按日期排序每个子集,以保证同环比的值是连续的。

再问下java

Q:java 实现二分法排序

以下是 Java 实现二分查找排序的示例代码:

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;
            }
        }
    }
}
复制代码

This implementation uses a double loop to compare adjacent elements and shift the smaller element back one position. In each round of comparison, the largest element will be kept and the smallest element will be replaced by its next element. So the final sorted array will be in ascending order. Similarly, if you need to use binary search to sort an array, you can use a similar method to achieve it. It should be noted that since the time complexity of this sorting algorithm is O(n^2), when dealing with large data sets, other algorithms may need to be used to optimize performance.

Summarize:

Overall it's ok, not that disappointing, one more thing, pictures are not supported, yes

We share here today, you can also search the WeChat public account "1dianshi", there will be a lot of AI information, thank you for liking and following.

Recently, I have been writing AIGPT-like things, which are included in the AI ​​column below, and will continue to be output in the future.

Guess you like

Origin juejin.im/post/7225632029798236216