ChatGPT入门教程||ChatGPT 应用场景5:改写已有的内容||ChatGPT 应用场景6:锦上添花——信息解释

ChatGPT 应用场景5:改写已有的内容

场景介绍

除了从 0 生成内容外,你也可以先给 AI 一段已经写好的内容,然后让 AI 对其进行修改,让 AI 帮你将内容改得更好。实际的场景有如:

  1. 翻译:将中文文档翻译成英文,亦或者将英文翻译成中文。关于翻译,我还想强调,像 ChatGPT 除了能翻译人类的语言外,还能翻译编程语言,比如将 Python 代码翻译成 Haskell 代码。
  2. 修改:修改内容的语法,甄别内容里的错别字。
  3. 润色:润色文章,将内容改成另一种风格。

ChatGPT的翻译功能比目前已有的谷歌翻译,百度翻译和bing自带的翻译更加优秀!修改和润色功能在论文修改中也可以起到很大的帮助!

本章重点介绍下润色场景,下面这是个润色的例子。

Prompt(内容来自维基百科):

Please rewrite the following sentences to make them easier to understand.
OpenAI is an American artificial intelligence (AI) research laboratory consisting of the non-profit OpenAI Incorporated (OpenAI Inc.) and its for-profit subsidiary corporation OpenAI Limited Partnership (OpenAI LP). OpenAI conducts AI research with the declared intention of promoting and developing a friendly AI. OpenAI systems run on the fifth most powerful supercomputer in the world.[5][6][7] The organization was founded in San Francisco in 2015 by Sam Altman, Reid Hoffman, Jessica Livingston, Elon Musk, Ilya Sutskever, Peter Thiel and others,[8][1][9] who collectively pledged US$1 billion. Musk resigned from the board in 2018 but remained a donor. Microsoft provided OpenAI LP with a $1 billion investment in 2019 and a second multi-year investment in January 2023, reported to be $10 billion.[10]

请重写下面的句子,使它们更容易理解。

OpenAI是一家美国人工智能(AI)研究实验室,由非盈利的OpenAI Incorporated(OpenAI Inc.)及其营利性子公司OpenAI Limited Partnership(OpenAI-LP)组成。OpenAI进行人工智能研究的目的是促进和开发友好的人工智能。OpenAI系统运行在世界上第五强大的超级计算机上。[5] [6][7]该组织于2015年在旧金山成立,由萨姆·奥尔特曼、里德·霍夫曼、杰西卡·利文斯顿、埃隆·马斯克、伊利亚·萨茨克弗、彼得·蒂尔等人共同认捐10亿美元。马斯克于2018年辞去董事会职务,但仍然是一名捐赠者。微软在2019年向OpenAI LP提供了10亿美元的投资,并在2023年1月提供了第二笔多年投资,据报道为100亿美元。[10]

它的输出是这样的:

OpenAI is a research organization that focuses on artificial intelligence (AI). It has two parts: a non-profit called OpenAI Incorporated and a for-profit subsidiary called OpenAI Limited Partnership. The organization's goal is to create AI that is friendly and beneficial to humans. OpenAI uses one of the most powerful supercomputers in the world for its research. The organization was founded in San Francisco in 2015 by a group of people who pledged a total of $1 billion, including Sam Altman, Reid Hoffman, Jessica Livingston, Elon Musk, Ilya Sutskever, and Peter Thiel. Musk resigned from the board in 2018 but still supports the organization financially. In 2019, Microsoft invested $1 billion in OpenAI LP, and in January 2023, they made a second investment reported to be $10 billion.
OpenAI是一家美国人工智能(AI)研究实验室,由非盈利的OpenAI Incorporated(OpenAI Inc.)及其营利性子公司OpenAI Limited Partnership(OpenAI-LP)组成。该组织的目的是进行人工智能研究,以促进和开发更加友好的人工智能。OpenAI使用全球排名第五的超级计算机来运行其系统。它成立于2015年,在旧金山由萨姆·奥尔特曼、里德·霍夫曼、杰西卡·利文斯顿、埃隆·马斯克、伊利亚·萨茨克弗、彼得·蒂尔等人联合捐赠10亿美元。虽然马斯克在2018年辞去了董事会职务,但仍然是一名捐赠者。微软在2019年向OpenAI-LP投资了10亿美元,并在2023年1月提供了第二笔多年投资,据报道为100亿美元。

ps:虽然看着与原文差不多,ChatGPT给出的内容语法更加口语化,也就更加容易理解。

技巧 4:增加 Role(角色)或人物

前面提到的改写例子,我在 prompt 里加了 Role 让其更易于阅读,这个优化方法是 OK 的。也很常用,比如你想将你写的 Email 改得更商务,则只需要加 business(商务) 相关的词即可。

我再介绍一个更有效的技巧,就是在 prompt 里增加一些 role(角色)相关的内容,让 AI 生成的内容更符合你的需求。

比如还是上面那个重写的例子,我在例子前加入这样的一段话,我让 AI 假设自己是一个小学老师,并且很擅长将复杂的内容转变成 7、8 岁小朋友也能听懂的话,然后再改写这段话:

You are a primary school teacher who can explain complex content to a level that a 7 or 8 year old child can understand. Please rewrite the following sentences to make them easier to understand:

你是一名小学老师,能够将复杂的内容解释到7岁或8岁的孩子能够理解的程度。请改写以下句子,使其更容易理解:

输出就变成了下面这样。不管是用词,还是语法,看起来都更容易懂了。

OpenAI is a place where people work on making computers really smart. It's like a lab where they do research to make computers do amazing things! They want the computers to be really friendly and helpful to people. They use one of the most powerful computers in the world to do this research. A bunch of really rich and smart people gave money to start this lab. One of them is Elon Musk, but he left in 2018. Another really big company, Microsoft, gave them a lot of money too.

 OpenAI是一家研究人工智能的公司,它的目标是让计算机变得更聪明和更友善。他们用世界上最强大的计算机来做这个工作。这家公司由一些很聪明的人创立,他们一起捐了很多钱来支持这个工作。其中有一些人,比如马斯克先生,还继续支持这个工作。微软公司也支持了OpenAI公司,给了他们很多钱来帮助他们继续研究人工智能。

另外除了增加角色外,还能让 AI 模拟某个人,比如让 AI 以 David Foster Wallace 的风格改写上述那段话:

Imagine you are the famous writer David Foster Wallace, please rewrite this sentences.

想象一下你是著名作家大卫·福斯特·华莱士,请重写这句话。

输出是这样的:

As David Foster Wallace, I might rewrite these sentences to sound more like this:

OpenAI is a lab that studies something called artificial intelligence, which is like when computers can do things that normally only humans can do. They have a big computer that's one of the most powerful in the world, and they're trying to make sure the AI they create is friendly and helpful. The lab was started in 2015 in a city called San Francisco, and a bunch of important people gave them a lot of money to do their research. One of those people was Elon Musk, who stopped working there but still gives them money, and Microsoft also gave them a lot of money recently.

如果我是大卫·福斯特·华莱士,我可能会这样写这句话:

OpenAI,是一个人工智能研究实验室,成立于2015年,总部位于旧金山。它的目标是开发和推广友好的人工智能,运行在世界上第五快的超级计算机上。OpenAI由一群爱好者创立,包括埃隆·马斯克等杰出人物。在他们的努力下,OpenAI得到了许多公司和个人的支持,微软更是在2019年投资了10亿美元。

关于这个技巧的应用,以及如何更好地使用 AI 提升写作能力,建议各位阅读 Nat Eliason 的 Using ChatGPT as a Writing Coach,他使用 ChatGPT 辅助其写作,就用到了上述的技巧。 

ChatGPT 应用场景6:锦上添花——信息解释

场景介绍

锦上添花下的第二大的场景是信息解释。它跟改写内容有点像,但又不太一样,信息解释有可能提供超过原文内容的信息。

举几个信息解释的例子,大家应该就能理解了:

  1. 解释代码:比如你看到一段 Python 的代码,但你看不懂,你可以让 AI 解释下代码的含义。
  2. 解释论文:看某篇论文看不懂,或者论文里的某一段看不懂,你也可以让 AI 解释。

以解释代码为例,它的 prompt 是这样的(此案例来自 OpenAI 官方案例):

Explanation of what the code does:

Python 3 
def remove_common_prefix(x, prefix, ws_prefix): 
    x["completion"] = x["completion"].str[len(prefix) :] 
    if ws_prefix: 
        # keep the single whitespace as prefix 
        x["completion"] = " " + x["completion"] 
return x

以下是 ChatGPT 的 Output,它阐述了这段代码是拿来干什么的,同时还阐述了各个参数的含义:

This is a Python function called remove_common_prefix that takes in three parameters: x, prefix, and ws_prefix.

The x parameter is assumed to be a Pandas DataFrame or Series object with a column named "completion", which contains strings that may or may not start with the prefix string.

The prefix parameter is a string that represents the common prefix that needs to be removed from the beginning of each string in the "completion" column of the DataFrame.

The ws_prefix parameter is a Boolean value that indicates whether or not to keep a single whitespace character as a prefix after the common prefix has been removed.

The function modifies the "completion" column of the DataFrame by removing the prefix string from the beginning of each string in that column using the Pandas str method and string slicing. The len(prefix) : syntax is used to slice the string starting from the character that follows the prefix.

If ws_prefix is True, then the function adds a single whitespace character as a prefix to each string in the "completion" column after removing the prefix.

Finally, the modified DataFrame is returned by the function.

猜你喜欢

转载自blog.csdn.net/m0_69824302/article/details/131494703