Ringkasan dan pengembangan teks

Prompt Engineering dengan OpenAI API

Fouad Trad

Machine Learning Engineer

Ringkasan teks

  • Meringkas teks ke format lebih singkat
  • Merapikan proses bisnis
    • Keuangan -> merangkum laporan panjang
    • Pemasaran -> mengubah umpan balik pelanggan menjadi wawasan yang dapat ditindaklanjuti
  • LLM dapat meringkas teks dengan prompt yang efektif

Gambar yang menunjukkan bagaimana peringkasan mengubah setumpuk buku menjadi dokumen berisi ringkasan.

Prompt Engineering dengan OpenAI API

Prompt tidak efektif

  • Hanya menentukan teks untuk diringkas
text = "I recently purchased your XYZ Smart Watch and wanted to provide some feedback
based on my experience with the product. I must say that I'm impressed with the sleek design 
and build quality of the watch. It feels comfortable on the wrist and looks great with any 
outfit. The touchscreen is responsive and easy to navigate through the various features."

prompt = f"""Summarize the text delimited by triple backticks: ```{text}```""" print(get_response(prompt))
The author purchased the XYZ Smart Watch and is impressed with its sleek design, build 
quality, and comfortable fit on the wrist. They find the touchscreen responsive and 
user-friendly for navigating the watch's features.
Prompt Engineering dengan OpenAI API

Peningkatan prompt

  • Batas keluaran
  • Struktur keluaran
  • Fokus ringkasan

Gambar seseorang naik dari satu anak tangga ke yang lebih tinggi sebagai tanda peningkatan.

Prompt Engineering dengan OpenAI API

Prompt efektif: batas keluaran

  • Tentukan jumlah kalimat, kata, karakter
text = "I recently purchased your XYZ Smart Watch and wanted to provide some feedback
based on my experience with the product. I must say that I'm impressed with the sleek design 
and build quality of the watch. It feels comfortable on the wrist and looks great with any 
outfit. The touchscreen is responsive and easy to navigate through the various features."

prompt = f"""Summarize the text delimited by triple backticks in one sentence: ```{text}```""" print(get_response(prompt))
The customer is impressed with the sleek design, build quality, comfort, and responsiveness 
of the XYZ Smart Watch's touch screen.
Prompt Engineering dengan OpenAI API

Prompt efektif: struktur keluaran

  • Tentukan struktur keluaran
text = "I recently purchased your XYZ Smart Watch and wanted to provide some feedback
based on my experience with the product. I must say that I'm impressed with the sleek design 
and build quality of the watch. It feels comfortable on the wrist and looks great with any 
outfit. The touchscreen is responsive and easy to navigate through the various features."

prompt = f"""Summarize the text delimited by triple backticks, in at most three bullet points. ```{text}```""" print(get_response(prompt))
- The XYZ Smart Watch has a sleek and impressive design with  excellent build quality.
- It feels comfortable on the wrist and complements any outfit.
- The touch screen is responsive and user-friendly for easy navigation through the features.
Prompt Engineering dengan OpenAI API

Prompt efektif: fokus ringkasan

  • Minta model fokus pada bagian tertentu dari teks
text = "I recently purchased your XYZ Smart Watch and wanted to provide some feedback
based on my experience with the product. I must say that I'm impressed with the sleek design 
and build quality of the watch. It feels comfortable on the wrist and looks great with any 
outfit. The touchscreen is responsive and easy to navigate through the various features."

prompt = f"""Summarize the review delimited by triple backticks, in three sentences, focusing on the key features and user experience: ```{text}```""" print(get_response(prompt))
Prompt Engineering dengan OpenAI API

Prompt efektif: fokus ringkasan

The customer purchased the XYZ Smart Watch and was impressed with its sleek design 
and build quality. 
They found it comfortable to wear and versatile enough to match any outfit. 
The touch screen was responsive and user-friendly, making it easy to navigate 
through the watch's features.
Prompt Engineering dengan OpenAI API

Pengembangan teks

  • Menghasilkan teks dari ide atau poin
  • Meningkatkan efisiensi dan produktivitas
  • LLM dapat mengembangkan teks dengan prompt yang tepat

Gambar yang menjelaskan bahwa perluasan teks adalah membuat teks lengkap dari beberapa ide atau kebutuhan kecil.

Prompt Engineering dengan OpenAI API

Prompt pengembangan teks

  • Minta model mengembangkan teks yang dibatasi
  • Sorot aspek yang perlu difokuskan
  • Berikan ketentuan keluaran (nada, panjang, struktur, audiens)

Ikon pensil menulis di buku catatan.

Prompt Engineering dengan OpenAI API

Mengembangkan deskripsi layanan

service_description = """Service: Social XYZ
- Social Media Strategy Development
- Content Creation and Posting 
- Audience Engagement and Community Building
- Increased Brand Visibility
- Enhanced Customer Engagement
- Data-Driven Marketing Decisions"""
prompt = f"""Expand the description for the Social XYZ service delimited by triple 
backticks to provide an overview of its features and benefits, without bypassing 
the limit of two sentences. Use a professional tone.
```{service_description}```"""
print(get_response(prompt))
Prompt Engineering dengan OpenAI API

Mengembangkan deskripsi layanan

Social XYZ is a comprehensive social media service that offers strategic 
development, content creation, and posting to help businesses effectively engage 
with their target audience and build a strong online community. 

With a focus on increasing brand visibility and enhancing customer engagement, 
Social XYZ enables businesses to make data-driven marketing decisions for optimal 
results.
Prompt Engineering dengan OpenAI API

Ayo berlatih!

Prompt Engineering dengan OpenAI API

Preparing Video For Download...