Chuyển đến nội dung chính

第 8 課:數據分析與商務寫作提示

資料分析提示:CSV 分析、SQL 產生、見解。商務寫作:報告、專業電子郵件、提案、會議記錄。

🧠 人工智慧與機器學習 — 第 7 課 第 8 課:資料分析與業務提示 寫作

即時工程大師班:向人工智慧發出命令的藝術

第三部分:實際應用

亞洲開發網

簡介

人工智慧不僅適合開發人員,企業用戶也需要它。本文涵蓋了兩個最實際的應用領域:Data Analysis(數據分析)和Businesswriting(撰寫商業文件)。

現實: 70% 的分析師時間花在清理+探索資料上,30% 的時間花在洞察上。反向人工智慧:你將 70% 的精力集中在洞察力上,人工智慧負責剩下的事情。


1. 數據分析——分析數據

1.1 CSV解析提示

= ROLE =
Bạn là Senior Data Analyst.

= DATA =
Dataset: {tên dataset}
Columns: {liệt kê cột + data type + mô tả}
Sample rows:
| col1 | col2 | col3 |
|------|------|------|
| ... | ... | ... |
(5-10 rows mẫu)

= TASK =
Phân tích dataset và cung cấp:
1. **Overview:** Số rows, columns, data quality (missing values, outliers)
2. **Key metrics:** Tính các KPIs quan trọng
3. **Trends:** Xu hướng theo thời gian
4. **Segments:** Phân nhóm (theo category, region...)
5. **Insights:** Top 3 phát hiện quan trọng nhất
6. **Actions:** Đề xuất hành động dựa trên data

= OUTPUT FORMAT =
- Bảng cho metrics
- Bullet points cho insights
- Code Python/SQL nếu cần

1.2 範例:收入分析

= DATA =
Dataset: Sales Q1-Q3 2024
Columns:
- date (DATE): ngày bán
- product (VARCHAR): tên sản phẩm
- region (VARCHAR): khu vực (North, South, Central)
- quantity (INT): số lượng
- revenue (DECIMAL): doanh thu (VND)
- customer_type (VARCHAR): new / returning

Sample:
| date       | product | region | quantity | revenue   | customer_type |
|-----------|---------|--------|----------|-----------|---------------|
| 2024-01-05 | Widget A | North  | 50       | 25000000  | new           |
| 2024-01-08 | Widget B | South  | 30       | 18000000  | returning     |

= TASK =
1. Tổng doanh thu theo quý, theo region
2. Top 3 sản phẩm best-seller theo quantity
3. Tỷ lệ new vs returning customers
4. Xu hướng monthly revenue (tăng/giảm?)
5. Region nào underperform?
6. Recommendations cho Q4

= OUTPUT =
Bảng + insights + Python code (pandas)

1.3 文字到 SQL

= DATABASE SCHEMA =
Table: orders
- id (INT, PK)
- customer_id (INT, FK → customers.id)
- product_id (INT, FK → products.id)
- quantity (INT)
- total_amount (DECIMAL)
- order_date (DATE)
- status (VARCHAR): pending, shipped, delivered, cancelled

Table: customers
- id (INT, PK)
- name (VARCHAR)
- email (VARCHAR)
- region (VARCHAR)
- joined_date (DATE)

Table: products
- id (INT, PK)
- name (VARCHAR)
- category (VARCHAR)
- price (DECIMAL)

= RULES =
- PostgreSQL syntax
- Dùng CTE thay subquery khi possible
- Alias tất cả columns trong SELECT
- LUÔN có ORDER BY
- LIMIT kết quả (max 100 rows)
- Comment giải thích logic

= QUESTION =
"Top 5 khách hàng chi tiêu nhiều nhất trong Q3 2024,
 cùng với sản phẩm họ mua nhiều nhất?"

💡 練習 1: 為真實資料庫模式(至少 3 個表格)建立文字到 SQL 提示。測試5個業務問題:從簡單(計數)到複雜(多連接+聚合)。


2. 商業智慧洞察

2.1 提示建立敘事儀表板

= DATA SUMMARY =
{Paste bảng tổng hợp metrics}

= AUDIENCE =
{CEO / Manager / Team lead / All-hands}

= TONE =
{Professional / Conversational / Executive brief}

= TASK =
Viết dashboard narrative (300-500 từ):
1. **Headline:** 1 câu tóm tắt tình hình
2. **Key takeaways:** 3-5 bullet points
3. **Deep dive:** Giải thích số liệu quan trọng
4. **Comparison:** So sánh với kỳ trước / target
5. **Call to action:** Đề xuất hành động cụ thể

Dùng:
- Số liệu cụ thể (không nói "tăng nhiều", nói "tăng 23%")
- So sánh có context ("cao hơn industry average 15%")
- Action-oriented language

2.2 異常檢測提示

Dữ liệu doanh thu hàng ngày (30 ngày gần nhất):
{paste data}

Phân tích và tìm:
1. **Anomalies:** Ngày nào doanh thu bất thường? (so với moving average 7 ngày)
2. **Pattern:** Có pattern theo ngày trong tuần không? (weekend effect?)
3. **Trend:** Xu hướng tổng thể: đi lên, đi xuống, hay sideways?
4. **Forecast:** Dự đoán 7 ngày tiếp theo (với confidence interval)
5. **Alert:** Có cần hành động gấp không?

Output: bảng anomalies + Python code cho visualization

3. 商務寫作

3.1 專業電子郵件

= CONTEXT =
Situation: {mô tả tình huống}
Sender: {vai trò của bạn}
Recipient: {ai, quan hệ}
Purpose: {mục đích email}

= TONE =
{Formal / Semi-formal / Friendly professional}
{Tiếng Việt / English / Bilingual}

= CONSTRAINTS =
- Độ dài: {ngắn gọn 3-5 câu / trung bình / chi tiết}
- Call to action: {hành động mong muốn từ người nhận}
- Deadline: {nếu có}
- Sensitivity: {confidential / normal}

= TEMPLATE =
Subject: [chủ đề rõ ràng]

Chào {tên},

[Mở đầu: context/reason for writing]
[Nội dung chính: thông tin/yêu cầu]
[Call to action: việc cần làm cụ thể]
[Kết: cảm ơn + next steps]

Trân trọng,
{tên}

3.2 會議記錄

= RAW NOTES =
{Paste meeting notes thô / transcript}

= OUTPUT FORMAT =
## Meeting Summary
- **Date:** 
- **Attendees:** 
- **Duration:** 

## Key Decisions
1. [Decision 1] — Owner: [tên]
2. [Decision 2] — Owner: [tên]

## Action Items
| # | Task | Owner | Deadline | Priority |
|---|------|-------|----------|----------|
| 1 | ... | ... | ... | High/Medium/Low |

## Discussion Points
- [Point 1: brief summary]
- [Point 2: brief summary]

## Next Steps
- Follow-up meeting: [date]
- Pending items: ...

3.3 報告/提案

= CONTEXT =
Loại báo cáo: {weekly report / monthly review / project proposal / post-mortem}
Audience: {CEO / team / stakeholders / investors}
Objective: {inform / persuade / request budget / post-mortem analysis}

= DATA =
{Key metrics, achievements, issues, risks}

= STRUCTURE =
1. **Executive Summary** (3-5 câu, AI tự viết)
2. **Highlights** (achievements, milestones)
3. **Challenges** (issues, risks, blockers)
4. **Metrics** (bảng số liệu)
5. **Next Steps** (action items, timeline)
6. **Budget/Resources** (nếu là proposal)

= TONE =
- Fact-based, data-driven
- Avoid jargon khi audience là non-technical
- Action-oriented conclusions

💡練習 2: 使用 AI 提示編寫 3 種類型的業務文件:(a) 請求預算批准的電子郵件,(b) 原始記錄中的會議記錄,(c) 每週報告。評估輸出品質。


4. 分析提示鏈

4.1 多步驟分析

Bước 1: Data Understanding
"Mô tả dataset: số rows, columns, data types, missing values"

Bước 2: Exploratory Analysis
"Dựa trên mô tả ở bước 1, tạo Python code cho EDA:
 distributions, correlations, time series plots"

Bước 3: Insights
"Dựa trên kết quả EDA, liệt kê top 5 insights business"

Bước 4: Recommendations
"Cho mỗi insight, đề xuất 1 action cụ thể + expected impact"

Bước 5: Presentation
"Tạo executive summary 1 trang cho CEO"

4.2 迭代細化

Lần 1: "Phân tích doanh thu Q3"
→ Output: overview chung

Lần 2: "Đi sâu vào region South — tại sao giảm 15%?"
→ Output: root cause analysis

Lần 3: "So sánh South với North — khác gì?"
→ Output: comparative analysis

Lần 4: "Đề xuất 3 actions cụ thể để South recovery Q4"
→ Output: action plan

→ Mỗi bước drill-down sâu hơn, context tích lũy

總結

使用案例關鍵提示要素
CSV 分析架構、範例資料、具體問題
文字到 SQL表格架構、SQL 方言、規則
儀表板敘述受眾、基調、指標、比較
電子郵件語境、語氣、號召性用語、限制條件
會議記錄原始筆記,結構化輸出格式
報告類型、受眾、結構、資料

一般練習

  1. ✅ 完成 2 個小練習 (1, 2)
  2. 資料到報告管道: CSV → 分析(提示 1)→ 見解(提示 2)→ 執行報告(提示 3)→ 透過電子郵件將摘要發送給 CEO(提示 4)。連鎖 4 提示。
  3. 提示範本庫: 建立一套5個業務提示範本(電子郵件、報告、會議、提案、資料分析)。使用 3 種不同場景進行測試。
  4. 人工智慧業務分析師: 角色扮演:你是一名業務分析師,使用人工智慧來分析真實的資料集(Kaggle 資料集)。從原始資料 → 可供演示的見解。

下一篇文章: 多重模式提示 — 影像、音訊和視訊 — 多媒體輸入的提示工程。