Using ChatGPT for Dialogue Information Extraction: Prompt Design and Workflow
This article demonstrates how to leverage ChatGPT to automatically extract structured key information from conversational text by defining input keywords, crafting effective prompts, testing iterative refinements, and integrating the process into a Coze workflow that outputs clean JSON data.
With the rapid development of artificial intelligence, ChatGPT offers a powerful way to extract key information from dialogues. The article guides readers through defining the required input ( content and keyword ) and expecting a JSON‑formatted output.
It explains how to write clear, unambiguous prompts, assign a role to the model (e.g., "you are an information collection model"), and specify the goal of extracting the listed keywords from the conversation.
Several prompt versions are presented and tested. Prompt 1 establishes the model’s role and goal; Prompt 2 adds reasoning for missing fields; Prompt 3 requests data cleaning and normalization (e.g., converting Chinese numerals to Arabic numbers); Prompt 4 forces the model to return only the desired fields in a strict JSON structure.
input:
keyword:姓名,年龄,每天学习时长,留学国家,报考学校,报考专业,是否留学,是否移民
content:`用户: 你好
客服: 您好啊宝子,叫什么名字啊?
用户: 我叫优弧
客服: 你好呀,优弧同学,今年多大了呀?
用户: 二十三岁
客服: 年轻有为呢,是在为留学还是移民做准备呢?
用户: 我想去哈佛学习计算机科学。
客服: 哈哈,哈佛大学呀,是个不错的选择呢。你每天学习多少小时呢
用户: 两个半小时`Test results show the model can extract fields such as name, age, daily study time, target university, major, and infer missing information like the study country (United States) when appropriate.
To integrate this into a production workflow, the article describes creating a Coze process: defining input parameters, embedding them in the prompts using {{变量名}} syntax, and configuring the output to return only the JSON payload.
Finally, a Bot is created that incorporates the workflow, enabling users to submit dialogues and receive structured JSON responses instantly. Screenshots illustrate the full interface and the resulting Bot ID.
Rare Earth Juejin Tech Community
Juejin, a tech community that helps developers grow.
How this landed with the community
Was this worth your time?
0 Comments
Thoughtful readers leave field notes, pushback, and hard-won operational detail here.