[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"similar-koursaros-ai--nboost":3,"tool-koursaros-ai--nboost":62},[4,18,28,37,45,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":24,"last_commit_at":25,"category_tags":26,"status":17},9989,"n8n","n8n-io\u002Fn8n","n8n 是一款面向技术团队的公平代码（fair-code）工作流自动化平台，旨在让用户在享受低代码快速构建便利的同时，保留编写自定义代码的灵活性。它主要解决了传统自动化工具要么过于封闭难以扩展、要么完全依赖手写代码效率低下的痛点，帮助用户轻松连接 400 多种应用与服务，实现复杂业务流程的自动化。\n\nn8n 特别适合开发者、工程师以及具备一定技术背景的业务人员使用。其核心亮点在于“按需编码”：既可以通过直观的可视化界面拖拽节点搭建流程，也能随时插入 JavaScript 或 Python 代码、调用 npm 包来处理复杂逻辑。此外，n8n 原生集成了基于 LangChain 的 AI 能力，支持用户利用自有数据和模型构建智能体工作流。在部署方面，n8n 提供极高的自由度，支持完全自托管以保障数据隐私和控制权，也提供云端服务选项。凭借活跃的社区生态和数百个现成模板，n8n 让构建强大且可控的自动化系统变得简单高效。",184740,2,"2026-04-19T23:22:26",[16,14,13,15,27],"插件",{"id":29,"name":30,"github_repo":31,"description_zh":32,"stars":33,"difficulty_score":10,"last_commit_at":34,"category_tags":35,"status":17},10095,"AutoGPT","Significant-Gravitas\u002FAutoGPT","AutoGPT 是一个旨在让每个人都能轻松使用和构建 AI 的强大平台，核心功能是帮助用户创建、部署和管理能够自动执行复杂任务的连续型 AI 智能体。它解决了传统 AI 应用中需要频繁人工干预、难以自动化长流程工作的痛点，让用户只需设定目标，AI 即可自主规划步骤、调用工具并持续运行直至完成任务。\n\n无论是开发者、研究人员，还是希望提升工作效率的普通用户，都能从 AutoGPT 中受益。开发者可利用其低代码界面快速定制专属智能体；研究人员能基于开源架构探索多智能体协作机制；而非技术背景用户也可直接选用预置的智能体模板，立即投入实际工作场景。\n\nAutoGPT 的技术亮点在于其模块化“积木式”工作流设计——用户通过连接功能块即可构建复杂逻辑，每个块负责单一动作，灵活且易于调试。同时，平台支持本地自托管与云端部署两种模式，兼顾数据隐私与使用便捷性。配合完善的文档和一键安装脚本，即使是初次接触的用户也能在几分钟内启动自己的第一个 AI 智能体。AutoGPT 正致力于降低 AI 应用门槛，让人人都能成为 AI 的创造者与受益者。",183572,"2026-04-20T04:47:55",[13,36,27,14,15],"语言模型",{"id":38,"name":39,"github_repo":40,"description_zh":41,"stars":42,"difficulty_score":10,"last_commit_at":43,"category_tags":44,"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":46,"name":47,"github_repo":48,"description_zh":49,"stars":50,"difficulty_score":24,"last_commit_at":51,"category_tags":52,"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 真正成长为懂上",161692,"2026-04-20T11:33:57",[14,13,36],{"id":54,"name":55,"github_repo":56,"description_zh":57,"stars":58,"difficulty_score":59,"last_commit_at":60,"category_tags":61,"status":17},8272,"opencode","anomalyco\u002Fopencode","OpenCode 是一款开源的 AI 编程助手（Coding Agent），旨在像一位智能搭档一样融入您的开发流程。它不仅仅是一个代码补全插件，而是一个能够理解项目上下文、自主规划任务并执行复杂编码操作的智能体。无论是生成全新功能、重构现有代码，还是排查难以定位的 Bug，OpenCode 都能通过自然语言交互高效完成，显著减少开发者在重复性劳动和上下文切换上的时间消耗。\n\n这款工具专为软件开发者、工程师及技术研究人员设计，特别适合希望利用大模型能力来提升编码效率、加速原型开发或处理遗留代码维护的专业人群。其核心亮点在于完全开源的架构，这意味着用户可以审查代码逻辑、自定义行为策略，甚至私有化部署以保障数据安全，彻底打破了传统闭源 AI 助手的“黑盒”限制。\n\n在技术体验上，OpenCode 提供了灵活的终端界面（Terminal UI）和正在测试中的桌面应用程序，支持 macOS、Windows 及 Linux 全平台。它兼容多种包管理工具，安装便捷，并能无缝集成到现有的开发环境中。无论您是追求极致控制权的资深极客，还是渴望提升产出的独立开发者，OpenCode 都提供了一个透明、可信",144296,1,"2026-04-16T14:50:03",[13,27],{"id":63,"github_repo":64,"name":65,"description_en":66,"description_zh":67,"ai_summary_zh":67,"readme_en":68,"readme_zh":69,"quickstart_zh":70,"use_case_zh":71,"hero_image_url":72,"owner_login":73,"owner_name":73,"owner_avatar_url":74,"owner_bio":75,"owner_company":76,"owner_location":76,"owner_email":76,"owner_twitter":76,"owner_website":76,"owner_url":77,"languages":78,"stars":107,"forks":108,"last_commit_at":109,"license":110,"difficulty_score":111,"env_os":112,"env_gpu":113,"env_ram":114,"env_deps":115,"category_tags":124,"github_topics":125,"view_count":24,"oss_zip_url":76,"oss_zip_packed_at":76,"status":17,"created_at":142,"updated_at":143,"faqs":144,"releases":178},10174,"koursaros-ai\u002Fnboost","nboost","NBoost is a scalable, search-api-boosting platform for deploying transformer models to improve the relevance of search results on different platforms (i.e. Elasticsearch)","NBoost 是一个可扩展的搜索增强平台，专为提升搜索引擎结果的相关性而设计。它通过部署先进的 Transformer 模型，充当用户与现有搜索引擎（如 Elasticsearch）之间的智能中间层。在传统搜索中，用户直接查询数据库获取结果；而引入 NBoost 后，系统会先由模型对初步检索到的内容进行二次排序和筛选，只将最匹配的答案返回给用户，从而显著优化搜索体验。\n\n这一工具主要解决了传统关键词搜索难以理解语义、导致结果不够精准的问题，特别适用于需要高质量排序输入的场景，如智能问答系统或企业级知识库检索。NBoost 非常适合开发者、数据科学家以及研究人员使用，帮助他们快速构建针对特定领域优化的神经搜索引擎。\n\n其核心技术亮点在于支持微调预训练模型，使其适应垂直领域的搜索需求，并具备出色的泛化能力，即便在与训练集不同的真实数据上也能表现优异。此外，NBoost 架构灵活，支持从本地部署到 Kubernetes 集群的各种环境，让高性能的神经重排序技术能够轻松集成到现有的搜索工作流中。","> 🧪 We're looking for beta testers for our \u003Ca href='https:\u002F\u002Fanswerbot.app'>virtual assistant\u003C\u002Fa> widget. \u003Ca href = 'mailto:jp954@cornell.edu'>Contact us\u003C\u002Fa> if you're interested in using it on your website.\n\n\u003Cp align=\"center\">\n\u003Cimg src=\"https:\u002F\u002Fgithub.com\u002Fkoursaros-ai\u002Fnboost\u002Fraw\u002Fmaster\u002F.github\u002Fbanner.svg?sanitize=true\" alt=\"Nboost\" width=\"70%\">\n\u003C\u002Fp>\n\n\u003Cp align=\"center\">\n\u003Ca href=\"https:\u002F\u002Fcloud.drone.io\u002Fkoursaros-ai\u002Fnboost\">\n    \u003Cimg src=\"https:\u002F\u002Fcloud.drone.io\u002Fapi\u002Fbadges\u002Fkoursaros-ai\u002Fnboost\u002Fstatus.svg\" \u002F>\n\u003C\u002Fa>\n\u003Ca href=\"https:\u002F\u002Fpypi.org\u002Fproject\u002Fnboost\u002F\">\n    \u003Cimg src=\"https:\u002F\u002Fimg.shields.io\u002Fpypi\u002Fpyversions\u002Fnboost.svg\" \u002F>\n\u003C\u002Fa>\n\u003Ca href=\"https:\u002F\u002Fpypi.org\u002Fproject\u002Fnboost\u002F\">\n    \u003Cimg alt=\"PyPI\" src=\"https:\u002F\u002Fimg.shields.io\u002Fpypi\u002Fv\u002Fnboost.svg\">\n\u003C\u002Fa>\n\u003Ca href='https:\u002F\u002Fnboost.readthedocs.io\u002Fen\u002Flatest\u002F'>\n    \u003Cimg src='https:\u002F\u002Foss.gittoolsai.com\u002Fimages\u002Fkoursaros-ai_nboost_readme_13d664e1afd7.png' alt='Documentation Status' \u002F>\n\u003C\u002Fa>\n\u003Ca href=\"https:\u002F\u002Fwww.codacy.com\u002Fapp\u002Fkoursaros-ai\u002Fnboost?utm_source=github.com&amp;utm_medium=referral&amp;utm_content=koursaros-ai\u002Fnboost&amp;utm_campaign=Badge_Grade\">\n    \u003Cimg src=\"https:\u002F\u002Fapi.codacy.com\u002Fproject\u002Fbadge\u002FGrade\u002Fa9ce545b9f3846ba954bcd449e090984\"\u002F>\n\u003C\u002Fa>\n\u003Ca href=\"https:\u002F\u002Fcodecov.io\u002Fgh\u002Fkoursaros-ai\u002Fneural_rerank\">\n  \u003Cimg src=\"https:\u002F\u002Fcodecov.io\u002Fgh\u002Fkoursaros-ai\u002Fneural_rerank\u002Fbranch\u002Fmaster\u002Fgraph\u002Fbadge.svg\" \u002F>\n\u003C\u002Fa>\n\u003Ca href='https:\u002F\u002Fgithub.com\u002Fkoursaros-ai\u002Fnboost\u002Fblob\u002Fmaster\u002FLICENSE'>\n    \u003Cimg alt=\"PyPI - License\" src=\"https:\u002F\u002Fimg.shields.io\u002Fpypi\u002Fl\u002Fnboost.svg\">\n\u003C\u002Fa>\n\u003C\u002Fp>\n\n\u003Cp align=\"center\">\n  \u003Ca href=\"#what-is-it\">Highlights\u003C\u002Fa> •\n  \u003Ca href=\"#overview\">Overview\u003C\u002Fa> •\n  \u003Ca href=\"#benchmarks\">Benchmarks\u003C\u002Fa> •\n  \u003Ca href=\"#install-nboost\">Install\u003C\u002Fa> •\n  \u003Ca href=\"#getting-started\">Getting Started\u003C\u002Fa> •\n  \u003Ca href=\"#kubernetes\">Kubernetes\u003C\u002Fa> •\n  \u003Ca href=\"https:\u002F\u002Fnboost.readthedocs.io\u002F\">Documentation\u003C\u002Fa> •\n  \u003Ca href=\"#tutorials\">Tutorials\u003C\u002Fa> •\n  \u003Ca href=\"#contributing\">Contributing\u003C\u002Fa> •\n  \u003Ca href=\".\u002FCHANGELOG.md\">Release Notes\u003C\u002Fa> •\n  \u003Ca href=\"https:\u002F\u002Fkoursaros-ai.github.io\u002F\">Blog\u003C\u002Fa>  \n\u003C\u002Fp>\n\n\u003Ch2 align=\"center\">What is it\u003C\u002Fh2>\n\n⚡**NBoost** is a scalable, search-engine-boosting platform for developing and deploying state-of-the-art models to improve the relevance of search results.\n\n\u003Cp align=\"center\">\n\u003Cimg src=\"https:\u002F\u002Fgithub.com\u002Fkoursaros-ai\u002Fnboost\u002Fraw\u002Fmaster\u002F.github\u002Foverview.svg?sanitize=true\" width=\"100%\">\n\u003C\u002Fp>\n\nNboost leverages finetuned models to produce domain-specific neural search engines. The platform can also improve other downstream tasks requiring ranked input, such as question answering.\n\n\u003Ca href = 'mailto:jp954@cornell.edu'>Contact us to request domain-specific models or leave feedback\u003C\u002Fa>\n\n\u003Ch2 align=\"center\">Overview\u003C\u002Fh2>\n\nThe workflow of NBoost is relatively simple. Take the graphic above, and imagine that the server in this case is Elasticsearch.\n\n\u003Cp align=\"center\">\n\u003Cimg src=\"https:\u002F\u002Fgithub.com\u002Fkoursaros-ai\u002Fnboost\u002Fraw\u002Fmaster\u002F.github\u002Fconventional.svg?sanitize=true\" width=\"80%\">\n\u003C\u002Fp>\n\nIn a **conventional search request**, the user sends a query to *Elasticsearch* and gets back the results.\n\n\u003Cp align=\"center\">\n\u003Cimg src=\"https:\u002F\u002Fgithub.com\u002Fkoursaros-ai\u002Fnboost\u002Fraw\u002Fmaster\u002F.github\u002Fnboost.svg?sanitize=true\" width=\"80%\">\n\u003C\u002Fp>\n\nIn an **NBoost search request**, the user sends a query to the *model*. Then, the model asks for results from *Elasticsearch* and picks the best ones to return to the user.\n\n\u003Ch2 align=\"center\">Benchmarks\u003C\u002Fh2>\n\n> 🔬 Note that we are evaluating models on differently constructed sets than they were trained on (MS Marco vs TREC-CAR), suggesting the generalizability of these models to many other real world search problems.\n\n\u003Ccenter>\n\nFine-tuned Models                                                                   | Dependency                                                                   | Eval Set                                                           | Search Boost\u003Ca href='#benchmarks'>\u003Csup>[1]\u003C\u002Fsup>\u003C\u002Fa>  | Speed on GPU\n----------------------------------------------------------------------------------- | ---------------------------------------------------------------------------- | ------------------------------------------------------------------ | ----------------------------------------------------- | ----------------------------------\n`nboost\u002Fpt-tinybert-msmarco` (**default**)                                          | \u003Cimg alt=\"PyTorch\" src=\"https:\u002F\u002Fimg.shields.io\u002Fbadge\u002FPyTorch-red\"\u002F>          |  \u003Ca href ='http:\u002F\u002Fwww.msmarco.org\u002F'>bing queries\u003C\u002Fa>               | **+45%** \u003Csub>\u003Csup>(0.26 vs 0.18)\u003C\u002Fsup>\u003C\u002Fsub>         | ~50ms\u002Fquery \u003Ca href='#footnotes'>\n`nboost\u002Fpt-bert-base-uncased-msmarco`                                               | \u003Cimg alt=\"PyTorch\" src=\"https:\u002F\u002Fimg.shields.io\u002Fbadge\u002FPyTorch-red\"\u002F>          | \u003Ca href ='http:\u002F\u002Fwww.msmarco.org\u002F'>bing queries\u003C\u002Fa>                | **+62%** \u003Csub>\u003Csup>(0.29 vs 0.18)\u003C\u002Fsup>\u003C\u002Fsub>         | ~300 ms\u002Fquery\u003Ca href='#footnotes'>\n`nboost\u002Fpt-bert-large-msmarco`                                                      | \u003Cimg alt=\"PyTorch\" src=\"https:\u002F\u002Fimg.shields.io\u002Fbadge\u002FPyTorch-red\"\u002F>          | \u003Ca href ='http:\u002F\u002Fwww.msmarco.org\u002F'>bing queries\u003C\u002Fa>                | **+77%** \u003Csub>\u003Csup>(0.32 vs 0.18)\u003C\u002Fsup>\u003C\u002Fsub>         | -\n`nboost\u002Fpt-biobert-base-msmarco`                                                    | \u003Cimg alt=\"PyTorch\" src=\"https:\u002F\u002Fimg.shields.io\u002Fbadge\u002FPyTorch-red\"\u002F>          | \u003Ca href ='https:\u002F\u002Fgithub.com\u002Fnaver\u002Fbiobert-pretrained'>biomed\u003C\u002Fa>  | **+66%** \u003Csub>\u003Csup>(0.17 vs 0.10)\u003C\u002Fsup>\u003C\u002Fsub>         | ~300 ms\u002Fquery\u003Ca href='#footnotes'>\n\n\n\u003C\u002Fcenter>\n\n**Instructions for reproducing \u003Ca href = 'https:\u002F\u002Fnboost.readthedocs.io\u002Fen\u002Flatest\u002Fchapter\u002Fbenchmarking.html'>here\u003C\u002Fa>.**\n\n\u003Csub>[1] \u003Ca href = 'https:\u002F\u002Fen.wikipedia.org\u002Fwiki\u002FMean_reciprocal_rank'>MRR \u003C\u002Fa> compared to BM25, the default for Elasticsearch. Reranking top 50.\u003C\u002Fsub>\n\u003Cbr>\n\u003Csub>[2] https:\u002F\u002Fgithub.com\u002Fnyu-dl\u002Fdl4marco-bert\u003C\u002Fsub>\n\nTo use one of these fine-tuned models with nboost, run `nboost --model_dir bert-base-uncased-msmarco` for example, and it will download and cache automatically.\n\nUsing pre-trained language understanding models, you can boost search relevance metrics by nearly **2x** compared to just text search, with little to no extra configuration. While assessing performance, there is often a tradeoff between model accuracy and speed, so we benchmark both of these factors above. This leaderboard is a work in progress, and we intend on releasing more cutting edge models!\n\n\u003Ch2 align=\"center\">Install NBoost\u003C\u002Fh2>\n\nThere are two ways to get NBoost, either as a Docker image or as a PyPi package. **For cloud users, we highly recommend using NBoost via Docker**. \n> 🚸 Depending on your model, you should install the respective Tensorflow or Pytorch dependencies. We package them below.\n\nFor installing NBoost, follow the table below.\n\u003Ccenter>\n\nDependency                      | 🐳 Docker                                                 | 📦 Pypi                                           |  \u003Ca href=\"#kubernetes\">🐙 Kubernetes\u003C\u002Fa>\n------------------------------- | --------------------------------------------------------- | ------------------------------------------------- | -------------\n**Pytorch** (*recommended*)     | \u003Csub>\u003Csup>`koursaros\u002Fnboost:latest-pt`\u003C\u002Fsup>\u003C\u002Fsub>        | \u003Csub>\u003Csup>`pip install nboost[pt]`\u003C\u002Fsup>\u003C\u002Fsub>    | \u003Csub>\u003Csup>`helm install nboost\u002Fnboost --set image.tag=latest-pt`\u003C\u002Fsup>\u003C\u002Fsub>\n**Tensorflow**                  | \u003Csub>\u003Csup>`koursaros\u002Fnboost:latest-tf`\u003C\u002Fsup>\u003C\u002Fsub>        | \u003Csub>\u003Csup>`pip install nboost[tf]`\u003C\u002Fsup>\u003C\u002Fsub>    | \u003Csub>\u003Csup>`helm install nboost\u002Fnboost --set image.tag=latest-tf`\u003C\u002Fsup>\u003C\u002Fsub>\n**All**                         | \u003Csub>\u003Csup>`koursaros\u002Fnboost:latest-all`\u003C\u002Fsup>\u003C\u002Fsub>       | \u003Csub>\u003Csup>`pip install nboost[all]`\u003C\u002Fsup>\u003C\u002Fsub>   | \u003Csub>\u003Csup>`helm install nboost\u002Fnboost --set image.tag=latest-all`\u003C\u002Fsup>\u003C\u002Fsub>\n**-** (*for testing*)           | \u003Csub>\u003Csup>`koursaros\u002Fnboost:latest-alpine`\u003C\u002Fsup>\u003C\u002Fsub>    | \u003Csub>\u003Csup>`pip install nboost`\u003C\u002Fsup>\u003C\u002Fsub>        | \u003Csub>\u003Csup>`helm install nboost\u002Fnboost --set image.tag=latest-alpine`\u003C\u002Fsup>\u003C\u002Fsub>\n\n\u003C\u002Fcenter>\n\nAny way you install it, if you end up reading the following message after `$ nboost --help` or `$ docker run koursaros\u002Fnboost --help`, then you are ready to go!\n\n\u003Cp align=\"center\">\n\u003Cimg src=\"https:\u002F\u002Fgithub.com\u002Fkoursaros-ai\u002Fnboost\u002Fraw\u002Fmaster\u002F.github\u002Fcli-help.svg?sanitize=true\" alt=\"success installation of NBoost\">\n\u003C\u002Fp>\n\n\n\u003Ch2 align=\"center\">Getting Started\u003C\u002Fh2>\n\n- [The Proxy](#the-proxy)\n- [Setting up a Neural Proxy for Elasticsearch in 3 minutes](#Setting-up-a-Neural-Proxy-for-Elasticsearch-in-3-minutes)\n  * [Setting up an Elasticsearch Server](#setting-up-an-elasticsearch-server)\n  * [Deploying the proxy](#deploying-the-proxy)\n  * [Indexing some data](#indexing-some-data)\n- [Elastic made easy](#elastic-made-easy)\n\n\n### 📡The Proxy\n\n\u003Ccenter>\n\u003Ctable>\n  \u003Ctr>\n  \u003Ctd width=\"33%\">\n      \u003Cimg src=\"https:\u002F\u002Fgithub.com\u002Fkoursaros-ai\u002Fnboost\u002Fraw\u002Fmaster\u002F.github\u002Frocket.svg?sanitize=true\" alt=\"component overview\">\n      \u003C\u002Ftd>\n  \u003Ctd>\n  \u003Cp>The \u003Ca href=\"https:\u002F\u002Fnboost.readthedocs.io\u002Fen\u002Flatest\u002Fapi\u002Fnboost.proxy.html\">Proxy\u003C\u002Fa> is the core of NBoost. The proxy is essentially a wrapper to enable serving the model. It is able to understand incoming messages from specific search apis (i.e. Elasticsearch). When the proxy receives a message, it increases the amount of results the client is asking for so that the model can rerank a larger set and return the (hopefully) better results.\u003C\u002Fp>\n  \u003Cp>For instance, if a client asks for 10 results to do with the query \"brown dogs\" from Elasticsearch, then the proxy may increase the results request to 100 and filter down the best ten results for the client.\u003C\u002Fp>\n\u003C\u002Ftd>\n  \u003C\u002Ftr>\n\u003C\u002Ftable>\n\u003C\u002Fcenter>\n\n#### \n\n\n\n### Setting up a Neural Proxy for Elasticsearch in 3 minutes\n\nIn this example we will set up a proxy to sit in between the client and Elasticsearch and boost the results!\n\n#### Installing NBoost with tensorflow\n\nIf you want to run the example on a GPU, make sure you have Tensorflow 1.14-1.15, Pytorch or ONNX Runtime with CUDA to support the modeling functionality. However, if you want to just run it on a CPU, don't worry about it. For both cases, just run:\n\n```bash\npip install nboost[pt]\n```\n\n\n#### Setting up an Elasticsearch Server\n> 🔔 If you already have an Elasticsearch server, you can skip this step!\n\nIf you don't have Elasticsearch, not to worry! We recommend setting up a local Elasticsearch cluster using docker (providing you have Docker installed). First, get the ES image by running:\n```bash\ndocker pull elasticsearch:7.4.2\n```\nOnce you have the image, you can run an Elasticsearch server via:\n```bash\ndocker run -d -p 9200:9200 -p 9300:9300 -e \"discovery.type=single-node\" elasticsearch:7.4.2\n```\n\n#### Deploying the proxy\nNow we're ready to deploy our Neural Proxy! It is very simple to do this, run:\n```bash\nnboost                                  \\\n    --uhost localhost                   \\\n    --uport 9200                        \\\n    --search_route \"\u002F\u003Cindex>\u002F_search\"   \\\n    --query_path url.query.q            \\\n    --topk_path url.query.size          \\\n    --default_topk 10                   \\\n    --choices_path body.hits.hits       \\\n    --cvalues_path _source.passage\n```\n> 📢 The `--uhost` and `--uport` should be the same as the Elasticsearch server above! Uhost and uport are short for upstream-host and upstream-port (referring to the upstream server).\n\nIf you get this message: `Listening: \u003Chost>:\u003Cport>`, then we're good to go!\n\n#### Indexing some data\nNBoost has a handy indexing tool built in (`nboost-index`). For demonstration purposes,  will be indexing [a set of passages about traveling and hotels](https:\u002F\u002Fmicrosoft.github.io\u002FTREC-2019-Deep-Learning\u002F) through NBoost. You can add the index to your Elasticsearch server by running:\n>  `travel.csv` comes with NBoost\n```bash\nnboost-index --file travel.csv --index_name travel --delim , --id_col\n```` \n\n\nNow let's test it out! Hit the Elasticsearch with:\n```bash\ncurl \"http:\u002F\u002Flocalhost:8000\u002Ftravel\u002F_search?pretty&q=passage:vegas&size=2\"\n```\n\nIf the Elasticsearch result has the `nboost` tag in it, congratulations it's working!\n\n\u003Cp align=\"center\">\n\u003Cimg src=\"https:\u002F\u002Fgithub.com\u002Fkoursaros-ai\u002Fnboost\u002Fraw\u002Fmaster\u002F.github\u002Ftravel-tutorial.svg?sanitize=true\" alt=\"success installation of NBoost\">\n\u003C\u002Fp>\n\n#### What just happened?\nLet's check out the **NBoost frontend**. Go to your browser and visit [localhost:8000\u002Fnboost](http:\u002F\u002Flocalhost:8000\u002Fnboost).\n> If you don't have access to a browser, you can `curl http:\u002F\u002Flocalhost:8000\u002Fnboost\u002Fstatus` for the same information.\n\n\u003Cp align=\"center\">\n\u003Cimg src=\"https:\u002F\u002Foss.gittoolsai.com\u002Fimages\u002Fkoursaros-ai_nboost_readme_5eb72890b034.png\">\n\u003C\u002Fp>\n\nThe frontend recorded everything that happened:\n\n1. NBoost got a request for **2 search results**. *(average_topk)*\n2. NBoost connected to the server at `localhost:9200`.\n3. NBoost sent a request for 50 search results to the server. *(topn)* \n4. NBoost received **50 search results** from the server. *(average_choices)*\n5. The model picked the best 2 search results and returned them to the client.\n\n#### Elastic made easy\nTo increase the number of parallel proxies, simply increase `--workers`. For a more robust deployment approach, you can distribute the proxy via Kubernetes (see below).\n\n\u003Ch2 align=\"center\">Kubernetes\u003C\u002Fh2>\n\n\u003Cp align=\"center\">\n\u003Cimg src=\"https:\u002F\u002Fgithub.com\u002Fkoursaros-ai\u002Fnboost\u002Fraw\u002Fmaster\u002F.github\u002Fsailboat.svg?sanitize=true\" width=\"100%\">\n\u003C\u002Fp>\n\n#### See also\nFor in-depth query DSL and other search API solutions (such as the Bing API), see the [docs](https:\u002F\u002Fnboost.readthedocs.io\u002Fen\u002Flatest\u002Fchapter\u002Fbing-api.html).\n\n### Deploying NBoost via Kubernetes\nWe can easily deploy NBoost in a Kubernetes cluster using [Helm](https:\u002F\u002Fhelm.sh\u002F).\n\n#### Add the NBoost Helm Repo\nFirst we need to register the repo with your Kubernetes cluster.\n```bash\nhelm repo add nboost https:\u002F\u002Fraw.githubusercontent.com\u002Fkoursaros-ai\u002Fnboost\u002Fmaster\u002Fcharts\u002F\nhelm repo update\n```\n\n#### Deploy some NBoost replicas\nLet's try deploying four replicas:\n```bash\nhelm install --name nboost --set replicaCount=4 nboost\u002Fnboost\n```\n\nAll possible `--set` ([values.yaml](https:\u002F\u002Fgithub.com\u002Fkoursaros-ai\u002Fnboost\u002Fblob\u002Fmaster\u002Fcharts\u002Fnboost\u002Fvalues.yaml)) options are listed below:\n\n| Parameter                                    | Description                                      | Default                                                     |\n| -------------------------------------------- | ------------------------------------------------ | ----------------------------------------------------------- |\n| `replicaCount`                               | Number of replicas to deploy                     | `3`                                                         |\n| `image.repository`                           | NBoost Image name                                | `koursaros\u002Fnboost`                                          |\n| `image.tag`                                  | NBoost Image tag                                 | `latest-pt`                                                 |\n| `args.model`                                 | Name of the model class                          | `nil`                                                       |\n| `args.model_dir`                             | Name or directory of the finetuned model         | `pt-bert-base-uncased-msmarco`                              |\n| `args.qa`                                    | Whether to use the qa plugin                     | `False`                                                     |\n| `args.qa_model_dir`                          | Name or directory of the qa model                | `distilbert-base-uncased-distilled-squad`                   |\n| `args.model`                                 | Name of the model class                          | `nil`                                                       |\n| `args.host`                                  | Hostname of the proxy                            | `0.0.0.0`                                                   |\n| `args.port`                                  | Port for the proxy to listen on                  | `8000`                                                      |\n| `args.uhost`                                 | Hostname of the upstream search api server       | `elasticsearch-master`                                      |\n| `args.uport`                                 | Port of the upstream server                      | `9200`                                                      |\n| `args.data_dir`                              | Directory to cache model binary                  | `nil`                                                       |\n| `args.max_seq_len`                           | Max combined token length                        | `64`                                                        |\n| `args.bufsize`                               | Size of the http buffer in bytes                 | `2048`                                                      |\n| `args.batch_size`                            | Batch size for running through rerank model      | `4`                                                         |\n| `args.multiplier`                            | Factor to increase results by                    | `5`                                                         |\n| `args.workers`                               | Number of threads serving the proxy              | `10`                                                        |\n| `args.query_path`                            | Jsonpath in the request to find the query        | `nil`                                                       |\n| `args.topk_path`                             | Jsonpath to find the number of requested results | `nil`                                                       |\n| `args.choices_path`                          | Jsonpath to find the array of choices to reorder | `nil`                                                       |\n| `args.cvalues_path`                          | Jsonpath to find the str values of the choices   | `nil`                                                       |\n| `args.cids_path`                             | Jsonpath to find the ids of the choices          | `nil`                                                       |\n| `args.search_path`                           | The url path to tag for reranking via nboost     | `nil`                                                       |\n| `service.type`                               | Kubernetes Service type                          | `LoadBalancer`                                              |\n| `resources`                                  | resource needs and limits to apply to the pod    | `{}`                                                        |\n| `nodeSelector`                               | Node labels for pod assignment                   | `{}`                                                        |\n| `affinity`                                   | Affinity settings for pod assignment             | `{}`                                                        |\n| `tolerations`                                | Toleration labels for pod assignment             | `[]`                                                        |\n| `image.pullPolicy`                           | Image pull policy                                | `IfNotPresent`                                              |\n| `imagePullSecrets`                           | Docker registry secret names as an array         | `[]` (does not add image pull secrets to deployed pods)     |\n| `nameOverride`                               | String to override Chart.name                    | `nil`                                                       |\n| `fullnameOverride`                           | String to override Chart.fullname                | `nil`                                                       |\n| `serviceAccount.create`                      | Specifies whether a service account is created   | `nil`                                                       |\n| `serviceAccount.name`                        | The name of the service account to use. If not set and create is true, a name is generated using the fullname template   | `nil`  |\n| `serviceAccount.create`                      | Specifies whether a service account is created   | `nil`                                                       |\n| `podSecurityContext.fsGroup`                 | Group ID for the container                       | `nil`                                                       |\n| `securityContext.runAsUser`                  | User ID for the container                        | `1001`                                                      |\n| `ingress.enabled`                            | Enable ingress resource                          | `false`                                                     |\n| `ingress.hostName`                           | Hostname to your installation                    | `nil`                                                       |\n| `ingress.path`                               | Path within the url structure                    | `[]`                                                        |\n| `ingress.tls`                                | enable ingress with tls                          | `[]`                                                        |\n| `ingress.tls.secretName`                     | tls type secret to be used                       | `chart-example-tls`                                         |\n\n\n\n\u003Ch2 align=\"center\">Documentation\u003C\u002Fh2>\n\n[![ReadTheDoc](https:\u002F\u002Foss.gittoolsai.com\u002Fimages\u002Fkoursaros-ai_nboost_readme_51d302063c11.png)](https:\u002F\u002Fnboost.readthedocs.io)\n\nThe official NBoost documentation is hosted on [nboost.readthedocs.io](http:\u002F\u002Fnboost.readthedocs.io\u002F). It is automatically built, updated and archived on every new release.\n\n\u003Ch2 align=\"center\">Contributing\u003C\u002Fh2>\n\nContributions are greatly appreciated! You can make corrections or updates and commit them to NBoost. Here are the steps:\n\n1. Create a new branch, say `fix-nboost-typo-1`\n2. Fix\u002Fimprove the codebase\n3. Commit the changes. Note the **commit message must follow [the naming style](.\u002FCONTRIBUTING.md#commit-message-naming)**, say `Fix\u002Fmodel-bert: improve the readability and move sections`\n4. Make a pull request. Note the **pull request must follow [the naming style](.\u002FCONTRIBUTING.md#commit-message-naming)**. It can simply be one of your commit messages, just copy paste it, e.g. `Fix\u002Fmodel-bert: improve the readability and move sections`\n5. Submit your pull request and wait for all checks passed (usually 10 minutes)\n    - Coding style\n    - Commit and PR styles check\n    - All unit tests\n6. Request reviews from one of the developers from our core team.\n7. Merge!\n\nMore details can be found in the [contributor guidelines](.\u002FCONTRIBUTING.md).\n\n\u003Ch2 align=\"center\">Citing NBoost\u003C\u002Fh2>\n\nIf you use NBoost in an academic paper, we would love to be cited. Here are the two ways of citing NBoost:\n\n1.     \\footnote{https:\u002F\u002Fgithub.com\u002Fkoursaros-ai\u002Fnboost}\n2. \n    ```latex\n    @misc{koursaros2019NBoost,\n      title={NBoost: Neural Boosting Search Results},\n      author={Thienes, Cole and Pertschuk, Jack},\n      howpublished={\\url{https:\u002F\u002Fgithub.com\u002Fkoursaros-ai\u002Fnboost}},\n      year={2019}\n    }\n    ```\n\n\u003Ch2 align=\"center\">License\u003C\u002Fh2>\n\nIf you have downloaded a copy of the NBoost binary or source code, please note that the NBoost binary and source code are both licensed under the [Apache License, Version 2.0](.\u002FLICENSE).\n\n\u003Csub>\nKoursaros AI is excited to bring this open source software to the community.\u003Cbr>\nCopyright (C) 2019. All rights reserved.\n\u003C\u002Fsub>\n","> 🧪 我们正在寻找我们\u003Ca href='https:\u002F\u002Fanswerbot.app'>虚拟助手\u003C\u002Fa>小工具的测试用户。如果您有兴趣在您的网站上使用它，请\u003Ca href = 'mailto:jp954@cornell.edu'>联系我们\u003C\u002Fa>。\n\n\u003Cp align=\"center\">\n\u003Cimg src=\"https:\u002F\u002Fgithub.com\u002Fkoursaros-ai\u002Fnboost\u002Fraw\u002Fmaster\u002F.github\u002Fbanner.svg?sanitize=true\" alt=\"Nboost\" width=\"70%\">\n\u003C\u002Fp>\n\n\u003Cp align=\"center\">\n\u003Ca href=\"https:\u002F\u002Fcloud.drone.io\u002Fkoursaros-ai\u002Fnboost\">\n    \u003Cimg src=\"https:\u002F\u002Fcloud.drone.io\u002Fapi\u002Fbadges\u002Fkoursaros-ai\u002Fnboost\u002Fstatus.svg\" \u002F>\n\u003C\u002Fa>\n\u003Ca href=\"https:\u002F\u002Fpypi.org\u002Fproject\u002Fnboost\u002F\">\n    \u003Cimg src=\"https:\u002F\u002Fimg.shields.io\u002Fpypi\u002Fpyversions\u002Fnboost.svg\" \u002F>\n\u003C\u002Fa>\n\u003Ca href=\"https:\u002F\u002Fpypi.org\u002Fproject\u002Fnboost\u002F\">\n    \u003Cimg alt=\"PyPI\" src=\"https:\u002F\u002Fimg.shields.io\u002Fpypi\u002Fv\u002Fnboost.svg\">\n\u003C\u002Fa>\n\u003Ca href='https:\u002F\u002Fnboost.readthedocs.io\u002Fen\u002Flatest\u002F'>\n    \u003Cimg src='https:\u002F\u002Foss.gittoolsai.com\u002Fimages\u002Fkoursaros-ai_nboost_readme_13d664e1afd7.png' alt='Documentation Status' \u002F>\n\u003C\u002Fa>\n\u003Ca href=\"https:\u002F\u002Fwww.codacy.com\u002Fapp\u002Fkoursaros-ai\u002Fnboost?utm_source=github.com&amp;utm_medium=referral&amp;utm_content=koursaros-ai\u002Fnboost&amp;utm_campaign=Badge_Grade\">\n    \u003Cimg src=\"https:\u002F\u002Fapi.codacy.com\u002Fproject\u002Fbadge\u002FGrade\u002Fa9ce545b9f3846ba954bcd449e090984\"\u002F>\n\u003C\u002Fa>\n\u003Ca href=\"https:\u002F\u002Fcodecov.io\u002Fgh\u002Fkoursaros-ai\u002Fneural_rerank\">\n  \u003Cimg src=\"https:\u002F\u002Fcodecov.io\u002Fgh\u002Fkoursaros-ai\u002Fneural_rerank\u002Fbranch\u002Fmaster\u002Fgraph\u002Fbadge.svg\" \u002F>\n\u003C\u002Fa>\n\u003Ca href='https:\u002F\u002Fgithub.com\u002Fkoursaros-ai\u002Fnboost\u002Fblob\u002Fmaster\u002FLICENSE'>\n    \u003Cimg alt=\"PyPI - License\" src=\"https:\u002F\u002Fimg.shields.io\u002Fpypi\u002Fl\u002Fnboost.svg\">\n\u003C\u002Fa>\n\u003C\u002Fp>\n\n\u003Cp align=\"center\">\n  \u003Ca href=\"#what-is-it\">亮点\u003C\u002Fa> •\n  \u003Ca href=\"#overview\">概述\u003C\u002Fa> •\n  \u003Ca href=\"#benchmarks\">基准测试\u003C\u002Fa> •\n  \u003Ca href=\"#install-nboost\">安装\u003C\u002Fa> •\n  \u003Ca href=\"#getting-started\">入门\u003C\u002Fa> •\n  \u003Ca href=\"#kubernetes\">Kubernetes\u003C\u002Fa> •\n  \u003Ca href=\"https:\u002F\u002Fnboost.readthedocs.io\u002F\">文档\u003C\u002Fa> •\n  \u003Ca href=\"#tutorials\">教程\u003C\u002Fa> •\n  \u003Ca href=\"#contributing\">贡献\u003C\u002Fa> •\n  \u003Ca href=\".\u002FCHANGELOG.md\">发布说明\u003C\u002Fa> •\n  \u003Ca href=\"https:\u002F\u002Fkoursaros-ai.github.io\u002F\">博客\u003C\u002Fa>  \n\u003C\u002Fp>\n\n\u003Ch2 align=\"center\">它是什么\u003C\u002Fh2>\n\n⚡**NBoost** 是一个可扩展的搜索引擎增强平台，用于开发和部署最先进的模型，以提高搜索结果的相关性。\n\n\u003Cp align=\"center\">\n\u003Cimg src=\"https:\u002F\u002Fgithub.com\u002Fkoursaros-ai\u002Fnboost\u002Fraw\u002Fmaster\u002F.github\u002Foverview.svg?sanitize=true\" width=\"100%\">\n\u003C\u002Fp>\n\nNBoost 利用微调后的模型来构建特定领域的神经搜索引擎。该平台还可以改进其他需要排序输入的下游任务，例如问答系统。\n\n\u003Ca href = 'mailto:jp954@cornell.edu'>请联系我们以请求特定领域的模型或留下反馈\u003C\u002Fa>\n\n\u003Ch2 align=\"center\">概述\u003C\u002Fh2>\n\nNBoost 的工作流程相对简单。请参考上面的示意图，假设这里的服务器是 Elasticsearch。\n\n\u003Cp align=\"center\">\n\u003Cimg src=\"https:\u002F\u002Fgithub.com\u002Fkoursaros-ai\u002Fnboost\u002Fraw\u002Fmaster\u002F.github\u002Fconventional.svg?sanitize=true\" width=\"80%\">\n\u003C\u002Fp>\n\n在**传统搜索请求**中，用户向 *Elasticsearch* 发送查询，并获得结果。\n\n\u003Cp align=\"center\">\n\u003Cimg src=\"https:\u002F\u002Fgithub.com\u002Fkoursaros-ai\u002Fnboost\u002Fraw\u002Fmaster\u002F.github\u002Fnboost.svg?sanitize=true\" width=\"80%\">\n\u003C\u002Fp>\n\n在**NBoost 搜索请求**中，用户将查询发送给 *模型*。然后，模型会从 *Elasticsearch* 请求结果，并挑选出最佳的结果返回给用户。\n\n\u003Ch2 align=\"center\">基准测试\u003C\u002Fh2>\n\n> 🔬 注意，我们在与模型训练时不同的数据集上评估这些模型（MS Marco vs TREC-CAR），这表明这些模型具有广泛的通用性，可以应用于许多其他实际的搜索问题。\n\n\u003Ccenter>\n\n微调模型                                                                   | 依赖项                                                                   | 评估集                                                           | 搜索提升\u003Ca href='#benchmarks'>\u003Csup>[1]\u003C\u002Fsup>\u003C\u002Fa>  | GPU 上的速度\n----------------------------------------------------------------------------------- | ---------------------------------------------------------------------------- | ------------------------------------------------------------------ | ----------------------------------------------------- | ----------------------------------\n`nboost\u002Fpt-tinybert-msmarco` (**默认**)                                          | \u003Cimg alt=\"PyTorch\" src=\"https:\u002F\u002Fimg.shields.io\u002Fbadge\u002FPyTorch-red\"\u002F>          |  \u003Ca href ='http:\u002F\u002Fwww.msmarco.org\u002F'>必应查询\u003C\u002Fa>               | **+45%** \u003Csub>\u003Csup>(0.26 vs 0.18)\u003C\u002Fsup>\u003C\u002Fsub>         | ~50ms\u002F查询 \u003Ca href='#footnotes'>\n`nboost\u002Fpt-bert-base-uncased-msmarco`                                               | \u003Cimg alt=\"PyTorch\" src=\"https:\u002F\u002Fimg.shields.io\u002Fbadge\u002FPyTorch-red\"\u002F>          | \u003Ca href ='http:\u002F\u002Fwww.msmarco.org\u002F'>必应查询\u003C\u002Fa>                | **+62%** \u003Csub>\u003Csup>(0.29 vs 0.18)\u003C\u002Fsup>\u003C\u002Fsub>         | ~300 ms\u002F查询\u003Ca href='#footnotes'>\n`nboost\u002Fpt-bert-large-msmarco`                                                      | \u003Cimg alt=\"PyTorch\" src=\"https:\u002F\u002Fimg.shields.io\u002Fbadge\u002FPyTorch-red\"\u002F>          | \u003Ca href ='http:\u002F\u002Fwww.msmarco.org\u002F'>必应查询\u003C\u002Fa>                | **+77%** \u003Csub>\u003Csup>(0.32 vs 0.18)\u003C\u002Fsup>\u003C\u002Fsub>         | -\n`nboost\u002Fpt-biobert-base-msmarco`                                                    | \u003Cimg alt=\"PyTorch\" src=\"https:\u002F\u002Fimg.shields.io\u002Fbadge\u002FPyTorch-red\"\u002F>          | \u003Ca href ='https:\u002F\u002Fgithub.com\u002Fnaver\u002Fbiobert-pretrained'>生物医学\u003C\u002Fa>  | **+66%** \u003Csub>\u003Csup>(0.17 vs 0.10)\u003C\u002Fsup>\u003C\u002Fsub>         | ~300 ms\u002F查询\u003Ca href='#footnotes'>\n\n\n\u003C\u002Fcenter>\n\n**重现方法请见\u003Ca href = 'https:\u002F\u002Fnboost.readthedocs.io\u002Fen\u002Flatest\u002Fchapter\u002Fbenchmarking.html'>此处\u003C\u002Fa>。**\n\n\u003Csub>[1] \u003Ca href = 'https:\u002F\u002Fen.wikipedia.org\u002Fwiki\u002FMean_reciprocal_rank'>MRR \u003C\u002Fa> 与 BM25 相比，BM25 是 Elasticsearch 的默认值。对前 50 个结果进行重新排名。\u003C\u002Fsub>\n\u003Cbr>\n\u003Csub>[2] https:\u002F\u002Fgithub.com\u002Fnyu-dl\u002Fdl4marco-bert\u003C\u002Fsub>\n\n要使用这些微调模型之一与 NBoost 配合使用，只需运行 `nboost --model_dir bert-base-uncased-msmarco` 等命令，它就会自动下载并缓存模型。\n\n通过使用预训练的语言理解模型，您可以将搜索相关性指标提高近 **2 倍**，而无需额外的配置。在评估性能时，通常需要在模型准确性和速度之间做出权衡，因此我们在上面同时列出了这两项指标。此排行榜仍在不断完善中，我们计划推出更多前沿模型！\n\n\u003Ch2 align=\"center\">安装 NBoost\u003C\u002Fh2>\n\n获取 NBoost 有两种方式：作为 Docker 镜像或作为 PyPi 包。**对于云用户，我们强烈建议使用 Docker 版本的 NBoost**。\n> 🚸 根据您选择的模型，您需要安装相应的 Tensorflow 或 Pytorch 依赖项。我们已在下方打包好这些依赖项。\n\n以下是安装 NBoost 的步骤：\n\u003Ccenter>\n\n依赖                      | 🐳 Docker                                                 | 📦 Pypi                                           |  \u003Ca href=\"#kubernetes\">🐙 Kubernetes\u003C\u002Fa>\n------------------------------- | --------------------------------------------------------- | ------------------------------------------------- | -------------\n**Pytorch** (*推荐*)     | \u003Csub>\u003Csup>`koursaros\u002Fnboost:latest-pt`\u003C\u002Fsup>\u003C\u002Fsub>        | \u003Csub>\u003Csup>`pip install nboost[pt]`\u003C\u002Fsup>\u003C\u002Fsub>    | \u003Csub>\u003Csup>`helm install nboost\u002Fnboost --set image.tag=latest-pt`\u003C\u002Fsup>\u003C\u002Fsub>\n**Tensorflow**                  | \u003Csub>\u003Csup>`koursaros\u002Fnboost:latest-tf`\u003C\u002Fsup>\u003C\u002Fsub>        | \u003Csub>\u003Csup>`pip install nboost[tf]`\u003C\u002Fsup>\u003C\u002Fsub>    | \u003Csub>\u003Csup>`helm install nboost\u002Fnboost --set image.tag=latest-tf`\u003C\u002Fsup>\u003C\u002Fsub>\n**全部**                         | \u003Csub>\u003Csup>`koursaros\u002Fnboost:latest-all`\u003C\u002Fsup>\u003C\u002Fsub>       | \u003Csub>\u003Csup>`pip install nboost[all]`\u003C\u002Fsup>\u003C\u002Fsub>   | \u003Csub>\u003Csup>`helm install nboost\u002Fnboost --set image.tag=latest-all`\u003C\u002Fsup>\u003C\u002Fsub>\n**-** (*用于测试*)           | \u003Csub>\u003Csup>`koursaros\u002Fnboost:latest-alpine`\u003C\u002Fsup>\u003C\u002Fsub>    | \u003Csub>\u003Csup>`pip install nboost`\u003C\u002Fsup>\u003C\u002Fsub>        | \u003Csub>\u003Csup>`helm install nboost\u002Fnboost --set image.tag=latest-alpine`\u003C\u002Fsup>\u003C\u002Fsub>\n\n\u003C\u002Fcenter>\n\n无论你以何种方式安装，只要在运行 `$ nboost --help` 或 `$ docker run koursaros\u002Fnboost --help` 后看到以下消息，就说明你可以开始使用了！\n\n\u003Cp align=\"center\">\n\u003Cimg src=\"https:\u002F\u002Fgithub.com\u002Fkoursaros-ai\u002Fnboost\u002Fraw\u002Fmaster\u002F.github\u002Fcli-help.svg?sanitize=true\" alt=\"NBoost安装成功\">\n\u003C\u002Fp>\n\n\n\u003Ch2 align=\"center\">入门指南\u003C\u002Fh2>\n\n- [代理](#the-proxy)\n- [3分钟内搭建Elasticsearch的神经网络代理](#Setting-up-a-Neural-Proxy-for-Elasticsearch-in-3-minutes)\n  * [搭建Elasticsearch服务器](#setting-up-an-elasticsearch-server)\n  * [部署代理](#deploying-the-proxy)\n  * [索引一些数据](#indexing-some-data)\n- [轻松玩转Elasticsearch](#elastic-made-easy)\n\n\n\n\n### 📡代理\n\n\u003Ccenter>\n\u003Ctable>\n  \u003Ctr>\n  \u003Ctd width=\"33%\">\n      \u003Cimg src=\"https:\u002F\u002Fgithub.com\u002Fkoursaros-ai\u002Fnboost\u002Fraw\u002Fmaster\u002F.github\u002Frocket.svg?sanitize=true\" alt=\"组件概览\">\n      \u003C\u002Ftd>\n  \u003Ctd>\n  \u003Cp>\u003Ca href=\"https:\u002F\u002Fnboost.readthedocs.io\u002Fen\u002Flatest\u002Fapi\u002Fnboost.proxy.html\">代理\u003C\u002Fa>是NBoost的核心。代理本质上是一个封装层，用于支持模型的服务化。它可以理解来自特定搜索API（如Elasticsearch）的请求消息。当代理接收到请求时，它会增加客户端要求的结果数量，以便模型能够对更多结果进行重新排序，并返回（希望是）更优的结果。\u003C\u002Fp>\n  \u003Cp>例如，如果客户端通过Elasticsearch查询“brown dogs”，并要求返回10条结果，那么代理可能会将请求结果数量提升至100条，然后再从中筛选出最优质的10条结果返回给客户端。\u003C\u002Fp>\n\u003C\u002Ftd>\n  \u003C\u002Ftr>\n\u003C\u002Ftable>\n\u003C\u002Fcenter>\n\n#### \n\n\n\n### 在3分钟内为Elasticsearch搭建神经网络代理\n\n在这个示例中，我们将搭建一个代理，使其位于客户端和Elasticsearch之间，从而提升搜索结果的质量！\n\n#### 使用TensorFlow安装NBoost\n\n如果你想在GPU上运行此示例，请确保已安装TensorFlow 1.14-1.15、PyTorch或ONNX Runtime，并且支持CUDA以实现建模功能。不过，如果你只想在CPU上运行也没关系。无论哪种情况，只需运行：\n\n```bash\npip install nboost[pt]\n```\n\n\n#### 搭建Elasticsearch服务器\n> 🔔 如果你已经有一个Elasticsearch服务器，可以跳过这一步！\n\n如果没有Elasticsearch也不用担心！我们建议使用Docker在本地搭建一个Elasticsearch集群（前提是已安装Docker）。首先，拉取ES镜像：\n\n```bash\ndocker pull elasticsearch:7.4.2\n```\n镜像下载完成后，可以通过以下命令运行Elasticsearch服务器：\n\n```bash\ndocker run -d -p 9200:9200 -p 9300:9300 -e \"discovery.type=single-node\" elasticsearch:7.4.2\n```\n\n#### 部署代理\n现在我们可以部署我们的神经网络代理了！操作非常简单，只需运行：\n\n```bash\nnboost                                  \\\n    --uhost localhost                   \\\n    --uport 9200                        \\\n    --search_route \"\u002F\u003Cindex>\u002F_search\"   \\\n    --query_path url.query.q            \\\n    --topk_path url.query.size          \\\n    --default_topk 10                   \\\n    --choices_path body.hits.hits       \\\n    --cvalues_path _source.passage\n```\n> 📢 `--uhost`和`--uport`应与上述Elasticsearch服务器保持一致！Uhost和uport分别是upstream-host和upstream-port的缩写，指代上游服务器。\n\n如果出现以下提示：`Listening: \u003Chost>:\u003Cport>`，那就说明一切准备就绪！\n\n#### 索引一些数据\nNBoost内置了一个便捷的索引工具（`nboost-index`）。为了演示目的，我们将通过NBoost索引一组关于旅行和酒店的文章片段（[微软TREC 2019深度学习数据集](https:\u002F\u002Fmicrosoft.github.io\u002FTREC-2019-Deep-Learning\u002F)）。你可以通过以下命令将这些数据添加到你的Elasticsearch服务器中：\n> `travel.csv`随NBoost一起提供\n```bash\nnboost-index --file travel.csv --index_name travel --delim , --id_col\n```` \n\n\n现在让我们来测试一下吧！向Elasticsearch发送如下请求：\n\n```bash\ncurl \"http:\u002F\u002Flocalhost:8000\u002Ftravel\u002F_search?pretty&q=passage:vegas&size=2\"\n```\n\n如果Elasticsearch返回的结果中带有`nboost`标签，那么恭喜你，一切正常运作！\n\n\u003Cp align=\"center\">\n\u003Cimg src=\"https:\u002F\u002Fgithub.com\u002Fkoursaros-ai\u002Fnboost\u002Fraw\u002Fmaster\u002F.github\u002Ftravel-tutorial.svg?sanitize=true\" alt=\"NBoost安装成功\">\n\u003C\u002Fp>\n\n#### 刚才发生了什么？\n让我们来看看**NBoost前端界面**。打开浏览器，访问[localhost:8000\u002Fnboost](http:\u002F\u002Flocalhost:8000\u002Fnboost)。\n> 如果无法访问浏览器，也可以通过`curl http:\u002F\u002Flocalhost:8000\u002Fnboost\u002Fstatus`获取相同信息。\n\n\u003Cp align=\"center\">\n\u003Cimg src=\"https:\u002F\u002Foss.gittoolsai.com\u002Fimages\u002Fkoursaros-ai_nboost_readme_5eb72890b034.png\">\n\u003C\u002Fp>\n\n前端记录了所有发生的事情：\n\n1. NBoost收到了一条请求，要求返回**2条搜索结果**。（average_topk）\n2. NBoost连接到了`localhost:9200`的服务器。\n3. NBoost向服务器发送了请求，要求返回50条搜索结果。（topn）\n4. NBoost从服务器接收到了**50条搜索结果**。（average_choices）\n5. 模型从中挑选出最优质的2条搜索结果，并将其返回给客户端。\n\n#### 轻松玩转Elasticsearch\n若需增加并行代理的数量，只需增加`--workers`参数即可。对于更健壮的部署方案，还可以通过Kubernetes来分发代理（见下文）。\n\n\u003Ch2 align=\"center\">Kubernetes\u003C\u002Fh2>\n\n\u003Cp align=\"center\">\n\u003Cimg src=\"https:\u002F\u002Fgithub.com\u002Fkoursaros-ai\u002Fnboost\u002Fraw\u002Fmaster\u002F.github\u002Fsailboat.svg?sanitize=true\" width=\"100%\">\n\u003C\u002Fp>\n\n#### 参阅\n有关深入的查询DSL及其他搜索API解决方案（如Bing API），请参阅[文档](https:\u002F\u002Fnboost.readthedocs.io\u002Fen\u002Flatest\u002Fchapter\u002Fbing-api.html)。\n\n### 通过Kubernetes部署NBoost\n我们可以使用[Helm](https:\u002F\u002Fhelm.sh\u002F)轻松地在Kubernetes集群中部署NBoost。\n\n#### 添加 NBoost Helm 仓库\n首先，我们需要在您的 Kubernetes 集群中注册该仓库。\n```bash\nhelm repo add nboost https:\u002F\u002Fraw.githubusercontent.com\u002Fkoursaros-ai\u002Fnboost\u002Fmaster\u002Fcharts\u002F\nhelm repo update\n```\n\n#### 部署若干 NBoost 副本\n让我们尝试部署四个副本：\n```bash\nhelm install --name nboost --set replicaCount=4 nboost\u002Fnboost\n```\n\n所有可能的 `--set` 参数（参考 [values.yaml](https:\u002F\u002Fgithub.com\u002Fkoursaros-ai\u002Fnboost\u002Fblob\u002Fmaster\u002Fcharts\u002Fnboost\u002Fvalues.yaml)）列于下文：\n\n| 参数                                    | 描述                                      | 默认值                                                     |\n| -------------------------------------------- | ------------------------------------------------ | ----------------------------------------------------------- |\n| `replicaCount`                               | 部署的副本数量                     | `3`                                                         |\n| `image.repository`                           | NBoost 镜像名称                                | `koursaros\u002Fnboost`                                          |\n| `image.tag`                                  | NBoost 镜像标签                                 | `latest-pt`                                                 |\n| `args.model`                                 | 模型类名称                          | `nil`                                                       |\n| `args.model_dir`                             | 微调后的模型名称或目录         | `pt-bert-base-uncased-msmarco`                              |\n| `args.qa`                                    | 是否使用问答插件                     | `False`                                                     |\n| `args.qa_model_dir`                          | 问答模型的名称或目录                | `distilbert-base-uncased-distilled-squad`                   |\n| `args.host`                                  | 代理服务器的主机名                            | `0.0.0.0`                                                   |\n| `args.port`                                  | 代理服务器监听的端口                  | `8000`                                                      |\n| `args.uhost`                                 | 上游搜索 API 服务器的主机名       | `elasticsearch-master`                                      |\n| `args.uport`                                 | 上游服务器的端口                      | `9200`                                                      |\n| `args.data_dir`                              | 缓存模型二进制文件的目录            | `nil`                                                       |\n| `args.max_seq_len`                           | 最大组合 token 长度                        | `64`                                                        |\n| `args.bufsize`                               | HTTP 缓冲区大小（字节）                 | `2048`                                                      |\n| `args.batch_size`                            | 重新排序模型的批处理大小              | `4`                                                         |\n| `args.multiplier`                            | 结果放大倍数                          | `5`                                                         |\n| `args.workers`                               | 服务代理的线程数量                    | `10`                                                        |\n| `args.query_path`                            | 请求中用于查找查询的 JsonPath        | `nil`                                                       |\n| `args.topk_path`                             | 用于查找请求结果数量的 JsonPath     | `nil`                                                       |\n| `args.choices_path`                          | 用于查找待重新排序选项数组的 JsonPath | `nil`                                                       |\n| `args.cvalues_path`                          | 用于查找选项字符串值的 JsonPath     | `nil`                                                       |\n| `args.cids_path`                             | 用于查找选项 ID 的 JsonPath          | `nil`                                                       |\n| `args.search_path`                           | 用于标记需通过 nboost 重新排序的 URL 路径 | `nil`                                                       |\n| `service.type`                               | Kubernetes 服务类型                          | `LoadBalancer`                                              |\n| `resources`                                  | Pod 的资源需求和限制                    | `{}`                                                        |\n| `nodeSelector`                               | 用于分配 Pod 的节点标签               | `{}`                                                        |\n| `affinity`                                   | 用于分配 Pod 的亲和性设置             | `{}`                                                        |\n| `tolerations`                                | 用于分配 Pod 的容忍度标签             | `[]`                                                        |\n| `image.pullPolicy`                           | 镜像拉取策略                                | `IfNotPresent`                                              |\n| `imagePullSecrets`                           | Docker 注册表 Secret 名称数组         | `[]`（不会将镜像拉取 Secret 添加到已部署的 Pod 中）     |\n| `nameOverride`                               | 用于覆盖 Chart.name 的字符串          | `nil`                                                       |\n| `fullnameOverride`                           | 用于覆盖 Chart.fullname 的字符串      | `nil`                                                       |\n| `serviceAccount.create`                      | 指定是否创建服务账户                  | `nil`                                                       |\n| `serviceAccount.name`                        | 要使用的服务账户名称。若未设置且 create 为 true，则会使用 fullname 模板生成名称   | `nil`  |\n| `podSecurityContext.fsGroup`                 | 容器的组 ID                       | `nil`                                                       |\n| `securityContext.runAsUser`                  | 容器的用户 ID                        | `1001`                                                      |\n| `ingress.enabled`                            | 启用 Ingress 资源                          | `false`                                                     |\n| `ingress.hostName`                           | 您安装的主机名                      | `nil`                                                       |\n| `ingress.path`                               | URL 结构中的路径                      | `[]`                                                        |\n| `ingress.tls`                                | 启用带有 TLS 的 Ingress                  | `[]`                                                        |\n| `ingress.tls.secretName`                     | 要使用的 TLS 类型 Secret              | `chart-example-tls`                                         |\n\n\u003Ch2 align=\"center\">文档\u003C\u002Fh2>\n\n[![ReadTheDoc](https:\u002F\u002Foss.gittoolsai.com\u002Fimages\u002Fkoursaros-ai_nboost_readme_51d302063c11.png)](https:\u002F\u002Fnboost.readthedocs.io)\n\nNBoost 的官方文档托管在 [nboost.readthedocs.io](http:\u002F\u002Fnboost.readthedocs.io\u002F) 上。每次发布新版本时，文档都会自动构建、更新并归档。\n\n\u003Ch2 align=\"center\">贡献\u003C\u002Fh2>\n\n我们非常欢迎您的贡献！您可以对代码进行修正或改进，并提交到 NBoost 仓库。以下是具体步骤：\n\n1. 创建一个新分支，例如 `fix-nboost-typo-1`。\n2. 修复或优化代码库。\n3. 提交更改。请注意，**提交信息必须遵循 [命名规范](.\u002FCONTRIBUTING.md#commit-message-naming)**，例如 `Fix\u002Fmodel-bert: 提高可读性并调整章节顺序`。\n4. 发起拉取请求。同样，**拉取请求的标题也必须遵循 [命名规范](.\u002FCONTRIBUTING.md#commit-message-naming)**。您可以直接使用其中一条提交信息作为拉取请求的标题，例如 `Fix\u002Fmodel-bert: 提高可读性并调整章节顺序`。\n5. 提交拉取请求，并等待所有检查通过（通常需要 10 分钟）：\n    - 代码风格检查\n    - 提交和拉取请求格式检查\n    - 所有单元测试\n6. 请求核心团队中的一位开发者进行评审。\n7. 合并！\n\n更多详细信息请参阅 [贡献指南](.\u002FCONTRIBUTING.md)。\n\n\u003Ch2 align=\"center\">引用 NBoost\u003C\u002Fh2>\n\n如果您在学术论文中使用了 NBoost，我们非常希望您能对其进行引用。以下是两种引用 NBoost 的方式：\n\n1.     \\footnote{https:\u002F\u002Fgithub.com\u002Fkoursaros-ai\u002Fnboost}\n2. \n    ```latex\n    @misc{koursaros2019NBoost,\n      title={NBoost: 神经网络增强搜索结果},\n      author={Thienes, Cole 和 Pertschuk, Jack},\n      howpublished={\\url{https:\u002F\u002Fgithub.com\u002Fkoursaros-ai\u002Fnboost}},\n      year={2019}\n    }\n    ```\n\n\u003Ch2 align=\"center\">许可证\u003C\u002Fh2>\n\n如果您下载了 NBoost 的二进制文件或源代码，请注意，NBoost 的二进制文件和源代码均采用 [Apache License, Version 2.0](.\u002FLICENSE) 许可证授权。\n\n\u003Csub>\nKoursaros AI 很高兴将这款开源软件贡献给社区。\u003Cbr>\n版权所有 © 2019。保留所有权利。\n\u003C\u002Fsub>","# NBoost 快速上手指南\n\nNBoost 是一个可扩展的搜索引擎增强平台，旨在通过部署最先进的神经重排序模型（Neural Reranking Models），显著提升 Elasticsearch 等搜索引擎的结果相关性。它作为客户端与搜索引擎之间的代理，自动获取更多候选结果并进行智能排序。\n\n## 环境准备\n\n### 系统要求\n- **操作系统**: Linux, macOS, Windows (推荐 Linux 环境以获得最佳性能)\n- **Python**: 3.6+\n- **搜索引擎**: Elasticsearch 7.x (示例基于 7.4.2，其他版本需调整配置)\n\n### 前置依赖\n根据选择的深度学习框架，需确保环境支持以下之一：\n- **PyTorch** (推荐): 适用于大多数场景，社区支持好。\n- **TensorFlow**: 如需使用特定 TF 模型。\n- **GPU 加速** (可选): 若需高性能推理，请安装对应的 CUDA 驱动及 Toolkit (PyTorch 或 TensorFlow 版本需匹配)。\n\n> 💡 **国内加速建议**: 安装 Python 依赖时，建议使用清华或阿里镜像源以提升下载速度。\n> ```bash\n> export PIP_INDEX_URL=https:\u002F\u002Fpypi.tuna.tsinghua.edu.cn\u002Fsimple\n> ```\n\n## 安装步骤\n\nNBoost 支持通过 PyPi 或 Docker 安装。**对于云部署或生产环境，强烈推荐使用 Docker**；本地开发测试可使用 PyPi。\n\n### 方式一：使用 PyPi 安装 (推荐 PyTorch 版本)\n\n这是最简单的本地开发安装方式。\n\n```bash\n# 安装带有 PyTorch 支持的 NBoost\npip install nboost[pt]\n\n# 如果需要 TensorFlow 版本\n# pip install nboost[tf]\n\n# 验证安装\nnboost --help\n```\n\n### 方式二：使用 Docker 安装\n\n适合隔离环境及快速部署。\n\n```bash\n# 拉取包含 PyTorch 支持的最新版镜像\ndocker pull koursaros\u002Fnboost:latest-pt\n\n# 验证安装\ndocker run koursaros\u002Fnboost:latest-pt --help\n```\n\n## 基本使用\n\n以下示例展示如何在 3 分钟内搭建一个针对 Elasticsearch 的神经重排序代理。\n\n### 1. 启动 Elasticsearch 服务\n\n如果您尚未运行 Elasticsearch，可以使用 Docker 快速启动一个单节点集群：\n\n```bash\n# 拉取镜像\ndocker pull elasticsearch:7.4.2\n\n# 启动容器 (映射端口 9200 和 9300)\ndocker run -d -p 9200:9200 -p 9300:9300 -e \"discovery.type=single-node\" elasticsearch:7.4.2\n```\n\n### 2. 准备测试数据\n\nNBoost 内置了索引工具 `nboost-index`。我们可以使用自带的旅行数据集进行测试：\n\n```bash\n# 创建名为 'travel' 的索引并导入数据\n# travel.csv 通常随包安装或在示例目录中\nnboost-index --file travel.csv --index_name travel --delim , --id_col id\n```\n\n### 3. 部署 NBoost 代理\n\n启动 NBoost 服务，使其监听本地端口并转发请求至 Elasticsearch。\n\n```bash\nnboost \\\n    --uhost localhost \\\n    --uport 9200 \\\n    --search_route \"\u002F\u003Cindex>\u002F_search\" \\\n    --query_path url.query.q \\\n    --topk_path url.query.size \\\n    --default_topk 10 \\\n    --choices_path body.hits.hits \\\n    --cvalues_path _source.passage\n```\n\n*参数说明*:\n- `--uhost` \u002F `--uport`: 上游 Elasticsearch 的地址和端口。\n- `--default_topk`: 最终返回给用户的结果数量（例如 10）。\n- 内部机制：当用户请求 10 条结果时，代理会向后端请求更多（如 100 条），经模型重排序后返回最优的 10 条。\n\n看到 `Listening: \u003Chost>:\u003Cport>` 消息即表示服务启动成功（默认监听 8000 端口）。\n\n### 4. 测试搜索效果\n\n现在可以通过 NBoost 代理端口（默认为 8000）发送搜索请求，体验增强后的搜索结果：\n\n```bash\ncurl \"http:\u002F\u002Flocalhost:8000\u002Ftravel\u002F_search?pretty&q=paris hotels\"\n```\n\n此时，请求会经过 NBoost 模型处理，返回相关性更高的排序结果。","某大型电商平台的搜索团队正致力于优化其基于 Elasticsearch 的商品检索系统，以解决用户在使用自然语言查询时难以找到精准商品的问题。\n\n### 没有 nboost 时\n- **关键词匹配局限**：传统搜索引擎仅依赖关键词字面匹配，当用户搜索“适合夏天的透气跑鞋”时，无法理解语义，导致包含“夏季”、“网面”等近义词的相关商品被遗漏。\n- **排序相关性低**：返回结果主要依据文本频率打分，往往将标题堆砌关键词但实际不相关的商品排在前列，用户需要翻越多页才能找到目标。\n- **长尾查询失效**：面对复杂的自然语言长句查询，系统缺乏深度理解能力，召回率大幅下降，直接导致转化率流失。\n- **模型部署困难**：团队虽想引入 BERT 等 Transformer 模型进行优化，但缺乏 scalable 的部署架构，难以将其无缝集成到现有的高并发搜索流中。\n\n### 使用 nboost 后\n- **语义理解增强**：nboost 作为中间层拦截查询，利用微调后的 Transformer 模型深刻理解“夏天透气”与“夏季网面”的语义关联，显著扩大相关商品的召回范围。\n- **智能重排序**：nboost 从 Elasticsearch 获取初筛结果后，通过神经重排序模型（Neural Rerank）精准评估相关性，将最符合用户意图的商品置顶展示。\n- **复杂查询胜任**：即使面对冗长的自然语言描述，nboost 也能准确捕捉核心需求，大幅提升长尾查询的命中率和用户满意度。\n- **无缝弹性部署**：借助 nboost 的平台化能力，团队轻松将先进的预训练模型部署为可扩展的 API，无需重构底层架构即可实现搜索能力的即时升级。\n\nnboost 通过引入深度学习重排序机制，将传统的关键词搜索升级为懂语义的智能检索，在不改变原有基础设施的前提下实现了搜索相关性的质的飞跃。","https:\u002F\u002Foss.gittoolsai.com\u002Fimages\u002Fkoursaros-ai_nboost_51dbf852.png","koursaros-ai","https:\u002F\u002Foss.gittoolsai.com\u002Favatars\u002Fkoursaros-ai_397c8776.png","",null,"https:\u002F\u002Fgithub.com\u002Fkoursaros-ai",[79,83,87,91,95,99,103],{"name":80,"color":81,"percentage":82},"Python","#3572A5",87.1,{"name":84,"color":85,"percentage":86},"JavaScript","#f1e05a",4.9,{"name":88,"color":89,"percentage":90},"HTML","#e34c26",4.7,{"name":92,"color":93,"percentage":94},"Smarty","#f0c040",1.7,{"name":96,"color":97,"percentage":98},"CSS","#663399",0.9,{"name":100,"color":101,"percentage":102},"Dockerfile","#384d54",0.5,{"name":104,"color":105,"percentage":106},"Shell","#89e051",0.2,674,68,"2026-04-10T19:11:47","Apache-2.0",4,"未说明 (支持 Docker 和 PyPi，通常兼容 Linux\u002FmacOS\u002FWindows)","非必需。若需加速，支持 CUDA 的 GPU（文中提到 Tensorflow 1.14-1.15 或 PyTorch with CUDA）。不同模型速度差异大：TinyBERT 约 50ms\u002Fquery，BERT-Base 约 300ms\u002Fquery。未明确具体显存大小要求。","未说明",{"notes":116,"python":117,"dependencies":118},"1. 提供多种安装方式：Docker 镜像（推荐云用户）、PyPi 包、Kubernetes Helm Chart。2. 默认模型为 'nboost\u002Fpt-tinybert-msmarco'，首次运行会自动下载并缓存。3. 若使用 GPU，需确保安装了带 CUDA 支持的 TensorFlow (1.14-1.15) 或 PyTorch。4. 该工具主要作为 Elasticsearch 的代理（Proxy），通过重排序提升搜索结果相关性。5. 文中基准测试基于 MS Marco 和 TREC-CAR 数据集。","未说明 (PyPI badge 显示支持多个 Python 版本，具体需参考 PyPI 页面)",[119,120,121,122,123],"PyTorch (推荐) 或 TensorFlow 1.14-1.15","nboost[pt] 或 nboost[tf]","Elasticsearch (建议 7.4.2)","Docker (可选，推荐用于云部署)","ONNX Runtime (可选)",[27,36,14],[126,127,128,129,130,131,132,133,65,134,135,136,137,138,139,140,141],"elasticsearch","tensorflow","pytorch","python","machine-learning","deep-learning","microservices","proxy","nlp","search-engine","kubernetes","helm","cloud","docker","semantic-search","search-api","2026-03-27T02:49:30.150509","2026-04-20T20:24:35.292621",[145,150,155,160,165,169,174],{"id":146,"question_zh":147,"answer_zh":148,"source_url":149},45671,"nboost 是否需要对现有的 ElasticSearch 索引进行重新索引？","不需要重新索引或创建 CSV 文件。nboost 支持所有 ElasticSearch 原生的查询方式，因为它会将查询直接转发给 ElasticSearch。你只需要在配置时指定用于重排序（re-ranking）的单个文本字段即可。注意：重排序功能目前仅支持针对一个文本字段进行操作，不支持多字段匹配（multi-match）的重排序。","https:\u002F\u002Fgithub.com\u002Fkoursaros-ai\u002Fnboost\u002Fissues\u002F66",{"id":151,"question_zh":152,"answer_zh":153,"source_url":154},45672,"运行 nboost 时遇到 'unable to open database file' 错误怎么办？","该错误通常是因为缺少 `.cache` 目录导致的。请按照以下步骤解决：\n1. 确保在 nboost 运行目录下创建 `.cache` 文件夹。\n2. 关闭所有相关的浏览器标签页。\n3. 确保 ElasticSearch 服务可访问，并且至少已经索引了一个文档（例如运行 `nboost-index --file travel.csv --index_name travel --delim , --id_col`）。\n4. 启动 nboost 后，先执行一次搜索查询以初始化数据库表（例如访问 `http:\u002F\u002Flocalhost:8000\u002Fyour_index\u002F_search?q=your_query&size=2`）。\n5. 完成上述步骤后，再访问仪表盘链接 `localhost:8000\u002Fnboost` 即可正常显示。","https:\u002F\u002Fgithub.com\u002Fkoursaros-ai\u002Fnboost\u002Fissues\u002F61",{"id":156,"question_zh":157,"answer_zh":158,"source_url":159},45673,"如何提高 nboost 的推理速度？","建议使用 ONNX Runtime 来加速模型推理。维护者已在 nboost 中实现了该功能（可能未更新到 README）。使用方法是指定 ONNX 格式的模型目录，例如添加参数 `--model_dir onnx-bert-base-uncased-msmarco`。实测数据显示，使用 ONNX Runtime 可以获得 2 倍以上的速度提升。你可以参考微软的 ONNX Runtime 项目获取更多细节。","https:\u002F\u002Fgithub.com\u002Fkoursaros-ai\u002Fnboost\u002Fissues\u002F32",{"id":161,"question_zh":162,"answer_zh":163,"source_url":164},45674,"nboost 的典型工作流程是怎样的？它是如何与 ElasticSearch 配合使用的？","nboost 的标准工作流程是“召回 + 重排序”模式：\n1. 首先向 ElasticSearch 发起请求，获取较大数量的候选文档（例如前 1000 个）。\n2. nboost 接收这些候选文档，仅基于深度学习模型（如 BERT）对它们进行重新打分和排序，不结合 ES 的原始权重。\n3. 最后返回重排序后的顶部结果（例如前 10 个）给用户。\n这种架构允许利用 ES 的快速检索能力和 BERT 的精准语义理解能力。","https:\u002F\u002Fgithub.com\u002Fkoursaros-ai\u002Fnboost\u002Fissues\u002F69",{"id":166,"question_zh":167,"answer_zh":168,"source_url":164},45675,"对于长文档，BERT 模型的输入长度限制（512 tokens）该如何处理？","常见的做法是将文档截断（Truncate）为前 512 个 token。对于像 Wikipedia 搜索这样的场景，最重要的信息通常位于文档开头，因此截断效果很好。虽然 BERT 只能处理前 512 个 token，但在大多数重排序任务中，这足以捕捉关键的语义匹配信息。",{"id":170,"question_zh":171,"answer_zh":172,"source_url":173},45676,"如何在没有 GPU 的服务器上运行 nboost（避免 libcuda 缺失错误）？","如果在没有 GPU 的服务器上运行遇到 `libcuda` 缺失错误，需要确保使用不包含 GPU 依赖的 Docker 镜像或 TensorFlow 版本。尝试使用 `tensorflow\u002Ftensorflow:1.15.0-py3`（不带 gpu 标签）的基础镜像构建或直接运行。此外，警告信息中提到 CPU 不支持 AVX2\u002FAVX512F 等指令集通常不会阻止程序运行，但可能会影响性能；主要需解决的是 CUDA 库的依赖问题，纯 CPU 环境下不应加载 CUDA 相关库。","https:\u002F\u002Fgithub.com\u002Fkoursaros-ai\u002Fnboost\u002Fissues\u002F25",{"id":175,"question_zh":176,"answer_zh":177,"source_url":159},45677,"nboost 与 S-BERT + ElasticSearch 向量字段方案相比有何优势？","S-BERT 需要将每个句子映射到向量空间并进行向量相似度搜索，而 nboost（基于 BERT Cross-Encoder 架构）能够利用注意力机制直接比较查询和文档（例如逐词比较）。虽然 S-BERT 在构建索引后检索速度更快，但 BERT 的直接交互模式通常在相关性判断上更准确，尤其是在处理复杂语义匹配时。nboost 采用重排序策略，结合了 ES 的快速初筛和 BERT 的精细排序，能在保证速度的同时获得更高的相关性得分。",[]]