原書用 11/patients.xlsx 的 Address 欄示範 Numerous.ai 的 NUM.AI():直接在 Excel cell 以自然語言要求從完整地址抽出城市。
NUM.AI(prompt, data_range)。原書在 K2 輸入 =NUM.AI("Extract the city from", J2),處理完成後城市出現在 K 欄,再將欄名由 Column1 改為 City。
| 欄位 | 用途 |
|---|---|
| J / Address | 完整 free-text residential address |
| K / City | AI 抽取出的 city |
| Formula | =NUM.AI("Extract the city from", J2) |
先在 K2 測試一筆,確認輸出真的是城市而非 postal code/整段地址,再向下套用。Numerous.ai 會消耗 tokens,因此原書建議大資料先用小 sample 測 accuracy/cost。
A 檔 Figure 11-2 顯示 City 欄已被填滿,但正文沒有列出完整城市清單,因此本頁保留公式與流程,不自行手抄圖中無法可靠核對的所有值。
AI extraction 的優勢是不用先寫複雜文字公式,但可重現性取決於 prompt 與 provider。若地址格式很多,應抽查不同格式,而不是只驗證第一筆。
請從 Address 中只抽取 city,輸出單一城市名稱;不要輸出 street、postal code 或 country。先測試 5 筆不同格式,再決定是否 fill down。
**問題:**若 Address 中沒有城市資訊,應讓 AI 猜一個城市嗎?