[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"similar-explosion--spacy-course":3,"tool-explosion--spacy-course":61},[4,18,26,36,44,53],{"id":5,"name":6,"github_repo":7,"description_zh":8,"stars":9,"difficulty_score":10,"last_commit_at":11,"category_tags":12,"status":17},4358,"openclaw","openclaw\u002Fopenclaw","OpenClaw 是一款专为个人打造的本地化 AI 助手，旨在让你在自己的设备上拥有完全可控的智能伙伴。它打破了传统 AI 助手局限于特定网页或应用的束缚，能够直接接入你日常使用的各类通讯渠道，包括微信、WhatsApp、Telegram、Discord、iMessage 等数十种平台。无论你在哪个聊天软件中发送消息，OpenClaw 都能即时响应，甚至支持在 macOS、iOS 和 Android 设备上进行语音交互，并提供实时的画布渲染功能供你操控。\n\n这款工具主要解决了用户对数据隐私、响应速度以及“始终在线”体验的需求。通过将 AI 部署在本地，用户无需依赖云端服务即可享受快速、私密的智能辅助，真正实现了“你的数据，你做主”。其独特的技术亮点在于强大的网关架构，将控制平面与核心助手分离，确保跨平台通信的流畅性与扩展性。\n\nOpenClaw 非常适合希望构建个性化工作流的技术爱好者、开发者，以及注重隐私保护且不愿被单一生态绑定的普通用户。只要具备基础的终端操作能力（支持 macOS、Linux 及 Windows WSL2），即可通过简单的命令行引导完成部署。如果你渴望拥有一个懂你",349277,3,"2026-04-06T06:32:30",[13,14,15,16],"Agent","开发框架","图像","数据工具","ready",{"id":19,"name":20,"github_repo":21,"description_zh":22,"stars":23,"difficulty_score":10,"last_commit_at":24,"category_tags":25,"status":17},3808,"stable-diffusion-webui","AUTOMATIC1111\u002Fstable-diffusion-webui","stable-diffusion-webui 是一个基于 Gradio 构建的网页版操作界面，旨在让用户能够轻松地在本地运行和使用强大的 Stable Diffusion 图像生成模型。它解决了原始模型依赖命令行、操作门槛高且功能分散的痛点，将复杂的 AI 绘图流程整合进一个直观易用的图形化平台。\n\n无论是希望快速上手的普通创作者、需要精细控制画面细节的设计师，还是想要深入探索模型潜力的开发者与研究人员，都能从中获益。其核心亮点在于极高的功能丰富度：不仅支持文生图、图生图、局部重绘（Inpainting）和外绘（Outpainting）等基础模式，还独创了注意力机制调整、提示词矩阵、负向提示词以及“高清修复”等高级功能。此外，它内置了 GFPGAN 和 CodeFormer 等人脸修复工具，支持多种神经网络放大算法，并允许用户通过插件系统无限扩展能力。即使是显存有限的设备，stable-diffusion-webui 也提供了相应的优化选项，让高质量的 AI 艺术创作变得触手可及。",162132,"2026-04-05T11:01:52",[14,15,13],{"id":27,"name":28,"github_repo":29,"description_zh":30,"stars":31,"difficulty_score":32,"last_commit_at":33,"category_tags":34,"status":17},1381,"everything-claude-code","affaan-m\u002Feverything-claude-code","everything-claude-code 是一套专为 AI 编程助手（如 Claude Code、Codex、Cursor 等）打造的高性能优化系统。它不仅仅是一组配置文件，而是一个经过长期实战打磨的完整框架，旨在解决 AI 代理在实际开发中面临的效率低下、记忆丢失、安全隐患及缺乏持续学习能力等核心痛点。\n\n通过引入技能模块化、直觉增强、记忆持久化机制以及内置的安全扫描功能，everything-claude-code 能显著提升 AI 在复杂任务中的表现，帮助开发者构建更稳定、更智能的生产级 AI 代理。其独特的“研究优先”开发理念和针对 Token 消耗的优化策略，使得模型响应更快、成本更低，同时有效防御潜在的攻击向量。\n\n这套工具特别适合软件开发者、AI 研究人员以及希望深度定制 AI 工作流的技术团队使用。无论您是在构建大型代码库，还是需要 AI 协助进行安全审计与自动化测试，everything-claude-code 都能提供强大的底层支持。作为一个曾荣获 Anthropic 黑客大奖的开源项目，它融合了多语言支持与丰富的实战钩子（hooks），让 AI 真正成长为懂上",159636,2,"2026-04-17T23:33:34",[14,13,35],"语言模型",{"id":37,"name":38,"github_repo":39,"description_zh":40,"stars":41,"difficulty_score":32,"last_commit_at":42,"category_tags":43,"status":17},2271,"ComfyUI","Comfy-Org\u002FComfyUI","ComfyUI 是一款功能强大且高度模块化的视觉 AI 引擎，专为设计和执行复杂的 Stable Diffusion 图像生成流程而打造。它摒弃了传统的代码编写模式，采用直观的节点式流程图界面，让用户通过连接不同的功能模块即可构建个性化的生成管线。\n\n这一设计巧妙解决了高级 AI 绘图工作流配置复杂、灵活性不足的痛点。用户无需具备编程背景，也能自由组合模型、调整参数并实时预览效果，轻松实现从基础文生图到多步骤高清修复等各类复杂任务。ComfyUI 拥有极佳的兼容性，不仅支持 Windows、macOS 和 Linux 全平台，还广泛适配 NVIDIA、AMD、Intel 及苹果 Silicon 等多种硬件架构，并率先支持 SDXL、Flux、SD3 等前沿模型。\n\n无论是希望深入探索算法潜力的研究人员和开发者，还是追求极致创作自由度的设计师与资深 AI 绘画爱好者，ComfyUI 都能提供强大的支持。其独特的模块化架构允许社区不断扩展新功能，使其成为当前最灵活、生态最丰富的开源扩散模型工具之一，帮助用户将创意高效转化为现实。",108322,"2026-04-10T11:39:34",[14,15,13],{"id":45,"name":46,"github_repo":47,"description_zh":48,"stars":49,"difficulty_score":32,"last_commit_at":50,"category_tags":51,"status":17},6121,"gemini-cli","google-gemini\u002Fgemini-cli","gemini-cli 是一款由谷歌推出的开源 AI 命令行工具，它将强大的 Gemini 大模型能力直接集成到用户的终端环境中。对于习惯在命令行工作的开发者而言，它提供了一条从输入提示词到获取模型响应的最短路径，无需切换窗口即可享受智能辅助。\n\n这款工具主要解决了开发过程中频繁上下文切换的痛点，让用户能在熟悉的终端界面内直接完成代码理解、生成、调试以及自动化运维任务。无论是查询大型代码库、根据草图生成应用，还是执行复杂的 Git 操作，gemini-cli 都能通过自然语言指令高效处理。\n\n它特别适合广大软件工程师、DevOps 人员及技术研究人员使用。其核心亮点包括支持高达 100 万 token 的超长上下文窗口，具备出色的逻辑推理能力；内置 Google 搜索、文件操作及 Shell 命令执行等实用工具；更独特的是，它支持 MCP（模型上下文协议），允许用户灵活扩展自定义集成，连接如图像生成等外部能力。此外，个人谷歌账号即可享受免费的额度支持，且项目基于 Apache 2.0 协议完全开源，是提升终端工作效率的理想助手。",100752,"2026-04-10T01:20:03",[52,13,15,14],"插件",{"id":54,"name":55,"github_repo":56,"description_zh":57,"stars":58,"difficulty_score":32,"last_commit_at":59,"category_tags":60,"status":17},4721,"markitdown","microsoft\u002Fmarkitdown","MarkItDown 是一款由微软 AutoGen 团队打造的轻量级 Python 工具，专为将各类文件高效转换为 Markdown 格式而设计。它支持 PDF、Word、Excel、PPT、图片（含 OCR）、音频（含语音转录）、HTML 乃至 YouTube 链接等多种格式的解析，能够精准提取文档中的标题、列表、表格和链接等关键结构信息。\n\n在人工智能应用日益普及的今天，大语言模型（LLM）虽擅长处理文本，却难以直接读取复杂的二进制办公文档。MarkItDown 恰好解决了这一痛点，它将非结构化或半结构化的文件转化为模型“原生理解”且 Token 效率极高的 Markdown 格式，成为连接本地文件与 AI 分析 pipeline 的理想桥梁。此外，它还提供了 MCP（模型上下文协议）服务器，可无缝集成到 Claude Desktop 等 LLM 应用中。\n\n这款工具特别适合开发者、数据科学家及 AI 研究人员使用，尤其是那些需要构建文档检索增强生成（RAG）系统、进行批量文本分析或希望让 AI 助手直接“阅读”本地文件的用户。虽然生成的内容也具备一定可读性，但其核心优势在于为机器",93400,"2026-04-06T19:52:38",[52,14],{"id":62,"github_repo":63,"name":64,"description_en":65,"description_zh":66,"ai_summary_zh":66,"readme_en":67,"readme_zh":68,"quickstart_zh":69,"use_case_zh":70,"hero_image_url":71,"owner_login":72,"owner_name":73,"owner_avatar_url":74,"owner_bio":75,"owner_company":76,"owner_location":76,"owner_email":77,"owner_twitter":76,"owner_website":78,"owner_url":79,"languages":80,"stars":107,"forks":108,"last_commit_at":109,"license":110,"difficulty_score":111,"env_os":112,"env_gpu":113,"env_ram":113,"env_deps":114,"category_tags":123,"github_topics":125,"view_count":32,"oss_zip_url":76,"oss_zip_packed_at":76,"status":17,"created_at":138,"updated_at":139,"faqs":140,"releases":169},8994,"explosion\u002Fspacy-course","spacy-course","👩‍🏫 Advanced NLP with spaCy: A free online course","spacy-course 是一套免费的在线进阶自然语言处理（NLP）课程，旨在帮助学习者掌握如何使用 spaCy 库构建高级语言理解系统。它解决了从基础语法分析迈向复杂 NLP 应用时的学习断层问题，通过结合规则匹配与机器学习两种主流方法，引导用户深入理解技术原理并付诸实践。\n\n这套资源特别适合具备一定编程基础的开发者、数据科学家及 AI 研究人员进行自学。课程设计灵活包容，鼓励探索式学习：所有练习题均提供提示与完整解决方案，用户可随时查看参考代码并按自己的节奏标记进度，无需担心犯错。\n\n在技术实现上，spacy-course 不仅内容详实，其本身也是一个现代化的开源 Web 框架范例。前端采用 Gatsby、Reveal.js 和 Plyr 打造流畅的交互体验，后端则巧妙集成 Binder 服务，允许用户在浏览器中直接运行和修改代码示例，无需本地配置环境。目前课程已支持英语、德语和西班牙语等多种语言版本，所有内容均在开放许可协议下发布，是社区驱动技术教育的优秀典范。","# Advanced NLP with spaCy: A free online course\n\nThis repo contains both an [**online course**](https:\u002F\u002Fcourse.spacy.io), as well\nas its modern open-source web framework. In the course, you'll learn how to use\n[spaCy](https:\u002F\u002Fspacy.io) to build advanced natural language understanding\nsystems, using both rule-based and machine learning approaches. The front-end is\npowered by [Gatsby](http:\u002F\u002Fgatsbyjs.org\u002F), [Reveal.js](https:\u002F\u002Frevealjs.com) and\n[Plyr](https:\u002F\u002Fgithub.com\u002Fsampotts\u002Fplyr), and the back-end code execution uses\n[Binder](https:\u002F\u002Fmybinder.org) 💖 It's all open-source and published under the\nMIT license (code and framework) and CC BY-NC (spaCy course materials).\n\n_This course is mostly intended for **self-study**. Yes, you can cheat – the\nsolutions are all in this repo, there's no penalty for clicking \"Show hints\" or\n\"Show solution\", and you can mark an exercise as done when you think it's done._\n\n[![Azure Pipelines](https:\u002F\u002Fimg.shields.io\u002Fazure-devops\u002Fbuild\u002Fexplosion-ai\u002Fpublic\u002F10\u002Fmaster.svg?logo=azure-devops&style=flat-square)](https:\u002F\u002Fdev.azure.com\u002Fexplosion-ai\u002Fpublic\u002F_build?definitionId=10)\n![Netlify Status](https:\u002F\u002Foss.gittoolsai.com\u002Fimages\u002Fexplosion_spacy-course_readme_999412434a2f.png)\n[![Binder](https:\u002F\u002Fmybinder.org\u002Fbadge_logo.svg)](https:\u002F\u002Fmybinder.org\u002Fv2\u002Fgh\u002Fexplosion\u002Fspacy-course\u002Fmaster)\n\n## 💬 Languages and Translations\n\n| Language                                     | Text Examples\u003Csup>1\u003C\u002Fsup> | Source                                                       | Authors                                                                                                                                                                                                                                                                                                                                                                                                                                              |\n| -------------------------------------------- | ------------------------- | ------------------------------------------------------------ | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |\n| **[English](https:\u002F\u002Fcourse.spacy.io\u002Fen)**    | English                   | [`chapters\u002Fen`](chapters\u002Fen), [`exercises\u002Fen`](exercises\u002Fen) | [@ines](https:\u002F\u002Fgithub.com\u002Fines)                                                                                                                                                                                                                                                                                                                                                                                                                     |\n| **[German](https:\u002F\u002Fcourse.spacy.io\u002Fde)**     | German                    | [`chapters\u002Fde`](chapters\u002Fde), [`exercises\u002Fde`](exercises\u002Fde) | [@ines](https:\u002F\u002Fgithub.com\u002Fines), [@Jette16](https:\u002F\u002Fgithub.com\u002FJette16)                                                                                                                                                                                                                                                                                                                                                                             |\n| **[Spanish](https:\u002F\u002Fcourse.spacy.io\u002Fes)**    | Spanish                   | [`chapters\u002Fes`](chapters\u002Fes), [`exercises\u002Fes`](exercises\u002Fes) | [@mariacamilagl](https:\u002F\u002Fgithub.com\u002Fmariacamilagl), [@damian-romero](https:\u002F\u002Fgithub.com\u002Fdamian-romero)                                                                                                                                                                                                                                                                                                                                               |\n| **[French](https:\u002F\u002Fcourse.spacy.io\u002Ffr)**     | French                    | [`chapters\u002Ffr`](chapters\u002Ffr), [`exercises\u002Ffr`](exercises\u002Ffr) | [@datakime](https:\u002F\u002Fgithub.com\u002Fdatakime)                                                                                                                                                                                                                                                                                                                                                                                                             |\n| **[Japanese](https:\u002F\u002Fcourse.spacy.io\u002Fja)**   | Japanese                  | [`chapters\u002Fja`](chapters\u002Fja), [`exercises\u002Fja`](exercises\u002Fja) | [@tamuhey](https:\u002F\u002Fgithub.com\u002Ftamuhey), [@hiroshi-matsuda-rit](https:\u002F\u002Fgithub.com\u002Fhiroshi-matsuda-rit), [@icoxfog417](https:\u002F\u002Fgithub.com\u002Ficoxfog417), [@akirakubo](https:\u002F\u002Fgithub.com\u002Fakirakubo), [@forest1988](https:\u002F\u002Fgithub.com\u002Fforest1988), [@ao9mame](https:\u002F\u002Fgithub.com\u002Fao9mame), [@matsurih](https:\u002F\u002Fgithub.com\u002Fmatsurih), [@HiromuHota](https:\u002F\u002Fgithub.com\u002FHiromuHota), [@mei28](https:\u002F\u002Fgithub.com\u002Fmei28), [@polm](https:\u002F\u002Fgithub.com\u002Fpolm) |\n| **[Chinese](https:\u002F\u002Fcourse.spacy.io\u002Fzh)**    | Chinese                   | [`chapters\u002Fzh`](chapters\u002Fzh), [`exercises\u002Fzh`](exercises\u002Fzh) | [@crownpku](https:\u002F\u002Fgithub.com\u002Fcrownpku)                                                                                                                                                                                                                                                                                                                                                                                                             |\n| **[Portuguese](https:\u002F\u002Fcourse.spacy.io\u002Fpt)** | English                   | [`chapters\u002Fpt`](chapters\u002Fpt), [`exercises\u002Fpt`](exercises\u002Fpt) | [@Cristianasp](https:\u002F\u002Fgithub.com\u002FCristianasp)                                                                                                                                                                                                                                                                                                                                                                                                       |\n\nIf you spot a mistake, I always appreciate\n[pull requests](https:\u002F\u002Fgithub.com\u002Fexplosion\u002Fspacy-course\u002Fpulls)!\n\n**1.** This is the language used for the text examples and resources used in the\nexercises. For example, the German version of the course also uses German text\nexamples and models. It's not always possible to translate all code examples, so\nsome translations may still use and analyze English text as part of the course.\n\n### Related resources\n\n- 📚 **Prefer notebooks?** Check out\n  [the Jupyter notebook version](https:\u002F\u002Fgithub.com\u002Fcristianasp\u002Fspacy) of this\n  course, put together by [@cristianasp](https:\u002F\u002Fgithub.com\u002Fcristianasp).\n\n## 💁 FAQ\n\n#### Is this related to the spaCy course on DataCamp?\n\nI originally developed the content for DataCamp, but I wanted to make a free\nversion to make it available to more people, and so you don't have to sign up\nfor their service. As a weekend project, I ended up putting together my own\nlittle app to present the exercises and content in a fun and interactive way.\n\n#### Can I use this to build my own course?\n\nProbably, yes! If you've been looking for a DIY way to publish your materials, I\nhope that my little framework can be useful. Because so many people expressed\ninterest in this, I put together some starter repos that you can fork and adapt:\n\n- 🐍 Python:\n  [`ines\u002Fcourse-starter-python`](https:\u002F\u002Fgithub.com\u002Fines\u002Fcourse-starter-python)\n- 🇷 R: [`ines\u002Fcourse-starter-r`](https:\u002F\u002Fgithub.com\u002Fines\u002Fcourse-starter-r)\n\n#### Why the different licenses?\n\nThe source of the app, UI components and Gatsby framework for building\ninteractive courses is licensed as MIT, like pretty much all of my open-source\nsoftware. The course materials themselves (slides and chapters), are licensed\nunder CC BY-NC. This means that you can use them freely – you just can't make\nmoney off them.\n\n#### I want to help translate this course into my language. How can I contribute?\n\nFirst, thanks so much, this is really cool and valuable to the community 🙌 I've\ntried to set up the course structure so it's easy to add different languages:\nlanguage-specific files are organized into directories in\n[`exercises`](exercises) and [`chapters`](chapters), and other language specific\ntexts are available in [`locale.json`](locale.json). If you want to contribute,\nthere are two different ways to get involved:\n\n1. Start a community translation project. This is the easiest,\n   no-strings-attached way. You can fork the repo, copy-paste the English\n   version, change the\n   [language code](https:\u002F\u002Fwww.loc.gov\u002Fstandards\u002Fiso639-2\u002Fphp\u002Fcode_list.php),\n   start translating and invite others to contribute (if you like). If you're\n   looking for contributors, feel free to open an issue here or tag\n   [@spacy_io](https:\u002F\u002Ftwitter.com\u002Fspacy_io) on Twitter so we can help get the\n   word out. We're also happy to answer your questions on the issue tracker.\n\n2. Make us an offer. We're open to commissioning translations for different\n   languages, so if you're interested, email us at\n   [contact@explosion.ai](mailto:contact@explosion.ai) and include your offer,\n   estimated time schedule and a bit about you and your background (and any\n   technical writing or translation work you've done in the past, if available).\n   It doesn't matter where you're based, but you should be able to issue\n   invoices as a freelancer or similar, depending on your country.\n\n#### I want to help create an audio\u002Fvideo tutorial for an existing translation. How can I get involved?\n\nAgain, thanks, this is super cool! While the\n[English](https:\u002F\u002Fwww.youtube.com\u002Fwatch?v=THduWAnG97k) and\n[German](https:\u002F\u002Fwww.youtube.com\u002Fwatch?v=K1elwpgDdls) videos also include a\nvideo recording, it's not a requirement and we'd be happy to just provide an\naudio track alongside the slides. We'd take care of the postprocessing and video\nediting, so all we need is the audio recording. If you feel comfortable\nrecording yourself reading out the slide notes in your language, email us at\n[contact@explosion.ai](mailto:contact@explosion.ai) and make us an offer and\ninclude a bit about you and similar work you've done in the past, if available.\n\n## 🎛 Usage & API\n\n### Running the app\n\nTo start the local development server, install [Gatsby](https:\u002F\u002Fgatsbyjs.org)\nand then all other dependencies, then use `npm run dev` to start the development\nserver. Make sure you have at least Node 10.15 installed.\n\n```bash\nnpm install -g gatsby-cli  # Install Gatsby globally\nnpm install                # Install dependencies\nnpm run dev                # Run the development server\n```\n\nIf running with docker just run `make build` and then `make gatsby-dev`\n\n### How it works\n\nWhen building the site, Gatsby will look for `.py` files and make their contents\navailable to query via GraphQL. This lets us use the raw code within the app.\nUnder the hood, the app uses [Binder](https:\u002F\u002Fmybinder.org) to serve up an image\nwith the package dependencies, including the spaCy models. By calling into\n[JupyterLab](https:\u002F\u002Fjupyterlab.readthedocs.io\u002Fen\u002Fstable\u002F), we can then execute\ncode using the active kernel. This lets you edit the code in the browser and see\nthe live results. Also see my [`juniper`](https:\u002F\u002Fgithub.com\u002Fines\u002Fjuniper) repo\nfor more details on the implementation.\n\nTo validate the code when the user hits \"Submit\", I'm currently using a slightly\nhacky trick. Since the Python code is sent back to the kernel as a string, we\ncan manipulate it and add tests – for example, exercise `exc_01_02_01.py` will\nbe validated using `test_01_02_01.py` (if available). The user code and test are\ncombined using a string template. At the moment, the `testTemplate` in the\n`meta.json` looks like this:\n\n```\nfrom wasabi import msg\n__msg__ = msg\n__solution__ = \"\"\"${solution}\"\"\"\n${solution}\n\n${test}\ntry:\n    test()\nexcept AssertionError as e:\n    __msg__.fail(e)\n```\n\nIf present, `${solution}` will be replaced with the string value of the\nsubmitted user code. In this case, we're inserting it twice: once as a string so\nwe can check whether the submission includes something, and once as the code, so\nwe can actually run it and check the objects it creates. `${test}` is replaced\nby the contents of the test file. I'm also making\n[`wasabi`](https:\u002F\u002Fgithub.com\u002Fines\u002Fwasabi)'s printer available as `__msg__`, so\nwe can easily print pretty messages in the tests. Finally, the `try`\u002F`accept`\nblock checks if the test function raises an `AssertionError` and if so, displays\nthe error message. This also hides the full error traceback (which can easily\nleak the correct answers).\n\nA test file could then look like this:\n\n```python\ndef test():\n    assert \"spacy.load\" in __solution__, \"Are you calling spacy.load?\"\n    assert nlp.meta[\"lang\"] == \"en\", \"Are you loading the correct model?\"\n    assert nlp.meta[\"name\"] == \"core_web_sm\", \"Are you loading the correct model?\"\n    assert \"nlp(text)\" in __solution__, \"Are you processing the text correctly?\"\n    assert \"print(doc.text)\" in __solution__, \"Are you printing the Doc's text?\"\n\n    __msg__.good(\n        \"Well done! Now that you've practiced loading models, let's look at \"\n        \"some of their predictions.\"\n    )\n```\n\nWith this approach, it's not _always_ possible to validate the input perfectly –\nthere are too many options and we want to avoid false positives.\n\n#### Running automated tests\n\nThe automated tests make sure that the provided solution code is compatible with\nthe test file that's used to validate submissions. The test suite is powered by\nthe [`pytest`](https:\u002F\u002Fdocs.pytest.org\u002Fen\u002Flatest\u002F) framework and runnable test\nfiles are generated automatically in a directory `__tests__` before the test\nsession starts. See the [`conftest.py`](conftest.py) for implementation details.\n\n```bash\n# Install requirements\npip install -r binder\u002Frequirements.txt\n# Run the tests (will generate the files automatically)\npython -m pytest __tests__\n```\n\nIf running with docker just run `make build` and then `make pytest`\n\n### Directory Structure\n\n```yaml\n├── binder\n|   └── requirements.txt  # Python dependency requirements for Binder\n├── chapters              # chapters, grouped by language\n|   ├── en                # English chapters, one Markdown file per language\n|   |   └── slides        # English slides, one Markdown file per presentation\n|   └── ...               # other languages\n├── exercises             # code files, tests and assets for exercises\n|   ├── en                # English exercises, solutions, tests and data\n|   └── ...               # other languages\n├── public                # compiled site\n├── src                   # Gatsby\u002FReact source, independent from content\n├── static                # static assets like images, available in slides\u002Fchapters\n├── locale.json           # translations of meta and UI text\n├── meta.json             # course metadata\n└── theme.sass            # UI theme colors and settings\n```\n\n### Setting up Binder\n\nThe [`requirements.txt`](binder\u002Frequirements.txt) in the repository defines the\npackages that are installed when building it with Binder. For this course, I'm\nusing the source repo as the Binder repo, as it allows to keep everything in one\nplace. It also lets the exercises reference and load other files (e.g. JSON),\nwhich will be copied over into the Python environment. I build the binder from a\nbranch `binder`, though, which I only update if Binder-relevant files change.\nOtherwise, every update to `master` would trigger an image rebuild.\n\nYou can specify the binder settings like repo, branch and kernel type in the\n`\"juniper\"` section of the `meta.json`. I'd recommend running the very first\nbuild via the interface on the [Binder website](https:\u002F\u002Fmybinder.org), as this\ngives you a detailed build log and feedback on whether everything worked as\nexpected. Enter your repository URL, click \"launch\" and wait for it to install\nthe dependencies and build the image.\n\n![Binder](https:\u002F\u002Foss.gittoolsai.com\u002Fimages\u002Fexplosion_spacy-course_readme_64e672f7c1c4.png)\n\n### File formats\n\n#### Chapters\n\nChapters are placed in [`\u002Fchapters`](\u002Fchapters) and are Markdown files\nconsisting of `\u003Cexercise>` components. They'll be turned into pages, e.g.\n`\u002Fchapter1`. In their frontmatter block at the top of the file, they need to\nspecify `type: chapter`, as well as the following meta:\n\n```yaml\n---\ntitle: The chapter title\ndescription: The chapter description\nprev: \u002Fchapter1 # exact path to previous chapter or null to not show a link\nnext: \u002Fchapter3 # exact path to next chapter or null to not show a link\nid: 2 # unique identifier for chapter\ntype: chapter # important: this creates a standalone page from the chapter\n---\n\n```\n\n#### Slides\n\nSlides are placed in [`\u002Fslides`](\u002Fslides) and are markdown files consisting of\nslide content, separated by `---`. They need to specify the following\nfrontmatter block at the top of the file:\n\n```yaml\n---\ntype: slides\n---\n\n```\n\nThe **first and last slide** use a special layout and will display the headline\nin the center of the slide. **Speaker notes** (in this case, the script) can be\nadded at the end of a slide, prefixed by `Notes:`. They'll then be shown on the\nright next to the slides. Here's an example slides file:\n\n```markdown\n---\ntype: slide\n---\n\n# Processing pipelines\n\nNotes: This is a slide deck about processing pipelines.\n\n---\n\n# Next slide\n\n- Some bullet points here\n- And another bullet point\n\n\u003Cimg src=\"\u002Fimage.jpg\" alt=\"An image located in \u002Fstatic\" \u002F>\n```\n\n### Custom Elements\n\nWhen using custom elements, make sure to place a newline between the\nopening\u002Fclosing tags and the children. Otherwise, Markdown content may not\nrender correctly.\n\n#### `\u003Cexercise>`\n\nContainer of a single exercise.\n\n| Argument     | Type            | Description                                                    |\n| ------------ | --------------- | -------------------------------------------------------------- |\n| `id`         | number \u002F string | Unique exercise ID within chapter.                             |\n| `title`      | string          | Exercise title.                                                |\n| `type`       | string          | Optional type. `\"slides\"` makes container wider and adds icon. |\n| **children** | -               | The contents of the exercise.                                  |\n\n```markdown\n\u003Cexercise id=\"1\" title=\"Introduction to spaCy\">\n\nContent goes here...\n\n\u003C\u002Fexercise>\n```\n\n#### `\u003Ccodeblock>`\n\n| Argument     | Type            | Description                                                                                  |\n| ------------ | --------------- | -------------------------------------------------------------------------------------------- |\n| `id`         | number \u002F string | Unique identifier of the code exercise.                                                      |\n| `source`     | string          | Name of the source file (without file extension). Defaults to `exc_${id}` if not set.        |\n| `solution`   | string          | Name of the solution file (without file extension). Defaults to `solution_${id}` if not set. |\n| `test`       | string          | Name of the test file (without file extension). Defaults to `test_${id}` if not set.         |\n| **children** | string          | Optional hints displayed when the user clicks \"Show hints\".                                  |\n\n```markdown\n\u003Ccodeblock id=\"02_03\">\n\nThis is a hint!\n\n\u003C\u002Fcodeblock>\n```\n\n#### `\u003Cslides>`\n\nContainer to display slides interactively using Reveal.js and a Markdown file.\n\n| Argument | Type   | Description                                   |\n| -------- | ------ | --------------------------------------------- |\n| `source` | string | Name of slides file (without file extension). |\n\n```markdown\n\u003Cslides source=\"chapter1_01_introduction-to-spacy\">\n\u003C\u002Fslides>\n```\n\n#### `\u003Cchoice>`\n\nContainer for multiple-choice question.\n\n| Argument     | Type            | Description                                                                                  |\n| ------------ | --------------- | -------------------------------------------------------------------------------------------- |\n| `id`         | string \u002F number | Optional unique ID. Can be used if more than one choice question is present in one exercise. |\n| **children** | nodes           | Only `\u003Copt>` components for the options.                                                     |\n\n```markdown\n\u003Cchoice>\n\n\u003Copt text=\"Option one\">You have selected option one! This is not good.\u003C\u002Fopt>\n\u003Copt text=\"Option two\" correct=\"true\">Yay! \u003C\u002Fopt>\n\n\u003C\u002Fchoice>\n```\n\n#### `\u003Copt>`\n\nA multiple-choice option.\n\n| Argument     | Type   | Description                                                                                    |\n| ------------ | ------ | ---------------------------------------------------------------------------------------------- |\n| `text`       | string | The option text to be displayed. Supports inline HTML.                                         |\n| `correct`    | string | `\"true\"` if the option is the correct answer.                                                  |\n| **children** | string | The text to be displayed if the option is selected (explaining why it's correct or incorrect). |\n","# 使用 spaCy 的高级自然语言处理：免费在线课程\n\n此仓库包含一个[**在线课程**](https:\u002F\u002Fcourse.spacy.io)，以及其现代化的开源Web框架。在课程中，您将学习如何使用[spaCy](https:\u002F\u002Fspacy.io)构建先进的自然语言理解系统，同时采用基于规则和机器学习的方法。前端由[Gatsby](http:\u002F\u002Fgatsbyjs.org\u002F)、[Reveal.js](https:\u002F\u002Frevealjs.com)和[Plyr](https:\u002F\u002Fgithub.com\u002Fsampotts\u002Fplyr)提供支持，后端代码执行则借助[Binder](https:\u002F\u002Fmybinder.org)实现 💖。整个项目均为开源，并以MIT许可证（代码和框架）及CC BY-NC协议（spaCy课程材料）发布。\n\n_本课程主要面向**自学**者。是的，您可以“作弊”——所有答案都包含在这个仓库中，点击“显示提示”或“显示答案”并不会受到任何惩罚，当您认为某个练习已完成时，也可以将其标记为已完成。_\n\n[![Azure Pipelines](https:\u002F\u002Fimg.shields.io\u002Fazure-devops\u002Fbuild\u002Fexplosion-ai\u002Fpublic\u002F10\u002Fmaster.svg?logo=azure-devops&style=flat-square)](https:\u002F\u002Fdev.azure.com\u002Fexplosion-ai\u002Fpublic\u002F_build?definitionId=10)\n![Netlify 状态](https:\u002F\u002Foss.gittoolsai.com\u002Fimages\u002Fexplosion_spacy-course_readme_999412434a2f.png)\n[![Binder](https:\u002F\u002Fmybinder.org\u002Fbadge_logo.svg)](https:\u002F\u002Fmybinder.org\u002Fv2\u002Fgh\u002Fexplosion\u002Fspacy-course\u002Fmaster)\n\n## 💬 语言与翻译\n\n| 语言                                     | 文本示例\u003Csup>1\u003C\u002Fsup> | 来源                                                       | 作者                                                                                                                                                                                                                                                                                                                                                                                                                                              |\n| -------------------------------------------- | ------------------------- | ------------------------------------------------------------ | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |\n| **[英语](https:\u002F\u002Fcourse.spacy.io\u002Fen)**    | 英语                   | [`chapters\u002Fen`](chapters\u002Fen), [`exercises\u002Fen`](exercises\u002Fen) | [@ines](https:\u002F\u002Fgithub.com\u002Fines)                                                                                                                                                                                                                                                                                                                                                                                                                     |\n| **[德语](https:\u002F\u002Fcourse.spacy.io\u002Fde)**     | 德语                    | [`chapters\u002Fde`](chapters\u002Fde), [`exercises\u002Fde`](exercises\u002Fde) | [@ines](https:\u002F\u002Fgithub.com\u002Fines), [@Jette16](https:\u002F\u002Fgithub.com\u002FJette16)                                                                                                                                                                                                                                                                                                                                                                             |\n| **[西班牙语](https:\u002F\u002Fcourse.spacy.io\u002Fes)**    | 西班牙语                   | [`chapters\u002Fes`](chapters\u002Fes), [`exercises\u002Fes`](exercises\u002Fes) | [@mariacamilagl](https:\u002F\u002Fgithub.com\u002Fmariacamilagl), [@damian-romero](https:\u002F\u002Fgithub.com\u002Fdamian-romero)                                                                                                                                                                                                                                                                                                                                               |\n| **[法语](https:\u002F\u002Fcourse.spacy.io\u002Ffr)**     | 法语                    | [`chapters\u002Ffr`](chapters\u002Ffr), [`exercises\u002Ffr`](exercises\u002Ffr) | [@datakime](https:\u002F\u002Fgithub.com\u002Fdatakime)                                                                                                                                                                                                                                                                                                                                                                                                             |\n| **[日语](https:\u002F\u002Fcourse.spacy.io\u002Fja)**   | 日语                  | [`chapters\u002Fja`](chapters\u002Fja), [`exercises\u002Fja`](exercises\u002Fja) | [@tamuhey](https:\u002F\u002Fgithub.com\u002Ftamuhey), [@hiroshi-matsuda-rit](https:\u002F\u002Fgithub.com\u002Fhiroshi-matsuda-rit), [@icoxfog417](https:\u002F\u002Fgithub.com\u002Ficoxfog417), [@akirakubo](https:\u002F\u002Fgithub.com\u002Fakirakubo), [@forest1988](https:\u002F\u002Fgithub.com\u002Fforest1988), [@ao9mame](https:\u002F\u002Fgithub.com\u002Fao9mame), [@matsurih](https:\u002F\u002Fgithub.com\u002Fmatsurih), [@HiromuHota](https:\u002F\u002Fgithub.com\u002FHiromuHota), [@mei28](https:\u002F\u002Fgithub.com\u002Fmei28), [@polm](https:\u002F\u002Fgithub.com\u002Fpolm) |\n| **[中文](https:\u002F\u002Fcourse.spacy.io\u002Fzh)**    | 中文                   | [`chapters\u002Fzh`](chapters\u002Fzh), [`exercises\u002Fzh`](exercises\u002Fzh) | [@crownpku](https:\u002F\u002Fgithub.com\u002Fcrownpku)                                                                                                                                                                                                                                                                                                                                                                                                             |\n| **[葡萄牙语](https:\u002F\u002Fcourse.spacy.io\u002Fpt)** | 英语                   | [`chapters\u002Fpt`](chapters\u002Fpt), [`exercises\u002Fpt`](exercises\u002Fpt) | [@Cristianasp](https:\u002F\u002Fgithub.com\u002FCristianasp)                                                                                                                                                                                                                                                                                                                                                                                                       |\n\n如果您发现任何错误，欢迎随时提交\n[pull requests](https:\u002F\u002Fgithub.com\u002Fexplosion\u002Fspacy-course\u002Fpulls)！\n\n**1.** 这是指练习中使用的文本示例和资源所采用的语言。例如，德语版课程也会使用德语文本示例和模型。由于并非所有代码示例都能翻译，因此部分翻译版本在课程中仍会使用并分析英语文本。\n\n### 相关资源\n\n- 📚 **更喜欢笔记本？** 请查看由 [@cristianasp](https:\u002F\u002Fgithub.com\u002Fcristianasp) 整理的\n  [Jupyter 笔记本版本](https:\u002F\u002Fgithub.com\u002Fcristianasp\u002Fspacy) 的本课程。\n\n## 💁 常见问题解答\n\n#### 这是否与 DataCamp 上的 spaCy 课程相关？\n\n我最初是为 DataCamp 开发这些内容的，但我想制作一个免费版本，以便让更多人使用，这样大家就不必注册他们的服务了。作为一个周末项目，我最终搭建了一个自己的小应用，以有趣且互动的方式呈现练习和内容。\n\n#### 我可以用这个来构建自己的课程吗？\n\n大概可以！如果你一直在寻找一种自助式的方式来发布你的学习材料，我希望我的这个小框架能对你有所帮助。由于很多人对此表现出兴趣，我整理了一些入门仓库，你可以直接 fork 并进行调整：\n\n- 🐍 Python：[`ines\u002Fcourse-starter-python`](https:\u002F\u002Fgithub.com\u002Fines\u002Fcourse-starter-python)\n- 🇷 R：[`ines\u002Fcourse-starter-r`](https:\u002F\u002Fgithub.com\u002Fines\u002Fcourse-starter-r)\n\n#### 为什么有不同的许可证？\n\n用于构建交互式课程的应用程序源代码、UI 组件以及 Gatsby 框架采用 MIT 许可证，这与我几乎所有开源软件的许可证一致。而课程本身的材料（幻灯片和章节）则采用 CC BY-NC 许可证。这意味着你可以自由使用这些材料，但不能从中获利。\n\n#### 我想帮助将这门课程翻译成我的语言。我该如何贡献？\n\n首先，非常感谢你！这对社区来说真的太棒了，也非常有价值 🙌 我尽量让课程结构便于添加多种语言：特定语言的文件分别放在 [`exercises`](exercises) 和 [`chapters`](chapters) 目录中，其他语言相关的文本则存储在 [`locale.json`](locale.json) 文件中。如果你想参与贡献，有两种方式：\n\n1. 发起一个社区翻译项目。这是最简单、没有任何附加条件的方式。你可以 fork 这个仓库，复制粘贴英文版本，更改\n   [语言代码](https:\u002F\u002Fwww.loc.gov\u002Fstandards\u002Fiso639-2\u002Fphp\u002Fcode_list.php)，开始翻译，并邀请其他人一起参与（如果你愿意的话）。如果你正在寻找合作者，欢迎在这里开一个 issue，或者在 Twitter 上标记 [@spacy_io](https:\u002F\u002Ftwitter.com\u002Fspacy_io)，我们会帮忙宣传。我们也很乐意在 issue tracker 中回答你的问题。\n   \n2. 向我们提出报价。我们愿意委托不同语言的翻译工作，所以如果你感兴趣，请发送邮件至\n   [contact@explosion.ai](mailto:contact@explosion.ai)，并附上你的报价、预计时间安排，以及关于你个人背景的一些信息（如果有过往的技术写作或翻译经验也请一并提供）。无论你身处何地，只要你能够以自由职业者或其他类似身份开具发票即可。\n\n#### 我想帮助为现有翻译版本制作音频\u002F视频教程。我该如何参与？\n\n再次感谢你，这真是太酷了！虽然\n[英语](https:\u002F\u002Fwww.youtube.com\u002Fwatch?v=THduWAnG97k) 和\n[德语](https:\u002F\u002Fwww.youtube.com\u002Fwatch?v=K1elwpgDdls) 视频都包含了画面录制，但这并不是必需的，我们也很乐意只提供音频轨道配合幻灯片使用。后期处理和视频剪辑由我们负责，因此你只需要提供音频录音即可。如果你觉得自己能够用母语朗读幻灯片上的文字说明，请发送邮件至\n[contact@explosion.ai](mailto:contact@explosion.ai)，并向我们提出报价，同时附上一些关于你个人及以往类似工作的信息（如果有的话）。\n\n## 🎛 使用与 API\n\n### 运行应用\n\n要启动本地开发服务器，你需要先安装 [Gatsby](https:\u002F\u002Fgatsbyjs.org)，然后再安装所有其他依赖项，最后运行 `npm run dev` 即可启动开发服务器。请确保你已安装 Node 10.15 或更高版本。\n\n```bash\nnpm install -g gatsby-cli  # 全局安装 Gatsby\nnpm install                # 安装依赖项\nnpm run dev                # 启动开发服务器\n```\n\n如果你使用 Docker 运行，只需执行 `make build`，然后运行 `make gatsby-dev` 即可。\n\n### 工作原理\n\n在构建站点时，Gatsby 会查找 `.py` 文件，并将其内容通过 GraphQL 提供给查询。这样我们就可以在应用中直接使用原始代码。在底层，该应用使用 [Binder](https:\u002F\u002Fmybinder.org) 来提供一个包含包依赖项（包括 spaCy 模型）的镜像。通过调用 [JupyterLab](https:\u002F\u002Fjupyterlab.readthedocs.io\u002Fen\u002Fstable\u002F)，我们可以使用当前内核执行代码。这使得用户可以在浏览器中编辑代码并实时查看结果。有关实现的更多细节，请参阅我的 [`juniper`](https:\u002F\u002Fgithub.com\u002Fines\u002Fjuniper) 仓库。\n\n为了在用户点击“提交”时验证代码，我目前采用了一个略显 hack 的技巧。由于 Python 代码以字符串形式发送回内核，我们可以对其进行操作并添加测试——例如，练习 `exc_01_02_01.py` 将使用 `test_01_02_01.py` 进行验证（如果存在）。用户代码和测试将通过字符串模板合并在一起。目前，`meta.json` 中的 `testTemplate` 如下所示：\n\n```\nfrom wasabi import msg\n__msg__ = msg\n__solution__ = \"\"\"${solution}\"\"\"\n${solution}\n\n${test}\ntry:\n    test()\nexcept AssertionError as e:\n    __msg__.fail(e)\n```\n\n如果存在 `${solution}`，它将被替换为用户提交代码的字符串值。在这种情况下，我们将它插入两次：一次作为字符串，以便检查提交是否包含任何内容；另一次作为代码，以便实际运行并检查其创建的对象。`${test}` 则会被测试文件的内容替换。我还把 [`wasabi`](https:\u002F\u002Fgithub.com\u002Fines\u002Fwasabi) 的打印工具作为 `__msg__` 提供，这样我们就可以在测试中轻松地输出美观的消息。最后，`try`\u002F`except` 块会检查测试函数是否抛出 `AssertionError`，如果是，则显示错误信息。这样做还可以隐藏完整的错误堆栈跟踪（这可能会轻易泄露正确答案）。\n\n一个测试文件可能如下所示：\n\n```python\ndef test():\n    assert \"spacy.load\" in __solution__, \"你是否调用了 spacy.load？\"\n    assert nlp.meta[\"lang\"] == \"en\", \"你是否加载了正确的模型？\"\n    assert nlp.meta[\"name\"] == \"core_web_sm\", \"你是否加载了正确的模型？\"\n    assert \"nlp(text)\" in __solution__, \"你是否正确地处理了文本？\"\n    assert \"print(doc.text)\" in __solution__, \"你是否打印了 Doc 的文本？\"\n\n    __msg__.good(\n        \"做得好！现在你已经练习了加载模型，接下来让我们看看它们的一些预测吧。\"\n    )\n```\n\n采用这种方法，并不能总是完美地验证输入——因为选项太多，而且我们希望避免误报。\n\n#### 运行自动化测试\n\n自动化测试确保提供的解决方案代码与用于验证提交的测试文件兼容。测试套件由 [`pytest`](https:\u002F\u002Fdocs.pytest.org\u002Fen\u002Flatest\u002F) 框架驱动，在测试会话开始前，会在 `__tests__` 目录中自动生成可运行的测试文件。有关实现细节，请参阅 `conftest.py`。\n\n```bash\n# 安装依赖\npip install -r binder\u002Frequirements.txt\n# 运行测试（会自动生成文件）\npython -m pytest __tests__\n```\n\n如果使用 Docker 运行，只需执行 `make build`，然后运行 `make pytest` 即可。\n\n### 目录结构\n\n```yaml\n├── binder\n|   └── requirements.txt  # Binder 所需的 Python 依赖项\n├── chapters              # 按语言分组的章节\n|   ├── en                # 英文章节，每种语言一个 Markdown 文件\n|   |   └── slides        # 英文幻灯片，每场演示一个 Markdown 文件\n|   └── ...               # 其他语言\n├── exercises             # 练习的代码文件、测试和资源\n|   ├── en                # 英文练习、解答、测试和数据\n|   └── ...               # 其他语言\n├── public                # 编译后的站点\n├── src                   # Gatsby\u002FReact 源代码，与内容无关\n├── static                # 静态资源，如图片，可在幻灯片和章节中使用\n├── locale.json           # 元数据和 UI 文本的翻译\n├── meta.json             # 课程元数据\n└── theme.sass            # UI 主题颜色和设置\n```\n\n### 设置 Binder\n\n仓库中的 [`requirements.txt`](binder\u002Frequirements.txt) 定义了使用 Binder 构建时要安装的包。对于本课程，我将源仓库用作 Binder 仓库，这样可以将所有内容集中在一个地方。这也使得练习能够引用和加载其他文件（例如 JSON），这些文件会被复制到 Python 环境中。不过，我是在 `binder` 分支上构建 Binder 的，只有当与 Binder 相关的文件发生变化时才会更新该分支。否则，每次对 `master` 分支的更新都会触发镜像的重新构建。\n\n您可以在 `meta.json` 的 `\"juniper\"` 部分指定 Binder 的设置，如仓库、分支和内核类型。我建议首次构建时通过 [Binder 官网](https:\u002F\u002Fmybinder.org) 上的界面进行操作，这样可以获得详细的构建日志以及关于一切是否按预期工作的反馈。输入您的仓库 URL，点击“启动”，然后等待依赖项安装完毕并完成镜像构建。\n\n![Binder](https:\u002F\u002Foss.gittoolsai.com\u002Fimages\u002Fexplosion_spacy-course_readme_64e672f7c1c4.png)\n\n### 文件格式\n\n#### 章节\n\n章节位于 [`\u002Fchapters`](\u002Fchapters) 目录中，是包含 `\u003Cexercise>` 组件的 Markdown 文件。它们将被转换为页面，例如 `\u002Fchapter1`。在文件顶部的 frontmatter 区域，需要指定 `type: chapter` 以及以下元数据：\n\n```yaml\n---\ntitle: 章节标题\ndescription: 章节描述\nprev: \u002Fchapter1 # 上一章的精确路径，或 null 表示不显示链接\nnext: \u002Fchapter3 # 下一章的精确路径，或 null 表示不显示链接\nid: 2 # 章节的唯一标识符\ntype: chapter # 重要：这会将章节转化为独立页面\n---\n\n```\n\n#### 幻灯片\n\n幻灯片位于 [`\u002Fslides`](\u002Fslides) 目录中，是包含幻灯片内容的 Markdown 文件，各张幻灯片之间用 `---` 分隔。文件顶部需要指定以下 frontmatter 区域：\n\n```yaml\n---\ntype: slides\n---\n\n```\n\n**第一张和最后一张幻灯片** 使用特殊的布局，将在幻灯片中央显示标题。**演讲者备注**（即讲稿）可以添加在幻灯片末尾，前面加上 `Notes:` 标记。这些备注将显示在幻灯片右侧。以下是一个幻灯片文件的示例：\n\n```markdown\n---\ntype: slide\n---\n\n# 处理流水线\n\nNotes: 这是一份关于处理流水线的幻灯片。\n\n---\n\n# 下一张幻灯片\n\n- 这里有一些要点\n- 还有另一个要点\n\n\u003Cimg src=\"\u002Fimage.jpg\" alt=\"位于 \u002Fstatic 的一张图片\" \u002F>\n```\n\n### 自定义元素\n\n使用自定义元素时，请确保在开始标签\u002F结束标签与子元素之间留出空行。否则，Markdown 内容可能无法正确渲染。\n\n#### `\u003Cexercise>`\n\n单个练习的容器。\n\n| 参数     | 类型            | 描述                                                    |\n| ------------ | --------------- | -------------------------------------------------------------- |\n| `id`         | 数字 \u002F 字符串 | 章节内唯一的练习 ID。                             |\n| `title`      | 字符串          | 练习标题。                                                |\n| `type`       | 字符串          | 可选类型。设置为 `\"slides\"` 会使容器更宽，并添加图标。 |\n| **children** | -               | 练习的内容。                                  |\n\n```markdown\n\u003Cexercise id=\"1\" title=\"spaCy 简介\">\n\n内容写在这里...\n\n\u003C\u002Fexercise>\n```\n\n#### `\u003Ccodeblock>`\n\n| 参数     | 类型            | 描述                                                                                  |\n| ------------ | --------------- | -------------------------------------------------------------------------------------------- |\n| `id`         | 数字 \u002F 字符串 | 代码练习的唯一标识符。                                                      |\n| `source`     | 字符串          | 源文件名（不含文件扩展名）。若未设置，则默认为 `exc_${id}`。        |\n| `solution`   | 字符串          | 解答文件名（不含文件扩展名）。若未设置，则默认为 `solution_${id}`。 |\n| `test`       | 字符串          | 测试文件名（不含文件扩展名）。若未设置，则默认为 `test_${id}`。         |\n| **children** | 字符串          | 用户点击“显示提示”时显示的可选提示。                                  |\n\n```markdown\n\u003Ccodeblock id=\"02_03\">\n\n这是一个提示！\n\n\u003C\u002Fcodeblock>\n```\n\n#### `\u003Cslides>`\n\n使用 Reveal.js 和 Markdown 文件交互式展示幻灯片的容器。\n\n| 参数 | 类型   | 描述                                   |\n| -------- | ------ | --------------------------------------------- |\n| `source` | 字符串 | 幻灯片文件名（不含文件扩展名）。 |\n\n```markdown\n\u003Cslides source=\"chapter1_01_introduction-to-spacy\">\n\u003C\u002Fslides>\n```\n\n#### `\u003Cchoice>`\n\n选择题的容器。\n\n| 参数     | 类型            | 描述                                                                                  |\n| ------------ | --------------- | -------------------------------------------------------------------------------------------- |\n| `id`         | 字符串 \u002F 数字 | 可选的唯一 ID。如果一个练习中包含多个选择题，可以使用此 ID。 |\n| **children** | 节点           | 仅包含用于选项的 `\u003Copt>` 组件。                                                     |\n\n```markdown\n\u003Cchoice>\n\n\u003Copt text=\"选项一\">您选择了选项一！这不太好。\u003C\u002Fopt>\n\u003Copt text=\"选项二\" correct=\"true\">太好了！\u003C\u002Fopt>\n\n\u003C\u002Fchoice>\n```\n\n#### `\u003Copt>`\n\n一个多项选择题的选项。\n\n| 参数     | 类型   | 描述                                                                                    |\n| ------------ | ------ | ---------------------------------------------------------------------------------------------- |\n| `text`       | 字符串 | 要显示的选项文本。支持内联 HTML。                                         |\n| `correct`    | 字符串 | 如果该选项是正确答案，则设置为 `\"true\"`。                                                  |\n| **children** | 字符串 | 如果该选项被选中，要显示的文本（解释其正确或错误的原因）。 |","# spaCy 高级自然语言处理课程快速上手指南\n\n本指南旨在帮助中国开发者快速搭建并运行 **spacy-course** 本地开发环境。该项目是一个免费的在线课程框架，用于学习如何使用 spaCy 构建高级自然语言理解系统。\n\n## 环境准备\n\n在开始之前，请确保您的系统满足以下要求：\n\n*   **操作系统**：Linux, macOS 或 Windows (推荐 WSL2)\n*   **Node.js**：版本需 >= 10.15 (建议使用 LTS 版本)\n*   **npm**：随 Node.js 自动安装\n*   **可选 - Docker**：如果您希望使用容器化环境运行，需安装 Docker 和 Make 工具\n*   **网络环境**：由于项目依赖 Binder 进行后端代码执行，请确保网络能访问 `mybinder.org`。如遇到连接问题，建议配置科学上网或使用国内镜像加速节点。\n\n> **提示**：国内用户安装 Node 依赖时，可临时切换淘宝镜像源以提升速度：\n> `npm config set registry https:\u002F\u002Fregistry.npmmirror.com`\n\n## 安装步骤\n\n您可以选择通过 **npm** 直接安装或通过 **Docker** 运行。\n\n### 方式一：使用 npm 安装（推荐）\n\n1.  **全局安装 Gatsby CLI**：\n    ```bash\n    npm install -g gatsby-cli\n    ```\n\n2.  **克隆项目代码**：\n    ```bash\n    git clone https:\u002F\u002Fgithub.com\u002Fexplosion\u002Fspacy-course.git\n    cd spacy-course\n    ```\n\n3.  **安装项目依赖**：\n    ```bash\n    npm install\n    ```\n\n### 方式二：使用 Docker 运行\n\n如果您已安装 Docker 和 Make，可直接构建并运行：\n\n```bash\nmake build\nmake gatsby-dev\n```\n\n## 基本使用\n\n安装完成后，启动本地开发服务器即可开始学习或开发。\n\n1.  **启动开发服务器**：\n    在项目根目录下运行以下命令：\n    ```bash\n    npm run dev\n    ```\n\n2.  **访问课程界面**：\n    终端显示 `Server started` 后，打开浏览器访问：\n    `http:\u002F\u002Flocalhost:8000`\n\n3.  **切换语言**：\n    默认可能为英文界面。访问以下地址直接进入中文版课程：\n    `http:\u002F\u002Flocalhost:8000\u002Fzh`\n\n4.  **交互体验**：\n    *   课程前端由 Gatsby 驱动，练习题支持直接在浏览器中编辑 Python 代码。\n    *   点击\"Run\"或\"Submit\"时，系统会通过 Binder 调用后台 Jupyter 内核执行代码并实时返回结果。\n    *   您可以随时查看章节内容、利用提示（Hints）或查看答案（Solutions）进行自学。\n\n5.  **停止服务**：\n    在终端按 `Ctrl + C` 即可停止开发服务器。","某初创公司的 NLP 工程师李明急需构建一个多语言评论情感分析系统，但团队对 spaCy 的高级特性（如规则匹配与机器学习结合）缺乏系统性认知。\n\n### 没有 spacy-course 时\n- 学习路径支离破碎，只能在零散的技术博客和过时的文档中摸索高级用法，效率极低。\n- 面对复杂的自定义管道（Pipeline）构建，因缺乏实战指引，频繁陷入代码报错却不知如何调试的困境。\n- 难以理解如何将规则系统与统计模型有效结合，导致开发出的原型准确率低且泛化能力差。\n- 团队缺乏统一的练习环境，新成员上手慢，且无法即时验证代码逻辑，沟通成本高昂。\n\n### 使用 spacy-course 后\n- 通过结构化的在线章节，李明快速掌握了从基础到进阶的完整知识体系，大幅缩短了调研时间。\n- 利用内置的交互式练习和即时反馈机制，他直接在浏览器中调试代码，迅速解决了管道配置的难题。\n- 课程中关于“规则 + 机器学习”混合架构的实战案例，帮助他成功设计出高精度的情感分析模型。\n- 团队成员利用开源的课程框架进行自测和协作，统一了技术标准，新人也能通过“提示与解答”功能快速独立上手。\n\nspacy-course 将抽象的 NLP 理论转化为可交互的实战演练，让开发者能以最低成本掌握构建工业级自然语言理解系统的核心能力。","https:\u002F\u002Foss.gittoolsai.com\u002Fimages\u002Fexplosion_spacy-course_9e7f802f.png","explosion","Explosion","https:\u002F\u002Foss.gittoolsai.com\u002Favatars\u002Fexplosion_6bc9ac84.png","Software company specializing in developer tools and tailored solutions for AI and Natural Language Processing",null,"contact@explosion.ai","https:\u002F\u002Fexplosion.ai","https:\u002F\u002Fgithub.com\u002Fexplosion",[81,85,89,93,96,100,104],{"name":82,"color":83,"percentage":84},"Python","#3572A5",80.3,{"name":86,"color":87,"percentage":88},"JavaScript","#f1e05a",8.2,{"name":90,"color":91,"percentage":92},"CSS","#663399",7.8,{"name":94,"color":95,"percentage":10},"Sass","#a53b70",{"name":97,"color":98,"percentage":99},"Shell","#89e051",0.4,{"name":101,"color":102,"percentage":103},"Dockerfile","#384d54",0.1,{"name":105,"color":106,"percentage":103},"Makefile","#427819",2417,376,"2026-04-15T21:27:04","MIT",4,"Linux, macOS, Windows","未说明",{"notes":115,"python":116,"dependencies":117},"该项目主要是一个基于 Gatsby 的在线课程网站框架。前端开发需要安装 Node.js (至少 10.15 版本) 和 Gatsby CLI。代码执行部分依赖 Binder 服务在云端运行 JupyterLab 环境，本地无需配置复杂的 Python 数据科学环境即可浏览课程内容。若要在本地完全复现代码执行功能，需自行配置支持 Jupyter 内核的环境。","未说明 (需支持 Gatsby\u002FNode.js 环境，后端代码通过 Binder\u002FJupyter 执行)",[118,119,120,121,122],"gatsby","reveal.js","plyr","spacy","jupyterlab",[124,14,35],"音频",[121,126,127,128,129,118,130,131,132,133,134,135,136,137],"nlp","natural-language-processing","online-course","course","gatsbyjs","jupyter","binder","machine-learning","named-entity-recognition","dependency-parsing","part-of-speech-tagging","word-vectors","2026-03-27T02:49:30.150509","2026-04-18T17:04:12.327785",[141,146,151,156,161,165],{"id":142,"question_zh":143,"answer_zh":144,"source_url":145},40347,"运行课程代码时遇到 'ValueError: numpy.dtype size changed' 错误怎么办？","这是由于 spaCy 的 C 绑定与新版本 numpy 不兼容导致的。维护者已更新依赖并重建了 Binder 镜像，通常刷新页面或清除浏览器本地存储即可解决。如果问题仍然存在，可以在代码开头添加以下命令强制安装兼容版本的 numpy：\nimport subprocess\nimport sys\nsubprocess.call(\n  [sys.executable, \"-m\", \"pip\", \"install\", \"numpy==1.26.4\"],\n   stdout=subprocess.DEVNULL,\n   stderr=subprocess.STDOUT)\n注意：这可能在某些章节有效，建议优先尝试清除缓存或使用最新环境。","https:\u002F\u002Fgithub.com\u002Fexplosion\u002Fspacy-course\u002Fissues\u002F135",{"id":147,"question_zh":148,"answer_zh":149,"source_url":150},40348,"如何在 Mac 或 Linux 上解决安装 JS 环境（特别是 sharp 包）时的失败问题？","该问题通常与 node-gyp 和 sharp 包的预编译二进制文件缺失有关。推荐解决方案是使用 Docker 环境以避免本地依赖冲突。用户可以构建包含所有更新包的 Docker 镜像，然后运行以下命令：\n1. 运行 make build 构建环境\n2. 运行 make pytest 测试 Python 代码\n3. 运行 make gatsby-dev 启动 Gatsby 开发服务器\n这样可以确保所有依赖项版本一致，避免在 Mac 或 Ubuntu 上手动处理复杂的 npm 依赖地狱。","https:\u002F\u002Fgithub.com\u002Fexplosion\u002Fspacy-course\u002Fissues\u002F53",{"id":152,"question_zh":153,"answer_zh":154,"source_url":155},40349,"是否有包含每章完整代码的独立 Jupyter Notebook 可供下载学习？","是的，社区成员已经整理了包含每章所有代码的独立 Jupyter Notebook。你可以访问以下仓库获取：https:\u002F\u002Fgithub.com\u002Fcristianasp\u002Fspacy。这些 Notebook 适合喜欢在本地环境中交互式学习和做笔记的用户。","https:\u002F\u002Fgithub.com\u002Fexplosion\u002Fspacy-course\u002Fissues\u002F25",{"id":157,"question_zh":158,"answer_zh":159,"source_url":160},40350,"如何参与日语版课程的翻译工作？","日语版课程正在使用中，欢迎贡献者参与翻译。参与者可以 fork 主仓库到个人账户（例如：https:\u002F\u002Fgithub.com\u002Fhiroshi-matsuda-rit\u002Fspacy-course），并在其中添加日语特定的文件（如 exercises\u002Fja\u002F 目录下的练习文件）。建议使用 VSCode 等统一环境进行协作，并通过 Issue 讨论任务分配和所需文件列表。由于工作量较大，贡献者可以逐步提交翻译内容，无需一次性完成所有文件。","https:\u002F\u002Fgithub.com\u002Fexplosion\u002Fspacy-course\u002Fissues\u002F67",{"id":162,"question_zh":163,"answer_zh":164,"source_url":150},40351,"在 Docker 环境中运行课程时，如何配置环境变量和 Makefile？","为了简化 Docker 环境配置，可以将 config.env 中的环境变量直接整合到 Makefile 中。如果只有一个主要的环境变量，这种做法非常合理且符合惯例。修改后的 Makefile 可以直接通过 make build、make pytest 或 make gatsby-dev 命令来构建环境、运行测试或启动开发服务器，无需单独管理 .env 文件。",{"id":166,"question_zh":167,"answer_zh":168,"source_url":150},40352,"遇到 sharp 包安装失败提示 'Handle is not a member of v8' 错误如何解决？","该错误通常是由于 Node.js 版本与 sharp 包不兼容引起的，特别是涉及 node-gyp 编译问题时。建议检查 node-gyp 的相关 issue（如 https:\u002F\u002Fgithub.com\u002Fnodejs\u002Fnode-gyp\u002Fissues\u002F1779），并尝试升级 Node.js 版本或使用 Docker 容器来隔离环境。最稳妥的方法是直接使用项目提供的 Dockerfile，它已经包含了所有经过验证的依赖版本，可避免此类底层编译错误。",[]]