Skip to content

Commit 4bddfbc

Browse files
authored
feat(docs): support readthedocs (#369)
* docs(readthedocs): add en doc * docs(project): update image
1 parent 87492ba commit 4bddfbc

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

52 files changed

+1052
-81
lines changed

Diff for: .github/scripts/doc_link_checker.py

+3-1
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,7 @@ def analyze_doc(home, path):
5858
ref = ref[ref.find('#'):]
5959
fullpath = os.path.join(home, ref)
6060
if not os.path.exists(fullpath):
61-
raise ValueError(fullpath)
61+
# raise ValueError(fullpath)
6262
problem_list.append(ref)
6363
else:
6464
continue
@@ -79,6 +79,8 @@ def traverse(target):
7979
if filename.endswith('.md'):
8080
path = os.path.join(home, filename)
8181
if os.path.islink(path) is False:
82+
if 'copy_' in path:
83+
continue
8284
analyze_doc(home, path)
8385

8486

Diff for: README.md

+21-18
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,11 @@ English | [简体中文](README_zh.md)
88
<a href="resource/figures/wechat.jpg" target="_blank">
99
<img alt="Wechat" src="https://img.shields.io/badge/wechat-robot%20inside-brightgreen?logo=wechat&logoColor=white" />
1010
</a>
11-
<a href="https://pypi.org/project/huixiangdou" target="_blank">
12-
<img alt="PyPI" src="https://img.shields.io/badge/PyPI-install-blue?logo=pypi&logoColor=white" />
11+
<!-- <a href="https://huixiangdou.readthedocs.io/en/latest/" target="_blank">
12+
<img alt="Readthedocs" src="https://img.shields.io/badge/readthedocs-chat%20with%20AI-brightgreen?logo=readthedocs&logoColor=white" />
13+
</a> -->
14+
<a href="https://huixiangdou.readthedocs.io/zh-cn/latest/" target="_blank">
15+
<img alt="Readthedocs" src="https://img.shields.io/badge/readthedocs-black?logo=readthedocs&logoColor=white" />
1316
</a>
1417
<a href="https://youtu.be/ylXrT-Tei-Y" target="_blank">
1518
<img alt="YouTube" src="https://img.shields.io/badge/YouTube-black?logo=youtube&logoColor=red" />
@@ -35,7 +38,7 @@ HuixiangDou is a **professional knowledge assistant** based on LLM.
3538
Advantages:
3639

3740
1. Design three-stage pipelines of preprocess, rejection and response
38-
* `chat_in_group` copes with **group chat** scenario, answer user questions without message flooding, see [2401.08772](https://arxiv.org/abs/2401.08772), [2405.02817](https://arxiv.org/abs/2405.02817), [Hybrid Retrieval](./docs/knowledge_graph_en.md) and [Precision Report](./evaluation/)
41+
* `chat_in_group` copes with **group chat** scenario, answer user questions without message flooding, see [2401.08772](https://arxiv.org/abs/2401.08772), [2405.02817](https://arxiv.org/abs/2405.02817), [Hybrid Retrieval](./docs/en/doc_knowledge_graph.md) and [Precision Report](./evaluation/)
3942
* `chat_with_repo` for **real-time streaming** chat
4043
2. No training required, with CPU-only, 2G, 10G, 20G and 80G configuration
4144
3. Offers a complete suite of Web, Android, and pipeline source code, industrial-grade and commercially viable
@@ -50,9 +53,9 @@ Our Web version has been released to [OpenXLab](https://openxlab.org.cn/apps/det
5053

5154
- \[2024/08\] `chat_with_repo` [pipeline](./huixiangdou/service/parallel_pipeline.py) 👍
5255
- \[2024/07\] Image and text retrieval & Removal of `langchain` 👍
53-
- \[2024/07\] [Hybrid Knowledge Graph and Dense Retrieval](./docs/knowledge_graph_en.md) improve 1.7% F1 score 🎯
56+
- \[2024/07\] [Hybrid Knowledge Graph and Dense Retrieval](./docs/en/doc_knowledge_graph.md) improve 1.7% F1 score 🎯
5457
- \[2024/06\] [Evaluation of chunksize, splitter, and text2vec model](./evaluation) 🎯
55-
- \[2024/05\] [wkteam WeChat access](./docs/add_wechat_commercial_zh.md), parsing image & URL, support coreference resolution
58+
- \[2024/05\] [wkteam WeChat access](./docs/zh/doc_add_wechat_commercial.md), parsing image & URL, support coreference resolution
5659
- \[2024/05\] [SFT LLM on NLP task, F1 increased by 29%](./sft/) 🎯
5760
<table>
5861
<tr>
@@ -63,9 +66,9 @@ Our Web version has been released to [OpenXLab](https://openxlab.org.cn/apps/det
6366
<td><a href="https://arxiv.org/abs/2405.02817">arXiv</a></td>
6467
</tr>
6568
</table>
66-
- \[2024/04\] [RAG Annotation SFT Q&A Data and Examples](./docs/rag_annotate_sft_data_zh.md)
69+
- \[2024/04\] [RAG Annotation SFT Q&A Data and Examples](./docs/zh/doc_rag_annotate_sft_data.md)
6770
- \[2024/04\] Release [Web Front and Back End Service Source Code](./web) 👍
68-
- \[2024/03\] New [Personal WeChat Integration](./docs/add_wechat_accessibility_zh.md) and [**Prebuilt APK**](https://github.com/InternLM/HuixiangDou/releases/download/v0.1.0rc1/huixiangdou-20240508.apk) !
71+
- \[2024/03\] New [Personal WeChat Integration](./docs/zh/doc_add_wechat_accessibility.md) and [**Prebuilt APK**](https://github.com/InternLM/HuixiangDou/releases/download/v0.1.0rc1/huixiangdou-20240508.apk) !
6972
- \[2024/02\] \[Experimental Feature\] [WeChat Group](https://github.com/InternLM/HuixiangDou/blob/main/resource/figures/wechat.jpg) Integration of multimodal to achieve OCR
7073

7174
# 📖 Support Status
@@ -117,7 +120,7 @@ Our Web version has been released to [OpenXLab](https://openxlab.org.cn/apps/det
117120

118121
<td>
119122

120-
- [Knowledge Graph](./docs/knowledge_graph_en.md)
123+
- [Knowledge Graph](./docs/en/doc_knowledge_graph.md)
121124
- [Internet Search](./huixiangdou/service/web_search.py)
122125
- [SourceGraph](https://sourcegraph.com)
123126
- Image and text (only markdown)
@@ -126,7 +129,7 @@ Our Web version has been released to [OpenXLab](https://openxlab.org.cn/apps/det
126129

127130
<td>
128131

129-
- WeChat([android](./docs/add_wechat_accessibility_zh.md)/[wkteam](./docs/add_wechat_commercial_zh.md))
132+
- WeChat([android](./docs/zh/doc_add_wechat_accessibility.md)/[wkteam](./docs/zh/doc_add_wechat_commercial.md))
130133
- Lark
131134
- [OpenXLab Web](https://openxlab.org.cn/apps/detail/tpoisonooo/huixiangdou-web)
132135
- [Gradio Demo](./huixiangdou/gradio.py)
@@ -244,10 +247,10 @@ Please update the `repodir` documents, [good_questions](./resource/good_question
244247

245248
## III. Integration into Feishu, WeChat group
246249

247-
- [**One-way** sending to Feishu group](./docs/send_only_lark_group_zh.md)
248-
- [**Two-way** Feishu group receiving and sending, recalling](./docs/add_lark_group_zh.md)
249-
- [Personal WeChat Android access](./docs/add_wechat_accessibility_zh.md)
250-
- [Personal WeChat wkteam access](./docs/add_wechat_commercial_zh.md)
250+
- [**One-way** sending to Feishu group](./docs/zh/doc_send_only_lark_group.md)
251+
- [**Two-way** Feishu group receiving and sending, recalling](./docs/zh/doc_add_lark_group.md)
252+
- [Personal WeChat Android access](./docs/zh/doc_add_wechat_accessibility.md)
253+
- [Personal WeChat wkteam access](./docs/zh/doc_add_wechat_commercial.md)
251254

252255
## IV. Deploy web front and back end
253256

@@ -328,7 +331,7 @@ Note:
328331

329332
- You need to manually download [Visualized_m3.pth](https://huggingface.co/BAAI/bge-visualized/blob/main/Visualized_m3.pth) to the [bge-m3](https://huggingface.co/BAAI/bge-m3) directory
330333
- Install FlagEmbedding on main branch, we have made [bugfix](https://github.com/FlagOpen/FlagEmbedding/commit/3f84da0796d5badc3ad519870612f1f18ff0d1d3). [Here](https://github.com/FlagOpen/FlagEmbedding/blob/master/FlagEmbedding/visual/eva_clip/bpe_simple_vocab_16e6.txt.gz) you can download `bpe_simple_vocab_16e6.txt.gz`
331-
- Install [requirments-multimodal.txt](./requirements-multimodal.txt)
334+
- Install [requirements/multimodal.txt](./requirements/multimodal.txt)
332335

333336
Run gradio to test, see the image and text retrieval result [here](https://github.com/InternLM/HuixiangDou/pull/326).
334337

@@ -348,11 +351,11 @@ The "HuiXiangDou" in the WeChat experience group has enabled all features:
348351

349352
Please read the following topics:
350353

351-
- [Hybrid knowledge graph and dense retrieval](./docs/knowledge_graph_en.md)
352-
- [Refer to config-advanced.ini configuration to improve effects](./docs/full_dev_en.md)
354+
- [Hybrid knowledge graph and dense retrieval](./docs/en/doc_knowledge_graph.md)
355+
- [Refer to config-advanced.ini configuration to improve effects](./docs/en/doc_full_dev.md)
353356
- [Group chat scenario anaphora resolution training](./sft)
354-
- [Use wkteam WeChat access, integrate images, public account parsing, and anaphora resolution](./docs/add_wechat_commercial_zh.md)
355-
- [Use rag.py to annotate SFT training data](./docs/rag_annotate_sft_data_zh.md)
357+
- [Use wkteam WeChat access, integrate images, public account parsing, and anaphora resolution](./docs/zh/doc_add_wechat_commercial.md)
358+
- [Use rag.py to annotate SFT training data](./docs/zh/doc_rag_annotate_sft_data.md)
356359

357360
## **Android Tools**
358361

Diff for: README_zh.md

+21-18
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,11 @@
77
<a href="resource/figures/wechat.jpg" target="_blank">
88
<img alt="Wechat" src="https://img.shields.io/badge/wechat-robot%20inside-brightgreen?logo=wechat&logoColor=white" />
99
</a>
10-
<a href="https://pypi.org/project/huixiangdou" target="_blank">
11-
<img alt="PyPI" src="https://img.shields.io/badge/PyPI-install-blue?logo=pypi&logoColor=white" />
10+
<!-- <a href="https://huixiangdou.readthedocs.io/zh-cn/latest/" target="_blank">
11+
<img alt="Readthedocs" src="https://img.shields.io/badge/readthedocs-chat%20with%20AI-brightgreen?logo=readthedocs&logoColor=white" />
12+
</a> -->
13+
<a href="https://huixiangdou.readthedocs.io/zh-cn/latest/" target="_blank">
14+
<img alt="Readthedocs" src="https://img.shields.io/badge/readthedocs-black?logo=readthedocs&logoColor=white" />
1215
</a>
1316
<a href="https://youtu.be/ylXrT-Tei-Y" target="_blank">
1417
<img alt="YouTube" src="https://img.shields.io/badge/YouTube-black?logo=youtube&logoColor=red" />
@@ -32,7 +35,7 @@
3235
茴香豆是一个基于 LLM 的专业知识助手,优势:
3336

3437
1. 设计预处理、拒答、响应三阶段 pipeline:
35-
* `chat_in_group` 群聊场景,解答问题时不会消息泛滥。见 [2401.08772](https://arxiv.org/abs/2401.08772)[2405.02817](https://arxiv.org/abs/2405.02817)[混合检索](./docs/knowledge_graph_zh.md)[业务数据精度测试](./evaluation)
38+
* `chat_in_group` 群聊场景,解答问题时不会消息泛滥。见 [2401.08772](https://arxiv.org/abs/2401.08772)[2405.02817](https://arxiv.org/abs/2405.02817)[混合检索](./docs/zh/doc_knowledge_graph.md)[业务数据精度测试](./evaluation)
3639
* `chat_with_repo` 实时聊天场景,响应更快
3740
2. 无需训练适用各行业,提供 CPU-only、2G、10G、20G、80G 规格配置
3841
3. 提供一整套前后端 web、android、算法源码,工业级开源可商用
@@ -49,9 +52,9 @@ Web 版视频教程见 [BiliBili](https://www.bilibili.com/video/BV1S2421N7mn)
4952

5053
- \[2024/08\] `chat_with_repo` [pipeline](./huixiangdou/service/parallel_pipeline.py)
5154
- \[2024/07\] 图文检索 & 移除 `langchain` 👍
52-
- \[2024/07\] [混合知识图谱和稠密检索,F1 提升 1.7%](./docs/knowledge_graph_zh.md) 🎯
55+
- \[2024/07\] [混合知识图谱和稠密检索,F1 提升 1.7%](./docs/zh/doc_knowledge_graph.md) 🎯
5356
- \[2024/06\] [评估 chunksize,splitter 和 text2vec 模型](./evaluation) 🎯
54-
- \[2024/05\] [wkteam 微信接入](./docs/add_wechat_commercial_zh.md),整合图片&公众号解析、集成指代消歧
57+
- \[2024/05\] [wkteam 微信接入](./docs/zh/doc_add_wechat_commercial.md),整合图片&公众号解析、集成指代消歧
5558
- \[2024/05\] [SFT LLM 处理 NLP 任务,F1 提升 29%](./sft/) 🎯
5659
<table>
5760
<tr>
@@ -62,9 +65,9 @@ Web 版视频教程见 [BiliBili](https://www.bilibili.com/video/BV1S2421N7mn)
6265
<td><a href="https://arxiv.org/abs/2405.02817">arXiv</a></td>
6366
</tr>
6467
</table>
65-
- \[2024/04\] 实现 [RAG 标注 SFT 问答数据和样例](./docs/rag_annotate_sft_data_zh.md)
68+
- \[2024/04\] 实现 [RAG 标注 SFT 问答数据和样例](./docs/zh/doc_rag_annotate_sft_data.md)
6669
- \[2024/04\] 发布 [web 前后端服务源码](./web) 👍
67-
- \[2024/03\] 新的[个人微信集成方法](./docs/add_wechat_accessibility_zh.md)[**预编译 apk**](https://github.com/InternLM/HuixiangDou/releases/download/v0.1.0rc1/huixiangdou-20240508.apk) !
70+
- \[2024/03\] 新的[个人微信集成方法](./docs/zh/doc_add_wechat_accessibility.md)[**预编译 apk**](https://github.com/InternLM/HuixiangDou/releases/download/v0.1.0rc1/huixiangdou-20240508.apk) !
6871
- \[2024/02\] \[实验功能\] [微信群](https://github.com/InternLM/HuixiangDou/blob/main/resource/figures/wechat.jpg) 集成多模态以实现 OCR
6972

7073
# 📖 支持情况
@@ -116,7 +119,7 @@ Web 版视频教程见 [BiliBili](https://www.bilibili.com/video/BV1S2421N7mn)
116119

117120
<td>
118121

119-
- [知识图谱](./docs/knowledge_graph_zh.md)
122+
- [知识图谱](./docs/zh/doc_knowledge_graph.md)
120123
- [联网搜索](./huixiangdou/service/web_search.py)
121124
- [SourceGraph](https://sourcegraph.com)
122125
- 图文混合(仅 markdown)
@@ -125,7 +128,7 @@ Web 版视频教程见 [BiliBili](https://www.bilibili.com/video/BV1S2421N7mn)
125128

126129
<td>
127130

128-
- 微信([android](./docs/add_wechat_accessibility_zh.md)/[wkteam](./docs/add_wechat_commercial_zh.md)
131+
- 微信([android](./docs/zh/doc_add_wechat_accessibility.md)/[wkteam](./docs/zh/doc_add_wechat_commercial.md)
129132
- 飞书
130133
- [OpenXLab Web](https://openxlab.org.cn/apps/detail/tpoisonooo/huixiangdou-web)
131134
- [Gradio Demo](./huixiangdou/gradio.py)
@@ -243,10 +246,10 @@ curl -X POST http://127.0.0.1:23333/huixiangdou_inference -H "Content-Type: app
243246

244247
## 三、集成到飞书、微信群
245248

246-
- [**单向**发送到飞书群](./docs/send_only_lark_group_zh.md)
247-
- [**双向**飞书群收发、撤回](./docs/add_lark_group_zh.md)
248-
- [个微 android 接入](./docs/add_wechat_accessibility_zh.md)
249-
- [个微 wkteam 接入](./docs/add_wechat_commercial_zh.md)
249+
- [**单向**发送到飞书群](./docs/zh/doc_send_only_lark_group.md)
250+
- [**双向**飞书群收发、撤回](./docs/zh/doc_add_lark_group.md)
251+
- [个微 android 接入](./docs/zh/doc_add_wechat_accessibility.md)
252+
- [个微 wkteam 接入](./docs/zh/doc_add_wechat_commercial.md)
250253

251254
## 四、WEB 前后端部署,零编程集成飞书微信
252255

@@ -326,7 +329,7 @@ reranker_model_path = "BAAI/bge-reranker-v2-minicpm-layerwise"
326329

327330
- 先下载 [bge-m3](https://huggingface.co/BAAI/bge-m3),然后把 [Visualized_m3.pth](https://huggingface.co/BAAI/bge-visualized/blob/main/Visualized_m3.pth) 放进 `bge-m3` 目录
328331
- FlagEmbedding 需要安装 master 最新版,我们做了 [bugfix](https://github.com/FlagOpen/FlagEmbedding/commit/3f84da0796d5badc3ad519870612f1f18ff0d1d3)[这里](https://github.com/FlagOpen/FlagEmbedding/blob/master/FlagEmbedding/visual/eva_clip/bpe_simple_vocab_16e6.txt.gz)可以下载 BGE 打包漏掉的 `bpe_simple_vocab_16e6.txt.gz`
329-
- 安装 [requirments-multimodal.txt](./requirements-multimodal.txt)
332+
- 安装 [requirements/multimodal.txt](./requirements/multimodal.txt)
330333

331334
运行 gradio 测试,图文检索效果见[这里](https://github.com/InternLM/HuixiangDou/pull/326).
332335

@@ -346,11 +349,11 @@ python3 tests/test_query_gradio.py
346349

347350
请阅读以下话题:
348351

349-
- [混合**知识图谱**和稠密检索提升精度](./docs/knowledge_graph_zh.md)
350-
- [参照 config-advanced.ini 配置提升效果](./docs/full_dev_zh.md)
352+
- [混合**知识图谱**和稠密检索提升精度](./docs/zh/doc_knowledge_graph.md)
353+
- [参照 config-advanced.ini 配置提升效果](./docs/zh/doc_full_dev.md)
351354
- [群聊场景指代消歧训练](./sft)
352-
- [使用 wkteam 微信接入,整合图片、公众号解析和指代消歧](./docs/add_wechat_commercial_zh.md)
353-
- [使用 rag.py 标注 SFT 训练数据](./docs/rag_annotate_sft_data_zh.md)
355+
- [使用 wkteam 微信接入,整合图片、公众号解析和指代消歧](./docs/zh/doc_add_wechat_commercial.md)
356+
- [使用 rag.py 标注 SFT 训练数据](./docs/zh/doc_rag_annotate_sft_data.md)
354357

355358
## **移动端**
356359

Diff for: config.ini

+1-1
Original file line numberDiff line numberDiff line change
@@ -209,4 +209,4 @@ introduction = "github https://github.com/InternLM/HuixiangDou 用户体验群"
209209
# github.com/tencent/ncnn contributors
210210
[frontend.wechat_wkteam.18356748488]
211211
name = "卷卷群"
212-
introduction = "ncnn contributors group"
212+
introduction = "ncnn contributors group"

Diff for: docs/en/.readthedocs.yaml

+17
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
version: 2
2+
3+
# Set the version of Python and other tools you might need
4+
build:
5+
os: ubuntu-22.04
6+
tools:
7+
python: "3.8"
8+
9+
formats:
10+
- epub
11+
12+
sphinx:
13+
configuration: docs/en/conf.py
14+
15+
python:
16+
install:
17+
- requirements: requirements/docs.txt

Diff for: docs/en/Makefile

+20
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
# Minimal makefile for Sphinx documentation
2+
#
3+
4+
# You can set these variables from the command line, and also
5+
# from the environment for the first two.
6+
SPHINXOPTS ?=
7+
SPHINXBUILD ?= sphinx-build
8+
SOURCEDIR = .
9+
BUILDDIR = _build
10+
11+
# Put it first so that "make" without argument is like "make help".
12+
help:
13+
@$(SPHINXBUILD) -M help "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O)
14+
15+
.PHONY: help Makefile
16+
17+
# Catch-all target: route all unknown targets to Sphinx using the new
18+
# "make mode" option. $(O) is meant as a shortcut for $(SPHINXOPTS).
19+
%: Makefile
20+
@$(SPHINXBUILD) -M $@ "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O)

Diff for: docs/en/_static/css/readthedocs.css

+62
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,62 @@
1+
.header-logo {
2+
background-image: url("../image/logo.svg");
3+
background-size: 444px 93px;
4+
height: 93px;
5+
width: 444px;
6+
}
7+
8+
@media screen and (min-width: 1100px) {
9+
.header-logo {
10+
top: -25px;
11+
}
12+
}
13+
14+
pre {
15+
white-space: pre;
16+
}
17+
18+
@media screen and (min-width: 2000px) {
19+
.pytorch-content-left {
20+
width: 1200px;
21+
margin-left: 30px;
22+
}
23+
article.pytorch-article {
24+
max-width: 1200px;
25+
}
26+
.pytorch-breadcrumbs-wrapper {
27+
width: 1200px;
28+
}
29+
.pytorch-right-menu.scrolling-fixed {
30+
position: fixed;
31+
top: 45px;
32+
left: 1580px;
33+
}
34+
}
35+
36+
37+
article.pytorch-article section code {
38+
padding: .2em .4em;
39+
background-color: #f3f4f7;
40+
border-radius: 5px;
41+
}
42+
43+
/* Disable the change in tables */
44+
article.pytorch-article section table code {
45+
padding: unset;
46+
background-color: unset;
47+
border-radius: unset;
48+
}
49+
50+
table.autosummary td {
51+
width: 50%
52+
}
53+
54+
img.align-center {
55+
display: block;
56+
margin-left: auto;
57+
margin-right: auto;
58+
}
59+
60+
article.pytorch-article p.rubric {
61+
font-weight: bold;
62+
}

0 commit comments

Comments
 (0)