728x90

https://www.deeplearning.ai/short-courses/chatgpt-prompt-engineering-for-developers/

 

ChatGPT Prompt Engineering for Developers

What youโ€™ll learn in this course In ChatGPT Prompt Engineering for Developers, you will learn how to use a large language model (LLM) to quickly build new and powerful applications.  Using the OpenAI API, youโ€™ll...

www.deeplearning.ai

 

ChatGPT Prompt Engineering for Developers 

 

5 - Transforming  ์ •๋ฆฌ

 

Setup

import openai
import os

from dotenv import load_dotenv, find_dotenv
_ = load_dotenv(find_dotenv())

openai.api_key  = os.getenv('OPENAI_API_KEY')

def get_completion(prompt, model="gpt-3.5-turbo"):
    messages = [{"role": "user", "content": prompt}]
    response = openai.ChatCompletion.create(
        model=model,
        messages=messages,
        temperature=0, # this is the degree of randomness of the model's output
    )
    return response.choices[0].message["content"]

 

Transforming - ๋ณ€ํ˜•

1) Translation ๋ฒˆ์—ญ

ChatGPT๋Š” ๋‹ค์–‘ํ•œ ์–ธ์–ด์˜ ์†Œ์Šค๋กœ ํ•™์Šต๋˜์—ˆ์œผ๋ฉฐ ์ด๋ฅผ ํ†ตํ•ด ๋ชจ๋ธ์— ๋ฒˆ์—ญ๊ธฐ๋Šฅ์„ ์ œ๊ณตํ•ฉ๋‹ˆ๋‹ค. 

 

- ์˜๋ฌธ ๋ฒˆ์—ญ

<prompt task>

Translate the following English text to Korean:

```Hi, I would like to order a blender```

 

- ๋ฌธ์žฅ์˜ ์–ธ์–ด ๊ตฌ๋ถ„

<prompt task>

Tell me which language this is:

```Combien coรปte le lampadaire?```

 

- ๋‹ค๊ตญ์–ด ๋™์‹œ ๋ฒˆ์—ญ

<prompt task>

Translate the following  text to French and Spanish

and English pirate:

```I want to order a basketball```

 

- ๊ณต์‹ / ๋น„๊ณต์‹ ํšŒํ™” ๋ฒˆ์—ญ

<prompt task>

Translate the following text to Korean in both the formal and informal forms:

'Would you like to order a pillow?'

 

* ๋‹ค๊ตญ์–ด ๋™์‹œ ๋ฒˆ์—ญ ํ™œ์šฉ - ๋Œ€๊ทœ๋ชจ ๋‹ค๊ตญ์  ์ด์ปค๋จธ์Šค ๊ธฐ์—…์—์„œ IT๋ฅผ ๋‹ด๋‹นํ•˜๊ณ  ์žˆ๋‹ค๊ณ  ๊ฐ€์ •ํ•ด ๋ณด์ž. ์‚ฌ์šฉ์ž๋“ค์ด ๊ฐ์ž์˜ ๋ชจ๊ตญ์–ด๋กœ IT ๋ฌธ์ œ์— ๋Œ€ํ•ด ๋ฉ”์‹œ์ง€๋ฅผ ๋ณด๋‚ด๊ณ  ์žˆ๋‹ค. ์ „ ์„ธ๊ณ„ ๊ฐ์ง€์—์„œ ์˜จ ์ง์›๋“ค์€ ๊ฐ์ž์˜ ๋ชจ๊ตญ์–ด๋งŒ ๊ตฌ์‚ฌํ•˜๋Š” ์ƒํ™ฉ์ด๋‹ค. ๋‹น์žฅ ๋ฒ”์šฉ ๋ฒˆ์—ญ๊ธฐ๊ฐ€ ํ•„์š”ํ•˜๋‹ค! 

https://www.amazon.com/product-reviews/B09NLS9TK4/ref=acr_dp_hist_1?ie=UTF8&filterByStar=one_star&reviewerType=all_reviews#reviews-filter-bar

 

 

<prompt task>

f"Tell me what language this is: ```{issue}```"

 

 

2) Tone Transformation  - ๋ฌธ์žฅ ์Šคํƒ€์ผ ๋ณ€๊ฒฝ

 

<prompt task>

Translate the following from slang to a business letter.


sentence is below letter, which is delimited by triple backticks.


translate in
korean.

 

letter: ```Dude, This is Joe, check out this spec on this standing lamp.```

 

 

3) Spellcheck / Grammer check  - ๋ฌธ์žฅ ๊ต์ •

LLM ๋ชจ๋ธ์— ๋ฌธ์žฅ ๊ต์ •์„ ํ•˜๊ธฐ ์œ„ํ•ด "'proofread" ์™€ "'proofread and correct"์„ ์ง€์‹œ

<prompt task>

f"'proofread and correct this korean sentence: ```{text}```โ€

ํ•œ๊ฒจ๋ก€ ๊ธฐ์‚ฌ

 

๋ฐ˜์‘ํ˜•
๋‹คํ–ˆ๋‹ค