UPE02 - Requesting Structured Outputs for Clarity and Efficiency

This set of exercises discuss prompt engineering techniques. In this lesson, we explore structured outputs as a way to get high-quality information from GenAI.

🚀 Learning Objectives

  1. Define explicit constraints or specify structured output formats (e.g. tables, forms, structured reports) to facilitate further processing or improve clarity of the information.

  2. Analyze messy or structured data using AI

  3. Use AI to create a form or provide example data to fill forms

🛠️ Tools

ChatGPT

Why care about structured outputs?

As you saw in earlier exercises, ChatGPT tends to output blobs of text, while Gemini tends to provide bulleted lists that are much easier to read and skim. In many real-world scenarios, unstructured text falls short to deliver the desired insights.

Structured data can be much more useful:

  • Tables neatly organize data like product catalogs, making it easy to view and compare attributes side-by-side. Much clearer than paragraphs of text.

  • Structured tickets/reports quickly convey key details in designated sections - customer info, issue summary, status. Ideal for support teams and managers reviewing at a glance.

  • Forms are used to record customers or internal information in a structured manner so data are neatly stored in databases.

Rather than parsing rambling text, structured outputs provide an organized, scannable format tailored to the specific use case. This clarity streamlines workflows and decision-making.

Working with tables

Asking AI assistants to create tables

Asking AI assistants to summarize information into tables

Next say to the AI:

Ask AI to summarize messy data into a table

ref https://pantip.com/topic/31899005arrow-up-right

Response I got: https://chatgpt.com/share/b22e8bda-9a5e-43a8-8d22-4996a7e31b69arrow-up-right

Asking AI to extract a table from a picture, pdf or from a website

For example, given a product page.

Ask Claude to output a table.

เข้าใจครับ ผมจะวิเคราะห์สินค้าทั้งหมดในภาพให้คุณ โดยจะแบ่งเป็นส่วนๆ เพื่อให้ง่ายต่อการอ่านและทำความเข้าใจ

ส่วนที่ 1:

ชื่อสินค้า
ประเภทสินค้า
ราคาเดิม
ราคาส่วนลด
วิเคราะห์ความคุ้มค่า
เหตุผลจากการวิเคราะห์ความคุ้มค่า

นมผงเด็ก Hi-Q1

อาหารเด็ก

1,458.-

1,415.-

คุ้มค่า

ส่วนลดมากกว่า 40 บาท สำหรับผลิตภัณฑ์คุณภาพสูง

เต็นท์บ้านเด็กเล่น

ของเล่น

659.-

พิเศษ

คุ้มค่าปานกลาง

ไม่ระบุราคาส่วนลด แต่เป็นของเล่นที่ใช้ได้นาน

นมผงเด็ก Hi-Q1 พร้อมรถสามล้อ

อาหารเด็กและของเล่น

2,064.-

1,999.-

คุ้มค่ามาก

ส่วนลดกว่า 60 บาท พร้อมของแถมมูลค่าสูง

นมผง S-26

อาหารเด็ก

1,304.-

1,278.-

คุ้มค่า

ส่วนลดกว่า 20 บาท สำหรับผลิตภัณฑ์ที่จำเป็น

นมผง S-26

อาหารเด็ก

1,816.-

1,782.-

คุ้มค่า

ส่วนลดกว่า 30 บาท สำหรับผลิตภัณฑ์ปริมาณมาก

ส่วนที่ 2:

ชื่อสินค้า
ประเภทสินค้า
ราคาเดิม
ราคาส่วนลด
วิเคราะห์ความคุ้มค่า
เหตุผลจากการวิเคราะห์ความคุ้มค่า

นมผงดูเม็กซ์

อาหารเด็ก

390.-

370.-

คุ้มค่าปานกลาง

ส่วนลด 20 บาท สำหรับผลิตภัณฑ์ราคาไม่สูง

นมผงเด็ก GEN1

อาหารเด็ก

139.-

119.-

คุ้มค่า

ส่วนลด 20 บาท คิดเป็นเปอร์เซ็นต์สูงเมื่อเทียบกับราคาเดิม

ผ้าอ้อมเด็ก Dumex

ผลิตภัณฑ์สำหรับเด็ก

387.-

267.-

คุ้มค่ามาก

ส่วนลดถึง 120 บาท สำหรับสินค้าจำเป็น

นมผงเด็ก Dumex

อาหารเด็ก

387.-

267.-

คุ้มค่ามาก

ส่วนลดถึง 120 บาท สำหรับอาหารเด็ก

นมผงผู้ใหญ่ แอนลีน

อาหารเสริม

738.-

658.-

คุ้มค่า

ส่วนลด 80 บาท สำหรับผลิตภัณฑ์เพื่อสุขภาพ

ส่วนที่ 3:

ชื่อสินค้า
ประเภทสินค้า
ราคาเดิม
ราคาส่วนลด
วิเคราะห์ความคุ้มค่า
เหตุผลจากการวิเคราะห์ความคุ้มค่า

นมผงผู้ใหญ่ เอนชัวร์

อาหารเสริม

615.-

537.-

คุ้มค่า

ส่วนลด 78 บาท สำหรับผลิตภัณฑ์เพื่อสุขภาพ

ผ้าอ้อมผู้ใหญ่

ผลิตภัณฑ์สุขอนามัย

735.-

699.-

คุ้มค่าปานกลาง

ส่วนลด 36 บาท สำหรับสินค้าจำเป็น

นมผงเด็ก Enfalac

อาหารเด็ก

951.-

903.-

คุ้มค่า

ส่วนลด 48 บาท สำหรับผลิตภัณฑ์คุณภาพสูง

หนังสือเสริมทักษะ

สื่อการเรียนรู้

750.-

49.-

คุ้มค่ามาก

ส่วนลดสูงมากถึง 701 บาท

หนังสือนิทาน

สื่อการเรียนรู้

ไม่ระบุ

75.-

ไม่สามารถวิเคราะห์ได้

ไม่มีข้อมูลราคาเดิม แต่ราคาพิเศษดูน่าสนใจ

ส่วนที่ 4:

ชื่อสินค้า
ประเภทสินค้า
ราคาเดิม
ราคาส่วนลด
วิเคราะห์ความคุ้มค่า
เหตุผลจากการวิเคราะห์ความคุ้มค่า

ผ้าอ้อมเด็ก D-nee

ผลิตภัณฑ์สำหรับเด็ก

174.-

116.- (2 แถม 1)

คุ้มค่ามาก

ได้สินค้า 3 ชิ้นในราคา 2 ชิ้น

น้ำยาซักผ้าเด็ก

ผลิตภัณฑ์ซักล้าง

177.-

118.- (2 แถม 1)

คุ้มค่ามาก

ได้สินค้า 3 ชิ้นในราคา 2 ชิ้น

นมผงเด็ก Dumex

อาหารเด็ก

1,548.-

1,068.-

คุ้มค่ามาก

ส่วนลดสูงถึง 480 บาท

อาหารเสริมเด็ก

อาหารเด็ก

ไม่ระบุ

68.-

ไม่สามารถวิเคราะห์ได้

ไม่มีข้อมูลราคาเดิม แต่ราคาพิเศษดูน่าสนใจ

อาหารเสริมเด็ก

อาหารเด็ก

ไม่ระบุ

55.-

ไม่สามารถวิเคราะห์ได้

ไม่มีข้อมูลราคาเดิม แต่ราคาพิเศษดูน่าสนใจ

ส่วนสุดท้าย:

ชื่อสินค้า
ประเภทสินค้า
ราคาเดิม
ราคาส่วนลด
วิเคราะห์ความคุ้มค่า
เหตุผลจากการวิเคราะห์ความคุ้มค่า

ขนมเด็ก

อาหารเด็ก

ไม่ระบุ

95.-

ไม่สามารถวิเคราะห์ได้

ไม่มีข้อมูลราคาเดิม แต่ราคาพิเศษดูน่าสนใจ

นี่คือการวิเคราะห์สินค้าทั้งหมดในภาพครับ มีสินค้าหลายรายการที่ไม่ระบุราคาเดิม ทำให้ไม่สามารถวิเคราะห์ความคุ้มค่าได้อย่างแม่นยำ แต่โดยรวมแล้ว โปรโมชั่นนี้มีสินค้าหลายรายการที่มีส่วนลดสูงและน่าสนใจ โดยเฉพาะสินค้าประเภทนมผงเด็กและผ้าอ้อม ซึ่งเป็นสินค้าจำเป็นสำหรับครอบครัวที่มีเด็กเล็ก

triangle-exclamation
  1. Structured outputs like tables, forms, and reports are often more useful than unstructured text in real-world scenarios. They provide clarity, organization, and easy scanning of key information tailored to specific use cases.

  2. Asking AI assistants to generate structured outputs, such as content calendars or feature lists for software, can help streamline workflows, decision-making, and data management compared to relying on unstructured text alone.

  3. Transforming messy data and website data into a structured table format can make it much more accessible and insightful for analysis and decision-making.


Working with forms

Ask AI to create a form

Ask for form response samples


triangle-exclamation
  • Use AI to help you design comprehensive forms, ensuring you include all relevant, informative fields. And also use AI to generate a response placeholder or sample form-filling information.

Last updated