提示工程 - 建設性批評提示



使用建設性批評提示,我們可以鼓勵ChatGPT提供有見地且可操作的批評,使使用者能夠獲得有價值的改進或完善輸入。

在本章中,我們將探討建設性批評提示的概念,以及如何使用它來指示ChatGPT以建設性的方式提供有幫助的反饋、評論或建議。

什麼是建設性批評提示?

建設性批評提示涉及設計提示,指示ChatGPT提供建設性的反饋、評論或評估。目的是引導模型以支援性和積極的方式提供批評,專注於改進領域,同時突出優勢。

建設性批評提示的益處

建設性批評提示提供了幾個好處 -

  • 寶貴的反饋 - 使用者獲得詳細且有幫助的反饋,有助於完善想法、內容或解決方案。

  • 技能提升 - 建設性批評允許使用者識別改進領域,促進技能發展和成長。

  • 積極的使用者體驗 - 以建設性和支援性的方式提供的反饋增強了整體使用者體驗,並鼓勵進一步參與。

實施建設性批評提示

撰寫建設性批評提示 - 要實施建設性批評提示,請設計提示,指示ChatGPT以積極和建設性的語氣進行評估和提供反饋。請檢視以下示例 -

User: Please evaluate my article on climate change and provide constructive feedback.

模型互動 - 當ChatGPT遇到建設性批評提示時,它會透過提供反饋來響應,該反饋突出內容的優勢和改進領域。這是一個示例 -

User: Please evaluate my article on climate change and provide constructive feedback.
ChatGPT: Your article on climate change is well-researched and informative. The introduction effectively grabs the reader's attention. However, consider expanding on the potential solutions to address climate change to make the article even more impactful. Great effort overall!

自定義反饋 - 根據上下文和使用者偏好,反饋的詳細程度和強調的領域可以調整以滿足特定需求。這是一個示例 -

User: Please critique my design for the website's homepage.
ChatGPT: Your design for the website's homepage is visually appealing and user-friendly. However, consider optimizing the layout for mobile devices to ensure seamless navigation for mobile users. Additionally, explore using a more contrasting color scheme to enhance readability. Keep up the good work!

建設性批評提示的應用

建設性批評提示可應用於各種場景 -

  • 內容審查 - 索取關於書面內容、設計草圖或營銷材料的寶貴反饋。

  • 程式碼審查 - 獲取關於程式碼片段或程式設計專案的建設性反饋。

  • 技能提升 - 使用建設性批評提示進行語言學習或技能發展練習。

思維鏈提示的最佳實踐

為了充分利用建設性批評提示,請考慮以下最佳實踐 -

  • 具體的反饋請求 - 撰寫明確概述要評估的特定領域或方面的提示。

  • 積極的語氣 - 指示ChatGPT以積極和鼓勵的方式提供反饋,強調優勢和改進領域。

  • 量身定製的反饋 - 根據上下文和使用者偏好自定義反饋,確保相關性和實用性。

示例應用 - Python實現

讓我們探索一個使用Python指令碼與ChatGPT互動的指令的實際示例。

import openai

# Set your API key here
openai.api_key = 'YOUR_API_KEY'

def generate_chat_response(prompt):
   response = openai.Completion.create(
   engine="text-davinci-003",
      prompt=prompt,
      max_tokens=500,
      temperature=0.7,
      n=1,
      stop=None
   )
   return response

user_prompt = "User: Please evaluate my article on climate change and provide constructive feedback. \n"
chat_prompt = user_prompt + "[Constructive Critic Prompting]"

response = generate_chat_response(chat_prompt)
print(response)

輸出

在這裡,我們收到了以下建設性批評作為輸出 -

The article provides a good overview of the key issues associated with climate change, but it could benefit from a more detailed analysis of the potential solutions. It would also be useful to include more specific examples of the impacts of climate change to provide context for the reader.
Additionally, it might be helpful to provide a more comprehensive overview of the different types of climate change and how they affect the environment.
Finally, it would be beneficial to include a conclusion that summarizes the main points of the article and provides the reader with some actionable steps they can take to help mitigate climate change.

結論

建設性批評提示培養了積極的使用者體驗,鼓勵參與和持續成長。當您將建設性批評提示融入與ChatGPT的互動時,您可以期待收到經過深思熟慮且可操作的反饋,從而增強您的專案。

廣告