LUO huan huan commited on
Commit
c46dd12
·
1 Parent(s): cf3cdcd

add file README_tzh.md (#4513)

Browse files

### What problem does this PR solve?

_Briefly describe what this PR aims to solve. Include background context
that will help reviewers understand the purpose of the PR._

### Type of change

- [x] Other (please describe):

Files changed (1) hide show
  1. README_tzh.md +342 -0
README_tzh.md ADDED
@@ -0,0 +1,342 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <div align="center">
2
+ <a href="https://demo.ragflow.io/">
3
+ <img src="web/src/assets/logo-with-text.png" width="350" alt="ragflow logo">
4
+ </a>
5
+ </div>
6
+
7
+ <p align="center">
8
+ <a href="./README.md">English</a> |
9
+ <a href="./README_zh.md">简体中文</a> |
10
+ <a href="./README_ja.md">日本語</a> |
11
+ <a href="./README_ko.md">한국어</a> |
12
+ <a href="./README_id.md">Bahasa Indonesia</a>
13
+ </p>
14
+
15
+ <p align="center">
16
+ <a href="https://x.com/intent/follow?screen_name=infiniflowai" target="_blank">
17
+ <img src="https://img.shields.io/twitter/follow/infiniflow?logo=X&color=%20%23f5f5f5" alt="follow on X(Twitter)">
18
+ </a>
19
+ <a href="https://demo.ragflow.io" target="_blank">
20
+ <img alt="Static Badge" src="https://img.shields.io/badge/Online-Demo-4e6b99">
21
+ </a>
22
+ <a href="https://hub.docker.com/r/infiniflow/ragflow" target="_blank">
23
+ <img src="https://img.shields.io/badge/docker_pull-ragflow:v0.15.1-brightgreen" alt="docker pull infiniflow/ragflow:v0.15.1">
24
+ </a>
25
+ <a href="https://github.com/infiniflow/ragflow/releases/latest">
26
+ <img src="https://img.shields.io/github/v/release/infiniflow/ragflow?color=blue&label=Latest%20Release" alt="Latest Release">
27
+ </a>
28
+ <a href="https://github.com/infiniflow/ragflow/blob/main/LICENSE">
29
+ <img height="21" src="https://img.shields.io/badge/License-Apache--2.0-ffffff?labelColor=d4eaf7&color=2e6cc4" alt="license">
30
+ </a>
31
+ </p>
32
+
33
+
34
+ <h4 align="center">
35
+ <a href="https://ragflow.io/docs/dev/">Document</a> |
36
+ <a href="https://github.com/infiniflow/ragflow/issues/4214">Roadmap</a> |
37
+ <a href="https://twitter.com/infiniflowai">Twitter</a> |
38
+ <a href="https://discord.gg/4XxujFgUN7">Discord</a> |
39
+ <a href="https://demo.ragflow.io">Demo</a>
40
+ </h4>
41
+
42
+ ## 💡 RAGFlow 是什麼?
43
+
44
+ [RAGFlow](https://ragflow.io/) 是一款基於深度文件理解所建構的開源 RAG(Retrieval-Augmented Generation)引擎。 RAGFlow 可以為各種規模的企業及個人提供一套精簡的 RAG 工作流程,結合大語言模型(LLM)針對用戶各類不同的複雜格式數據提供可靠的問答以及有理有據的引用。
45
+
46
+ ## 🎮 Demo 試用
47
+
48
+ 請登入網址 [https://demo.ragflow.io](https://demo.ragflow.io) 試用 demo。
49
+ <div align="center" style="margin-top:20px;margin-bottom:20px;">
50
+ <img src="https://github.com/infiniflow/ragflow/assets/7248/2f6baa3e-1092-4f11-866d-36f6a9d075e5" width="1200"/>
51
+ <img src="https://github.com/user-attachments/assets/504bbbf1-c9f7-4d83-8cc5-e9cb63c26db6" width="1200"/>
52
+ </div>
53
+
54
+
55
+ ## 🔥 近期更新
56
+
57
+ - 2024-12-18 升級了 Deepdoc 的文檔佈局分析模型。
58
+ - 2024-12-04 支援知識庫的 Pagerank 分數。
59
+ - 2024-11-22 完善了 Agent 中的變數定義和使用。
60
+ - 2024-11-01 對解析後的 chunk 加入關鍵字抽取和相關問題產生以提高回想的準確度。
61
+ - 2024-08-22 支援用 RAG 技術實現從自然語言到 SQL 語句的轉換。
62
+ - 2024-08-02 支持 GraphRAG 啟發於 [graphrag](https://github.com/microsoft/graphrag) 和心智圖。
63
+
64
+ ## 🎉 關注項目
65
+ ⭐️點擊右上角的 Star 追蹤RAGFlow,可以取得最新發布的即時通知 !🌟
66
+ <div align="center" style="margin-top:20px;margin-bottom:20px;">
67
+ <img src="https://github.com/user-attachments/assets/18c9707e-b8aa-4caf-a154-037089c105ba" width="1200"/>
68
+ </div>
69
+
70
+
71
+ ## 🌟 主要功能
72
+
73
+ ### 🍭 **"Quality in, quality out"**
74
+
75
+ - 基於[深度文件理解](./deepdoc/README.md),能夠從各類複雜格式的非結構化資料中提取真知灼見。
76
+ - 真正在無限上下文(token)的場景下快速完成大海撈針測試。
77
+
78
+ ### 🍱 **基於模板的文字切片**
79
+
80
+ - 不只是智能,更重要的是可控可解釋。
81
+ - 多種文字範本可供選擇
82
+
83
+ ### 🌱 **有理有據、最大程度降低幻覺(hallucination)**
84
+
85
+ - 文字切片過程視覺化,支援手動調整。
86
+ - 有理有據:答案提供關鍵引用的快照並支持追根溯源。
87
+
88
+ ### 🍔 **相容各類異質資料來源**
89
+
90
+ - 支援豐富的文件類型,包括 Word 文件、PPT、excel 表格、txt 檔案、圖片、PDF、影印件、影印件、結構化資料、網頁等。
91
+
92
+ ### 🛀 **全程無憂、自動化的 RAG 工作流程**
93
+
94
+ - 全面優化的 RAG 工作流程可以支援從個人應用乃至超大型企業的各類生態系統。
95
+ - 大語言模型 LLM 以及向量模型皆支援配置。
96
+ - 基於多路召回、融合重排序。
97
+ - 提供易用的 API,可輕鬆整合到各類企業系統。
98
+
99
+ ## 🔎 系統架構
100
+
101
+ <div align="center" style="margin-top:20px;margin-bottom:20px;">
102
+ <img src="https://github.com/infiniflow/ragflow/assets/12318111/d6ac5664-c237-4200-a7c2-a4a00691b485" width="1000"/>
103
+ </div>
104
+
105
+ ## 🎬快速開始
106
+
107
+ ### 📝 前提條件
108
+
109
+ - CPU >= 4 核
110
+ - RAM >= 16 GB
111
+ - Disk >= 50 GB
112
+ - Docker >= 24.0.0 & Docker Compose >= v2.26.1
113
+ > 如果你並沒有在本機安裝 Docker(Windows、Mac,或 Linux), 可以參考文件 [Install Docker Engine](https://docs.docker.com/engine/install/) 自行安裝。
114
+
115
+ ### 🚀 啟動伺���器
116
+
117
+ 1. 確保 `vm.max_map_count` 不小於 262144:
118
+
119
+ > 如需確認 `vm.max_map_count` 的大小:
120
+ >
121
+ > ```bash
122
+ > $ sysctl vm.max_map_count
123
+ > ```
124
+ >
125
+ > 如果 `vm.max_map_count` 的值小於 262144,可以進行重設:
126
+ >
127
+ > ```bash
128
+ > # 這裡我們設為 262144:
129
+ > $ sudo sysctl -w vm.max_map_count=262144
130
+ > ```
131
+ >
132
+ > 你的改動會在下次系統重新啟動時被重置。如果希望做永久改動,還需要在 **/etc/sysctl.conf** 檔案裡把 `vm.max_map_count` 的值再相應更新一遍:
133
+ >
134
+ > ```bash
135
+ > vm.max_map_count=262144
136
+ > ```
137
+
138
+ 2. 克隆倉庫:
139
+
140
+ ```bash
141
+ $ git clone https://github.com/infiniflow/ragflow.git
142
+ ```
143
+
144
+ 3. 進入 **docker** 資料夾,利用事先編譯好的 Docker 映像啟動伺服器:
145
+
146
+ > 執行以下指令會自動下載 RAGFlow slim Docker 映像 `v0.15.1-slim`。請參考下表查看不同 Docker 發行版的說明。如需下載不同於 `v0.15.1-slim` 的 Docker 映像,請在執行 `docker compose` 啟動服務之前先更新 **docker/.env** 檔案內的 `RAGFLOW_IMAGE` 變數。例如,你可以透過設定 `RAGFLOW_IMAGE=infiniflow/ragflow:v0.15.1` 來下載 RAGFlow 鏡像的 `v0.15.1` 完整發行版。
147
+ ```bash
148
+ $ cd ragflow
149
+ $ docker compose -f docker/docker-compose.yml up -d
150
+ ```
151
+
152
+ | RAGFlow image tag | Image size (GB) | Has embedding models? | Stable? |
153
+ | ----------------- | --------------- | --------------------- | ------------------------ |
154
+ | v0.15.1 | &approx;9 | :heavy_check_mark: | Stable release |
155
+ | v0.15.1-slim | &approx;2 | ❌ | Stable release |
156
+ | nightly | &approx;9 | :heavy_check_mark: | *Unstable* nightly build |
157
+ | nightly-slim | &approx;2 | ❌ | *Unstable* nightly build |
158
+
159
+ > [!TIP]
160
+ > 如果你遇到 Docker 映像檔拉不下來的問題,可以在 **docker/.env** 檔案內根據變數 `RAGFLOW_IMAGE` 的註解提示選擇華為雲或阿里雲的對應映像。
161
+ > - 華為雲鏡像名:`swr.cn-north-4.myhuaweicloud.com/infiniflow/ragflow`
162
+ > - 阿里雲鏡像名:`registry.cn-hangzhou.aliyuncs.com/infiniflow/ragflow`
163
+
164
+ 4. 伺服器啟動成功後再次確認伺服器狀態:
165
+
166
+ ```bash
167
+ $ docker logs -f ragflow-server
168
+ ```
169
+
170
+ _出現以下介面提示說明伺服器啟動成功:_
171
+
172
+ ```bash
173
+ ____ ___ ______ ______ __
174
+ / __ \ / | / ____// ____// /____ _ __
175
+ / /_/ // /| | / / __ / /_ / // __ \| | /| / /
176
+ / _, _// ___ |/ /_/ // __/ / // /_/ /| |/ |/ /
177
+ /_/ |_|/_/ |_|\____//_/ /_/ \____/ |__/|__/
178
+
179
+ * Running on all addresses (0.0.0.0)
180
+ * Running on http://127.0.0.1:9380
181
+ * Running on http://x.x.x.x:9380
182
+ INFO:werkzeug:Press CTRL+C to quit
183
+ ```
184
+ > 如果您跳過這一步驟系統確認步驟就登入 RAGFlow,你的瀏覽器有可能會提示 `network anormal` 或 `網路異常`,因為 RAGFlow 可能並未完全啟動成功。
185
+
186
+ 5. 在你的瀏覽器中輸入你的伺服器對應的 IP 位址並登入 RAGFlow。
187
+ > 上面這個範例中,您只需輸入 http://IP_OF_YOUR_MACHINE 即可:未改動過設定則無需輸入連接埠(預設的 HTTP 服務連接埠 80)。
188
+ 6. 在 [service_conf.yaml.template](./docker/service_conf.yaml.template) 檔案的 `user_default_llm` 欄位設定 LLM factory,並在 `API_KEY` 欄填入和你選擇的大模型相對應的 API key。
189
+
190
+ > 詳見 [llm_api_key_setup](https://ragflow.io/docs/dev/llm_api_key_setup)。
191
+
192
+ _好戲開始,接著奏樂接著舞! _
193
+
194
+ ## 🔧 系統配置
195
+
196
+ 系統配置涉及以下三份文件:
197
+
198
+ - [.env](./docker/.env):存放一些基本的系統環境變量,例如 `SVR_HTTP_PORT`、`MYSQL_PASSWORD`、`MINIO_PASSWORD` 等。
199
+ - [service_conf.yaml.template](./docker/service_conf.yaml.template):設定各類別後台服務。
200
+ - [docker-compose.yml](./docker/docker-compose.yml): 系統依賴該檔案完成啟動。
201
+
202
+ 請務必確保 [.env](./docker/.env) 檔案中的變數設定與 [service_conf.yaml.template](./docker/service_conf.yaml.template) 檔案中的設定保持一致!
203
+
204
+ 如果無法存取映像網站 hub.docker.com 或模型網站 huggingface.co,請依照 [.env](./docker/.env) 註解修改 `RAGFLOW_IMAGE` 和 `HF_ENDPOINT`。
205
+
206
+ > [./docker/README](./docker/README.md) 解釋了 [service_conf.yaml.template](./docker/service_conf.yaml.template) 用到的環境變數設定和服務配置。
207
+
208
+ 如需更新預設的HTTP 服務連接埠(80), 可以在[docker-compose.yml](./docker/docker-compose.yml) 檔案中將配置`80:80` 改為`<YOUR_SERVING_PORT>:80` 。
209
+
210
+ > 所有系統配置都需要透過系統重新啟動生效:
211
+ >
212
+ > ```bash
213
+ > $ docker compose -f docker/docker-compose.yml up -d
214
+ > ```
215
+
216
+ ###把文檔引擎從 Elasticsearch 切換成為 Infinity
217
+
218
+ RAGFlow 預設使用 Elasticsearch 儲存文字和向量資料. 如果要切換為 [Infinity](https://github.com/infiniflow/infinity/), 可以按照下面步驟進行:
219
+
220
+ 1. 停止所有容器運作:
221
+
222
+ ```bash
223
+ $ docker compose -f docker/docker-compose.yml down -v
224
+ ```
225
+
226
+ 2. 設定 **docker/.env** 目錄中的 `DOC_ENGINE` 為 `infinity`.
227
+
228
+ 3. 啟動容器:
229
+
230
+ ```bash
231
+ $ docker compose -f docker/docker-compose.yml up -d
232
+ ```
233
+
234
+ > [!WARNING]
235
+ > Infinity 目前官方並未正式支援在 Linux/arm64 架構下的機器上運行.
236
+
237
+
238
+ ## 🔧 原始碼編譯 Docker 映像(不含 embedding 模型)
239
+
240
+ 本 Docker 映像大小約 2 GB 左右並且依賴外部的大模型和 embedding 服務。
241
+
242
+ ```bash
243
+ git clone https://github.com/infiniflow/ragflow.git
244
+ cd ragflow/
245
+ docker build --build-arg LIGHTEN=1 --build-arg NEED_MIRROR=1 -f Dockerfile -t infiniflow/ragflow:nightly-slim .
246
+ ```
247
+
248
+ ## 🔧 原始碼編譯 Docker 映像(包含 embedding 模型)
249
+
250
+ 本 Docker 大小約 9 GB 左右。由於已包含 embedding 模型,所以只需依賴外部的大模型服務即可。
251
+
252
+ ```bash
253
+ git clone https://github.com/infiniflow/ragflow.git
254
+ cd ragflow/
255
+ docker build --build-arg NEED_MIRROR=1 -f Dockerfile -t infiniflow/ragflow:nightly .
256
+ ```
257
+
258
+ ## 🔨 以原始碼啟動服務
259
+
260
+ 1. 安裝 uv。如已安裝,可跳過此步驟:
261
+ ```bash
262
+ pipx install uv
263
+ export UV_INDEX=https://pypi.tuna.tsinghua.edu.cn/simple
264
+ ```
265
+
266
+ 2. 下載原始碼並安裝 Python 依賴:
267
+ ```bash
268
+ git clone https://github.com/infiniflow/ragflow.git
269
+ cd ragflow/
270
+ uv sync --python 3.10 --all-extras # install RAGFlow dependent python modules
271
+ ```
272
+
273
+ 3. 透過 Docker Compose 啟動依賴的服務(MinIO, Elasticsearch, Redis, and MySQL):
274
+ ```bash
275
+ docker compose -f docker/docker-compose-base.yml up -d
276
+ ```
277
+
278
+ 在 `/etc/hosts` 中加入以下程式碼,將 **conf/service_conf.yaml** 檔案中的所有 host 位址都解析為 `127.0.0.1`:
279
+ ```
280
+ 127.0.0.1 es01 infinity mysql minio redis
281
+ ```
282
+
283
+ 4. 如果無法存取 HuggingFace,可以把環境變數 `HF_ENDPOINT` 設為對應的鏡像網站:
284
+
285
+ ```bash
286
+ export HF_ENDPOINT=https://hf-mirror.com
287
+ ```
288
+
289
+ 5.啟動後端服務:
290
+ 『`bash
291
+ source .venv/bin/activate
292
+ export PYTHONPATH=$(pwd)
293
+ bash docker/launch_backend_service.sh
294
+ ```
295
+
296
+ 6. 安裝前端依賴:
297
+ 『`bash
298
+ cd web
299
+ npm install
300
+ ```
301
+ 7. 啟動前端服務:
302
+ 『`bash
303
+ npm run dev
304
+ ```
305
+
306
+ 以下界面說明系統已成功啟動:_
307
+
308
+ ![](https://github.com/user-attachments/assets/0daf462c-a24d-4496-a66f-92533534e187)
309
+
310
+ ## 📚 技術文檔
311
+
312
+ - [Quickstart](https://ragflow.io/docs/dev/)
313
+ - [User guide](https://ragflow.io/docs/dev/category/guides)
314
+ - [References](https://ragflow.io/docs/dev/category/references)
315
+ - [FAQ](https://ragflow.io/docs/dev/faq)
316
+
317
+ ## 📜 路線圖
318
+
319
+ 詳見 [RAGFlow Roadmap 2025](https://github.com/infiniflow/ragflow/issues/4214) 。
320
+
321
+ ## 🏄 開源社群
322
+
323
+ - [Discord](https://discord.gg/4XxujFgUN7)
324
+ - [Twitter](https://twitter.com/infiniflowai)
325
+ - [GitHub Discussions](https://github.com/orgs/infiniflow/discussions)
326
+
327
+ ## 🙌 貢獻指南
328
+
329
+ RAGFlow 只有透過開源協作才能蓬勃發展。秉持這項精神,我們歡迎來自社區的各種貢獻。如果您有意參與其中,請查閱我們的 [貢獻者指南](./CONTRIBUTING.md) 。
330
+
331
+ ## 🤝 商務合作
332
+
333
+ - [預約諮詢](https://aao615odquw.feishu.cn/share/base/form/shrcnjw7QleretCLqh1nuPo1xxh)
334
+
335
+ ## 👥 加入社區
336
+
337
+ 掃二維碼加入 RAGFlow 小助手,進 RAGFlow 交流群。
338
+
339
+ <p align="center">
340
+ <img src="https://github.com/infiniflow/ragflow/assets/7248/bccf284f-46f2-4445-9809-8f1030fb7585" width=50% height=50%>
341
+ </p>
342
+