[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"similar-Eladlev--AutoPrompt":3,"tool-Eladlev--AutoPrompt":65},[4,23,32,40,48,57],{"id":5,"name":6,"github_repo":7,"description_zh":8,"stars":9,"difficulty_score":10,"last_commit_at":11,"category_tags":12,"status":22},2268,"ML-For-Beginners","microsoft\u002FML-For-Beginners","ML-For-Beginners 是由微软推出的一套系统化机器学习入门课程，旨在帮助零基础用户轻松掌握经典机器学习知识。这套课程将学习路径规划为 12 周，包含 26 节精炼课程和 52 道配套测验，内容涵盖从基础概念到实际应用的完整流程，有效解决了初学者面对庞大知识体系时无从下手、缺乏结构化指导的痛点。\n\n无论是希望转型的开发者、需要补充算法背景的研究人员，还是对人工智能充满好奇的普通爱好者，都能从中受益。课程不仅提供了清晰的理论讲解，还强调动手实践，让用户在循序渐进中建立扎实的技能基础。其独特的亮点在于强大的多语言支持，通过自动化机制提供了包括简体中文在内的 50 多种语言版本，极大地降低了全球不同背景用户的学习门槛。此外，项目采用开源协作模式，社区活跃且内容持续更新，确保学习者能获取前沿且准确的技术资讯。如果你正寻找一条清晰、友好且专业的机器学习入门之路，ML-For-Beginners 将是理想的起点。",84991,2,"2026-04-05T10:45:23",[13,14,15,16,17,18,19,20,21],"图像","数据工具","视频","插件","Agent","其他","语言模型","开发框架","音频","ready",{"id":24,"name":25,"github_repo":26,"description_zh":27,"stars":28,"difficulty_score":29,"last_commit_at":30,"category_tags":31,"status":22},2234,"scikit-learn","scikit-learn\u002Fscikit-learn","scikit-learn 是一个基于 Python 构建的开源机器学习库，依托于 SciPy、NumPy 等科学计算生态，旨在让机器学习变得简单高效。它提供了一套统一且简洁的接口，涵盖了从数据预处理、特征工程到模型训练、评估及选择的全流程工具，内置了包括线性回归、支持向量机、随机森林、聚类等在内的丰富经典算法。\n\n对于希望快速验证想法或构建原型的数据科学家、研究人员以及 Python 开发者而言，scikit-learn 是不可或缺的基础设施。它有效解决了机器学习入门门槛高、算法实现复杂以及不同模型间调用方式不统一的痛点，让用户无需重复造轮子，只需几行代码即可调用成熟的算法解决分类、回归、聚类等实际问题。\n\n其核心技术亮点在于高度一致的 API 设计风格，所有估算器（Estimator）均遵循相同的调用逻辑，极大地降低了学习成本并提升了代码的可读性与可维护性。此外，它还提供了强大的模型选择与评估工具，如交叉验证和网格搜索，帮助用户系统地优化模型性能。作为一个由全球志愿者共同维护的成熟项目，scikit-learn 以其稳定性、详尽的文档和活跃的社区支持，成为连接理论学习与工业级应用的最",65628,1,"2026-04-05T10:10:46",[20,18,14],{"id":33,"name":34,"github_repo":35,"description_zh":36,"stars":37,"difficulty_score":10,"last_commit_at":38,"category_tags":39,"status":22},3364,"keras","keras-team\u002Fkeras","Keras 是一个专为人类设计的深度学习框架，旨在让构建和训练神经网络变得简单直观。它解决了开发者在不同深度学习后端之间切换困难、模型开发效率低以及难以兼顾调试便捷性与运行性能的痛点。\n\n无论是刚入门的学生、专注算法的研究人员，还是需要快速落地产品的工程师，都能通过 Keras 轻松上手。它支持计算机视觉、自然语言处理、音频分析及时间序列预测等多种任务。\n\nKeras 3 的核心亮点在于其独特的“多后端”架构。用户只需编写一套代码，即可灵活选择 TensorFlow、JAX、PyTorch 或 OpenVINO 作为底层运行引擎。这一特性不仅保留了 Keras 一贯的高层易用性，还允许开发者根据需求自由选择：利用 JAX 或 PyTorch 的即时执行模式进行高效调试，或切换至速度最快的后端以获得最高 350% 的性能提升。此外，Keras 具备强大的扩展能力，能无缝从本地笔记本电脑扩展至大规模 GPU 或 TPU 集群，是连接原型开发与生产部署的理想桥梁。",63927,"2026-04-04T15:24:37",[20,14,18],{"id":41,"name":42,"github_repo":43,"description_zh":44,"stars":45,"difficulty_score":10,"last_commit_at":46,"category_tags":47,"status":22},2403,"crawl4ai","unclecode\u002Fcrawl4ai","Crawl4AI 是一款专为大语言模型（LLM）设计的开源网络爬虫与数据提取工具。它的核心使命是将纷繁复杂的网页内容转化为干净、结构化的 Markdown 格式，直接服务于检索增强生成（RAG）、智能体构建及各类数据管道，让 AI 能更轻松地“读懂”互联网。\n\n传统爬虫往往面临反爬机制拦截、动态内容加载困难以及输出格式杂乱等痛点，导致后续数据处理成本高昂。Crawl4AI 通过内置自动化的三级反机器人检测、代理升级策略以及对 Shadow DOM 的深度支持，有效突破了这些障碍。它能智能移除同意弹窗，处理深层链接，并具备长任务崩溃恢复能力，确保数据采集的稳定与高效。\n\n这款工具特别适合开发者、AI 研究人员及数据工程师使用。无论是需要为本地模型构建知识库，还是搭建大规模自动化信息采集流程，Crawl4AI 都提供了极高的可控性与灵活性。作为 GitHub 上备受瞩目的开源项目，它完全免费开放，无需繁琐的注册或昂贵的 API 费用，让用户能够专注于数据价值本身而非采集难题。",63242,"2026-04-02T22:29:19",[14,17],{"id":49,"name":50,"github_repo":51,"description_zh":52,"stars":53,"difficulty_score":54,"last_commit_at":55,"category_tags":56,"status":22},4243,"MinerU","opendatalab\u002FMinerU","MinerU 是一款专为大语言模型（LLM）打造的文档解析工具，旨在将复杂的 PDF 文件高效转化为机器易读的 Markdown 或 JSON 格式。在日常工作中，许多用户面临从扫描版论文、技术手册或包含复杂排版的文档中提取高质量文本的难题，传统方法往往难以保留原有的公式、表格和结构信息，导致后续 AI 处理效果不佳。MinerU 正是为了解决这一痛点而生，它能精准识别并还原文档中的多栏布局、数学公式及图表内容，确保输出数据干净、结构化，直接适配各类智能体（Agentic）工作流。\n\n这款工具特别适合开发者、数据科学家以及需要构建知识库的研究人员使用。无论是希望微调专属模型的算法工程师，还是试图搭建企业级 RAG（检索增强生成）系统的技术团队，MinerU 都能提供强有力的支持。其核心技术亮点在于对复杂版面分析的深度优化，不仅支持批量处理，还能在保持高准确率的同时，大幅降低数据清洗的人力成本。通过 MinerU，用户可以轻松打通从原始文档到 AI 应用的数据链路，让非结构化文档真正变成可被智能体理解的高价值资产。",58197,3,"2026-04-06T01:37:49",[13,14,18,20,19],{"id":58,"name":59,"github_repo":60,"description_zh":61,"stars":62,"difficulty_score":10,"last_commit_at":63,"category_tags":64,"status":22},193,"meilisearch","meilisearch\u002Fmeilisearch","Meilisearch 是一个开源的极速搜索服务，专为现代应用和网站打造，开箱即用。它能帮助开发者快速集成高质量的搜索功能，无需复杂的配置或额外的数据预处理。传统搜索方案往往需要大量调优才能实现准确结果，而 Meilisearch 内置了拼写容错、同义词识别、即时响应等实用特性，并支持 AI 驱动的混合搜索（结合关键词与语义理解），显著提升用户查找信息的体验。\n\nMeilisearch 特别适合 Web 开发者、产品团队或初创公司使用，尤其适用于需要快速上线搜索功能的场景，如电商网站、内容平台或 SaaS 应用。它提供简洁的 RESTful API 和多种语言 SDK，部署简单，资源占用低，本地开发或生产环境均可轻松运行。对于希望在不依赖大型云服务的前提下，为用户提供流畅、智能搜索体验的团队来说，Meilisearch 是一个高效且友好的选择。",56972,"2026-04-05T22:34:33",[13,17,14,20,16,18],{"id":66,"github_repo":67,"name":68,"description_en":69,"description_zh":70,"ai_summary_zh":70,"readme_en":71,"readme_zh":72,"quickstart_zh":73,"use_case_zh":74,"hero_image_url":75,"owner_login":76,"owner_name":77,"owner_avatar_url":78,"owner_bio":77,"owner_company":77,"owner_location":77,"owner_email":77,"owner_twitter":77,"owner_website":77,"owner_url":79,"languages":80,"stars":85,"forks":86,"last_commit_at":87,"license":88,"difficulty_score":10,"env_os":89,"env_gpu":89,"env_ram":89,"env_deps":90,"category_tags":99,"github_topics":100,"view_count":10,"oss_zip_url":77,"oss_zip_packed_at":77,"status":22,"created_at":104,"updated_at":105,"faqs":106,"releases":138},4224,"Eladlev\u002FAutoPrompt","AutoPrompt","A framework for prompt tuning using Intent-based Prompt Calibration ","AutoPrompt 是一款专为优化大语言模型提示词（Prompt）而设计的开源框架，旨在帮助用户轻松生成高质量、鲁棒性强的提示词。在实际应用中，提示词的微小变动往往会导致模型表现大幅波动，且构建可靠的测试基准耗时费力。AutoPrompt 通过“基于意图的提示校准”技术，自动迭代生成具有挑战性的边缘案例数据集，并据此不断修正提示词，有效解决了提示词敏感性和歧义性难题，显著降低了人工调试成本。\n\n该工具特别适合开发者、AI 研究人员以及需要部署生产级应用的企业团队使用。无论是文本分类、内容生成还是对话审核任务，AutoPrompt 都能凭借模块化设计无缝集成到 LangChain 等主流工作流中。其核心亮点在于结合了合成数据生成与提示词优化，仅需少量数据和标注步骤即可实现性能提升。在成本控制方面，AutoPrompt 允许用户设定预算上限，通常使用 GPT-4 Turbo 仅需几分钟和不到 1 美元即可完成一次高效优化，让提示词工程变得更加经济、透明且易于落地。","\u003Cp align=\"center\">\n    \u003C!-- community badges -->\n    \u003Ca href=\"https:\u002F\u002Fdiscord.gg\u002FG2rSbAf8uP\">\u003Cimg src=\"https:\u002F\u002Fimg.shields.io\u002Fbadge\u002FJoin-Discord-blue.svg\"\u002F>\u003C\u002Fa>\n    \u003C!-- license badge -->\n    \u003Ca href=\"https:\u002F\u002Fgithub.com\u002FEladlev\u002FAutoPrompt\u002Fblob\u002Fmain\u002FLICENSE\">\n        \u003Cimg alt=\"License\" src=\"https:\u002F\u002Fimg.shields.io\u002Fbadge\u002FLicense-Apache_2.0-blue.svg\">\u003C\u002Fa>\n\u003C\u002Fp>\n\n# 📝 AutoPrompt\n\n\n\u003C!-- MARKDOWN LINKS & IMAGES -->\n\u003C!-- https:\u002F\u002Fwww.markdownguide.org\u002Fbasic-syntax\u002F#reference-style-links -->\n\n**Auto Prompt is a prompt optimization framework designed to enhance and perfect your prompts for real-world use cases.**\n\nThe framework automatically generates high-quality, detailed prompts tailored to user intentions. It employs a refinement (calibration) process, where it iteratively builds a dataset of challenging edge cases and optimizes the prompt accordingly. This approach not only reduces manual effort in prompt engineering but also effectively addresses common issues such as prompt [sensitivity](https:\u002F\u002Farxiv.org\u002Fabs\u002F2307.09009) and inherent prompt [ambiguity](https:\u002F\u002Farxiv.org\u002Fabs\u002F2311.04205) issues.\n\n\n**Our mission:** Empower users to produce high-quality robust prompts using the power of large language models (LLMs).\n\n# Why Auto Prompt?\n- **Prompt Engineering Challenges.** The quality of LLMs greatly depends on the prompts used. Even [minor changes](#prompt-sensitivity-example) can significantly affect their performance. \n- **Benchmarking Challenges.**  Creating a benchmark for production-grade prompts is often labour-intensive and time-consuming.\n- **Reliable Prompts.** Auto Prompt generates robust high-quality prompts, offering measured accuracy and performance enhancement using minimal data and annotation steps.\n- **Modularity and Adaptability.** With modularity at its core, Auto Prompt integrates seamlessly with popular open-source tools such as LangChain, Wandb, and Argilla, and can be adapted for a variety of tasks, including data synthesis and prompt migration.\n\n## System Overview\n\n![System Overview](https:\u002F\u002Foss.gittoolsai.com\u002Fimages\u002FEladlev_AutoPrompt_readme_fd010fd3c78b.png)\n\nThe system is designed for real-world scenarios, such as moderation tasks, which are often  challenged by imbalanced data distributions. The system implements the [Intent-based Prompt Calibration](https:\u002F\u002Farxiv.org\u002Fabs\u002F2402.03099) method. The process begins with a user-provided initial prompt and task description, optionally including user examples. The refinement process iteratively generates diverse samples, annotates them via user\u002FLLM, and evaluates prompt performance, after which an LLM suggests an improved prompt.  \n\nThe optimization process can be extended to content generation tasks by first devising a ranker prompt and then performing the prompt optimization with this learned ranker. The optimization concludes upon reaching the budget or iteration limit.  \n\n\nThis joint synthetic data generation and prompt optimization approach outperform traditional methods while requiring minimal data and iterations. Learn more in our paper\n[Intent-based Prompt Calibration: Enhancing prompt optimization with synthetic boundary cases](https:\u002F\u002Farxiv.org\u002Fabs\u002F2402.03099) by E. Levi et al. (2024).\n\n\n**Using GPT-4 Turbo, this optimization typically completes in just a few minutes at a cost of under $1.** To manage costs associated with GPT-4 LLM's token usage, the framework enables users to set a budget limit for optimization, in USD or token count, configured as illustrated [here](docs\u002Fexamples.md#steps-to-run-example).\n\n## Demo\n\n![pipeline_recording](https:\u002F\u002Foss.gittoolsai.com\u002Fimages\u002FEladlev_AutoPrompt_readme_0ab3da2fa2f0.gif)\n\n\n## 📖 Documentation\n - [How to install](docs\u002Finstallation.md) (Setup instructions)\n - [Prompt optimization examples](docs\u002Fexamples.md) (Use cases: movie review classification, generation, and chat moderation)\n - [How it works](docs\u002Fhow-it-works.md) (Explanation of pipelines)\n - [Architecture guide](docs\u002Farchitecture.md) (Overview of main components)\n\n## Features\n- 📝 Boosts prompt quality with a minimal amount of data and annotation steps.\n- 🛬 Designed for production use cases like moderation, multi-label classification, and content generation.\n- ⚙️ Enables seamless migrating of prompts across model versions or LLM providers.\n- 🎓 Supports prompt squeezing. Combine multiple rules into a single efficient prompt.\n\n\n## QuickStart\nAutoPrompt requires `python \u003C= 3.10`\n\u003Cbr \u002F>\n\n> **Step 1** - Download the project\n\n```bash\ngit clone git@github.com:Eladlev\u002FAutoPrompt.git\ncd AutoPrompt\n```\n\n\u003Cbr \u002F>\n\n> **Step 2** - Install dependencies\n\nUse either Conda or pip, depending on your preference. Using Conda:\n```bash\nconda env create -f environment_dev.yml\nconda activate AutoPrompt\n```\n\nUsing pip: \n```bash\npip install -r requirements.txt\n```\n\nUsing pipenv:\n```bash\npip install pipenv\npipenv sync\n```\n\n\u003Cbr \u002F>\n\n> **Step 3** - Configure your LLM. \n\nSet your OpenAI API key  by updating the configuration file `config\u002Fllm_env.yml`\n- If you need help locating your API key, visit this [link](https:\u002F\u002Fhelp.openai.com\u002Fen\u002Farticles\u002F4936850-where-do-i-find-my-api-key).\n\n- We recommend using [OpenAI's GPT-4](https:\u002F\u002Fplatform.openai.com\u002Fdocs\u002Fguides\u002Fgpt) for the LLM. Our framework also supports other providers and open-source models, as discussed [here](docs\u002Finstallation.md#configure-your-llm).\n\n\u003Cbr \u002F>\n\n> **Step 4** - Configure your Annotator\n- Select an annotation approach for your project:\n    -  We recommend beginning with a human-in-the-loop method, utilizing [Argilla](https:\u002F\u002Fdocs.v1.argilla.io\u002Fen\u002Fv1.11.0). Observe that AutoPrompt is compatible with **Argilla V1**, not with the latest V2. Follow the [Argilla setup instructions](https:\u002F\u002Fdocs.v1.argilla.io\u002Fen\u002Fv1.11.0\u002Fgetting_started\u002Fquickstart_installation.html), with the following modifications:\n        -  If you are using local docker use `v1.29.0` instead of the `latest` tag.\n        -  For a quick setup using HF, duplicate the following [space](https:\u002F\u002Fhuggingface.co\u002Fspaces\u002FEladlev\u002Ftest4)\n    -  Alternatively, you can set up an LLM as your annotator by following these [configuration steps](docs\u002Finstallation.md#configure-llm-annotator).\n\n- The default predictor LLM, GPT-3.5, for estimating prompt performance, is configured in the `predictor` section of `config\u002Fconfig_default.yml`.\n\n- Define your budget in the input config yaml file using the `max_usage parameter`. For OpenAI models, `max_usage` sets the maximum spend in USD. For other LLMs, it limits the maximum token count.\n\n\u003Cbr \u002F>\n\n\n> **Step 5** - Run the pipeline\n\nFirst, configure your labels by editing `config\u002Fconfig_default.yml`\n```\ndataset:\n    label_schema: [\"Yes\", \"No\"]\n```\n\n\nFor a **classification pipeline**, use the following command from your terminal within the appropriate working directory: \n```bash\npython run_pipeline.py\n```\nIf the initial prompt and task description are not provided directly as input, you will be guided to provide these details.  Alternatively, specify them as command-line arguments:\n```bash\npython run_pipeline.py \\\n    --prompt \"Does this movie review contain a spoiler? answer Yes or No\" \\\n    --task_description \"Assistant is an expert classifier that will classify a movie review, and let the user know if it contains a spoiler for the reviewed movie or not.\" \\\n    --num_steps 30\n```\nYou can track the optimization progress using the [W&B](https:\u002F\u002Fwandb.ai\u002Fsite) dashboard, with setup instructions available  [here](docs\u002Finstallation.md#monitoring-weights-and-biases-setup). \n\n\nIf you are using pipenv, be sure to activate the environment:\n``` bash\npipenv shell\npython run_pipeline.py  \n```\nor alternatively prefix your command with `pipenv run`:\n```bash\npipenv run python run_pipeline.py \n```\n\n#### Generation pipeline\nTo run the generation pipeline, use the following example command:\n```bash\npython run_generation_pipeline.py \\\n    --prompt \"Write a good and comprehensive movie review about a specific movie.\" \\\n    --task_description \"Assistant is a large language model that is tasked with writing movie reviews.\"\n```\nFor more information, refer to our [generation task example](docs\u002Fexamples.md#generating-movie-reviews-generation-task).\n\n\u003Cbr \u002F>\n\n#### Benchmark optimization (optimize-only mode)\nIf you already have an annotated dataset and want to skip sample generation and annotation, use the benchmark optimization script. This mode runs a pure optimization loop: **predict → evaluate → refine**.\n\nYour dataset should be a CSV file with `text` and `annotation` columns:\n```csv\ntext,annotation\n\"The movie was absolutely fantastic!\",Yes\n\"Waste of time and money.\",No\n```\n\nRun the optimization:\n```bash\npython run_benchmark_optimization.py \\\n    --dataset path\u002Fto\u002Fyour_data.csv \\\n    --prompt \"Is this movie review positive? Answer Yes or No.\" \\\n    --task_description \"Classify movie reviews as positive or negative.\" \\\n    --labels Yes No \\\n    --num_steps 10 \\\n    --output results.json\n```\n\nArguments:\n- `--dataset` (required): Path to CSV with `text` and `annotation` columns\n- `--prompt`: Initial prompt to optimize (interactive if omitted)\n- `--task_description`: Task description (interactive if omitted)\n- `--labels`: Label schema (default: Yes No)\n- `--num_steps`: Number of optimization iterations (default: 10)\n- `--output`: Output JSON file for results (default: benchmark_results.json)\n- `--config`: Configuration file (default: config\u002Fconfig_benchmark.yml)\n\nThis is useful when:\n- You already have labeled benchmark data\n- You want faster iteration without sample generation\n- You're fine-tuning a prompt for a specific dataset\n\n\u003Cbr \u002F>\n\nEnjoy the results. Completion of these steps yields a **refined (calibrated)\nprompt** tailored for your task, alongside a **benchmark** featuring challenging samples,\nstored in the default `dump` path.\n\n\n\n## Tips\n\n- Prompt accuracy may fluctuate during the optimization. To identify the best prompts, we recommend continuous refinement following the initial generation of the benchmark.  Set the number of optimization iterations with `--num_steps` and control sample generation by specifying `max_samples` in the `dataset` section. For instance, setting `max_samples: 50` and `--num_steps 30` limits the benchmark to 50 samples, allowing for 25 additional refinement iterations, assuming 10 samples per iteration.\n\n- The framework supports checkpoints for easy resumption of optimization from the last saved state. It automatically saves the most recent optimization state in a `dump` path. Use `--output_dump` to set this path and `--load_path` to resume from a checkpoint.\n- The iterations include multiple calls to the LLM service, with long prompts and requests for a relatively large amount of generated tokens by the LLM. This might take time ~1 minute (especially in the generative tasks), so please be patient.\n- If there are some issues with the Argilla server connection\u002Ferror, try to restart the space.\n\u003C!-- \nMeanwhile, the num_initialize_samples and num_generated_samples fields within the meta_prompts section specify the counts for initial and per iteration sample generation, respectively. -->\n\n\n## Prompt Sensitivity Example\nYou write a prompt for identifying movie spoilers:\n```\nReview the content provided and indicate whether it includes any significant plot revelations or critical points that could reveal important elements of the story or its outcome. Respond with \"Yes\" if it contains such spoilers or critical insights, and \"No\" if it refrains from unveiling key story elements.\n```\nThis prompt scores 81 on your [benchmark](docs\u002Fexamples.md#filtering-movie-reviews-with-spoilers-classification-task)  using GPT-4 LLM. Then, you make a minor modification:\n```\nReview the text and determine if it provides essential revelations or critical details about the story that would constitute a spoiler. Respond with \"Yes\" for the presence of spoilers, and \"No\" for their absence.\n```\nSurprisingly, the second prompt scores 72, representing an 11% drop in accuracy. This illustrates the need for a careful prompt engineering process.\n\n## 🚀 Contributing\n\nYour contributions are greatly appreciated! If you're eager to contribute, kindly refer to our [Contributing Guidelines](docs\u002Fcontributing.md)) for detailed information.\n\n\u003C!-- For an insight into our future plans, visit our Project Roadmap. -->\nIf you wish to be a part of our journey, we invite you to connect with us through our [Discord Community](https:\u002F\u002Fdiscord.gg\u002FG2rSbAf8uP). We're excited to have you onboard! \n\n## 🛡 Disclaimer\n\nThe AutoPrompt project is provided on an \"as-is\" basis without any guarantees or warranties, expressed or implied. \n\nOur perspective on the optimization and usage of prompts:\n\n1. The core objective of AutoPrompt is to refine and perfect prompts to achieve high-quality results. This is achieved through an iterative calibration process, which helps in reducing errors and enhancing the performance of LLMs. However, the framework does not guarantee absolute correctness or unbiased results in every instance.\n\n2. AutoPrompt aims to improve the reliability of prompts and mitigate sensitivity issues, but it does not claim to completely eliminate such issues. \n\u003C!-- Our community is committed to exploring the most effective ways to interact with LLMs, fostering a space for diverse views and approaches. -->\n\nPlease note that using LLMs like OpenAI's GPT-4, supported by AutoPrompt, may lead to significant costs due to token usage. By using AutoPrompt, you acknowledge your responsibility to monitor and manage your token use and expenses. We advise regularly reviewing your LLM provider's API usage and establishing limits or alerts to prevent unexpected charges.\nTo manage costs associated with GPT-4 LLM's token usage, the framework enables users to set a budget limit for optimization, in USD or token count, configured as illustrated [here](docs\u002Fexamples.md#steps-to-run-example).\n\n## Citation\n\nIf you have used our code in your research, please cite our [paper](https:\u002F\u002Farxiv.org\u002Fabs\u002F2402.03099):\n\n```\n@misc{2402.03099,\nAuthor = {Elad Levi and Eli Brosh and Matan Friedmann},\nTitle = {Intent-based Prompt Calibration: Enhancing prompt optimization with synthetic boundary cases},\nYear = {2024},\nEprint = {arXiv:2402.03099},\n}\n```\n\n\n## License\n\nThis framework is licensed under the [Apache License, Version 2.0](http:\u002F\u002Fwww.apache.org\u002Flicenses\u002FLICENSE-2.0).\n\n## ✉️ Support \u002F Contact us\n- [Community Discord](https:\u002F\u002Fdiscord.gg\u002FG2rSbAf8uP)\n- Our email: [‫autopromptai@gmail.com‬](mailto:autopromptai@gmail.com)\n\n\n","\u003Cp align=\"center\">\n    \u003C!-- 社区徽章 -->\n    \u003Ca href=\"https:\u002F\u002Fdiscord.gg\u002FG2rSbAf8uP\">\u003Cimg src=\"https:\u002F\u002Fimg.shields.io\u002Fbadge\u002FJoin-Discord-blue.svg\"\u002F>\u003C\u002Fa>\n    \u003C!-- 许可证徽章 -->\n    \u003Ca href=\"https:\u002F\u002Fgithub.com\u002FEladlev\u002FAutoPrompt\u002Fblob\u002Fmain\u002FLICENSE\">\n        \u003Cimg alt=\"License\" src=\"https:\u002F\u002Fimg.shields.io\u002Fbadge\u002FLicense-Apache_2.0-blue.svg\">\u003C\u002Fa>\n\u003C\u002Fp>\n\n# 📝 AutoPrompt\n\n\n\u003C!-- MARKDOWN LINKS & IMAGES -->\n\u003C!-- https:\u002F\u002Fwww.markdownguide.org\u002Fbasic-syntax\u002F#reference-style-links -->\n\n**Auto Prompt 是一个提示优化框架，旨在为实际应用场景增强和优化您的提示。**\n\n该框架会自动根据用户意图生成高质量、详细的提示。它采用一种精炼（校准）过程，通过迭代构建包含挑战性边缘案例的数据集，并相应地优化提示。这种方法不仅减少了提示工程中的手动工作量，还有效解决了常见的提示[敏感性](https:\u002F\u002Farxiv.org\u002Fabs\u002F2307.09009)以及提示本身的[歧义性](https:\u002F\u002Farxiv.org\u002Fabs\u002F2311.04205)问题。\n\n\n**我们的使命：** 利用大型语言模型（LLM）的力量，帮助用户生成高质量且稳健的提示。\n\n# 为什么选择 Auto Prompt？\n- **提示工程的挑战。** LLM 的性能高度依赖于所使用的提示。即使是[细微的变化](#prompt-sensitivity-example)，也可能显著影响其表现。\n- **基准测试的挑战。** 为生产级提示创建基准通常既费力又耗时。\n- **可靠的提示。** Auto Prompt 能够生成稳健且高质量的提示，在使用最少数据和标注步骤的情况下，提供可衡量的准确性和性能提升。\n- **模块化与适应性。** Auto Prompt 以模块化为核心设计，可无缝集成到 LangChain、Wandb 和 Argilla 等流行的开源工具中，并适用于多种任务，包括数据合成和提示迁移。\n\n## 系统概述\n\n![系统概述](https:\u002F\u002Foss.gittoolsai.com\u002Fimages\u002FEladlev_AutoPrompt_readme_fd010fd3c78b.png)\n\n该系统专为现实场景设计，例如经常面临数据分布不均衡问题的审核任务。系统实现了基于意图的提示校准方法（[Intent-based Prompt Calibration](https:\u002F\u002Farxiv.org\u002Fabs\u002F2402.03099)）。流程从用户提供的初始提示和任务描述开始，还可选择性地加入用户示例。精炼过程会迭代生成多样化的样本，通过用户或 LLM 进行标注，并评估提示性能，随后由 LLM 提出改进后的提示。\n\n对于内容生成任务，优化过程可以先设计一个排序器提示，再利用该学习到的排序器进行提示优化。优化将在达到预算或迭代次数上限时结束。\n\n\n这种结合合成数据生成与提示优化的方法，相较于传统方法表现更优，同时所需的数据量和迭代次数极少。更多信息请参阅我们的论文\n[基于意图的提示校准：利用合成边界案例提升提示优化效果](https:\u002F\u002Farxiv.org\u002Fabs\u002F2402.03099)，作者为 E. Levi 等人（2024 年）。\n\n\n**使用 GPT-4 Turbo 时，此优化通常只需几分钟，成本不到 1 美元。** 为了控制 GPT-4 LLM 的 token 使用成本，该框架允许用户设置优化的预算限制，单位为美元或 token 数量，具体配置方式请参见 [这里](docs\u002Fexamples.md#steps-to-run-example)。\n\n## 演示\n\n![pipeline_recording](https:\u002F\u002Foss.gittoolsai.com\u002Fimages\u002FEladlev_AutoPrompt_readme_0ab3da2fa2f0.gif)\n\n\n## 📖 文档\n - [如何安装](docs\u002Finstallation.md)（设置说明）\n - [提示优化示例](docs\u002Fexamples.md)（用例：电影评论分类、内容生成和聊天内容审核）\n - [工作原理](docs\u002Fhow-it-works.md)（流水线解释）\n - [架构指南](docs\u002Farchitecture.md)（主要组件概述）\n\n## 特性\n- 📝 仅需少量数据和标注步骤即可大幅提升提示质量。\n- 🛬 专为审核、多标签分类和内容生成等生产级场景设计。\n- ⚙️ 支持在不同模型版本或 LLM 提供商之间无缝迁移提示。\n- 🎓 支持提示压缩。可将多个规则合并为一条高效提示。\n\n## 快速入门\nAutoPrompt 需要 `python \u003C= 3.10`\n\u003Cbr \u002F>\n\n> **步骤 1** - 克隆项目\n\n```bash\ngit clone git@github.com:Eladlev\u002FAutoPrompt.git\ncd AutoPrompt\n```\n\n\u003Cbr \u002F>\n\n> **步骤 2** - 安装依赖\n\n您可以根据个人偏好选择 Conda 或 pip。使用 Conda：\n```bash\nconda env create -f environment_dev.yml\nconda activate AutoPrompt\n```\n\n使用 pip：\n```bash\npip install -r requirements.txt\n```\n\n使用 pipenv：\n```bash\npip install pipenv\npipenv sync\n```\n\n\u003Cbr \u002F>\n\n> **步骤 3** - 配置您的 LLM。\n\n通过更新配置文件 `config\u002Fllm_env.yml` 来设置您的 OpenAI API 密钥。\n- 如果您需要帮助查找 API 密钥，请访问此 [链接](https:\u002F\u002Fhelp.openai.com\u002Fen\u002Farticles\u002F4936850-where-do-i-find-my-api-key)。\n\n- 我们建议使用 [OpenAI 的 GPT-4](https:\u002F\u002Fplatform.openai.com\u002Fdocs\u002Fguides\u002Fgpt) 作为 LLM。我们的框架也支持其他提供商和开源模型，详情请参阅 [这里](docs\u002Finstallation.md#configure-your-llm)。\n\n\u003Cbr \u002F>\n\n> **步骤 4** - 配置您的标注器\n- 为您的项目选择一种标注方式：\n    - 我们建议从人机协作的方式开始，使用 [Argilla](https:\u002F\u002Fdocs.v1.argilla.io\u002Fen\u002Fv1.11.0)。请注意，AutoPrompt 仅兼容 **Argilla V1**，不支持最新的 V2 版本。请按照 [Argilla 设置说明](https:\u002F\u002Fdocs.v1.argilla.io\u002Fen\u002Fv1.11.0\u002Fgetting_started\u002Fquickstart_installation.html) 进行操作，并做如下修改：\n        - 如果您使用本地 Docker，请使用 `v1.29.0` 而不是 `latest` 标签。\n        - 对于使用 HF 的快速部署，可以复制以下 [空间](https:\u002F\u002Fhuggingface.co\u002Fspaces\u002FEladlev\u002Ftest4)。\n    - 或者，您也可以按照这些 [配置步骤](docs\u002Finstallation.md#configure-llm-annotator) 设置一个 LLM 作为您的标注器。\n\n- 默认的预测 LLM，即用于评估提示性能的 GPT-3.5，已在 `config\u002Fconfig_default.yml` 文件的 `predictor` 部分进行配置。\n\n- 在输入配置 YAML 文件中，使用 `max_usage 参数` 定义您的预算。对于 OpenAI 模型，`max_usage` 设置以美元计的最大支出；对于其他 LLM，则限制最大 token 数量。\n\n\u003Cbr \u002F>\n\n\n> **步骤 5** - 运行流水线\n\n首先，通过编辑 `config\u002Fconfig_default.yml` 配置您的标签：\n```yaml\ndataset:\n    label_schema: [\"Yes\", \"No\"]\n```\n\n\n对于 **分类流水线**，请在相应的工作目录下使用终端运行以下命令：\n```bash\npython run_pipeline.py\n```\n如果初始提示和任务描述未直接作为输入提供，系统将引导您输入这些信息。您也可以将其作为命令行参数指定：\n```bash\npython run_pipeline.py \\\n    --prompt \"这部电影影评是否包含剧透？回答是或否\" \\\n    --task_description \"助手是一位专家级分类器，将对电影影评进行分类，告知用户其是否包含所评论电影的剧透内容。\" \\\n    --num_steps 30\n```\n您可以通过 [W&B](https:\u002F\u002Fwandb.ai\u002Fsite) 仪表板跟踪优化进度，设置说明请参阅 [这里](docs\u002Finstallation.md#monitoring-weights-and-biases-setup)。\n\n\n如果您使用 pipenv，请确保激活环境：\n```bash\npipenv shell\npython run_pipeline.py  \n```\n或者在命令前加上 `pipenv run`：\n```bash\npipenv run python run_pipeline.py \n```\n\n#### 生成流水线\n要运行生成流水线，可以使用以下示例命令：\n```bash\npython run_generation_pipeline.py \\\n    --prompt \"写一篇关于特定电影的好且全面的影评。\" \\\n    --task_description \"助手是一个大型语言模型，负责撰写电影影评。\"\n```\n更多信息请参阅我们的 [生成任务示例](docs\u002Fexamples.md#generating-movie-reviews-generation-task)。\n\n\u003Cbr \u002F>\n\n#### 基准优化（仅优化模式）\n如果您已经拥有标注数据集，并希望跳过样本生成和标注步骤，可以使用基准优化脚本。此模式仅执行纯优化循环：**预测 → 评估 → 优化**。\n\n您的数据集应为包含 `text` 和 `annotation` 列的 CSV 文件：\n```csv\ntext,annotation\n\"这部电影真是太棒了！\",是\n\"浪费时间和金钱。\",否\n```\n\n运行优化：\n```bash\npython run_benchmark_optimization.py \\\n    --dataset path\u002Fto\u002Fyour_data.csv \\\n    --prompt \"这篇电影影评是正面的吗？回答是或否。\" \\\n    --task_description \"将电影影评分类为正面或负面。\" \\\n    --labels 是 否 \\\n    --num_steps 10 \\\n    --output results.json\n```\n\n参数说明：\n- `--dataset`（必填）：包含 `text` 和 `annotation` 列的 CSV 文件路径\n- `--prompt`：待优化的初始提示（若省略则交互式输入）\n- `--task_description`：任务描述（若省略则交互式输入）\n- `--labels`：标签体系（默认：是 否）\n- `--num_steps`：优化迭代次数（默认：10 次）\n- `--output`：结果输出 JSON 文件（默认：benchmark_results.json）\n- `--config`：配置文件（默认：config\u002Fconfig_benchmark.yml）\n\n此功能适用于以下场景：\n- 您已拥有带标签的基准数据\n- 您希望跳过样本生成，加快迭代速度\n- 您正在为特定数据集微调提示\n\n\u003Cbr \u002F>\n\n尽情享受成果吧！完成以上步骤后，您将获得一个针对您任务量身定制的 **优化（校准）后的提示**，以及一个包含挑战性样本的 **基准测试集**，它们都将存储在默认的 `dump` 路径中。\n\n\n\n## 小贴士\n\n- 在优化过程中，提示的准确性可能会有所波动。为了找到最佳提示，我们建议在首次生成基准测试集之后继续进行持续优化。您可以使用 `--num_steps` 设置优化迭代次数，并通过在 `dataset` 部分指定 `max_samples` 来控制样本生成数量。例如，设置 `max_samples: 50` 和 `--num_steps 30` 可将基准测试集限制为 50 个样本，从而允许在每次迭代生成 10 个样本的情况下进行 25 次额外的优化迭代。\n\n- 该框架支持检查点功能，方便您从上次保存的状态继续优化。它会自动将最近的优化状态保存到 `dump` 路径中。您可以使用 `--output_dump` 设置此路径，并用 `--load_path` 从检查点恢复。\n- 每次迭代都会涉及多次调用 LLM 服务，尤其是生成式任务中，通常会发送较长的提示并请求 LLM 生成较多的 token，这可能需要约 1 分钟的时间，请耐心等待。\n- 如果 Argilla 服务器连接出现问题或报错，请尝试重启该空间。\n\u003C!-- \n同时，meta_prompts 部分中的 num_initialize_samples 和 num_generated_samples 字段分别指定了初始样本生成数量和每次迭代的样本生成数量。 -->\n\n## 提示敏感性示例\n你编写了一个用于识别电影剧透的提示：\n```\n请审阅提供的内容，并指出其中是否包含任何重要的情节揭示或关键点，这些内容可能会泄露故事的重要元素或结局。如果包含此类剧透或关键见解，请回答“是”；如果不涉及揭露关键故事元素，请回答“否”。\n```\n此提示在使用 GPT-4 大型语言模型时，在你的[基准测试](docs\u002Fexamples.md#filtering-movie-reviews-with-spoilers-classification-task)中得分为 81 分。随后，你对提示进行了微小修改：\n```\n请审阅文本，判断其是否提供了构成剧透的故事本质性揭示或关键细节。如有剧透，请回答“是”；若无，则回答“否”。\n```\n令人惊讶的是，第二个提示的得分降至 72 分，准确率下降了 11%。这说明提示工程需要谨慎细致的过程。\n\n## 🚀 贡献\n我们非常感谢您的贡献！如果您有意参与贡献，请参阅我们的[贡献指南](docs\u002Fcontributing.md)，以获取详细信息。\n\n\u003C!-- 如需了解我们的未来计划，请访问项目路线图。 -->\n如果您希望加入我们的旅程，欢迎通过我们的[Discord 社区](https:\u002F\u002Fdiscord.gg\u002FG2rSbAf8uP)与我们联系。我们非常期待您的加入！\n\n## 🛡 免责声明\nAutoPrompt 项目按“现状”提供，不提供任何形式的明示或暗示担保或保证。\n\n我们对提示优化及使用的看法如下：\n\n1. AutoPrompt 的核心目标是优化和完善提示，以获得高质量的结果。这一目标通过迭代校准过程实现，有助于减少错误并提升大语言模型的性能。然而，该框架并不能保证在每种情况下都能得出绝对正确或无偏见的结果。\n\n2. AutoPrompt 旨在提高提示的可靠性并缓解敏感性问题，但并不声称能够完全消除这些问题。\n\u003C!-- 我们的社区致力于探索与大语言模型互动的最佳方式，营造一个包容多元观点和方法的交流空间。 -->\n\n请注意，使用由 AutoPrompt 支持的 OpenAI GPT-4 等大语言模型可能会因令牌使用而产生高昂费用。使用 AutoPrompt 即表示您承认自己有责任监控和管理令牌使用情况及相关支出。我们建议您定期查看大语言模型提供商的 API 使用情况，并设置使用限制或预警，以避免意外收费。\n为管理 GPT-4 大语言模型的令牌使用成本，该框架允许用户以美元或令牌数量的形式设定优化预算上限，配置方法请参见[此处](docs\u002Fexamples.md#steps-to-run-example)。\n\n## 引用\n如果您在研究中使用了我们的代码，请引用我们的论文：\n\n```\n@misc{2402.03099,\n作者 = {Elad Levi、Eli Brosh 和 Matan Friedmann},\n标题 = {基于意图的提示校准：利用合成边界案例增强提示优化},\n年份 = {2024},\n预印本 = {arXiv:2402.03099},\n}\n```\n\n\n## 许可证\n本框架采用[Apache 许可证 2.0 版](http:\u002F\u002Fwww.apache.org\u002Flicenses\u002FLICENSE-2.0)授权。\n\n## ✉️ 支持 \u002F 联系我们\n- [社区 Discord](https:\u002F\u002Fdiscord.gg\u002FG2rSbAf8uP)\n- 我们的邮箱：[‫autopromptai@gmail.com‬](mailto:autopromptai@gmail.com)","# AutoPrompt 快速上手指南\n\nAutoPrompt 是一个提示词优化框架，旨在通过自动化生成高质量、详细的提示词来提升大语言模型（LLM）在实际场景中的表现。它通过迭代构建挑战性边缘案例数据集并校准提示词，有效解决提示词敏感性和模糊性问题。\n\n## 环境准备\n\n在开始之前，请确保满足以下系统要求：\n\n*   **Python 版本**：必须使用 `Python \u003C= 3.10`（不支持 Python 3.11 及以上版本）。\n*   **API Key**：需要配置 OpenAI API Key（推荐使用 GPT-4 或 GPT-3.5 Turbo）。\n*   **可选依赖**：\n    *   若使用人工标注流程，需部署 [Argilla V1](https:\u002F\u002Fdocs.v1.argilla.io\u002Fen\u002Fv1.11.0\u002F)（注意：不兼容 Argilla V2）。\n    *   若需监控优化进度，可配置 Weights & Biases (W&B)。\n\n## 安装步骤\n\n### 1. 克隆项目\n```bash\ngit clone git@github.com:Eladlev\u002FAutoPrompt.git\ncd AutoPrompt\n```\n\n### 2. 安装依赖\n你可以选择 Conda、pip 或 pipenv 进行安装。\n\n**方式 A：使用 Conda（推荐）**\n```bash\nconda env create -f environment_dev.yml\nconda activate AutoPrompt\n```\n\n**方式 B：使用 pip**\n```bash\npip install -r requirements.txt\n```\n\n**方式 C：使用 pipenv**\n```bash\npip install pipenv\npipenv sync\n```\n\n### 3. 配置 LLM\n编辑配置文件 `config\u002Fllm_env.yml`，填入你的 OpenAI API Key。\n> 提示：如需查找 API Key，请访问 [OpenAI 官方帮助文档](https:\u002F\u002Fhelp.openai.com\u002Fen\u002Farticles\u002F4936850-where-do-i-find-my-api-key)。\n\n### 4. 配置标注器（可选）\n*   **人工标注**：推荐使用 Argilla V1。若使用 Docker 本地部署，请将镜像标签设为 `v1.29.0` 而非 `latest`。\n*   **LLM 自动标注**：参考 `docs\u002Finstallation.md` 配置 LLM 作为标注器。\n*   **预算控制**：在输入配置的 yaml 文件中设置 `max_usage` 参数（OpenAI 模型单位为美元，其他模型为 Token 数量），以控制优化成本。\n\n## 基本使用\n\n### 场景一：分类任务优化（最常用）\n\n此模式会自动生成样本、标注并迭代优化提示词。\n\n1.  **编辑标签配置**：修改 `config\u002Fconfig_default.yml` 定义标签体系。\n    ```yaml\n    dataset:\n        label_schema: [\"Yes\", \"No\"]\n    ```\n\n2.  **运行流水线**：\n    你可以直接运行命令，随后按交互式提示输入初始提示词和任务描述；或通过命令行参数直接指定。\n\n    **交互式运行：**\n    ```bash\n    python run_pipeline.py\n    ```\n\n    **命令行参数运行（示例：电影剧透检测）：**\n    ```bash\n    python run_pipeline.py \\\n        --prompt \"Does this movie review contain a spoiler? answer Yes or No\" \\\n        --task_description \"Assistant is an expert classifier that will classify a movie review, and let the user know if it contains a spoiler for the reviewed movie or not.\" \\\n        --num_steps 30\n    ```\n\n    > 若使用 pipenv，请在命令前加 `pipenv run` 或先执行 `pipenv shell`。\n\n3.  **查看结果**：\n    优化完成后， refined prompt（校准后的提示词）和包含挑战性样本的 benchmark 将保存在默认的 `dump` 路径下。你可配置 W&B 仪表盘实时跟踪优化进度。\n\n### 场景二：基于现有数据集的纯优化（Benchmark Optimization）\n\n如果你已有标注好的数据集（CSV 格式，包含 `text` 和 `annotation` 列），可跳过样本生成阶段，直接进行“预测→评估→优化”循环。\n\n**数据格式示例 (`data.csv`)：**\n```csv\ntext,annotation\n\"The movie was absolutely fantastic!\",Yes\n\"Waste of time and money.\",No\n```\n\n**运行命令：**\n```bash\npython run_benchmark_optimization.py \\\n    --dataset path\u002Fto\u002Fyour_data.csv \\\n    --prompt \"Is this movie review positive? Answer Yes or No.\" \\\n    --task_description \"Classify movie reviews as positive or negative.\" \\\n    --labels Yes No \\\n    --num_steps 10 \\\n    --output results.json\n```\n\n### 场景三：内容生成任务优化\n\n针对文本生成类任务（如写影评），使用专用脚本：\n\n```bash\npython run_generation_pipeline.py \\\n    --prompt \"Write a good and comprehensive movie review about a specific movie.\" \\\n    --task_description \"Assistant is a large language model that is tasked with writing movie reviews.\"\n```\n\n## 实用技巧\n\n*   **断点续跑**：框架支持检查点机制。优化状态会自动保存在 `dump` 路径。使用 `--load_path` 参数可从上次保存的状态恢复运行。\n*   **控制样本量**：在 `config` 文件的 `dataset` 部分设置 `max_samples`，配合 `--num_steps` 控制迭代次数，避免产生过多数据。\n*   **耐心等待**：每次迭代涉及多次 LLM 调用及长文本生成，单次迭代可能耗时约 1 分钟（生成任务尤甚），属正常现象。\n*   **Argilla 连接问题**：若遇到 Argilla 服务器连接错误，尝试重启服务或 Hugging Face Space。","某电商平台的客服团队正利用大语言模型自动处理海量的用户投诉工单，需要确保模型能精准识别恶意攻击、虚假索赔等复杂意图并进行合规回复。\n\n### 没有 AutoPrompt 时\n- **提示词极度敏感**：工程师手动编写的提示词稍作修改（如调整语气或增加示例），模型对“恶意投诉”的识别准确率就会大幅波动，难以稳定上线。\n- **边界案例覆盖不足**：人工构造测试集耗时费力，往往遗漏罕见的边缘情况（如隐晦的威胁言论），导致模型在生产环境中频繁误判。\n- **优化迭代成本高昂**：为了提升效果，团队需反复进行多轮人工标注和提示词微调，整个流程耗时数周且依赖资深专家的经验。\n- **缺乏量化评估标准**：无法系统性地衡量提示词在不同数据分布下的鲁棒性，只能凭感觉判断优化是否生效。\n\n### 使用 AutoPrompt 后\n- **自动校准抗干扰**：AutoPrompt 通过基于意图的校准机制，自动生成并学习各类困难样本，使提示词对细微变化不再敏感，保持性能稳定。\n- **智能合成边缘数据**：框架自动迭代生成多样化的挑战性边界案例（如变种的欺诈话术），无需人工穷举即可覆盖潜在风险点。\n- **分钟级低成本优化**：仅需少量初始示例，AutoPrompt 能在几分钟内（成本低于 1 美元）自动完成多轮“生成 - 评估 - 优化”闭环，产出高质量提示词。\n- **可量化的性能提升**：内置评估流水线提供明确的准确率指标，让团队清晰看到提示词在特定任务上的鲁棒性增强效果。\n\nAutoPrompt 将原本依赖专家经验且耗时数周的提示词工程，转变为低成本、自动化且数据驱动的标准流程，显著提升了大模型在复杂业务场景中的落地可靠性。","https:\u002F\u002Foss.gittoolsai.com\u002Fimages\u002FEladlev_AutoPrompt_0219afe3.png","Eladlev",null,"https:\u002F\u002Foss.gittoolsai.com\u002Favatars\u002FEladlev_601f2139.png","https:\u002F\u002Fgithub.com\u002FEladlev",[81],{"name":82,"color":83,"percentage":84},"Python","#3572A5",100,2960,264,"2026-04-05T12:41:36","Apache-2.0","未说明",{"notes":91,"python":92,"dependencies":93},"该工具主要基于云端 LLM（如 OpenAI GPT-4）运行，本地无需高性能 GPU。核心依赖为配置 OpenAI API Key。若使用人工标注功能，需部署 Argilla V1 版本（注意不兼容 V2），可通过 Docker (v1.29.0) 或 Hugging Face Space 部署。支持通过配置文件设置预算上限（美元或 Token 数量）以控制成本。","\u003C=3.10",[94,95,96,97,98],"OpenAI API (推荐 GPT-4)","Argilla (V1 版本，用于人工标注)","LangChain","Wandb","Conda\u002FPip\u002FPipenv",[14],[101,102,103],"prompt-engineering","prompt-tuning","synthetic-dataset-generation","2026-03-27T02:49:30.150509","2026-04-06T14:01:29.534262",[107,112,117,122,126,130,134],{"id":108,"question_zh":109,"answer_zh":110,"source_url":111},19252,"运行管道时出现 'KeyError: samples' 错误怎么办？","该错误通常是因为配置文件中的 LLM 类型大小写不匹配导致的。例如，配置文件中写了小写的 'azure'，但系统期望的是首字母大写的 'Azure'。请检查配置文件（如 config_default.yml）中 annotator 和 predictor 部分的 llm.type 字段，确保其值的大小写正确（例如改为 'Azure'）。维护者已更新代码以忽略大小写，但手动修正配置是最快的解决方法。","https:\u002F\u002Fgithub.com\u002FEladlev\u002FAutoPrompt\u002Fissues\u002F75",{"id":113,"question_zh":114,"answer_zh":115,"source_url":116},19253,"如何在 AutoPrompt 中使用自己的数据集进行迭代优化？","需要按以下步骤操作：\n1. 将数据转换为 AutoPrompt 格式 CSV，包含列：\"Id\", \"text\", \"prediction\", \"annotation\", \"metadata\", \"score\", \"batch_id\"。其中 'Id' 是唯一行 ID，'text' 是输入，'prediction' 留空，'annotation' 填真实标签（GT），'score' 留空，'batch_id' 全部设为 0。\n2. 将该 CSV 放入一个空文件夹（确保文件夹内没有 history.pickle）。\n3. 修改 default_config 文件：调整 label_schema 以匹配你的标签体系；将 max_samples 改为你 CSV 中的样本数量；如果完全移除配置中的 annotator，系统将直接使用 CSV 中的 annotation 列，否则该列可为空由系统填充。","https:\u002F\u002Fgithub.com\u002FEladlev\u002FAutoPrompt\u002Fissues\u002F51",{"id":118,"question_zh":119,"answer_zh":120,"source_url":121},19254,"运行 run_generation_pipeline.py 时报错 'At least one label specified must be in y_true' 如何解决？","这通常是因为标注器（annotator）的指令与标签架构不匹配。解决方法是修改标注器的指令，使其输出符合指定的评分范围（例如 1-5 分的排名），或者确保指令输出的标签在数据集的 label_schema 中定义。建议创建一个单独的配置文件（如 config_llm.yml），明确指定 annotator 的 method 为 'llm'，并在 instruction 中清晰定义任务（例如：\"Assess whether the text...\"），同时确保 label_schema 配置正确。","https:\u002F\u002Fgithub.com\u002FEladlev\u002FAutoPrompt\u002Fissues\u002F37",{"id":123,"question_zh":124,"answer_zh":125,"source_url":116},19255,"使用 Azure OpenAI 作为标注器时需要添加哪些依赖？","如果在环境中使用 Azure OpenAI 或特定的 LangChain 功能，可能需要在 environment_dev.yml 或 requirements.txt 中添加以下依赖包：\n- langchain-community==0.0.8\n- langchain-core==0.2.25\n添加后请重新安装环境以确保兼容性。",{"id":127,"question_zh":128,"answer_zh":129,"source_url":116},19256,"数据集 CSV 文件的命名和格式有什么具体要求？","数据集文件必须命名为 dataset.csv，因为 optimization_pipeline.py 默认读取此文件名。CSV 的表头字段名需严格匹配，特别是 'id' 应为小写。一个可用的示例格式如下：\n\"id\",\"text\",\"prediction\",\"annotation\",\"metadata\",\"score\",\"batch_id\"\n0,\"文本内容\",,\"Yes\",,,0\n注意字段顺序和名称的大小写敏感性。",{"id":131,"question_zh":132,"answer_zh":133,"source_url":116},19257,"如何配置使用 Ground Truth（真实标签）进行优化？","若要使用 Ground Truth，需在 CSV 数据的 'annotation' 列填入真实标签。在配置文件中，如果你完全移除了 annotator 部分，系统将直接读取 CSV 中的 'annotation' 列作为真值而不调用 LLM 进行标注；如果你保留了 annotator 配置，系统会根据选择的标注器方法更新 'annotation' 列，此时该列可以留空。此外，确保 config 文件中的 label_schema 与你的真实标签一致。",{"id":135,"question_zh":136,"answer_zh":137,"source_url":121},19258,"找不到 config_default.yml 中的 label_schema 配置项怎么办？","label_schema 通常位于配置文件的 dataset 部分而不是 annotator 部分。如果遇到配置混乱，建议先将所有配置文件恢复为默认设置。然后，在 'config\u002Fconfig_diff' 文件夹下创建一个新的配置文件（例如 config_llm.yml），在其中明确定义 annotator 的方法、LLM 类型、模型名称以及具体的指令内容，这样可以避免直接修改默认文件导致的结构错误。",[139,143],{"id":140,"version":141,"summary_zh":77,"released_at":142},117255,"0.2","2024-03-06T15:10:37",{"id":144,"version":145,"summary_zh":146,"released_at":147},117256,"v0.1","arXiv版本","2024-02-06T07:25:55"]