AI Prompt Engineering

From LemonWiki共筆
Jump to navigation Jump to search

Tips of ChatGPT prompts


Most Popular ChatGPT Prompts

Most Popular ChatGPT Prompts And How To Improve Them https://www.forbes.com/sites/tjmccue/2023/02/26/most-popular-chatgpt-prompts-and-how-to-improve-them/?sh=45a8fee73064

  1. 你能為我總結一下這篇文章/文本嗎?
  2. 你能把這個短語/句子翻譯成[語言]嗎?
  3. [詞/短語]的定義是什麼?
  4. 你能告訴我一個笑話嗎?
  5. 誰是[人/歷史人物]?
  6. 你能就[話題]寫一篇有說服力的文章嗎?
  7. 你能提供有關[主題/話題]的訊息嗎?
  8. 你能就[主題]創作一首詩/歌詞嗎?
  9. 我如何[解決問題/執行任務]?
  10. 你能幫助我完成作業嗎?

Act as somebody

(1) 聊天機器人扮演怎樣的角色、(2) 我會輸入怎樣的資料、(3) 期待機器人回覆的資料

I want you to act as a prompt generator. Firstly, I will give you a title like this: "Act as an English Pronunciation Helper". Then you give me a prompt like this: "I want you to act as an English pronunciation assistant for Chinese speaking people. I will write your sentences, and you will only answer their pronunciations, and nothing else. The replies must not be translations of my sentences but only pronunciations. Pronunciations should use Chinese letters for phonetics. Do not write explanations on replies. My first sentence is "how the weather is in Istanbul?"." (You should adapt the sample prompt according to the title I gave. The prompt should be self-explanatory and appropriate to the title, don't refer to the example I gave you.). My first title is "Act as a Code Review Helper" (Give me prompt only)

Auto text summarization

文章自動摘要

  • Summarize: 接上要摘要的文章
  • 或 summary the following: 接上要摘要的文章
  • 或 Summarize the article: 接上要摘要的文章
  • 或 「Summarize the following text as if you are Richard Feynman: 接上要摘要的文章[1]
  • 或 提供以下文章的中文摘要:: 接上要摘要的文章
  • 或 提供以下文章的摘要,請用繁體中文回答:接上要摘要的文章

萃取出列點式重點

  • 從文章中,整理十句重點:接上原始的文章
  • 或 幫我列點方式總結這篇文章:接上原始的文章

Icon_exclaim.gif 不成功的嘗試:

  • 組合技 Summarize the following and translate into Traditional Chinese:
  • Summarize the article in bullet points: 結果有摘要,但是沒有列點方式呈現結果 [Last visited: 2023-02-27]

Convert the response to json

  • 目的:將機器人的結果可以更結構化,減少後續資料清理的功
  • 提示:「... And put your response into a JSON with keys "aaa", "bbb", "ccc":」、「分析底下這句話,直接以 JSON 回傳抓取到的資訊 ,包含 ...」[2]

修改前

Human: Write 10 keywords, sentiment and Named entity recognition for following article: 
今天台北天氣真好,希望可以不用上班
AI: Keywords: Taipei, Weather, Work, Today. Sentiment: Positive. Named Entity Recognition: Taipei, Work.

修改後

Human: Write 10 keywords, sentiment and Named entity recognition for following article. And put your response into a JSON with keys "keywords", "sentiment", "entity":

今天台北天氣真好,希望可以不用上班
AI:
{
    "keywords": ["Taipei", "weather", "not working", "today"], 
    "sentiment": "positive", 
    "entity": ["Taipei", "today"]
}
AI: I am an AI created by OpenAI. How can I help you today?
Human: 分析底下這句話,直接以 JSON 回傳抓取到的資訊 ,包含 出發站(Departure)、到達站(arrival)、票種(TickeType)、數量 (Amount)、出發時間 (DepartureTime)。•我爱從台北到高雄的自由座三張,下午1:30出發。還有爾張優待票,去合中的,2:30出發
AI: { "Departure": "Taipei",  "Arrival": "Kaohsiung",  "TicketType": "Freedom Seats", "Amount": 3, "DepartureTime": "1:30 PM" }, { "TicketType": "Discounted", "Departure": "Hecheng", "DepartureTime": "2:30 PM" }

Clarify a question

  • 目的:同時扮演辯論隊的正方與反方
  • 效果:找 AI 機器人同時當辯論隊的正方與反方的角色。感覺機器人還不是很理解「辯論」,陳述的方式也還好,也許需要再跟機器人詳細說明如何陳述論點。
  • 提示:「這是一場辯論比賽,主題關於人類世界是否該使用核能發電,接下來請正方提出論點,反方需要攻擊正方的論點」[3]
  • 範例:
你參與農曆春節制度的辯論,有支持農曆春節制度的正方辯論隊,以及反對農曆春節制度的反方辯論隊。總共有四個階段:

第一階段:你要扮演正方辯論隊隊員,你要提出支持農曆春節制度的三個論點。論點的格式是「我支持這個制度,理由是什麼?」

第二階段:你要扮演反方辯論隊隊員,你要質詢正方觀點內最多三個問題。質詢論點的格式是「我質詢正方觀點內的問題,理由是什麼?」

第三階段:你要扮演正方辯論隊隊員,回答第二階段反方辯論隊隊員提出的質詢。回答的格式是「我反對反方的質詢,理由是什麼?」

第四階段:你要扮演辯論的裁判,整理正方與反方的三個重點,並且決定正方或反方哪一個觀點比較好?

Convert a transcript into article

將採訪逐字稿,轉成通順的文章(加上標點符號)

  • Convert the transcript into article: 接上文章
  • 或 Convert the transcript into a blog article: 接上文章
  • 或 幫我整理成通順的文章: 接上文章[4]

將採訪逐字稿,轉成通順的文章(加上標點符號),並且摘要重點

  • 「summarize the transcript into a fluent article:接上文章


Convert to table

Prompt:

  • "Convert to table: 接上文章"[5]
  • 或「請將下面文章整理成表格,欄位是 (1) 欄位接上文章

Draft of email writing

Example: Generate a business email

輸入:「擬定商業 email」[6]

Example

Generate a business email:

Please inform Henny to schedule a meeting next Monday morning in Kaohsiung. We will discuss the business plan for next year and strategies to achieve a 87% growth in the business. Following the meeting, let's plan to have a delicious Shantou Hotpot lunch.
擬定商業 email:

告訴韓總經理下週一在高雄開會,討論明年公司的營運計畫,KPI 預計要成長 87%。開會後吃汕頭火鍋店火鍋。

Example: How to write an email with different emotional expression

輸入[7]

你有份文件,需要請客戶在三天內交付,否則會面臨違約的風險。
請協助寫三種版本的 email 內容
1. 用客氣委婉的口吻表達
2. 用中性不帶情緒的口吻表達
3. 用強烈帶著激動情緒的口吻表達

English conversation practice

英文會話練習。輸入

I would like you to serve as my English conversation teacher, and I will provide the location for our conversation. During our session, you will ask me three questions related to the location, and our conversation will conclude once we have discussed all three questions. After our conversation, I would appreciate it if you could evaluate my responses and provide feedback on which replies were good or bad, and suggest ways to revise them for the purpose of improving fluency.

Location: Airport

如果想要機器人用中文回答,則可改輸入

I would like you to serve as my English conversation teacher, and I will provide the location for our conversation. During our session, you will ask me three questions related to the location, and our conversation will conclude once we have discussed all three questions. After our conversation, I would appreciate it if you could evaluate my responses and provide feedback in Traditional Chinese on which replies were good or bad, and suggest ways to revise them for the purpose of improving fluency.

Location: Airport

English writing

修改英文文章或句子

  • Edit the following 貼上英文文章 [8] (可以在英文文章前後加上雙引號)
  • 或 Edit the sentence 貼上英文文章
  • 或 Can you check the spelling and grammar in the following text? 貼上英文文章[9]

PowerPoint presentation

將文章轉換成列點式的簡報

  • Turn the following article into a PowerPoint presentation: 再貼上原始文章
  • 或 Please provide bullet points for the above summary, including information on how, when, for whom, and why it is important: 再貼上原始文章

產生某主題的簡報

  • Create a PowerPoint presentation from the article: 主題 e.g. Create a PowerPoint presentation: "5G Technology: Case Studies in Action"

Icon_exclaim.gif 不成功的嘗試:

  • Summarize the article in a presentation
  • Summarize the article in PowerPoint
  • Create a PowerPoint presentation from the article: 會回覆「I'm sorry, but as an AI language model, I do not have the capability to create a PowerPoint presentation. However, I can summarize the article ...」
  • 產生簡報「5G 技術案例研究」

Product description

將文章轉成亞馬遜產品描述

  • Turn the following article into a amazon product introduction: 再貼上原始文章

Icon_exclaim.gif 不成功的嘗試:

  • Turn the following article into a product introduction:

Sentiment analysis

判斷文章的正負情緒分析

Prompt:

I will provide you with the article, and your task will be to analyze (1) the sentiment - whether it is positive or negative, and (2) the confidence score. The confidence score is a number between O and 1 that represents the likelihood that the output is correct and will
satisfy my question. And put your response into a JSON with keys "sentiment", "score" and "explanation". The
article:

喬巴說:就算你誇獎我,我也不會高興的

Example output

{
"sentiment": "negative",
"score": 0.95,
"explanation": "The article is in Chinese, but the use of the words '不會高興的' (won't be happy) indicates a negative sentiment. The high confidence score of 0.95 is due to the clear negative connotation of the statement."
}

Story

將文章轉成故事

  • Turn the following article into a story: 接上文章

Translation

Translate into Traditional Chinese

  • 目的:英翻中
  • 提示:
    • 「請幫我翻譯以下文章,並且使用臺灣常用的繁體中文:接上文章」、或
    • 「Translate the following into Traditional Chinese, which is commonly used in Taiwan: 接上文章
    • 「As a translator, your jobs are (1) Replace the quote symbols into Chinese quote symbols e.g. The setence “萬物皆有、無所不在” should replace "“" with "「" and replace "”" with "」". The final sentence would be 「萬物皆有、無所不在」 (2) Use Traditional Chinese, which is commonly used in Taiwan. Translate the following article: 接上文章」 額外提示雙引號,取代為中文的刮號

Translate into English

  • 目的:中翻英
  • 提示:「Please translate the above response into English. 接上文章

Wikihow

將文章轉成步驟式教學

  • Turn the following article into a wikihow article: 接上文章


Troubleshooting of ChatGPT errors

How to fix "The message you submitted was too long"

  • Error message: "The message you submitted was too long, please reload the conversation and submit something shorter."
  • Solution: Reduce the length of an input message to less than 15,000 characters. The exact characters limit is not listed on official document, 17,000 characters will not allowed in my experience[10].

How to fix "An error occurred"

  • Error message: "An error occurred. If this issue persists please contact us through our help center at help.openai.com."
  • Solution: Refresh the webpage https://chat.openai.com/chat

How to fix "The server had an error while processing your request"

Error message:

The server had an error while processing your request. Sorry about that! You can retry your request, or contact us through our help center at help.openai.com if the error persists. (Please include the request ID XXXX1 in your message.)

Solution:

強制保持繁體中文輸出

References


Further reading

Articles

OpenAI API

Groups =