[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"similar-KRLabsOrg--LettuceDetect":3,"tool-KRLabsOrg--LettuceDetect":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 真正成长为懂上",150037,2,"2026-04-10T23:33:47",[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":85,"forks":86,"last_commit_at":87,"license":88,"difficulty_score":89,"env_os":90,"env_gpu":91,"env_ram":90,"env_deps":92,"category_tags":101,"github_topics":103,"view_count":10,"oss_zip_url":76,"oss_zip_packed_at":76,"status":17,"created_at":112,"updated_at":113,"faqs":114,"releases":115},3292,"KRLabsOrg\u002FLettuceDetect","LettuceDetect","Lightweight hallucination detection framework for RAG applications","LettuceDetect 是一款专为检索增强生成（RAG）系统设计的轻量级幻觉检测工具。它的核心任务是像“侦探”一样，通过对比 AI 生成的回答与提供的参考上下文，精准识别出那些缺乏事实依据的“幻觉”内容，并定位到具体的错误片段。\n\n在 RAG 应用开发中，开发者常面临两难选择：传统编码器模型处理长文本能力有限，而大语言模型（LLM）方案则计算成本高、推理速度慢。LettuceDetect 巧妙解决了这一痛点，它基于 ModernBERT 和 EuroBERT 架构，不仅支持长达 4K 至 8K 的上下文窗口，还能在保持极高推理速度的同时，提供词元级别的检测精度。实测表明，其在多项指标上优于现有的编码器模型及部分微调大模型。\n\n该工具特别适合构建 RAG 系统的后端工程师、AI 研究人员以及需要高效内容验证机制的技术团队使用。其独特亮点包括支持英语、中文等七种语言的多语言能力，以及极小的模型体积，便于快速集成。通过简单的 Python API 或一行代码即可加载模型，让开发者能轻松为 AI 应用加上可靠的“现实检查”机制，且完全免费开源。","# LettuceDetect 🥬🔍\n\n\n\u003Cp align=\"center\">\n  \u003Cimg src=\"https:\u002F\u002Foss.gittoolsai.com\u002Fimages\u002FKRLabsOrg_LettuceDetect_readme_ac84b6f31187.png\" alt=\"LettuceDetect Logo\" width=\"400\"\u002F>\n  \u003Cbr>\u003Cem>Because even AI needs a reality check! 🥬\u003C\u002Fem>\n\u003C\u002Fp>\n\nLettuceDetect is a lightweight and efficient tool for detecting hallucinations in Retrieval-Augmented Generation (RAG) systems. It identifies unsupported parts of an answer by comparing it to the provided context. The tool is trained and evaluated on the [RAGTruth](https:\u002F\u002Faclanthology.org\u002F2024.acl-long.585\u002F) dataset and leverages [ModernBERT](https:\u002F\u002Fgithub.com\u002FAnswerDotAI\u002FModernBERT) for English and [EuroBERT](https:\u002F\u002Fhuggingface.co\u002Fblog\u002FEuroBERT\u002Frelease) for multilingual support, making it ideal for tasks requiring extensive context windows.\n\nOur models are inspired from the [Luna](https:\u002F\u002Faclanthology.org\u002F2025.coling-industry.34\u002F) paper which is an encoder-based model and uses a similar token-level approach.\n\n[![PyPI](https:\u002F\u002Fimg.shields.io\u002Fpypi\u002Fv\u002Flettucedetect)](https:\u002F\u002Fpypi.org\u002Fproject\u002Flettucedetect\u002F)\n[![License](https:\u002F\u002Fimg.shields.io\u002Fbadge\u002FLicense-MIT-blue.svg)](https:\u002F\u002Fopensource.org\u002Flicenses\u002FMIT)\n[![Hugging Face](https:\u002F\u002Fimg.shields.io\u002Fbadge\u002F🤗-Models-yellow.svg)](https:\u002F\u002Fhuggingface.co\u002FKRLabsOrg)\n[![Open In Colab](https:\u002F\u002Fcolab.research.google.com\u002Fassets\u002Fcolab-badge.svg)](https:\u002F\u002Fcolab.research.google.com\u002Fdrive\u002F1Ubca5aMaBGdHtJ1rpqj3Ke9SLEr-PaDn?usp=sharing)\n[![arXiv](https:\u002F\u002Fimg.shields.io\u002Fbadge\u002FarXiv-2502.17125-b31b1b.svg)](https:\u002F\u002Farxiv.org\u002Fabs\u002F2502.17125)\n\n## Highlights\n\n- LettuceDetect addresses two critical limitations of existing hallucination detection models:\n  - Context window constraints of traditional encoder-based methods\n  - Computational inefficiency of LLM-based approaches\n- Our models currently **outperform** all other encoder-based and prompt-based models on the RAGTruth dataset and are significantly faster and smaller \n- Achieves higher score than some fine-tuned LLMs e.g. LLAMA-2-13B presented in [RAGTruth](https:\u002F\u002Faclanthology.org\u002F2024.acl-long.585\u002F), coming up just short of the LLM fine-tuned in the [RAG-HAT paper](https:\u002F\u002Faclanthology.org\u002F2024.emnlp-industry.113.pdf)\n\n## 🚀 Latest Updates\n\n- **August 31, 2025** - Released version **0.1.8**: Added TinyLettuce Ettin models for 17M, 32M, and 68M variants, Hallucination generation pipeline and added RAGFactChecker for triplet-based hallucination detection.\n  - See [TinyLettuce Blog Post](https:\u002F\u002Fhuggingface.co\u002Fblog\u002Fadaamko\u002Ftinylettuce) for more details.\n  - Our collection on Hugging Face: [TinyLettuce](https:\u002F\u002Fhuggingface.co\u002Fcollections\u002FKRLabsOrg\u002Ftinylettuce-68b42a66b8b6aaa4bf287bf4)\n  - See the documentation: [TinyLettuce Documentation](docs\u002FTINYLETTUCE.md) for more details.\n- May 18, 2025 - Released version **0.1.7**: Multilingual support (thanks to EuroBERT) for 7 languages: English, German, French, Spanish, Italian, Polish, and Chinese!\n- Up to **17 F1 points improvement** over baseline LLM judges like GPT-4.1-mini across different languages\n- **EuroBERT models**: We've trained base\u002F210M (faster) and large\u002F610M (more accurate) variants\n- You can now also use **LLM baselines** for hallucination detection (see below)\n\n## Get going  \n\n### Features\n\n- ✨ **Token-level precision**: detect exact hallucinated spans\n- 🚀 **Optimized for inference**: smaller model size and faster inference\n- 🧠 **Long context window** support (4K for ModernBERT, 8K for EuroBERT)\n- 🌍 **Multilingual support**: 7 languages covered\n- ⚖️ **MIT-licensed** models & code\n- 🤖 **HF Integration**: one-line model loading\n- 📦 **Easy to use python API**: can be downloaded from pip and few lines of code to integrate into your RAG system\n\n### Installation\n\nInstall from the repository:\n```bash\npip install -e .\n```\n\nFrom pip:\n```bash\npip install lettucedetect -U\n```\n\n### Quick Start\n\nCheck out our models published to Huggingface: \n\n**English Models**:\n- Base: [KRLabsOrg\u002Flettucedect-base-modernbert-en-v1](https:\u002F\u002Fhuggingface.co\u002FKRLabsOrg\u002Flettucedect-base-modernbert-en-v1)\n- Large: [KRLabsOrg\u002Flettucedect-large-modernbert-en-v1](https:\u002F\u002Fhuggingface.co\u002FKRLabsOrg\u002Flettucedect-large-modernbert-en-v1)\n\n**Multilingual Models**:\nWe've trained 210m and 610m variants of EuroBERT, see our HuggingFace collection: [HF models](https:\u002F\u002Fhuggingface.co\u002Fcollections\u002FKRLabsOrg\u002Fmultilingual-hallucination-detection-682a2549c18ecd32689231ce)\n\n\n*See the full list of models and smaller variants in our [HuggingFace page](https:\u002F\u002Fhuggingface.co\u002FKRLabsOrg).*\n\nYou can get started right away with just a few lines of code.\n\n```python\nfrom lettucedetect.models.inference import HallucinationDetector\n\n# For English:\ndetector = HallucinationDetector(\n    method=\"transformer\", \n    model_path=\"KRLabsOrg\u002Flettucedect-base-modernbert-en-v1\",\n)\n\n# For other languages (e.g., German):\n# detector = HallucinationDetector(\n#     method=\"transformer\", \n#     model_path=\"KRLabsOrg\u002Flettucedect-210m-eurobert-de-v1\",\n#     lang=\"de\",\n#     trust_remote_code=True\n# )\n\ncontexts = [\"France is a country in Europe. The capital of France is Paris. The population of France is 67 million.\",]\nquestion = \"What is the capital of France? What is the population of France?\"\nanswer = \"The capital of France is Paris. The population of France is 69 million.\"\n\n# Get span-level predictions indicating which parts of the answer are considered hallucinated.\npredictions = detector.predict(context=contexts, question=question, answer=answer, output_format=\"spans\")\nprint(\"Predictions:\", predictions)\n\n# Predictions: [{'start': 31, 'end': 71, 'confidence': 0.9944414496421814, 'text': ' The population of France is 69 million.'}]\n```\n\nCheck out our [HF collection](https:\u002F\u002Fhuggingface.co\u002Fcollections\u002FKRLabsOrg\u002Fmultilingual-hallucination-detection-682a2549c18ecd32689231ce) for more examples.\n\nWe also implemented LLM-based baselines, for that add your OpenAI API key:\n\n```bash\nexport OPENAI_API_KEY=your_api_key\n```\n\nThen in code:\n\n```python\nfrom lettucedetect.models.inference import HallucinationDetector\n\n# For German:\ndetector = HallucinationDetector(method=\"llm\", lang=\"de\")\n\n# Then predict the same way\npredictions = detector.predict(context=contexts, question=question, answer=answer, output_format=\"spans\")\n```\n\n## Performance\n\nWe've evaluated our models against both encoder-based and LLM-based approaches. The key findings include:\n\n- In English, our model **outperform** all other encoder-based and prompt-based models on the RAGTruth dataset and are significantly faster and smaller \n- Our multilingual models are better than baseline LLM judges like GPT-4.1-mini\n- Our models are also significantly faster and smaller than the LLM-based judges\n\nFor detailed performance metrics and evaluations of our models:\n- [English model documentation](docs\u002FREADME.md)\n- [Multilingual model documentation](docs\u002FEUROBERT.md)\n- [Paper](https:\u002F\u002Farxiv.org\u002Fabs\u002F2502.17125)\n- [Model cards](https:\u002F\u002Fhuggingface.co\u002FKRLabsOrg)\n\n## How does it work?\n\nThe model is a token-level model that predicts whether a token is hallucinated or not. The model is trained to predict the tokens that are hallucinated in the answer given the context and the question.\n\n```mermaid\nflowchart LR\n    subgraph Inputs\n        Context[\"**Context**: France is a country in Europe. Population is 67 million.\"]\n        Question[\"**Question**: What is the capital? What is the population?\"]\n        Answer[\"**Answer**: The capital of France is Paris. The population is 69 million.\"]\n    end\n\n    Model[\"**LettuceDetect**: Token Classification\"]\n    Tokens[\"**Token Probabilities**: \u003Cbr> ... \u003Cbr> The [0.01] \u003Cbr> population [0.02] \u003Cbr> is [0.01] \u003Cbr> 69 [0.95] \u003Cbr> million [0.95]\"]\n\n    Context --> Model\n    Question --> Model\n    Answer --> Model\n    Model --> Tokens\n\n```\n\n### Training a Model\n\nYou need to download the RAGTruth dataset first from [here](https:\u002F\u002Fgithub.com\u002FParticleMedia\u002FRAGTruth\u002Ftree\u002Fmain\u002Fdataset), then put it under the `data\u002Fragtruth` directory. Then run\n\n```bash\npython lettucedetect\u002Fpreprocess\u002Fpreprocess_ragtruth.py --input_dir data\u002Fragtruth --output_dir data\u002Fragtruth\n```\n\nThis will create a `data\u002Fragtruth\u002Fragtruth_data.json` file which contains the processed data.\n\nThen you can train the model with the following command.\n\n```bash\npython scripts\u002Ftrain.py \\\n    --ragtruth-path data\u002Fragtruth\u002Fragtruth_data.json \\\n    --model-name answerdotai\u002FModernBERT-base \\\n    --output-dir output\u002Fhallucination_detector \\\n    --batch-size 4 \\\n    --epochs 6 \\\n    --learning-rate 1e-5 \n```\n\nWe trained our models for 6 epochs with a batch size of 8 on a single A100 GPU.\n\n### Evaluation\n\nYou can evaluate the models on each level (example, token and span) and each data-type.\n\n```bash\npython scripts\u002Fevaluate.py \\\n    --model_path outputs\u002Fhallucination_detector \\\n    --data_path data\u002Fragtruth\u002Fragtruth_data.json \\\n    --evaluation_type example_level\n```\n\n### Model Output Format\n\nThe model can output predictions in two formats:\n\n#### Span Format\n```python\n[{\n    'text': str,        # The hallucinated text\n    'start': int,       # Start position in answer\n    'end': int,         # End position in answer\n    'confidence': float # Model's confidence (0-1)\n}]\n```\n\n### Token Format\n```python\n[{\n    'token': str,       # The token\n    'pred': int,        # 0: supported, 1: hallucinated\n    'prob': float       # Model's confidence (0-1)\n}]\n```\n\n## Streamlit Demo\n\nCheck out the Streamlit demo to see the model in action.\n\nInstall streamlit:\n\n```bash\npip install streamlit\n```\n\nRun the demo:\n\n```bash\nstreamlit run demo\u002Fstreamlit_demo.py\n```\n\n## Use the Web API\n\nLettuceDetect comes with it's own web API and python client library. To use it, make sure to install the package with the optional API dependencies:\n\n```bash\npip install -e .[api]\n```\n\nor\n\n```bash\npip install lettucedetect[api]\n```\n\nStart the API server with the `scripts\u002Fstart_api.py` script:\n\n```bash\npython scripts\u002Fstart_api.py dev  # use \"prod\" for production environments\n```\n\nUsage:\n\n```bash\nusage: start_api.py [-h] [--model MODEL] [--method {transformer}] {prod,dev}\n\nStart lettucedetect Web API.\n\npositional arguments:\n  {prod,dev}            Choose \"dev\" for development or \"prod\" for production\n                        environments. The serve script uses \"fastapi dev\" for \"dev\" or\n                        \"fastapi run\" for \"prod\" to start the web server. Additionally\n                        when choosing the \"dev\" mode, python modules can be directly\n                        imported from the repositroy without installing the package.\n\noptions:\n  -h, --help            show this help message and exit\n  --model MODEL         Path or huggingface URL to the model. The default value is\n                        \"KRLabsOrg\u002Flettucedect-base-modernbert-en-v1\".\n  --method {transformer}\n                        Hallucination detection method. The default value is\n                        \"transformer\".\n```\n\nExample using the python client library:\n\n```python\nfrom lettucedetect_api.client import LettuceClient\n\ncontexts = [\n    \"France is a country in Europe. \"\n    \"The capital of France is Paris. \"\n    \"The population of France is 67 million.\",\n]\nquestion = \"What is the capital of France? What is the population of France?\"\nanswer = \"The capital of France is Paris. The population of France is 69 million.\"\n\nclient = LettuceClient(\"http:\u002F\u002F127.0.0.1:8000\")\nresponse = client.detect_spans(contexts, question, answer)\nprint(response.predictions)\n\n# [SpanDetectionItem(start=31, end=71, text=' The population of France is 69 million.', hallucination_score=0.989198625087738)]\n```\n\nSee `demo\u002Fdetection_api.ipynb` for more examples.\nFor async support use the `LettuceClientAsync` class instead.\n\n## License\n\nMIT License - see LICENSE file for details.\n\n## Citation\n\nPlease cite the following paper if you use LettuceDetect in your work:\n\n```bibtex\n@misc{Kovacs:2025,\n      title={LettuceDetect: A Hallucination Detection Framework for RAG Applications}, \n      author={Ádám Kovács and Gábor Recski},\n      year={2025},\n      eprint={2502.17125},\n      archivePrefix={arXiv},\n      primaryClass={cs.CL},\n      url={https:\u002F\u002Farxiv.org\u002Fabs\u002F2502.17125}, \n}\n```\n","# LettuceDetect 🥬🔍\n\n\n\u003Cp align=\"center\">\n  \u003Cimg src=\"https:\u002F\u002Foss.gittoolsai.com\u002Fimages\u002FKRLabsOrg_LettuceDetect_readme_ac84b6f31187.png\" alt=\"LettuceDetect Logo\" width=\"400\"\u002F>\n  \u003Cbr>\u003Cem>因为即使是 AI 也需要现实检验！🥬\u003C\u002Fem>\n\u003C\u002Fp>\n\nLettuceDetect 是一款轻量且高效的工具，用于检测检索增强生成（RAG）系统中的幻觉现象。它通过将回答与提供的上下文进行对比，识别出回答中没有依据的部分。该工具基于 [RAGTruth](https:\u002F\u002Faclanthology.org\u002F2024.acl-long.585\u002F) 数据集进行训练和评估，并利用 [ModernBERT](https:\u002F\u002Fgithub.com\u002FAnswerDotAI\u002FModernBERT) 处理英语，以及 [EuroBERT](https:\u002F\u002Fhuggingface.co\u002Fblog\u002FEuroBERT\u002Frelease) 提供多语言支持，因此非常适合需要大上下文窗口的任务。\n\n我们的模型灵感来源于 [Luna](https:\u002F\u002Faclanthology.org\u002F2025.coling-industry.34\u002F) 论文，该论文提出了一种基于编码器的模型，并采用了类似的标记级方法。\n\n[![PyPI](https:\u002F\u002Fimg.shields.io\u002Fpypi\u002Fv\u002Flettucedetect)](https:\u002F\u002Fpypi.org\u002Fproject\u002Flettucedetect\u002F)\n[![License](https:\u002F\u002Fimg.shields.io\u002Fbadge\u002FLicense-MIT-blue.svg)](https:\u002F\u002Fopensource.org\u002Flicenses\u002FMIT)\n[![Hugging Face](https:\u002F\u002Fimg.shields.io\u002Fbadge\u002F🤗-Models-yellow.svg)](https:\u002F\u002Fhuggingface.co\u002FKRLabsOrg)\n[![Open In Colab](https:\u002F\u002Fcolab.research.google.com\u002Fassets\u002Fcolab-badge.svg)](https:\u002F\u002Fcolab.research.google.com\u002Fdrive\u002F1Ubca5aMaBGdHtJ1rpqj3Ke9SLEr-PaDn?usp=sharing)\n[![arXiv](https:\u002F\u002Fimg.shields.io\u002Fbadge\u002FarXiv-2502.17125-b31b1b.svg)](https:\u002F\u002Farxiv.org\u002Fabs\u002F2502.17125)\n\n## 亮点\n\n- LettuceDetect 解决了现有幻觉检测模型的两大关键限制：\n  - 传统基于编码器的方法对上下文窗口的限制\n  - 基于 LLM 的方法计算效率低下\n- 目前，我们的模型在 RAGTruth 数据集中**优于**所有其他基于编码器和提示的方法，同时速度更快、体积更小。\n- 检测性能甚至超过了一些微调后的 LLM，例如 [RAGTruth](https:\u002F\u002Faclanthology.org\u002F2024.acl-long.585\u002F) 中提到的 LLAMA-2-13B，仅略逊于 [RAG-HAT 论文](https:\u002F\u002Faclanthology.org\u002F2024.emnlp-industry.113.pdf)中微调的 LLM。\n\n## 🚀 最新动态\n\n- **2025年8月31日** - 发布版本 **0.1.8**：新增 TinyLettuce Ettin 模型，涵盖 17M、32M 和 68M 参数量；引入幻觉生成流水线，并添加 RAGFactChecker 用于基于三元组的幻觉检测。\n  - 更多详情请参阅 [TinyLettuce 博客文章](https:\u002F\u002Fhuggingface.co\u002Fblog\u002Fadaamko\u002Ftinylettuce)。\n  - 我们的 Hugging Face 收藏：[TinyLettuce](https:\u002F\u002Fhuggingface.co\u002Fcollections\u002FKRLabsOrg\u002Ftinylettuce-68b42a66b8b6aaa4bf287bf4)\n  - 文档请见：[TinyLettuce 文档](docs\u002FTINYLETTUCE.md)。\n- 2025年5月18日 - 发布版本 **0.1.7**：借助 EuroBERT 实现多语言支持，覆盖英语、德语、法语、西班牙语、意大利语、波兰语和中文共7种语言！\n- 在不同语言上，相比 GPT-4.1-mini 等基准 LLM 判别器，F1 分数提升高达 **17点**。\n- **EuroBERT 模型**：我们训练了基础版\u002F210M（速度更快）和大型版\u002F610M（精度更高）两种变体。\n- 现在您也可以使用 **LLM 基准** 进行幻觉检测（见下文）。\n\n## 快速入门\n\n### 功能特性\n\n- ✨ **标记级精度**：精准检测幻觉片段\n- 🚀 **推理优化**：模型体积更小，推理速度更快\n- 🧠 **长上下文窗口支持**（ModernBERT 支持4K，EuroBERT 支持8K）\n- 🌍 **多语言支持**：覆盖7种语言\n- ⚖️ **MIT 许可证** 的模型与代码\n- 🤖 **Hugging Face 集成**：一行代码即可加载模型\n- 📦 **易用的 Python API**：可通过 pip 安装，只需几行代码即可集成到您的 RAG 系统。\n\n### 安装\n\n从仓库安装：\n```bash\npip install -e .\n```\n\n或通过 pip 安装：\n```bash\npip install lettucedetect -U\n```\n\n### 快速开始\n\n请查看我们在 Hugging Face 上发布的模型：\n\n**英语模型**：\n- 基础版：[KRLabsOrg\u002Flettucedect-base-modernbert-en-v1](https:\u002F\u002Fhuggingface.co\u002FKRLabsOrg\u002Flettucedect-base-modernbert-en-v1)\n- 大型版：[KRLabsOrg\u002Flettucedect-large-modernbert-en-v1](https:\u002F\u002Fhuggingface.co\u002FKRLabsOrg\u002Flettucedect-large-modernbert-en-v1)\n\n**多语言模型**：\n我们训练了 EuroBERT 的 210M 和 610M 变体，请参阅我们的 Hugging Face 收藏：[HF 模型](https:\u002F\u002Fhuggingface.co\u002Fcollections\u002FKRLabsOrg\u002Fmultilingual-hallucination-detection-682a2549c18ecd32689231ce)\n\n\n*完整模型列表及小型变体请访问我们的 [Hugging Face 页面](https:\u002F\u002Fhuggingface.co\u002FKRLabsOrg)。*\n\n您只需几行代码即可快速开始使用。\n\n```python\nfrom lettucedetect.models.inference import HallucinationDetector\n\n# 英语：\ndetector = HallucinationDetector(\n    method=\"transformer\", \n    model_path=\"KRLabsOrg\u002Flettucedect-base-modernbert-en-v1\",\n)\n\n# 其他语言（如德语）：\n# detector = HallucinationDetector(\n#     method=\"transformer\", \n#     model_path=\"KRLabsOrg\u002Flettucedect-210m-eurobert-de-v1\",\n#     lang=\"de\",\n#     trust_remote_code=True\n# )\n\ncontexts = [\"法国是欧洲的一个国家。法国的首都是巴黎。法国的人口为6700万。\"]\nquestion = \"法国的首都是什么？法国的人口是多少？\"\nanswer = \"法国的首都是巴黎。法国的人口为6900万。\"\n\n# 获取跨度级别的预测结果，指示回答中哪些部分被认为是幻觉。\npredictions = detector.predict(context=contexts, question=question, answer=answer, output_format=\"spans\")\nprint(\"预测结果:\", predictions)\n\n# 预测结果：[{'start': 31, 'end': 71, 'confidence': 0.9944414496421814, 'text': '法国的人口为6900万。'}]\n```\n\n更多示例请参阅我们的 [HF 收藏](https:\u002F\u002Fhuggingface.co\u002Fcollections\u002FKRLabsOrg\u002Fmultilingual-hallucination-detection-682a2549c18ecd32689231ce)。\n\n我们还实现了基于 LLM 的基准方法，为此请设置您的 OpenAI API 密钥：\n\n```bash\nexport OPENAI_API_KEY=your_api_key\n```\n\n然后在代码中：\n\n```python\nfrom lettucedetect.models.inference import HallucinationDetector\n\n# 德语：\ndetector = HallucinationDetector(method=\"llm\", lang=\"de\")\n\n# 接着以相同的方式进行预测\npredictions = detector.predict(context=contexts, question=question, answer=answer, output_format=\"spans\")\n```\n\n## 性能表现\n\n我们已将我们的模型与基于编码器和基于 LLM 的方法进行了对比评估。主要发现包括：\n\n- 在英语方面，我们的模型在 RAGTruth 数据集中**优于**所有其他基于编码器和提示的方法，且速度更快、体积更小。\n- 我们的多语言模型表现优于 GPT-4.1-mini 等基准 LLM 判别器。\n- 此外，我们的模型在速度和体积上也显著优于基于 LLM 的判别器。\n\n有关详细性能指标和模型评估：\n- [英语模型文档](docs\u002FREADME.md)\n- [多语言模型文档](docs\u002FEUROBERT.md)\n- [论文](https:\u002F\u002Farxiv.org\u002Fabs\u002F2502.17125)\n- [模型卡片](https:\u002F\u002Fhuggingface.co\u002FKRLabsOrg)\n\n## 它是如何工作的？\n\n该模型是一个基于标记的分类模型，用于预测某个标记是否为幻觉内容。模型经过训练，能够在给定上下文和问题的情况下，识别出答案中哪些标记是幻觉生成的。\n\n```mermaid\nflowchart LR\n    subgraph Inputs\n        Context[\"**上下文**: 法国是欧洲的一个国家。人口为6700万。\"]\n        Question[\"**问题**: 首都是什么？人口是多少？\"]\n        Answer[\"**回答**: 法国的首都是巴黎。人口为6900万。\"]\n    end\n\n    Model[\"**LettuceDetect**: 标记分类\"]\n    Tokens[\"**标记概率**: \u003Cbr> ... \u003Cbr> The [0.01] \u003Cbr> population [0.02] \u003Cbr> is [0.01] \u003Cbr> 69 [0.95] \u003Cbr> million [0.95]\"]\n\n    Context --> Model\n    Question --> Model\n    Answer --> Model\n    Model --> Tokens\n\n```\n\n### 模型训练\n\n首先需要从[这里](https:\u002F\u002Fgithub.com\u002FParticleMedia\u002FRAGTruth\u002Ftree\u002Fmain\u002Fdataset)下载 RAGTruth 数据集，并将其放置在 `data\u002Fragtruth` 目录下。然后运行以下命令：\n\n```bash\npython lettucedetect\u002Fpreprocess\u002Fpreprocess_ragtruth.py --input_dir data\u002Fragtruth --output_dir data\u002Fragtruth\n```\n\n这将生成一个 `data\u002Fragtruth\u002Fragtruth_data.json` 文件，其中包含处理后的数据。\n\n接下来，可以使用以下命令训练模型：\n\n```bash\npython scripts\u002Ftrain.py \\\n    --ragtruth-path data\u002Fragtruth\u002Fragtruth_data.json \\\n    --model-name answerdotai\u002FModernBERT-base \\\n    --output-dir output\u002Fhallucination_detector \\\n    --batch-size 4 \\\n    --epochs 6 \\\n    --learning-rate 1e-5 \n```\n\n我们使用单个 A100 GPU，在批大小为 8 的情况下训练了 6 个 epoch。\n\n### 模型评估\n\n可以在不同层级（示例、标记和跨度）以及不同数据类型上对模型进行评估。\n\n```bash\npython scripts\u002Fevaluate.py \\\n    --model_path outputs\u002Fhallucination_detector \\\n    --data_path data\u002Fragtruth\u002Fragtruth_data.json \\\n    --evaluation_type example_level\n```\n\n### 模型输出格式\n\n模型可以以两种格式输出预测结果：\n\n#### 跨度格式\n```python\n[{\n    'text': str,        # 幻觉文本\n    'start': int,       # 在回答中的起始位置\n    'end': int,         # 在回答中的结束位置\n    'confidence': float # 模型置信度（0-1）\n}]\n```\n\n### 标记格式\n```python\n[{\n    'token': str,       # 标记\n    'pred': int,        # 0：支持，1：幻觉\n    'prob': float       # 模型置信度（0-1）\n}]\n```\n\n## Streamlit 演示\n\n请查看 Streamlit 演示，了解模型的实际应用效果。\n\n安装 Streamlit：\n\n```bash\npip install streamlit\n```\n\n运行演示：\n\n```bash\nstreamlit run demo\u002Fstreamlit_demo.py\n```\n\n## 使用 Web API\n\nLettuceDetect 自带 Web API 和 Python 客户端库。要使用它，请确保安装包含可选 API 依赖项的包：\n\n```bash\npip install -e .[api]\n```\n\n或者\n\n```bash\npip install lettucedetect[api]\n```\n\n使用 `scripts\u002Fstart_api.py` 脚本启动 API 服务器：\n\n```bash\npython scripts\u002Fstart_api.py dev  # 生产环境使用 \"prod\"\n```\n\n用法：\n\n```bash\nusage: start_api.py [-h] [--model MODEL] [--method {transformer}] {prod,dev}\n\n启动 LettuceDetect Web API。\n\n位置参数:\n  {prod,dev}            选择 \"dev\" 进行开发，或 \"prod\" 进行生产环境部署。\n                        服务脚本会根据模式分别使用 \"fastapi dev\" 或 \"fastapi run\" 来启动 Web 服务器。此外，在 \"dev\" 模式下，可以直接从仓库导入 Python 模块，而无需安装包。\n\n选项:\n  -h, --help            显示帮助信息并退出\n  --model MODEL         模型路径或 Hugging Face URL。默认值为\n                        \"KRLabsOrg\u002Flettucedect-base-modernbert-en-v1\"。\n  --method {transformer}\n                        幻觉检测方法。默认值为\n                        \"transformer\"。\n```\n\n使用 Python 客户端库的示例：\n\n```python\nfrom lettucedetect_api.client import LettuceClient\n\ncontexts = [\n    \"法国是欧洲的一个国家。 \"\n    \"法国的首都是巴黎。 \"\n    \"法国的人口为6700万。\",\n]\nquestion = \"法国的首都是什么？法国的人口是多少？\"\nanswer = \"法国的首都是巴黎。法国的人口为6900万。\"\n\nclient = LettuceClient(\"http:\u002F\u002F127.0.0.1:8000\")\nresponse = client.detect_spans(contexts, question, answer)\nprint(response.predictions)\n\n# [SpanDetectionItem(start=31, end=71, text=' 法国的人口为6900万。', hallucination_score=0.989198625087738)]\n```\n\n更多示例请参阅 `demo\u002Fdetection_api.ipynb`。如需异步支持，请改用 `LettuceClientAsync` 类。\n\n## 许可证\n\nMIT 许可证 - 详情请参阅 LICENSE 文件。\n\n## 引用\n\n如果您在工作中使用了 LettuceDetect，请引用以下论文：\n\n```bibtex\n@misc{Kovacs:2025,\n      title={LettuceDetect: 一种用于 RAG 应用的幻觉检测框架}, \n      author={Ádám Kovács 和 Gábor Recski},\n      year={2025},\n      eprint={2502.17125},\n      archivePrefix={arXiv},\n      primaryClass={cs.CL},\n      url={https:\u002F\u002Farxiv.org\u002Fabs\u002F2502.17125}, \n}\n```","# LettuceDetect 快速上手指南\n\nLettuceDetect 是一款轻量级且高效的工具，专为检测检索增强生成（RAG）系统中的“幻觉”（即模型生成的与上下文不符的内容）而设计。它支持英语及多种语言（包括中文），能够精确识别答案中缺乏依据的片段。\n\n## 环境准备\n\n- **操作系统**：Linux, macOS, Windows\n- **Python 版本**：建议 Python 3.8 及以上\n- **依赖项**：\n  - `torch` (PyTorch)\n  - `transformers` (Hugging Face)\n  - `accelerate` (可选，用于加速推理)\n\n> **提示**：国内开发者建议使用清华或阿里镜像源加速依赖安装。\n\n## 安装步骤\n\n### 方式一：通过 PyPI 安装（推荐）\n\n```bash\npip install lettucedetect -U -i https:\u002F\u002Fpypi.tuna.tsinghua.edu.cn\u002Fsimple\n```\n\n如需使用 Web API 功能，请安装额外依赖：\n\n```bash\npip install \"lettucedetect[api]\" -i https:\u002F\u002Fpypi.tuna.tsinghua.edu.cn\u002Fsimple\n```\n\n### 方式二：从源码安装\n\n```bash\ngit clone https:\u002F\u002Fgithub.com\u002FKRLabsOrg\u002FLettuceDetect.git\ncd LettuceDetect\npip install -e . -i https:\u002F\u002Fpypi.tuna.tsinghua.edu.cn\u002Fsimple\n```\n\n## 基本使用\n\n以下示例展示如何使用预训练模型检测答案中的幻觉内容。\n\n### 1. 检测英文内容\n\n```python\nfrom lettucedetect.models.inference import HallucinationDetector\n\n# 初始化检测器（英文模型）\ndetector = HallucinationDetector(\n    method=\"transformer\", \n    model_path=\"KRLabsOrg\u002Flettucedect-base-modernbert-en-v1\",\n)\n\ncontexts = [\"France is a country in Europe. The capital of France is Paris. The population of France is 67 million.\"]\nquestion = \"What is the capital of France? What is the population of France?\"\nanswer = \"The capital of France is Paris. The population of France is 69 million.\"\n\n# 获取片段级别的预测结果\npredictions = detector.predict(context=contexts, question=question, answer=answer, output_format=\"spans\")\nprint(\"Predictions:\", predictions)\n```\n\n**输出示例：**\n```text\nPredictions: [{'start': 31, 'end': 71, 'confidence': 0.9944414496421814, 'text': ' The population of France is 69 million.'}]\n```\n\n### 2. 检测中文或其他多语言内容\n\nLettuceDetect 基于 EuroBERT 支持包括中文在内的 7 种语言。\n\n```python\nfrom lettucedetect.models.inference import HallucinationDetector\n\n# 初始化检测器（中文模型需指定 lang 参数）\ndetector = HallucinationDetector(\n    method=\"transformer\", \n    model_path=\"KRLabsOrg\u002Flettucedect-210m-eurobert-zh-v1\", # 假设存在中文模型路径，请根据 HF 实际地址调整\n    lang=\"zh\",\n    trust_remote_code=True\n)\n\ncontexts = [\"中国的首都是北京。中国的人口约为 14 亿。\"]\nquestion = \"中国的首都是哪里？人口是多少？\"\nanswer = \"中国的首都是北京。中国的人口约为 15 亿。\"\n\npredictions = detector.predict(context=contexts, question=question, answer=answer, output_format=\"spans\")\nprint(\"Predictions:\", predictions)\n```\n\n> **注意**：具体多语言模型路径请参考 [Hugging Face 模型集合](https:\u002F\u002Fhuggingface.co\u002Fcollections\u002FKRLabsOrg\u002Fmultilingual-hallucination-detection-682a2549c18ecd32689231ce)。\n\n### 3. 使用 LLM 作为基线检测（可选）\n\n若需使用大语言模型（如 GPT-4）进行对比检测，需先设置 API Key：\n\n```bash\nexport OPENAI_API_KEY=your_api_key\n```\n\n代码调用：\n\n```python\nfrom lettucedetect.models.inference import HallucinationDetector\n\n# 使用 LLM 方法检测\ndetector = HallucinationDetector(method=\"llm\", lang=\"zh\")\n\npredictions = detector.predict(context=contexts, question=question, answer=answer, output_format=\"spans\")\nprint(\"Predictions:\", predictions)\n```","某金融科技公司正在构建面向内部分析师的 RAG 问答系统，用于快速检索并总结海量合规文档与财报数据。\n\n### 没有 LettuceDetect 时\n- **幻觉难以察觉**：模型常将不同财报中的营收数据“张冠李戴”，生成看似合理但完全虚构的分析结论，误导投资决策。\n- **排查成本高昂**：开发人员不得不依赖人工抽检或调用昂贵的 GPT-4 进行二次验证，导致上线周期延长且运营成本激增。\n- **定位精度不足**：传统检测模型受限于上下文窗口，无法处理长文档，且只能判断整段回答是否有误，无法指出具体哪一句是编造的。\n- **多语言支持缺失**：面对包含中文、德文等多语种的国际财报，现有方案缺乏统一高效的检测手段，被迫维护多套系统。\n\n### 使用 LettuceDetect 后\n- **精准定位造假**：LettuceDetect 利用 Token 级精度，直接高亮标出回答中 unsupported 的具体片段（如错误的营收数字），让修正有的放矢。\n- **实时高效拦截**：凭借轻量级的 ModernBERT 和 EuroBERT 架构，系统在毫秒级内完成检测，无需等待大模型响应，大幅降低推理延迟与成本。\n- **长文档全覆盖**：支持高达 8K 的上下文窗口，能完整消化长篇财报全文，确保在复杂语境下依然准确识别断章取义产生的幻觉。\n- **多语言一键部署**：原生支持中、德、法等 7 种语言，同一套代码即可覆盖全球业务线，无需为不同语种单独训练或适配模型。\n\nLettuceDetect 通过轻量级、高精度的实时检测，将 RAG 系统的可信度从“概率猜测”提升为“事实确证”，成为企业级应用落地的安全守门人。","https:\u002F\u002Foss.gittoolsai.com\u002Fimages\u002FKRLabsOrg_LettuceDetect_f1f57839.png","KRLabsOrg","KR Labs","https:\u002F\u002Foss.gittoolsai.com\u002Favatars\u002FKRLabsOrg_5a1a0771.png","",null,"info@krlabs.eu","krlabs.eu","https:\u002F\u002Fgithub.com\u002FKRLabsOrg",[81],{"name":82,"color":83,"percentage":84},"Python","#3572A5",100,538,38,"2026-04-03T04:03:54","MIT",1,"未说明","训练需单张 A100 GPU；推理未强制要求，但建议使用 GPU 以加速 ModernBERT\u002FEuroBERT 模型运行",{"notes":93,"python":90,"dependencies":94},"该工具主要用于检测 RAG 系统中的幻觉。支持英语（ModernBERT）和 7 种多语言（EuroBERT）。提供 Transformer 和 LLM 两种检测模式。若使用 LLM 模式需配置 OpenAI API Key。模型支持长达 4K-8K 的上下文窗口。可通过 pip 直接安装，也提供 Web API 和 Streamlit 演示。",[95,96,97,98,99,100],"torch","transformers","accelerate","streamlit","fastapi","openai",[35,14,102],"其他",[104,105,106,107,108,109,110,111],"bert","hallucination-detection","hallucination-evaluation","information-extraction","nlp","python","pytorch","token-classification","2026-03-27T02:49:30.150509","2026-04-11T18:31:19.555627",[],[116,121,126,131,135,139,144,149,154],{"id":117,"version":118,"summary_zh":119,"released_at":120},87884,"0.1.8","## 变更内容\n* TinyLettuce、RagFactChecker、Elysia，由 @adaamko 在 https:\u002F\u002Fgithub.com\u002FKRLabsOrg\u002FLettuceDetect\u002Fpull\u002F26 中贡献\n* HallucinationGenerator，由 RagFactChecker 提供\n* 修复链接，由 @adaamko 在 https:\u002F\u002Fgithub.com\u002FKRLabsOrg\u002FLettuceDetect\u002Fpull\u002F27 中完成\n\n\n**完整变更日志**: https:\u002F\u002Fgithub.com\u002FKRLabsOrg\u002FLettuceDetect\u002Fcompare\u002F0.1.7...0.1.8","2025-08-31T16:10:10",{"id":122,"version":123,"summary_zh":124,"released_at":125},87885,"0.1.7","## 变更内容\n* 由 @nadiaverdha 在 https:\u002F\u002Fgithub.com\u002FKRLabsOrg\u002FLettuceDetect\u002Fpull\u002F7 中预处理 RagBenchData 并翻译文件\n* 由 @adaamko 在 https:\u002F\u002Fgithub.com\u002FKRLabsOrg\u002FLettuceDetect\u002Fpull\u002F9 中实现 RagBench 翻译功能\n* 由 @ceeli 在 https:\u002F\u002Fgithub.com\u002FKRLabsOrg\u002FLettuceDetect\u002Fpull\u002F12 中添加 Web API 和 Python 客户端库\n* 由 @lebe1 在 https:\u002F\u002Fgithub.com\u002FKRLabsOrg\u002FLettuceDetect\u002Fpull\u002F18 中修复张量复制问题\n* 由 @nadiaverdha 在 https:\u002F\u002Fgithub.com\u002FKRLabsOrg\u002FLettuceDetect\u002Fpull\u002F14 中引入 ChatGPT 和 RAGAS 基线\n* 由 @adaamko 在 https:\u002F\u002Fgithub.com\u002FKRLabsOrg\u002FLettuceDetect\u002Fpull\u002F19 中为训练添加随机种子，并修复编码器的 SEP 标记\n* 由 @adaamko 在 https:\u002F\u002Fgithub.com\u002FKRLabsOrg\u002FLettuceDetect\u002Fpull\u002F21 中实现 LLM 基线优化功能\n* 由 @adaamko 在 https:\u002F\u002Fgithub.com\u002FKRLabsOrg\u002FLettuceDetect\u002Fpull\u002F22 中添加中文 LLM 评估功能\n\n## 新贡献者\n* @nadiaverdha 在 https:\u002F\u002Fgithub.com\u002FKRLabsOrg\u002FLettuceDetect\u002Fpull\u002F7 中完成了首次贡献\n* @ceeli 在 https:\u002F\u002Fgithub.com\u002FKRLabsOrg\u002FLettuceDetect\u002Fpull\u002F12 中完成了首次贡献\n* @lebe1 在 https:\u002F\u002Fgithub.com\u002FKRLabsOrg\u002FLettuceDetect\u002Fpull\u002F18 中完成了首次贡献\n\n**完整变更日志**: https:\u002F\u002Fgithub.com\u002FKRLabsOrg\u002FLettuceDetect\u002Fcompare\u002F0.1.6...0.1.7","2025-05-18T20:45:40",{"id":127,"version":128,"summary_zh":129,"released_at":130},87886,"0.1.6","## 变更内容\n* 现仅使用 `pyproject`，新增对 `ruff` 的支持，并由 @adaamko 在 https:\u002F\u002Fgithub.com\u002FKRLabsOrg\u002FLettuceDetect\u002Fpull\u002F1 中添加了 GitHub 工作流。\n* 由 @adaamko 在 https:\u002F\u002Fgithub.com\u002FKRLabsOrg\u002FLettuceDetect\u002Fpull\u002F2 中引入功能和工作流。\n\n## 新贡献者\n* @adaamko 在 https:\u002F\u002Fgithub.com\u002FKRLabsOrg\u002FLettuceDetect\u002Fpull\u002F1 中完成了首次贡献。\n\n**完整变更日志**: https:\u002F\u002Fgithub.com\u002FKRLabsOrg\u002FLettuceDetect\u002Fcompare\u002F0.1.5...0.1.6","2025-02-27T16:16:53",{"id":132,"version":133,"summary_zh":76,"released_at":134},87887,"0.1.5","2025-02-22T14:24:41",{"id":136,"version":137,"summary_zh":76,"released_at":138},87888,"0.1.4","2025-02-12T09:12:29",{"id":140,"version":141,"summary_zh":142,"released_at":143},87889,"0.1.3","**完整更新日志**: https:\u002F\u002Fgithub.com\u002FKRLabsOrg\u002FLettuceDetect\u002Fcompare\u002F0.1.2...0.1.3","2025-02-12T09:04:40",{"id":145,"version":146,"summary_zh":147,"released_at":148},87890,"0.1.2","**完整更新日志**: https:\u002F\u002Fgithub.com\u002FKRLabsOrg\u002FLettuceDetect\u002Fcompare\u002F0.1.1...0.1.2","2025-02-11T21:15:55",{"id":150,"version":151,"summary_zh":152,"released_at":153},87891,"0.1.1","**完整更新日志**: https:\u002F\u002Fgithub.com\u002FKRLabsOrg\u002FLettuceDetect\u002Fcompare\u002F0.1.0...0.1.1","2025-02-10T14:28:50",{"id":155,"version":156,"summary_zh":157,"released_at":158},87892,"0.1.0","模型的第一个版本，结果如下：\n\n-- 令牌级别评估 ----\n\n```\n详细分类报告：\n              精确率    召回率  F1分数   支持数\n\n   支持的     0.9799    0.9859    0.9829    422046\n幻觉的     0.6096    0.5222    0.5625     17844\n\n    精确度                         0.9671    439890\n   宏平均     0.7947    0.7540    0.7727    439890\n加权平均     0.9649    0.9671    0.9658    439890\n```\n\n评估结果：\n```\n\n幻觉检测（类别1）：\n  精确率：0.6096\n  召回率：0.5222\n  F1分数：0.5625\n\n支持的内容（类别0）：\n  精确率：0.9799\n  召回率：0.9859\n  F1分数：0.9829\n```\n---- 示例级别评估 ----\n```\n\n详细示例级别分类报告：\n              精确率    召回率  F1分数   支持数\n\n   支持的     0.8696    0.8765    0.8730      1757\n幻觉的     0.7664    0.7550    0.7607       943\n\n    精确度                         0.8341      2700\n   宏平均     0.8180    0.8158    0.8168      2700\n加权平均     0.8335    0.8341    0.8338      2700\n\n\n```\n示例级别评估结果：\n\n```\n幻觉检测（示例级别）—— 类别1：\n  精确率：0.7664\n  召回率：0.7550\n  F1分数：0.7607\n\n支持的内容（示例级别）—— 类别0：\n  精确率：0.8696\n  召回率：0.8765\n  F1分数：0.8730\n```\n\n**完整变更日志**：https:\u002F\u002Fgithub.com\u002FKRLabsOrg\u002FLettuceDetect\u002Fcommits\u002F0.1.0","2025-02-09T17:33:25"]