https://www.deeplearning.ai/short-courses/chatgpt-prompt-engineering-for-developers/
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 ๋ฌธ์ ์ ๋ํด ๋ฉ์์ง๋ฅผ ๋ณด๋ด๊ณ ์๋ค. ์ ์ธ๊ณ ๊ฐ์ง์์ ์จ ์ง์๋ค์ ๊ฐ์์ ๋ชจ๊ตญ์ด๋ง ๊ตฌ์ฌํ๋ ์ํฉ์ด๋ค. ๋น์ฅ ๋ฒ์ฉ ๋ฒ์ญ๊ธฐ๊ฐ ํ์ํ๋ค!
<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}```”
'๐ ๏ธ Tools > ๐ค ChatGPT' ์นดํ ๊ณ ๋ฆฌ์ ๋ค๋ฅธ ๊ธ
[LLM] ChatGPT Prompt Engineering for Developers - Chatbot (0) | 2023.05.07 |
---|---|
[LLM] ChatGPT Prompt Engineering for Developers - Expanding (0) | 2023.05.06 |
[LLM] ChatGPT Prompt Engineering for Developers - Inferring (0) | 2023.05.04 |
[LLM] ChatGPT Prompt Engineering for Developers - Summarizing (0) | 2023.05.04 |
[LLM] ChatGPT Prompt Engineering for Developers - Iterative (0) | 2023.05.03 |