---
title: QAnything
canonical_url: "https://www.modelscope.cn/models/netease-youdao/QAnything"
md_url: "https://www.modelscope.cn/models/netease-youdao/QAnything.md"
repository: netease-youdao/QAnything
chinese_name: "有道QAnything"
last_updated: 2024-01-30
license: "Apache License 2.0"
pipeline_tag: question-answering
tasks:
  - question-answering
library_name:
  - "其他"
frameworks:
  - "其他"
downloads: 9969
stars: 71
---

# QAnything

> QAnything - netease-youdao 在 ModelScope 开源的模型。致力于支持任意格式文件或数据库的本地知识库问答系统（Question and Answer based on Anything）

netease-youdao/QAnything 是 ModelScope 魔搭社区上的question-answering模型，采用 Apache License 2.0 许可。

- **Repository**: netease-youdao/QAnything
- **License**: Apache License 2.0
- **Tasks**: question-answering
- **Downloads**: 9969
- **Stars**: 71
- **Last updated**: 2024-01-30

Source: https://www.modelscope.cn/models/netease-youdao/QAnything

---

<div align="center">

  <a href="https://github.com/netease-youdao/QAnything">
    <!-- Please provide path to your logo here -->
    <img src="docs/images/qanything_logo.png" alt="Logo" width="911" height="175">
  </a>

# **Q**uestion and **A**nswer based on **Anything**

<p align="center">
  <a href="https://github.com/netease-youdao/QAnything">去往GitHub</a> |
  <a href="./README.md">English</a> |
  <a href="./README_zh.md">简体中文</a>
</p>

</div>

<div align="center">
<br />

<a href="https://qanything.ai"><img src="https://img.shields.io/badge/%E5%9C%A8%E7%BA%BF%E4%BD%93%E9%AA%8C-QAnything-purple"></a>
&nbsp;&nbsp;&nbsp;&nbsp;
<a href="https://read.youdao.com#/home"><img src="https://img.shields.io/badge/%E5%9C%A8%E7%BA%BF%E4%BD%93%E9%AA%8C-有道速读-purple"></a>
&nbsp;&nbsp;&nbsp;&nbsp;

<a href="./LICENSE"><img src="https://img.shields.io/badge/license-Apache--2.0-yellow"></a>
&nbsp;&nbsp;&nbsp;&nbsp;
<a href="https://github.com/netease-youdao/QAnything/pulls"><img src="https://img.shields.io/badge/PRs-welcome-red"></a>
&nbsp;&nbsp;&nbsp;&nbsp;
<a href="https://twitter.com/YDopensource"><img src="https://img.shields.io/badge/follow-%40YDOpenSource-1DA1F2?logo=twitter&style={style}"></a>
&nbsp;&nbsp;&nbsp;&nbsp;

</div>

<details open="open">
<summary>目 录</summary>

- [什么是QAnything](#什么是QAnything)
  - [特点](#特点)
  - [架构](#架构)
- [开始](#开始)
  - [必要条件](#必要条件)
  - [下载安装](#下载安装)
- [使用](#使用)
  - [接入API](#接入API)
- [微信群](#微信群)
- [支持](#支持)
- [协议](#协议)
- [Acknowledgements](#Acknowledgements)

</details>

## GitHub
[👉本文档更新不及时，建议点击此链接前往QAnything GitHub了解更多内容](https://github.com/netease-youdao/QAnything)

## 什么是QAnything？
**QAnything** (**Q**uestion and **A**nswer based on **Anything**) 是致力于支持任意格式文件或数据库的本地知识库问答系统，可断网安装使用。

您的任何格式的本地文件都可以往里扔，即可获得准确、快速、靠谱的问答体验。

目前已支持格式: **PDF**，**Word(doc/docx)**，**PPT**，**Markdown**，**Eml**，**TXT**，**图片（jpg，png等）**，**网页链接**，更多格式，敬请期待...

### 特点
- 数据安全，支持全程拔网线安装使用。
- 支持跨语种问答，中英文问答随意切换，无所谓文件是什么语种。
- 支持海量数据问答，两阶段向量排序，解决了大规模数据检索退化的问题，数据越多，效果越好。
- 高性能生产级系统，可直接部署企业应用。
- 易用性，无需繁琐的配置，一键安装部署，拿来就用。
- 支持选择多知识库问答。

### 架构
<div align="center">
<img src="docs/images/qanything_arch.png" width = "700" alt="qanything_system" align=center />
</div>

#### 为什么是两阶段检索?
知识库数据量大的场景下两阶段优势非常明显，如果只用一阶段embedding检索，随着数据量增大会出现检索退化的问题，如下图中绿线所示，二阶段rerank重排后能实现准确率稳定增长，即**数据越多，效果越好**。

<div align="center">
<img src="docs/images/two_stage_retrieval.jpg" width = "500" alt="two stage retrievaal" align=center />
</div>
</br>

QAnything使用的检索组件[BCEmbedding](https://github.com/netease-youdao/BCEmbedding)有非常强悍的双语和跨语种能力，能消除语义检索里面的中英语言之间的差异，从而实现：
- **强大的双语和跨语种语义表征能力【<a href="https://github.com/netease-youdao/BCEmbedding/tree/master?tab=readme-ov-file#semantic-representation-evaluations-in-mteb" target="_Self">基于MTEB的语义表征评测指标</a>】。**
- **基于LlamaIndex的RAG评测，表现SOTA【<a href="https://github.com/netease-youdao/BCEmbedding/tree/master?tab=readme-ov-file#rag-evaluations-in-llamaindex" target="_Self">基于LlamaIndex的RAG评测指标</a>】。**


#### 一阶段检索（embedding）
| 模型名称 | Retrieval | STS | PairClassification | Classification | Reranking | Clustering | 平均 |  
|:-------------------------------|:--------:|:--------:|:--------:|:--------:|:--------:|:--------:|:--------:|  
| bge-base-en-v1.5 | 37.14 | 55.06 | 75.45 | 59.73 | 43.05 | 37.74 | 47.20 |  
| bge-base-zh-v1.5 | 47.60 | 63.72 | 77.40 | 63.38 | 54.85 | 32.56 | 53.60 |  
| bge-large-en-v1.5 | 37.15 | 54.09 | 75.00 | 59.24 | 42.68 | 37.32 | 46.82 |  
| bge-large-zh-v1.5 | 47.54 | 64.73 | **79.14** | 64.19 | 55.88 | 33.26 | 54.21 |  
| jina-embeddings-v2-base-en | 31.58 | 54.28 | 74.84 | 58.42 | 41.16 | 34.67 | 44.29 |  
| m3e-base | 46.29 | 63.93 | 71.84 | 64.08 | 52.38 | 37.84 | 53.54 |  
| m3e-large | 34.85 | 59.74 | 67.69 | 60.07 | 48.99 | 31.62 | 46.78 |  
| ***bce-embedding-base_v1*** | **57.60** | **65.73** | 74.96 | **69.00** | **57.29** | **38.95** | ***59.43*** |  

- 更详细的评测结果详见[Embedding模型指标汇总](https://github.com/netease-youdao/BCEmbedding/blob/master/Docs/EvaluationSummary/embedding_eval_summary.md)。

#### 二阶段检索（rerank）
| 模型名称 | Reranking | 平均 |  
|:-------------------------------|:--------:|:--------:|  
| bge-reranker-base | 57.78 | 57.78 |  
| bge-reranker-large | 59.69 | 59.69 |  
| ***bce-reranker-base_v1*** | **60.06** | ***60.06*** |  

- 更详细的评测结果详见[Reranker模型指标汇总](https://github.com/netease-youdao/BCEmbedding/blob/master/Docs/EvaluationSummary/reranker_eval_summary.md)

#### 基于LlamaIndex的RAG评测（embedding and rerank）

<img src="docs/images/rag_eval_multiple_domains_summary.jpg">

***NOTE:***

- 在WithoutReranker列中，我们的bce-embedding-base_v1模型优于所有其他embedding模型。
- 在固定embedding模型的情况下，我们的bce-reranker-base_v1模型达到了最佳表现。
- **bce-embedding-base_v1和bce-reranker-base_v1的组合是SOTA。**
- 如果想单独使用embedding和rerank请参阅：[BCEmbedding](https://github.com/netease-youdao/BCEmbedding)

#### LLM

开源版本QAnything的大模型基于通义千问，并在大量专业问答数据集上进行微调；在千问的基础上大大加强了问答的能力。
如果需要商用请遵循千问的license，具体请参阅：[通义千问](https://github.com/QwenLM/Qwen)

## 开始
[👉在线试用QAnything](https://qanything.ai)

### 必要条件
|  **必要项**     | **最低要求**   | **备注** |
| --------------         | ------------------------- | --------------------------------- |
| NVIDIA GPU Memory      |      >= 16GB              | 推荐NVIDIA 3090|
| NVIDIA Driver 版本      |      >= 525.105.17        |                           |
| CUDA 版本               |      >= 12.0              |                           |
| docker compose 版本     |      >=1.27.4             | [docker compose 安装教程](https://docs.docker.com/compose/install/)|

### 下载安装
安装教程请参考：
https://github.com/netease-youdao/QAnything/blob/master/README_zh.md#%E4%B8%8B%E8%BD%BD%E5%AE%89%E8%A3%85

## 使用

### 跨语种：多篇英文论文问答
<div align="center">
  <video controls autoplay src="https://cdn-uploads.huggingface.co/production/uploads/63aa90473453852ef5458cd3/KBXAReIo_fYyV9hsQXCm_.mp4" width = "800" alt="information extraction" align=center></video>
</div>

### 信息抽取
<div align="center">
  <video controls autoplay src="https://cdn-uploads.huggingface.co/production/uploads/63aa90473453852ef5458cd3/Iz-Tp5DCb1cpwjGZKei05.mp4" width = "800" alt="multi English paper" align=center></video>
</div>

### 文件大杂烩
<div align="center">
  <video controls autoplay src="https://cdn-uploads.huggingface.co/production/uploads/63aa90473453852ef5458cd3/KoX1g-lWJEtZpiD2ItOnw.mp4" width = "800" alt="various files" align=center></video>
</div>

### 网页问答
<div align="center">
 <video controls autoplay src="https://cdn-uploads.huggingface.co/production/uploads/63aa90473453852ef5458cd3/_Uijrg055LlChJykjnC37.mp4" width = "800" alt="web qa" align=center></video>
</div>


### 接入API
如果需要接入API，请参阅[QAnything API 文档](docs/API.md)

## 微信群

欢迎大家扫码加入官方微信交流群。

<img src="docs/images/Wechat.jpg" width="20%" height="auto">

## 支持

有任何问题，请通过以下方式联系我们:

- [Github issues](https://github.com/netease-youdao/QAnything/issues)
- [Netease Youdao](https://github.com/netease-youdao)

## 协议

`QAnything` 依照 [Apache 2.0 协议](./LICENSE)开源。

## Acknowledgements
- [BCEmbedding](https://github.com/netease-youdao/BCEmbedding)
- [Qwen](https://github.com/QwenLM/Qwen)
- [Triton Inference Server](https://github.com/triton-inference-server/server)
- [FasterTransformer](https://github.com/NVIDIA/FasterTransformer)
- [Langchain](https://github.com/langchain-ai/langchain)
- [Langchain-Chatchat](https://github.com/chatchat-space/Langchain-Chatchat)
- [Milvus](https://github.com/milvus-io/milvus)
- [PaddleOCR](https://github.com/PaddlePaddle/PaddleOCR) 
- [Sanic](https://github.com/sanic-org/sanic)
