How Preply combines AI and human tutors to personalize learning

2026-06-12 28 预计阅读时间: 1 分钟
来源: openai.com AI 摘要 Original link

Disclaimer: This article is an AI-assisted summary. Read it together with the original source when precision matters. The summary may omit context, version differences, or edge cases and is not official documentation.

预计阅读时间:12 分钟

{ "title_zh": "Preply 如何用 OpenAI 为每节课生成个性化摘要与练习", "body_zh": "在线语言学习平台 Preply 最近把 OpenAI 的能力嵌入到课后流程里:每次一对一课程结束后,系统自动生成学习摘要、个性化反馈和针对性练习题。这意味着学员不再只靠记忆回顾课堂内容,而是拿到一份结构化的"课后报告"。\n\n## 从人工回顾到 AI 即时总结\n\n过去,学员课后能留下的只有自己的笔记和零散记忆。 tutors 可能会在聊天窗口里发几条建议,但信息碎片化、不及时。Preply 的做法是把课堂对话和教学记录送进 OpenAI 模型,让它在几分钟内产出三样东西:\n\n- 课程摘要:覆盖当节课讨论的主题、新词汇、语法点。\n- 个性化反馈:指出学员在发音、用词、句式上的具体问题,而不是泛泛的"继续加油"。\n- 练习题:根据暴露的薄弱点生成填空、改错、翻译等小练习,难度与当节课水平匹配。\n\n关键在于,这些内容不是模板套话,而是基于当节课真实交互数据生成的,每份摘要都不同。\n\n## 人机协作而非替代\n\nPreply 强调 AI 不会替代 tutor。tutor 仍然负责教学设计、实时纠错和情感支持;AI 只做"课后整理和延伸"这类重复性高、但 tutor 没时间细做的事。这种分工让 tutor 把精力集中在课堂上,同时学员在课下也不断有可操作的材料。\n\n实际效果是:学员收到摘要后,下次课的准备更充分;tutor 也能快速回顾上节课的要点,不用自己翻聊天记录。两端都省时间。\n\n## 自己动手:用 OpenAI API 生成课后摘要与练习\n\nPreply 的具体实现细节没有完全公开,但核心逻辑可以复现。下面是一个最小可运行示例——模拟一段课堂对话,调用 OpenAI API 生成摘要、反馈和练习题。\n\n先安装依赖:\n\nbash\npip install openai python-dotenv\n\n\n创建 .env 文件写入你的 API Key:\n\n\nOPENAI_API_KEY=sk-your-key-here\n\n\n然后运行以下脚本:\n\npython\nimport os\nimport json\nfrom openai import OpenAI\nfrom dotenv import load_dotenv\n\nload_dotenv()\nclient = OpenAI()\n\n# 模拟一段课堂对话记录\nlesson_transcript = \"\"\"\nTutor: Today we're talking about travel. Have you been to any interesting places recently?\nStudent: I go to Japan last year. It was very beautiful.\nTutor: Good! But remember — 'I went to Japan', not 'I go'. Past tense uses 'went' for 'go'.\nStudent: Oh, I went to Japan. The food was delicious. I eat sushi every day.\nTutor: Another past tense tip — 'I ate sushi', not 'I eat'. Let's practice: say 'I ate tempura in Tokyo'.\nStudent: I ate tempura in Tokyo. And I visit many temples.\nTutor: 'I visited many temples.' You're getting the pattern — irregular verbs need extra attention.\n\"\"\"\n\nsystem_prompt = \"\"\"You are a language lesson assistant. Given a lesson transcript, produce a JSON object with three keys:\n- \"summary\": a concise lesson summary covering topics, vocabulary, and grammar points discussed.\n- \"feedback\": specific, actionable feedback on the student's mistakes, grouped by error type.\n- \"exercises\": 3-5 short exercises targeting the student's weak points, each with a question and an answer.\nOutput valid JSON only, no extra text.\"\"\"\n\nresponse = client.chat.completions.create(\n model=\"gpt-4o-mini\",\n messages=[\n {\"role\": \"system\", \"content\": system_prompt},\n {\"role\": \"user\", \"content\": f\"Transcript:\\n{lesson_transcript}\"}\n ],\n response_format={\"type\": \"json_object\"},\n temperature=0.3\n)\n\nresult = json.loads(response.choices[0].message.content)\n\nprint(\"=== 课程摘要 ===\")\nprint(result[\"summary\"])\nprint(\"\\n=== 个性化反馈 ===\")\nprint(result[\"feedback\"])\nprint(\"\\n=== 针对性练习 ===\")\nfor i, ex in enumerate(result[\"exercises\"], 1):\n print(f\"{i}. {ex['question']}\n 答案: {ex['answer']}\")\n\n\n运行后你会看到类似这样的输出:\n\n\n=== 课程摘要 ===\n本节课主题为旅行经历,讨论了去日本的旅行。重点语法:不规则动词的过去时态(go→went, eat→ate, visit→visited)。词汇涉及旅行、美食、寺庙等。\n\n=== 个性化反馈 ===\n不规则动词过去时态:学生多次将不规则动词误用为原形(go→went, eat→ate, visit→visited)。建议制作不规则动词过去时对照表,每日复习5个。\n\n=== 针对性练习 ===\n1. 将 \"I go to the market yesterday\" 改为正确过去时。\n 答案: I went to the market yesterday.\n2. 填空:I ___ (eat) ramen in Osaka last week.\n 答案: ate\n3. 用过去时造句:visit / the museum\n 答案: I visited the museum.\n\n\n把 lesson_transcript 替换成真实课堂记录,就能产出和 Preply 类似的个性化课后材料。如果要接入生产系统,还需要加上:\n\n- 对话数据的清洗与脱敏(去掉学员隐私信息)\n- 输出的校验层(确保 JSON 结构完整、练习答案正确)\n- 多语言支持(prompt 中指定目标语言)\n\n## 落地时的取舍\n\nPreply 的方案看起来顺滑,但实际部署要处理几个问题:\n\n- 延迟与成本:每节课都调一次大模型,token 消耗和响应时间需要监控。用 gpt-4o-mini 这类轻量模型做摘要,成本可控;如果需要更细致的反馈,可以按需升级。\n- 准确性边界:模型可能误判学员的错误类型,或生成不合适的练习。需要 tutor 有权编辑或驳回 AI 输出——人仍然是最后一道校验。\n- 隐私合规:课堂对话包含个人信息,送入第三方 API 前要确认数据处理协议和学员知情同意。\n\n如果你也在做教育产品,可以从小处起步:先只做"摘要生成",验证学员使用率;再加反馈和练习,观察对学习效果的增量。不要一次性把三个功能全推上线,迭代节奏更健康。\n", "title_en": "How Preply Uses OpenAI to Auto-Generate Lesson Summaries, Feedback, and Exercises", "body_en": "Preply, the online language tutoring platform, has integrated OpenAI into its post-lesson workflow. After each one-on-one session, the system automatically produces a structured lesson summary, personalized feedback, and targeted practice exercises — all derived from the actual classroom interaction data.\n\n## From Scattered Notes to Structured Post-Lesson Reports\n\nBefore this change, students relied on their own memory and whatever notes they managed to jot down. Tutors might send a few tips in chat, but the information was fragmented and often delayed. Preply now feeds the lesson transcript into an OpenAI model and gets back three things within minutes:\n\n- Lesson summary: topics covered, new vocabulary, grammar points discussed.\n- Personalized feedback: specific errors flagged — wrong verb tense, misused prepositions, awkward phrasing — rather than generic encouragement.\n- Practice exercises: fill-in-the-blank, error correction, or translation drills, calibrated to the student's current level and targeting the weaknesses just exposed.\n\nEach output is unique because it's grounded in that specific session's data, not a canned template.\n\n## AI Assists, Tutors Lead\n\nPreply is explicit: AI doesn't replace the tutor. The tutor handles lesson design, real-time correction, motivation, and emotional support. AI takes on the repetitive post-class work — summarizing, diagnosing patterns, generating drills — that tutors rarely have time to do thoroughly. The result is a tighter feedback loop: students arrive better prepared for the next session, and tutors can review the previous lesson's highlights without digging through chat logs.\n\n## Build Your Own: A Minimal Working Example\n\nPreply hasn't published full implementation details, but the core logic is straightforward to replicate. Below is a self-contained script that simulates a lesson transcript, calls the OpenAI API, and produces a summary, feedback, and exercises in structured JSON.\n\nInstall dependencies:\n\nbash\npip install openai python-dotenv\n\n\nCreate a .env file:\n\n\nOPENAI_API_KEY=sk-your-key-here\n\n\nThen run:\n\npython\nimport os\nimport json\nfrom openai import OpenAI\nfrom dotenv import load_dotenv\n\nload_dotenv()\nclient = OpenAI()\n\n# Simulated lesson transcript\nlesson_transcript = \"\"\"\nTutor: Today we're talking about travel. Have you been to any interesting places recently?\nStudent: I go to Japan last year. It was very beautiful.\nTutor: Good! But remember — 'I went to Japan', not 'I go'. Past tense uses 'went' for 'go'.\nStudent: Oh, I went to Japan. The food was delicious. I eat sushi every day.\nTutor: Another past tense tip — 'I ate sushi', not 'I eat'. Let's practice: say 'I ate tempura in Tokyo'.\nStudent: I ate tempura in Tokyo. And I visit many temples.\nTutor: 'I visited many temples.' You're getting the pattern — irregular verbs need extra attention.\n\"\"\"\n\nsystem_prompt = \"\"\"You are a language lesson assistant. Given a lesson transcript, produce a JSON object with three keys:\n- \"summary\": a concise lesson summary covering topics, vocabulary, and grammar points discussed.\n- \"feedback\": specific, actionable feedback on the student's mistakes, grouped by error type.\n- \"exercises\": 3-5 short exercises targeting the student's weak points, each with a question and an answer.\nOutput valid JSON only, no extra text.\"\"\"\n\nresponse = client.chat.completions.create(\n model=\"gpt-4o-mini\",\n messages=[\n {\"role\": \"system\", \"content\": system_prompt},\n {\"role\": \"user\", \"content\": f\"Transcript:\\n{lesson_transcript}\"}\n ],\n response_format={\"type\": \"json_object\"},\n temperature=0.3\n)\n\nresult = json.loads(response.choices[0].message.content)\n\nprint(\"=== Lesson Summary ===\")\nprint(result[\"summary\"])\nprint(\"\\n=== Personalized Feedback ===\")\nprint(result[\"feedback\"])\nprint(\"\\n=== Targeted Exercises ===\")\nfor i, ex in enumerate(result[\"exercises\"], 1):\n print(f\"{i}. {ex['question']}\n Answer: {ex['answer']}\")\n\n\nExpected output:\n\n\n=== Lesson Summary ===\nTopic: travel experiences. Discussed a trip to Japan. Grammar focus: irregular verb past tenses (go→went, eat→ate, visit→visited). Vocabulary: travel, food, temples.\n\n=== Personalized Feedback ===\nIrregular verb past tenses: the student repeatedly used base forms instead of past tense (go→went, eat→ate, visit→visited). Recommendation: create an irregular verb past tense reference sheet and review 5 per day.\n\n=== Targeted Exercises ===\n1. Correct the sentence: \"I go to the market yesterday.\"\n Answer: I went to the market yesterday.\n2. Fill in the blank: I ___ (eat) ramen in Osaka last week.\n Answer: ate\n3. Make a past-tense sentence using: visit / the museum\n Answer: I visited the museum.\n\n\nSwap lesson_transcript for real session data and you get personalized post-lesson materials similar to what Preply ships. For production use, add:\n\n- Data sanitization (strip personal identifiers before sending to the API)\n- Output validation (verify JSON structure and exercise answer correctness)\n- Multi-language support (specify the target language in the prompt)\n\n## Tradeoffs to Watch\n\nPreply's integration looks seamless, but deploying it in practice means navigating a few tensions:\n\n- Latency and cost: calling a large model after every session adds token spend and response time. Using a lighter model like gpt-4o-mini for summaries keeps costs manageable; upgrade selectively when richer feedback is needed.\n- Accuracy limits: the model can misclassify errors or generate flawed exercises. Tutors must be able to review, edit, or reject AI output — humans stay the final quality gate.\n- Privacy compliance: lesson transcripts contain personal data. Before piping them into a third-party API, confirm data processing agreements and obtain student consent.\n\nIf you're building an edtech product, start narrow: launch summary generation first, measure adoption, then layer in feedback and exercises. Pushing all three features at once is tempting but makes iteration harder. One feature at a time keeps the feedback loop tight.\n", "seo_description_en": "Preply integrates OpenAI to auto-generate personalized lesson summaries, feedback, and exercises after each tutoring session. Learn how it works and build your own version with a runnable Python example." }


相关推荐