Transforming
How to use Large Language Models for text transformation tasks such as language translation, spelling and grammar checking, tone adjustment, and format conversion.
Translation
ChatGPT is trained with sources in many languages. This gives the model the ability to do translations. Here are some examples of how to use this capability.
Prompts
Translate the following English text to Spanish:
```Hi, I would like to order a blender```
Tell me which language this is:
```Combien coûte le lampadaire?```
Translate the following text to French and Spanish and English pirate:
```I want to order a basketball```
Translate the following text to Spanish in both the formal and informal forms:
'Would you like to order a pillow?'
Universal Translator
Imagine you are in charge of IT at a large multinational e-commerce company. Users are messaging you with IT issues in all their native languages. Your staff is from all over the world and speaks only their native languages. You need a universal translator!
- “La performance du système est plus lente que d’habitude.”
System performance is slower than normal - “Mi monitor tiene píxeles que no se iluminan.”
My monitor has pixels that are not lighting - “Il mio mouse non funziona”
My mouse is not working - “Mój klawisz Ctrl jest zepsuty”
My keyboard has a broken control key - “我的屏幕在闪烁”
My screen is flashing
Loop through each of the messages and use the following prompts.
Prompt (Get the language)
Tell me what language this is: ```{issue}```
Prompt (Translate)
Translate the following text to English and Korean: ```{issue}```
Tone Transformation
Writing can vary based on the intended audience. ChatGPT can produce different tones.
Prompt
Translate the following from slang to a business letter:
'Dude, This is Joe, check out this spec on this standing lamp.'
Format Conversion
ChatGPT can translate between formats. The prompt should describe the input and output formats.
JSON
{
"resturant employees": [
{"name":"Shyam", "email":"shyamjaiswal@gmail.com"},
{"name":"Bob", "email":"bob32@gmail.com"},
{"name":"Jai", "email":"jai87@gmail.com"}
]
}
Prompt
Translate the following object from JSON to an HTML table with column headers and title: {data_json}
Spellcheck/Grammar check
Examples of common grammar and spelling problems and the LLM’s response. To signal to the LLM that you want it to proofread your text, you instruct the model to ‘proofread’ or ‘proofread and correct’.
Consider a list of test strings.
- The girl with the black and white puppies have a ball.
- Yolanda has her notebook
- Its going to be a long day. Does the car need it’s oil changed?
- Their goes my freedom. There going to bring they’re suitcases.
- Your going to need you’re notebook.
- That medicine effects my ability to sleep. Have you heard of the butterfly affect?
- This phrase is to cherck chatGPT for speling ability
Loop through the list and pass each to the following prompt.
Prompt
Proofread and correct the following text and rewrite the corrected version. If you don't find and errors, just say "No errors found". Don't use any punctuation around the text: ```{t}```
Consider the text:
Text
Got this for my daughter for her birthday cuz she keeps taking mine from my room. Yes, adults also like pandas too. She takes it everywhere with her, and it's super soft and cute. One of the ears is a bit lower than the other, and I don't think that was designed to be asymmetrical. It's a bit small for what I paid for it though. I think there might be other options that are bigger for the same price. It arrived a day earlier than expected, so I got to play with it myself before I gave it to my daughter.
Prompt
proofread and correct this review: ```{text}```
Prompt
Proofread and correct this review. Make it more compelling.
Ensure it follows APA style guide and targets an advanced reader.
Output in markdown format.
Text: ```{text}```