AI教程 2025年01月12日
0 收藏 0 点赞 128 浏览 8405 个字
摘要 :

面向开发者的LLM入门课程-文本转换英文版: 文本转换英文版 1.翻译为西班牙语 prompt = f””” Translate the following English text to Spanish: ……

哈喽!伙伴们,我是小智,你们的AI向导。欢迎来到每日的AI学习时间。今天,我们将一起深入AI的奇妙世界,探索“面向开发者的LLM入门课程-文本转换英文版”,并学会本篇文章中所讲的全部知识点。还是那句话“不必远征未知,只需唤醒你的潜能!”跟着小智的步伐,我们终将学有所成,学以致用,并发现自身的更多可能性。话不多说,现在就让我们开始这场激发潜能的AI学习之旅吧。

面向开发者的LLM入门课程-文本转换英文版

面向开发者的LLM入门课程-文本转换英文版:

文本转换英文版

1.翻译为西班牙语

prompt = f”””
Translate the following English text to Spanish:
“`Hi, I would like to order a blender“`
“””
response = get_completion(prompt)
print(response)

Hola, me gustaría ordenar una licuadora.

2.识别语种

prompt = f”””
Tell me which language this is:
“`Combien coûte le lampadaire?“`
“””
response = get_completion(prompt)
print(response)

This language is French.

3.多语种翻译

prompt = f”””
Translate the following text to French and Spanish
and English pirate:
“`I want to order a basketball“`
“””
response = get_completion(prompt)
print(response)

French: “`Je veux commander un ballon de basket“`
Spanish: “`Quiero ordenar una pelota de baloncesto“`
English: “`I want to order a basketball“`

4.同时进行语气转换

prompt = f”””
Translate the following text to Spanish in both the
formal and informal forms:
‘Would you like to order a pillow?’
“””
response = get_completion(prompt)
print(response)

Formal: ¿Le gustaría ordenar una almohada?
Informal: ¿Te gustaría ordenar una almohada?

5.通用翻译器

user_messages = [
“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
]

for issue in user_messages:
prompt = f”Tell me what language this is: “`{issue}“`”
lang = get_completion(prompt)
print(f”Original message ({lang}): {issue}”)
prompt = f”””
Translate the following text to English
and Korean: “`{issue}“`
“””
response = get_completion(prompt)
print(response, “n”)

Original message (The language is French.): La performance du système est plus
lente que d’habitude.
The performance of the system is slower than usual.
시스템의 성능이 평소보다 느립니다.
Original message (The language is Spanish.): Mi monitor tiene píxeles que no se
iluminan.
English: “My monitor has pixels that do not light up.”
Korean: “내 모니터에는 밝아지지 않는 픽셀이 있습니다.”
Original message (The language is Italian.): Il mio mouse non funziona
English: “My mouse is not working.”
Korean: “내 마우스가 작동하지 않습니다.”
Original message (The language is Polish.): Mój klawisz Ctrl jest zepsuty
English: “My Ctrl key is broken”
Korean: “내 Ctrl 키가 고장 났어요”
Original message (The language is Chinese.): 我的屏幕在闪烁
English: My screen is flickering.
Korean: 내 화면이 깜박거립니다.

6.语气风格调整

prompt = f”””
Translate the following from slang to a business letter:
‘Dude, This is Joe, check out this spec on this standing lamp.’
“””
response = get_completion(prompt)
print(response)

Dear Sir/Madam,
I hope this letter finds you well. My name is Joe, and I am writing to bring your
attention to a specification document regarding a standing lamp.
I kindly request that you take a moment to review the attached document, as it
provides detailed information about the features and specifications of the
aforementioned standing lamp.
Thank you for your time and consideration. I look forward to discussing this
further with you.
Yours sincerely,
Joe

7.文件格式转换

data_json = { “resturant employees” :[
{“name”:”Shyam”, “email”:”shyamjaiswal@gmail.com”},
{“name”:”Bob”, “email”:”bob32@gmail.com”},
{“name”:”Jai”, “email”:”jai87@gmail.com”}
]}

prompt = f”””
Translate the following python dictionary from JSON to an HTML
table with column headers and title: {data_json}
“””
response = get_completion(prompt)
print(response)

面向开发者的LLM入门课程-文本转换英文版

from IPython.display import display, Markdown, Latex, HTML, JSON
display(HTML(response))

td, th {
border: 1px solid #dddddd;
text-align: left;
padding: 8px;
}
tr:nth-child(even) {
background-color: #dddddd;
}

面向开发者的LLM入门课程-文本转换英文版

8.拼写及语法纠错

text = [
“The girl with the black and white puppies have a ball.”, # The girl has a
ball.
“Yolanda has her notebook.”, # ok
“Its going to be a long day. Does the car need it’s oil changed?”, # Homonyms
“Their goes my freedom. There going to bring they’re suitcases.”, # Homonyms
“Your going to need you’re notebook.”, # Homonyms
“That medicine effects my ability to sleep. Have you heard of the butterfly
affect?”, # Homonyms
“This phrase is to cherck chatGPT for spelling abilitty” # spelling
]

for t in text:
prompt = f”””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}“`”””
response = get_completion(prompt)
print(response)

The girl with the black and white puppies has a ball.
No errors found.
It’s going to be a long day. Does the car need its oil changed?
There goes my freedom. They’re going to bring their suitcases.
You’re going to need your notebook.
That medicine affects my ability to sleep. Have you heard of the butterfly effect?
This phrase is to check chatGPT for spelling ability.

text = f”””
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 = f”proofread and correct this review: “`{text}“`”
response = get_completion(prompt)
print(response)

Got this for my daughter for her birthday because 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. However, one of the ears is a bit lower than the other,
and I don’t think that was designed to be asymmetrical. Additionally, it’s a bit
small for what I paid for it. I believe there might be other options that are
bigger for the same price. On the positive side, it arrived a day earlier than
expected, so I got to play with it myself before I gave it to my daughter.

from redlines import Redlines
from IPython.display import display, Markdown
diff = Redlines(text,response)
display(Markdown(diff.output_markdown))

Got this for my daughter for her birthday cuz because she keeps taking mine from my room.
room. Yes, adults also like pandas too. too. She takes it everywhere with her, and it’s super soft
and cute. One cute. However, one of the ears is a bit lower than the other, and I don’t think that
was designed to be asymmetrical. It’s Additionally, it’s a bit small for what I paid for it though.
it. I think believe there might be other options that are bigger for the same price. It price. On
the positive side, it arrived a day earlier than expected, so I got to play with it myself before I
gave it to my daughter.
daughter.

9.综合样例

text = f”””
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 = f”””
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}“`
“””
# 校对注:APA style guide是APA Style Guide是一套用于心理学和相关领域的研究论文写作和格式化
的规则。
# 它包括了文本的缩略版,旨在快速阅读,包括引用、解释和参考列表,
# 其详细内容可参考:https://apastyle.apa.org/about-apa-style
# 下一单元格内的汉化prompt内容由译者进行了本地化处理,仅供参考
response = get_completion(prompt)
display(Markdown(response))

Title: A Delightful Gift for Panda Enthusiasts: A Review of the Soft and Adorable Panda Plush
Toy
Reviewer: [Your Name]

I recently purchased this charming panda plush toy as a birthday gift for my daughter, who has a penchant for “borrowing” my belongings from time to time. As an adult, I must admit that I too have fallen under the spell of these lovable creatures. This review aims to provide an in-depth analysis of the product, catering to advanced readers who appreciate a comprehensive evaluation.

First and foremost, the softness and cuteness of this panda plush toy are simply unparalleled. Its irresistibly plush exterior makes it a joy to touch and hold, ensuring a delightful sensory experience for both children and adults alike. The attention to detail is evident, with its endearing features capturing the essence of a real panda. However, it is worth noting that one of the ears appears to be slightly asymmetrical, which may not have been an intentional design choice.

While the overall quality of the product is commendable, I must express my slight disappointment regarding its size in relation to its price. Considering the investment made, I expected a larger plush toy. It is worth exploring alternative options that offer a more substantial size for the same price point. Nevertheless, this minor setback does not overshadow the toy’s undeniable appeal and charm.

In terms of delivery, I was pleasantly surprised to receive the panda plush toy a day earlier than anticipated. This unexpected early arrival allowed me to indulge in some personal playtime with the toy before presenting it to my daughter. Such promptness in delivery is a testament to the seller’s efficiency and commitment to customer satisfaction.

In conclusion, this panda plush toy is a delightful gift for both children and adults who appreciate the enchanting allure of these beloved creatures. Its softness, cuteness, and attention to detail make it a truly captivating addition to any collection. While the size may not fully justify the price, the overall quality and prompt delivery make it a worthwhile purchase. I highly recommend this panda plush toy to anyone seeking a charming and endearing companion.

Word Count: 305 words

面向开发者的LLM入门课程-文本扩展
面向开发者的LLM入门课程-文本扩展:文本扩展 文本扩展是大语言模型的一个重要应用方向,它可以输入简短文本,生成更加丰富的长文。...

嘿,伙伴们,今天我们的AI探索之旅已经圆满结束。关于“面向开发者的LLM入门课程-文本转换英文版”的内容已经分享给大家了。感谢你们的陪伴,希望这次旅程让你对AI能够更了解、更喜欢。谨记,精准提问是解锁AI潜能的钥匙哦!如果有小伙伴想要了解学习更多的AI知识,请关注我们的官网“AI智研社”,保证让你收获满满呦!

微信扫一扫

支付宝扫一扫

版权: 转载请注明出处:https://www.ai-blog.cn/2489.html

相关推荐
01-15

面向开发者的LLM入门课程-路由链: 路由链 到目前为止,我们已经学习了大语言模型链和顺序链。但是…

215
01-15

面向开发者的LLM入门课程-顺序链: 顺序链 当只有一个输入和一个输出时,简单顺序链(SimpleSequen…

128
01-15

面向开发者的LLM入门课程-简单顺序链: 简单顺序链 顺序链(SequentialChains)是按预定义顺序执行…

128
01-15

面向开发者的LLM入门课程-大语言模型链: 模型链 链(Chains)通常将大语言模型(LLM)与提示(Pro…

128
01-15

面向开发者的LLM入门课程-对话储存英文版提示: 英文版提示 1.对话缓存储存 from langchain.chains…

128
01-15

面向开发者的LLM入门课程-对话摘要缓存储存: 对话摘要缓存储存 对话摘要缓存储存,使用 LLM 对到…

128
01-15

面向开发者的LLM入门课程-对话字符缓存储存: 对话字符缓存储存 使用对话字符缓存记忆,内存将限制…

128
01-15

面向开发者的LLM入门课程-对话缓存窗口储存: 对话缓存窗口储存 随着对话变得越来越长,所需的内存…

128
发表评论
暂无评论

还没有评论呢,快来抢沙发~

助力原创内容

快速提升站内名气成为大牛

扫描二维码

手机访问本站