mirror of
https://github.com/TeamWiseFlow/wiseflow.git
synced 2025-02-02 18:28:46 +08:00
update README
This commit is contained in:
parent
6b85b90429
commit
10cda47778
163
README.md
163
README.md
@ -2,7 +2,7 @@
|
||||
|
||||
**[中文](README_CN.md) | [日本語](README_JP.md) | [Français](README_FR.md) | [Deutsch](README_DE.md)**
|
||||
|
||||
**Wiseflow** is an agile information mining tool that extracts concise messages from various sources such as websites, WeChat official accounts, social platforms, etc. It automatically categorizes and uploads them to the database.
|
||||
**Wiseflow** is an agile information extraction tool that can refine information from various sources such as websites, WeChat Public Accounts, and social media platforms based on predefined focus points, automatically categorize tags, and upload to the database.
|
||||
|
||||
We are not short of information; what we need is to filter out the noise from the vast amount of information so that valuable information stands out!
|
||||
|
||||
@ -38,127 +38,142 @@ https://github.com/TeamWiseFlow/wiseflow/assets/96130569/bd4b2091-c02d-4457-9ec6
|
||||
😄 **Wiseflow is particularly good at extracting information from WeChat official account articles**; for this, we have configured a dedicated mp article parser!
|
||||
|
||||
|
||||
- 🌍 **Can be Integrated into Any RAG Project**
|
||||
Can serve as a dynamic knowledge base for any RAG project, without needing to understand the code of Wiseflow, just operate through database reads!
|
||||
- 🌍 **Can be Integrated into Any Agent Project**
|
||||
Can serve as a dynamic knowledge base for any Agent project, without needing to understand the code of Wiseflow, just operate through database reads!
|
||||
|
||||
|
||||
- 📦 **Popular Pocketbase Database**
|
||||
The database and interface use PocketBase. Besides the web interface, APIs for Go/Javascript/Python languages are available.
|
||||
The database and interface use PocketBase. Besides the web interface, SDK for Go/Javascript/Python languages are available.
|
||||
|
||||
- Go: https://pocketbase.io/docs/go-overview/
|
||||
- Javascript: https://pocketbase.io/docs/js-overview/
|
||||
- Python: https://github.com/vaphes/pocketbase
|
||||
|
||||
## 🔄 What are the Differences and Connections between Wiseflow and Common Crawlers, RAG Projects?
|
||||
## 🔄 What are the Differences and Connections between Wiseflow and Common Crawlers, LLM-Agent Projects?
|
||||
|
||||
| Feature | Wiseflow | Crawler / Scraper | RAG Projects |
|
||||
|-----------------|--------------------------------------|------------------------------------------|--------------------------|
|
||||
| **Main Problem Solved** | Data processing (filtering, extraction, labeling) | Raw data acquisition | Downstream applications |
|
||||
| Feature | Wiseflow | Crawler / Scraper | LLM-Agent |
|
||||
|-----------------|--------------------------------------|------------------------------------------|----------------------------------------------------|
|
||||
| **Main Problem Solved** | Data processing (filtering, extraction, labeling) | Raw data acquisition | Downstream applications |
|
||||
| **Connection** | | Can be integrated into Wiseflow for more powerful raw data acquisition | Can integrate Wiseflow as a dynamic knowledge base |
|
||||
|
||||
## 📥 Installation and Usage
|
||||
|
||||
WiseFlow has virtually no hardware requirements, with minimal system overhead, and does not need a discrete GPU or CUDA (when using online LLM services).
|
||||
WiseFlow has virtually no hardware requirements, with minimal system overhead, and does not need GPU or CUDA (when using online LLM services).
|
||||
|
||||
1. **Clone the Code Repository**
|
||||
1. **Clone the Repository**
|
||||
|
||||
😄 Liking and forking is a good habit
|
||||
😄 Starring and forking are good habits
|
||||
|
||||
```bash
|
||||
git clone https://github.com/TeamWiseFlow/wiseflow.git
|
||||
cd wiseflow
|
||||
|
||||
```
|
||||
|
||||
2. **Highly Recommended: Use Docker**
|
||||
|
||||
**For users in China, please configure your network properly or specify a Docker Hub mirror**
|
||||
|
||||
```bash
|
||||
docker compose up
|
||||
```
|
||||
You may modify `compose.yaml` as needed.
|
||||
|
||||
**Note:**
|
||||
- Run the above command in the root directory of the wiseflow repository.
|
||||
- Before running, create and edit a `.env` file in the same directory as the Dockerfile (root directory of the wiseflow repository). Refer to `env_sample` for the `.env` file.
|
||||
- The first time you run the Docker container, an error might occur because you haven't created an admin account for the pb repository.
|
||||
|
||||
At this point, keep the container running, open `http://127.0.0.1:8090/_/` in your browser, and follow the instructions to create an admin account (make sure to use an email). Then enter the created admin email (again, make sure it's an email) and password into the `.env` file, and restart the container.
|
||||
|
||||
_If you want to change the container's timezone and language [which will determine the prompt language, but has little effect on the results], run the image with the following command_
|
||||
|
||||
```bash
|
||||
docker run -e LANG=zh_CN.UTF-8 -e LC_CTYPE=zh_CN.UTF-8 your_image
|
||||
```
|
||||
|
||||
3. **[Alternative] Run Directly with Python**
|
||||
|
||||
```bash
|
||||
conda create -n wiseflow python=3.10
|
||||
conda activate wiseflow
|
||||
cd core
|
||||
pip install -r requirement.txt
|
||||
```
|
||||
|
||||
You can start `pb`, `task`, and `backend` using the scripts in the `core/scripts` directory (move the script files to the `core` directory).
|
||||
|
||||
**Note:**
|
||||
- Always start `pb` first. `task` and `backend` are independent processes and can be started in any order or only one of them can be started as needed.
|
||||
- First, download the PocketBase client corresponding to your device from [here](https://pocketbase.io/docs/) and place it in the `/core/pb` directory.
|
||||
- For issues with running `pb` (including errors on the first run, etc.), refer to [`core/pb/README.md`](/core/pb/README.md).
|
||||
- Before using, create and edit the `.env` file and place it in the root directory of the wiseflow code repository (one level above the `core` directory). The `.env` file can reference `env_sample`. Detailed configuration instructions are below.
|
||||
- It is highly recommended to use the Docker approach, see the fifth point below.
|
||||
You can then start pb, task, and backend individually using the scripts in core/scripts (move the script files to the core directory).
|
||||
|
||||
Note:
|
||||
- Start pb first; task and backend are independent processes, and the order doesn't matter. You can start any one of them as needed.
|
||||
- Download the pocketbase client suitable for your device from https://pocketbase.io/docs/ and place it in the /core/pb directory.
|
||||
- For issues with pb (including first-run errors), refer to [core/pb/README.md](/core/pb/README.md).
|
||||
- Before use, create and edit a `.env` file and place it in the root directory of the wiseflow repository (the directory above core). Refer to `env_sample` for the `.env` file, and see below for detailed configuration.
|
||||
|
||||
|
||||
📚 For developers, see [/core/README.md](/core/README.md) for more.
|
||||
📚 For developers, see [/core/README.md](/core/README.md) for more information.
|
||||
|
||||
Access data obtained via PocketBase:
|
||||
- http://127.0.0.1:8090/_/ - Admin dashboard UI
|
||||
- http://127.0.0.1:8090/api/ - REST API
|
||||
Access data via pocketbase:
|
||||
- http://127.0.0.1:8090/_/ - Admin dashboard UI
|
||||
- http://127.0.0.1:8090/api/ - REST API
|
||||
|
||||
|
||||
2. **Configuration**
|
||||
4. **Configuration**
|
||||
|
||||
Copy `env_sample` in the directory and rename it to `.env`, then fill in your configuration information (such as LLM service tokens) as follows:
|
||||
Copy `env_sample` from the directory and rename it to `.env`, then fill in your configuration information (such as LLM service tokens) as follows:
|
||||
|
||||
- LLM_API_KEY # API key for large model inference service (if using OpenAI service, you can omit this by deleting this entry)
|
||||
- LLM_API_BASE # Base URL for the OpenAI-compatible model service (omit this if using OpenAI service)
|
||||
- WS_LOG="verbose" # Enable debug logging, delete if not needed
|
||||
- GET_INFO_MODEL # Model for information extraction and tagging tasks, default is gpt-3.5-turbo
|
||||
- REWRITE_MODEL # Model for near-duplicate information merging and rewriting tasks, default is gpt-3.5-turbo
|
||||
- HTML_PARSE_MODEL # Web page parsing model (smartly enabled when GNE algorithm performs poorly), default is gpt-3.5-turbo
|
||||
- PROJECT_DIR # Location for storing data, cache and log files, relative to the code repository; default is the code repository itself if not specified
|
||||
- PB_API_AUTH='email|password' # Admin email and password for the pb database (**it can be a fictitious one but must be an email**)
|
||||
- PB_API_BASE # Not required for normal use, only needed if not using the default local PocketBase interface (port 8090)
|
||||
- LLM_API_KEY # API key for large language model inference services
|
||||
- LLM_API_BASE # This project relies on the OpenAI SDK. Configure this if your model service supports OpenAI's API. If using OpenAI's service, you can omit this.
|
||||
- WS_LOG="verbose" # Set to enable debug observation. Delete if not needed.
|
||||
- GET_INFO_MODEL # Model for information extraction and tag matching tasks, default is gpt-3.5-turbo
|
||||
- REWRITE_MODEL # Model for approximate information merging and rewriting tasks, default is gpt-3.5-turbo
|
||||
- HTML_PARSE_MODEL # Model for web page parsing (intelligently enabled if the GNE algorithm performs poorly), default is gpt-3.5-turbo
|
||||
- PROJECT_DIR # Storage location for data, cache, and log files, relative to the repository. Default is within the repository.
|
||||
- PB_API_AUTH='email|password' # Email and password for the pb database admin (must be an email, can be a fictitious one)
|
||||
- PB_API_BASE # Typically unnecessary. Only configure if you're not using the default local pocketbase interface (8090).
|
||||
|
||||
|
||||
3. **Model Recommendation**
|
||||
5. **Model Recommendations**
|
||||
|
||||
After extensive testing (in both Chinese and English tasks), for comprehensive effect and cost, we recommend the following for **GET_INFO_MODEL**, **REWRITE_MODEL**, and **HTML_PARSE_MODEL**: **"zhipuai/glm4-9B-chat"**, **"alibaba/Qwen2-7B-Instruct"**, **"alibaba/Qwen2-7B-Instruct"**.
|
||||
Based on extensive testing (for both Chinese and English tasks), we recommend **"zhipuai/glm4-9B-chat"** for **GET_INFO_MODEL**, **"alibaba/Qwen2-7B-Instruct"** for **REWRITE_MODEL**, and **"alibaba/Qwen2-7B-Instruct"** for **HTML_PARSE_MODEL**.
|
||||
|
||||
These models fit the project well, with stable command adherence and excellent generation effects. The related prompts for this project are also optimized for these three models. (**HTML_PARSE_MODEL** can also use **"01-ai/Yi-1.5-9B-Chat"**, which also performs excellently in tests)
|
||||
|
||||
⚠️ We strongly recommend using **SiliconFlow**'s online inference service for lower costs, faster speeds, and higher free quotas! ⚠️
|
||||
|
||||
SiliconFlow online inference service is compatible with the OpenAI SDK and provides open-source services for the above three models. Just configure LLM_API_BASE as "https://api.siliconflow.cn/v1" and set up LLM_API_KEY to use it.
|
||||
|
||||
😄 Or you may prefer to use my [invitation link](https://cloud.siliconflow.cn?referrer=clx6wrtca00045766ahvexw92), so I can also get more token rewards 😄
|
||||
These models are well-suited for this project, with stable adherence to instructions and excellent generation quality. The project's prompts have been optimized for these three models. (**HTML_PARSE_MODEL** can also use **"01-ai/Yi-1.5-9B-Chat"**, which has been tested to perform excellently.)
|
||||
|
||||
|
||||
4. **Local Deployment**
|
||||
⚠️ We highly recommend using **SiliconFlow**'s online inference service for lower costs, faster speeds, and higher free quotas! ⚠️
|
||||
|
||||
As you can see, this project uses 7B/9B LLMs and does not require any vector models, which means you can fully deploy this project locally with just an RTX 3090 (24GB VRAM).
|
||||
SiliconFlow's online inference service is compatible with the OpenAI SDK and provides open-source services for the above three models. Simply configure `LLM_API_BASE` to "https://api.siliconflow.cn/v1" and set `LLM_API_KEY` to use it.
|
||||
|
||||
Ensure your local LLM service is compatible with the OpenAI SDK, and configure LLM_API_BASE accordingly.
|
||||
😄 Alternatively, you can use my [invitation link](https://cloud.siliconflow.cn?referrer=clx6wrtca00045766ahvexw92), which also rewards me with more tokens 😄
|
||||
|
||||
|
||||
5. **Run the Program**
|
||||
6. **Focus Points and Scheduled Source Scanning**
|
||||
|
||||
```bash
|
||||
docker compose up
|
||||
```
|
||||
**Note:**
|
||||
- Run the above commands in the root directory of the wiseflow code repository.
|
||||
- Before running, create and edit the `.env` file in the same directory as the Dockerfile (root directory of the wiseflow code repository). The `.env` file can reference `env_sample`.
|
||||
- You may encounter errors when running the Docker container for the first time. This is normal because you have not yet created an admin account for the `pb` repository.
|
||||
After starting the program, open the pocketbase Admin dashboard UI (http://127.0.0.1:8090/_/)
|
||||
|
||||
At this point, keep the container running, open `http://127.0.0.1:8090/_/` in your browser, and follow the instructions to create an admin account (make sure to use an email). Then, fill in the created admin email (again, make sure to use an email) and password in the `.env` file, and restart the container.
|
||||
6.1 Open the **tags form**
|
||||
|
||||
Use this form to specify your focus points. The LLM will extract, filter, and classify information based on these.
|
||||
|
||||
Tags field description:
|
||||
|
||||
- name, Description of the focus point. **Note: Be specific.** Good example: `Trends in US-China competition`. Bad example: `International situation`.
|
||||
- activated, Whether activated. If deactivated, the focus point will be ignored. It can be reactivated later. Activation and deactivation don't require a Docker container restart and will update in the next scheduled task.
|
||||
|
||||
6.2 Open the **sites form**
|
||||
|
||||
Use this form to specify custom sources. The system will start background tasks to scan, parse, and analyze these sources locally.
|
||||
|
||||
Sites field description:
|
||||
|
||||
- url, URL of the source. Provide a URL to the list page rather than a specific article page.
|
||||
- per_hours, Scan frequency in hours, as an integer (range 1-24; we recommend no more than once a day, i.e., set to 24).
|
||||
- activated, Whether activated. If deactivated, the source will be ignored. It can be reactivated later. Activation and deactivation don't require a Docker container restart and will update in the next scheduled task.
|
||||
|
||||
|
||||
6. **Adding Scheduled Source Scanning**
|
||||
7. **Local Deployment**
|
||||
|
||||
After starting the program, open the PocketBase Admin dashboard UI at [http://127.0.0.1:8090/_/](http://127.0.0.1:8090/_/)
|
||||
As you can see, this project uses 7B/9B LLMs and does not require any vector models, which means you only need a single RTX 3090 (24GB VRAM) to fully deploy this project locally.
|
||||
|
||||
6.1 Open the **tags form**
|
||||
|
||||
This form allows you to specify your points of interest. The LLM will refine, filter, and categorize information accordingly.
|
||||
|
||||
**Tags field description:**
|
||||
- `name`: Description of the point of interest. **Note: Be specific**. A good example is `Trends in US-China competition`; a poor example is `International situation`.
|
||||
- `activated`: Whether the tag is activated. If deactivated, this point of interest will be ignored. It can be toggled on and off without restarting the Docker container; updates will be applied at the next scheduled task.
|
||||
|
||||
6.2 Open the **sites form**
|
||||
|
||||
This form allows you to specify custom information sources. The system will start background scheduled tasks to scan, parse, and analyze these sources locally.
|
||||
|
||||
**Sites field description:**
|
||||
- url: The URL of the source. The source does not need to specify the specific article page, just the article list page.
|
||||
- per_hours: Scanning frequency, in hours, integer type (range 1~24; we recommend a scanning frequency of no more than once per day, i.e., set to 24).
|
||||
- activated: Whether to activate. If turned off, the source will be ignored; it can be turned on again later. Turning on and off does not require restarting the Docker container and will be updated at the next scheduled task.
|
||||
Ensure your local LLM service is compatible with the OpenAI SDK and configure `LLM_API_BASE` accordingly.
|
||||
|
||||
|
||||
## 🛡️ License
|
||||
|
127
README_CN.md
127
README_CN.md
@ -2,7 +2,7 @@
|
||||
|
||||
**[English](README.md) | [日本語](README_JP.md) | [Français](README_FR.md) | [Deutsch](README_DE.md)**
|
||||
|
||||
**首席情报官**(Wiseflow)是一个敏捷的信息挖掘工具,可以从网站、微信公众号、社交平台等各种信息源中提炼简洁的讯息,自动做标签归类并上传数据库。
|
||||
**首席情报官**(Wiseflow)是一个敏捷的信息挖掘工具,可以从网站、微信公众号、社交平台等各种信息源中按设定的关注点提炼讯息,自动做标签归类并上传数据库。
|
||||
|
||||
我们缺的其实不是信息,我们需要的是从海量信息中过滤噪音,从而让有价值的信息显露出来!
|
||||
|
||||
@ -36,27 +36,27 @@ https://github.com/TeamWiseFlow/wiseflow/assets/96130569/bd4b2091-c02d-4457-9ec6
|
||||
😄 **WiseFlow尤其擅长从微信公众号文章中提取信息**,为此我们配置了mp article专属解析器!
|
||||
|
||||
|
||||
- 🌍 **可以被整合至任意RAG项目**
|
||||
可以作为任意 RAG 类项目的动态知识库,无需了解wiseflow的代码,只需要与数据库进行读取操作即可!
|
||||
- 🌍 **可以被整合至任意Agent项目**
|
||||
可以作为任意 Agent 项目的动态知识库,无需了解wiseflow的代码,只需要与数据库进行读取操作即可!
|
||||
|
||||
|
||||
- 📦 **流行的 Pocketbase 数据库**
|
||||
数据库和界面使用 PocketBase,除了 Web 界面外,目前已有 Go/Javascript/Python 等语言的API。
|
||||
数据库和界面使用 PocketBase,除了 Web 界面外,目前已有 Go/Javascript/Python 等语言的SDK。
|
||||
|
||||
- Go : https://pocketbase.io/docs/go-overview/
|
||||
- Javascript : https://pocketbase.io/docs/js-overview/
|
||||
- python : https://github.com/vaphes/pocketbase
|
||||
|
||||
## 🔄 wiseflow 与常见的爬虫工具、RAG类项目有何不同与关联?
|
||||
## 🔄 wiseflow 与常见的爬虫工具、LLM-Agent类项目有何不同与关联?
|
||||
|
||||
| 特点 | 首席情报官(Wiseflow) | Crawler / Scraper | RAG 类项目 |
|
||||
| 特点 | 首席情报官(Wiseflow) | Crawler / Scraper | LLM-Agent |
|
||||
|-------------|-----------------|---------------------------------------|----------------------|
|
||||
| **主要解决的问题** | 数据处理(筛选、提炼、贴标签) | 原始数据获取 | 下游应用 |
|
||||
| **关联** | | 可以集成至WiseFlow,使wiseflow具有更强大的原始数据获取能力 | 可以集成WiseFlow,作为动态知识库 |
|
||||
|
||||
## 📥 安装与使用
|
||||
|
||||
首席情报官对于硬件基本无任何要求,系统开销很小,无需独立显卡和CUDA(使用在线LLM服务的情况下)
|
||||
首席情报官对于硬件基本无要求,系统开销很小,无需独立显卡和CUDA(使用在线LLM服务的情况下)
|
||||
|
||||
1. **克隆代码仓库**
|
||||
|
||||
@ -65,35 +65,62 @@ https://github.com/TeamWiseFlow/wiseflow/assets/96130569/bd4b2091-c02d-4457-9ec6
|
||||
```bash
|
||||
git clone https://github.com/TeamWiseFlow/wiseflow.git
|
||||
cd wiseflow
|
||||
|
||||
```
|
||||
|
||||
2. **强烈推荐使用docker 运行**
|
||||
|
||||
**中国区用户使用前请合理配置网络,或者指定docker hub镜像**
|
||||
|
||||
```bash
|
||||
docker compose up
|
||||
```
|
||||
可按需修改`compose.yaml`
|
||||
|
||||
**注意:**
|
||||
- 在wiseflow代码仓根目录下运行上述命令;
|
||||
- 运行前先创建并编辑.env文件放置在Dockerfile同级目录(wiseflow代码仓根目录),.env文件可以参考env_sample
|
||||
- 第一次运行docker container时会遇到报错,这其实是正常现象,因为你尚未为pb仓库创建admin账号。
|
||||
|
||||
此时请保持container不关闭状态,浏览器打开`http://127.0.0.1:8090/_/ `,按提示创建admin账号(一定要使用邮箱),然后将创建的admin邮箱(再次强调,一定要用邮箱)和密码填入.env文件,重启container即可。
|
||||
|
||||
_如您想更改container的时区和语言【会决定prompt语言选择,但实测对呈现结果影响不大】,使用如下命令运行image_
|
||||
|
||||
```bash
|
||||
docker run -e LANG=zh_CN.UTF-8 -e LC_CTYPE=zh_CN.UTF-8 your_image
|
||||
```
|
||||
|
||||
|
||||
3. **【备选】直接使用python运行**
|
||||
|
||||
```bash
|
||||
conda create -n wiseflow python=3.10
|
||||
conda activate wiseflow
|
||||
cd core
|
||||
pip install -r requirement.txt
|
||||
```
|
||||
|
||||
|
||||
之后可以通过core/scrips 中的脚本分别启动pb、task和backend (将脚本文件移动到core目录下)
|
||||
|
||||
注意:
|
||||
- 一定要先启动pb,task和backend是独立进程,先后顺序无所谓,也可以按需求只启动其中一个;
|
||||
- 需要先去这里 https://pocketbase.io/docs/ 下载对应自己设备的pocketbase客户端,并放置在 /core/pb 目录下
|
||||
- pb运行问题(包括首次运行报错等)参考 [core/pb/README.md](/core/pb/README.md)
|
||||
- 使用前请创建并编辑.env文件放置在wiseflow代码仓根目录(core目录的上级),.evn文件可以参考env_sample,详细配置说明见下
|
||||
- 更加推荐使用docker方案,见下第五条。
|
||||
|
||||
📚 for developer, see [/core/README.md](/core/README.md) for more
|
||||
|
||||
通过 pocketbase 访问获取的数据:
|
||||
|
||||
- http://127.0.0.1:8090/_/ - Admin dashboard UI
|
||||
- http://127.0.0.1:8090/api/ - REST API
|
||||
- 使用前请创建并编辑.env文件,放置在wiseflow代码仓根目录(core目录的上级),.evn文件可以参考env_sample,详细配置说明见下
|
||||
|
||||
|
||||
2. **配置**
|
||||
📚 for developer, see [/core/README.md](/core/README.md) for more
|
||||
|
||||
通过 pocketbase 访问获取的数据:
|
||||
|
||||
- http://127.0.0.1:8090/_/ - Admin dashboard UI
|
||||
- http://127.0.0.1:8090/api/ - REST API
|
||||
|
||||
|
||||
4. **配置**
|
||||
|
||||
复制目录下的env_sample,并改名为.env, 参考如下 填入你的配置信息(LLM服务token等)
|
||||
|
||||
- LLM_API_KEY # 大模型推理服务API KEY(如使用openai服务,也可以不在这里配置,删除这一项即可)
|
||||
- LLM_API_KEY # 大模型推理服务API KEY
|
||||
- LLM_API_BASE # 本项目依赖openai sdk,只要模型服务支持openai接口,就可以通过配置该项正常使用,如使用openai服务,删除这一项即可
|
||||
- WS_LOG="verbose" # 设定是否开始debug观察,如无需要,删除即可
|
||||
- GET_INFO_MODEL # 信息提炼与标签匹配任务模型,默认为 gpt-3.5-turbo
|
||||
@ -104,62 +131,50 @@ https://github.com/TeamWiseFlow/wiseflow/assets/96130569/bd4b2091-c02d-4457-9ec6
|
||||
- PB_API_BASE # 正常使用无需这一项,只有当你不使用默认的pocketbase本地接口(8090)时才需要
|
||||
|
||||
|
||||
3. **模型推荐**
|
||||
5. **模型推荐**
|
||||
|
||||
经过反复测试(中英文任务),综合效果和价格,**GET_INFO_MODEL**、**REWRITE_MODEL**、**HTML_PARSE_MODEL** 三项我们分别推荐 **"zhipuai/glm4-9B-chat"**、**"alibaba/Qwen2-7B-Instruct"**、**"alibaba/Qwen2-7B-Instruct"**
|
||||
|
||||
它们可以非常好的适配本项目,指令遵循稳定且生成效果优秀,本项目相关的prompt也是针对这三个模型进行的优化。(**HTML_PARSE_MODEL** 也可以使用 **"01-ai/Yi-1.5-9B-Chat"**,实测效果也非常棒)
|
||||
|
||||
|
||||
⚠️ 同时强烈推荐使用 **SiliconFlow** 的在线推理服务,更低的价格、更快的速度、更高的免费额度!⚠️
|
||||
⚠️ 同时强烈推荐使用 **SiliconFlow** 的在线推理服务,更低的价格、更快的速度、更高的免费额度!⚠️
|
||||
|
||||
SiliconFlow 在线推理服务兼容openai SDK,并同时提供上述三个模型的开源服务,仅需配置 LLM_API_BASE 为 "https://api.siliconflow.cn/v1" , 并配置 LLM_API_KEY 即可使用。
|
||||
SiliconFlow 在线推理服务兼容openai SDK,并同时提供上述三个模型的开源服务,仅需配置 LLM_API_BASE 为 "https://api.siliconflow.cn/v1" , 并配置 LLM_API_KEY 即可使用。
|
||||
|
||||
😄 或者您愿意使用我的[邀请链接](https://cloud.siliconflow.cn?referrer=clx6wrtca00045766ahvexw92),这样我也可以获得更多token奖励 😄
|
||||
|
||||
|
||||
4. **本地部署**
|
||||
|
||||
如您所见,本项目使用7b\9b大小的LLM,且无需任何向量模型,这就意味着仅仅需要一块3090RTX(24G显存)就可以完全的对本项目进行本地化部署。
|
||||
|
||||
请保证您的本地化部署LLM服务兼容openai SDK,并配置 LLM_API_BASE 即可
|
||||
|
||||
|
||||
5. **docker部署**
|
||||
|
||||
```bash
|
||||
docker compose up
|
||||
```
|
||||
注意:
|
||||
- 在wiseflow代码仓根目录下运行上述命令;
|
||||
- 运行前先创建并编辑.env文件放置在Dockerfile同级目录(wiseflow代码仓根目录),.env文件可以参考env_sample
|
||||
- 第一次运行docker container时会遇到报错,这其实是正常现象,因为你尚未为pb仓库创建admin账号。
|
||||
|
||||
此时请保持container不关闭状态,浏览器打开`http://127.0.0.1:8090/_/ `,按提示创建admin账号(一定要使用邮箱),然后将创建的admin邮箱(再次强调,一定要用邮箱)和密码填入.env文件,重启container即可。
|
||||
😄 或者您愿意使用我的[邀请链接](https://cloud.siliconflow.cn?referrer=clx6wrtca00045766ahvexw92),这样我也可以获得更多token奖励 😄
|
||||
|
||||
|
||||
6. **关注点和定时扫描信源添加**
|
||||
|
||||
启动程序后,打开pocketbase Admin dashboard UI (http://127.0.0.1:8090/_/)
|
||||
|
||||
6.1 打开 **tags表单**
|
||||
6.1 打开 **tags表单**
|
||||
|
||||
通过这个表单可以指定你的关注点,LLM会按此提炼、过滤并分类信息。
|
||||
通过这个表单可以指定你的关注点,LLM会按此提炼、过滤并分类信息。
|
||||
|
||||
tags 字段说明:
|
||||
tags 字段说明:
|
||||
|
||||
- name, 关注点描述,**注意:要具体一些**,好的例子是:`中美竞争动向`,不好的例子是:`国际局势`。
|
||||
- activated, 是否激活。如果关闭则会忽略该关注点,关闭后可再次开启。开启和关闭无需重启docker容器,会在下一次定时任务时更新。
|
||||
- name, 关注点描述,**注意:要具体一些**,好的例子是:`中美竞争动向`,不好的例子是:`国际局势`。
|
||||
- activated, 是否激活。如果关闭则会忽略该关注点,关闭后可再次开启。开启和关闭无需重启docker容器,会在下一次定时任务时更新。
|
||||
|
||||
6.2 打开 **sites表单**
|
||||
|
||||
通过这个表单可以指定自定义信源,系统会启动后台定时任务,在本地执行信源扫描、解析和分析。
|
||||
6.2 打开 **sites表单**
|
||||
|
||||
sites 字段说明:
|
||||
通过这个表单可以指定自定义信源,系统会启动后台定时任务,在本地执行信源扫描、解析和分析。
|
||||
|
||||
- url, 信源的url,信源无需给定具体文章页面,给文章列表页面即可。
|
||||
- per_hours, 扫描频率,单位为小时,类型为整数(1~24范围,我们建议扫描频次不要超过一天一次,即设定为24)
|
||||
- activated, 是否激活。如果关闭则会忽略该信源,关闭后可再次开启。开启和关闭无需重启docker容器,会在下一次定时任务时更新。
|
||||
sites 字段说明:
|
||||
|
||||
- url, 信源的url,信源无需给定具体文章页面,给文章列表页面即可。
|
||||
- per_hours, 扫描频率,单位为小时,类型为整数(1~24范围,我们建议扫描频次不要超过一天一次,即设定为24)
|
||||
- activated, 是否激活。如果关闭则会忽略该信源,关闭后可再次开启。开启和关闭无需重启docker容器,会在下一次定时任务时更新。
|
||||
|
||||
|
||||
7. **本地部署**
|
||||
|
||||
如您所见,本项目使用7b\9b大小的LLM,且无需任何向量模型,这就意味着仅仅需要一块3090RTX(24G显存)就可以完全的对本项目进行本地化部署。
|
||||
|
||||
请保证您的本地化部署LLM服务兼容openai SDK,并配置 LLM_API_BASE 即可
|
||||
|
||||
|
||||
## 🛡️ 许可协议
|
||||
@ -169,7 +184,7 @@ SiliconFlow 在线推理服务兼容openai SDK,并同时提供上述三个模
|
||||
商用以及定制合作,请联系 **Email:35252986@qq.com**
|
||||
|
||||
|
||||
- 商用客户请联系我们报备登记,产品承诺永远免费。)
|
||||
- 商用客户请联系我们报备登记,产品承诺永远免费。
|
||||
- 对于定制客户,我们会针对您的信源和业务需求提供如下服务:
|
||||
- 针对客户业务场景信源的专用爬虫和解析器
|
||||
- 定制信息提取和分类策略
|
||||
|
157
README_DE.md
157
README_DE.md
@ -2,7 +2,7 @@
|
||||
|
||||
**[中文](README_CN.md) | [日本語](README_JP.md) | [Français](README_FR.md) | [English](README.md)**
|
||||
|
||||
**Wiseflow** ist ein agiles Information-Mining-Tool, das in der Lage ist, prägnante Nachrichten aus verschiedenen Quellen wie Webseiten, offiziellen WeChat-Konten, sozialen Plattformen usw. zu extrahieren. Es kategorisiert die Informationen automatisch mit Tags und lädt sie in eine Datenbank hoch.
|
||||
**Wiseflow** ist ein agiles Informationsgewinnungstool, das Informationen aus verschiedenen Quellen wie Websites, WeChat-Accounts und sozialen Medien basierend auf vordefinierten Fokusbereichen extrahieren, automatisch kategorisieren und in die Datenbank hochladen kann.
|
||||
|
||||
Es mangelt uns nicht an Informationen, sondern wir müssen den Lärm herausfiltern, um wertvolle Informationen hervorzuheben!
|
||||
|
||||
@ -36,127 +36,140 @@ https://github.com/TeamWiseFlow/wiseflow/assets/96130569/bd4b2091-c02d-4457-9ec6
|
||||
😄 **Wiseflow ist besonders gut darin, Informationen aus WeChat-Official-Account-Artikeln zu extrahieren**; hierfür haben wir einen dedizierten Parser für mp-Artikel eingerichtet!
|
||||
|
||||
|
||||
- 🌍 **Kann in jedes RAG-Projekt integriert werden**
|
||||
Kann als dynamische Wissensdatenbank für jedes RAG-Projekt dienen, ohne dass der Code von Wiseflow verstanden werden muss. Es reicht, die Datenbank zu lesen!
|
||||
- 🌍 **Kann in jedes Agent-Projekt integriert werden**
|
||||
Kann als dynamische Wissensdatenbank für jedes Agent-Projekt dienen, ohne dass der Code von Wiseflow verstanden werden muss. Es reicht, die Datenbank zu lesen!
|
||||
|
||||
|
||||
- 📦 **Beliebte PocketBase-Datenbank**
|
||||
Die Datenbank und das Interface nutzen PocketBase. Zusätzlich zur Webschnittstelle sind APIs für Go/JavaScript/Python verfügbar.
|
||||
Die Datenbank und das Interface nutzen PocketBase. Zusätzlich zur Webschnittstelle sind SDK für Go/JavaScript/Python verfügbar.
|
||||
|
||||
- Go: https://pocketbase.io/docs/go-overview/
|
||||
- JavaScript: https://pocketbase.io/docs/js-overview/
|
||||
- Python: https://github.com/vaphes/pocketbase
|
||||
|
||||
## 🔄 Unterschiede und Zusammenhänge zwischen Wiseflow und allgemeinen Crawler-Tools und RAG-Projekten
|
||||
## 🔄 Unterschiede und Zusammenhänge zwischen Wiseflow und allgemeinen Crawler-Tools und LLM-Agent Projekten
|
||||
|
||||
| Merkmal | WiseFlow | Crawler / Scraper | RAG-Projekte |
|
||||
|------------------------|----------------------------------------------------|------------------------------------------|----------------------------|
|
||||
| **Hauptproblem gelöst** | Datenverarbeitung (Filterung, Extraktion, Tagging) | Rohdaten-Erfassung | Downstream-Anwendungen |
|
||||
| Merkmal | WiseFlow | Crawler / Scraper | LLM-Agent |
|
||||
|------------------------|----------------------------------------------------|------------------------------------------|-----------------------------------------------------------|
|
||||
| **Hauptproblem gelöst** | Datenverarbeitung (Filterung, Extraktion, Tagging) | Rohdaten-Erfassung | Downstream-Anwendungen |
|
||||
| **Zusammenhang** | | Kann in Wiseflow integriert werden, um leistungsfähigere Rohdaten-Erfassung zu ermöglichen | Kann Wiseflow als dynamische Wissensdatenbank integrieren |
|
||||
|
||||
## 📥 Installation und Verwendung
|
||||
|
||||
WiseFlow hat fast keine Hardwareanforderungen, minimale Systemlast und benötigt keine dedizierte GPU oder CUDA (bei Verwendung von Online-LLM-Diensten).
|
||||
WiseFlow hat fast keine Hardwareanforderungen, minimale Systemlast und benötigt keine GPU oder CUDA (bei Verwendung von Online-LLM-Diensten).
|
||||
|
||||
1. **Code-Repository klonen**
|
||||
1. **Repository klonen**
|
||||
|
||||
😄 Liken und Forken ist eine gute Angewohnheit
|
||||
😄 Star und Forken sind gute Gewohnheiten
|
||||
|
||||
```bash
|
||||
git clone https://github.com/TeamWiseFlow/wiseflow.git
|
||||
cd wiseflow
|
||||
|
||||
```
|
||||
|
||||
2. **Dringend empfohlen: Docker verwenden**
|
||||
|
||||
```bash
|
||||
docker compose up
|
||||
```
|
||||
`compose.yaml` kann nach Bedarf angepasst werden.
|
||||
|
||||
**Hinweis:**
|
||||
- Führen Sie den obigen Befehl im Stammverzeichnis des wiseflow-Repositories aus.
|
||||
- Erstellen und bearbeiten Sie vor dem Ausführen eine `.env`-Datei im gleichen Verzeichnis wie die Dockerfile (Stammverzeichnis des wiseflow-Repositories). Orientieren Sie sich an `env_sample` für die `.env`-Datei.
|
||||
- Beim ersten Start des Docker-Containers kann ein Fehler auftreten, da Sie noch kein Admin-Konto für das pb-Repository erstellt haben.
|
||||
|
||||
Halten Sie in diesem Fall den Container am Laufen, öffnen Sie `http://127.0.0.1:8090/_/` in Ihrem Browser und folgen Sie den Anweisungen, um ein Admin-Konto zu erstellen (stellen Sie sicher, dass Sie eine E-Mail verwenden). Geben Sie dann die erstellte Admin-E-Mail (nochmals, stellen Sie sicher, dass es sich um eine E-Mail handelt) und das Passwort in die `.env`-Datei ein und starten Sie den Container neu.
|
||||
|
||||
_Falls Sie die Zeitzone und Sprache des Containers ändern möchten [was die Sprache der Prompts bestimmt, aber wenig Einfluss auf die Ergebnisse hat], führen Sie das Image mit folgendem Befehl aus_
|
||||
|
||||
```bash
|
||||
docker run -e LANG=de_DE.UTF-8 -e LC_CTYPE=de_DE.UTF-8 your_image
|
||||
```
|
||||
|
||||
3. **[Alternative] Direkt mit Python ausführen**
|
||||
|
||||
```bash
|
||||
conda create -n wiseflow python=3.10
|
||||
conda activate wiseflow
|
||||
cd core
|
||||
pip install -r requirement.txt
|
||||
```
|
||||
|
||||
Sie können `pb`, `task` und `backend` mit den Skripten im Verzeichnis `core/scripts` starten (verschieben Sie die Skriptdateien in das Verzeichnis `core`).
|
||||
Sie können dann pb, task und backend einzeln mit den Skripten im core/scripts-Verzeichnis starten (verschieben Sie die Skriptdateien in das core-Verzeichnis).
|
||||
|
||||
**Hinweis:**
|
||||
- Starten Sie immer zuerst `pb`. `task` und `backend` sind unabhängige Prozesse und können in beliebiger Reihenfolge gestartet werden, oder es kann nur einer von ihnen nach Bedarf gestartet werden.
|
||||
- Laden Sie zuerst den PocketBase-Client, der Ihrem Gerät entspricht, von [hier](https://pocketbase.io/docs/) herunter und platzieren Sie ihn im Verzeichnis `/core/pb`.
|
||||
- Bei Problemen mit dem Betrieb von `pb` (einschließlich Fehler beim ersten Start usw.), siehe [`core/pb/README.md`](/core/pb/README.md).
|
||||
- Erstellen und bearbeiten Sie vor der Verwendung die `.env`-Datei und platzieren Sie sie im Stammverzeichnis des wiseflow-Code-Repositories (eine Ebene über dem Verzeichnis `core`). Die `.env`-Datei kann auf `env_sample` verweisen. Detaillierte Konfigurationsanweisungen sind unten aufgeführt.
|
||||
- Es wird dringend empfohlen, den Docker-Ansatz zu verwenden. Siehe den fünften Punkt unten.
|
||||
|
||||
📚 Für Entwickler siehe [/core/README.md](/core/README.md) für weitere Informationen.
|
||||
|
||||
Zugriff auf die erfassten Daten über PocketBase:
|
||||
- http://127.0.0.1:8090/_/ - Admin-Dashboard-Interface
|
||||
- http://127.0.0.1:8090/api/ - REST-API
|
||||
Hinweis:
|
||||
- Starten Sie zuerst pb; task und backend sind unabhängige Prozesse und die Reihenfolge spielt keine Rolle. Sie können auch nur einen der beiden nach Bedarf starten.
|
||||
- Laden Sie den passenden pocketbase-Client für Ihr Gerät von https://pocketbase.io/docs/ herunter und platzieren Sie ihn im Verzeichnis /core/pb.
|
||||
- Bei Problemen mit pb (einschließlich Fehlern beim ersten Start) siehe [core/pb/README.md](/core/pb/README.md).
|
||||
- Erstellen und bearbeiten Sie vor der Nutzung eine `.env`-Datei und platzieren Sie diese im Stammverzeichnis des wiseflow-Repositories (oberes Verzeichnis von core). Orientieren Sie sich an `env_sample` für die `.env`-Datei, und sehen Sie unten für detaillierte Konfigurationen.
|
||||
|
||||
|
||||
2. **Konfiguration**
|
||||
📚 Für Entwickler, siehe [/core/README.md](/core/README.md) für mehr Informationen.
|
||||
|
||||
Kopiere `env_sample` im Verzeichnis und benenne es in `.env` um, und fülle deine Konfigurationsinformationen (wie LLM-Service-Tokens) wie folgt aus:
|
||||
|
||||
- LLM_API_KEY # API-Schlüssel für den Large-Model-Inference-Service (falls du den OpenAI-Dienst nutzt, kannst du diesen Eintrag löschen)
|
||||
- LLM_API_BASE # URL-Basis für den Modellservice, der OpenAI-kompatibel ist (falls du den OpenAI-Dienst nutzt, kannst du diesen Eintrag löschen)
|
||||
- WS_LOG="verbose" # Debug-Logging aktivieren, wenn nicht benötigt, löschen
|
||||
- GET_INFO_MODEL # Modell für Informations-Extraktions- und Tagging-Aufgaben, standardmäßig gpt-3.5-turbo
|
||||
- REWRITE_MODEL # Modell für Aufgaben der Konsolidierung und Umschreibung von nahegelegenen Informationen, standardmäßig gpt-3.5-turbo
|
||||
- HTML_PARSE_MODEL # Modell für Web-Parsing (intelligent aktiviert, wenn der GNE-Algorithmus unzureichend ist), standardmäßig gpt-3.5-turbo
|
||||
- PROJECT_DIR # Speicherort für Data- Cache- und Log-Dateien, relativ zum Code-Repository; standardmäßig das Code-Repository selbst, wenn nicht angegeben
|
||||
- PB_API_AUTH='email|password' # Admin-E-Mail und Passwort für die pb-Datenbank (**sie kann fiktiv sein, muss aber eine E-Mail-Adresse sein**)
|
||||
- PB_API_BASE # Nicht erforderlich für den normalen Gebrauch, nur notwendig, wenn du nicht die standardmäßige PocketBase-Local-Interface (Port 8090) verwendest.
|
||||
Zugriff auf Daten über pocketbase:
|
||||
- http://127.0.0.1:8090/_/ - Admin-Dashboard-Oberfläche
|
||||
- http://127.0.0.1:8090/api/ - REST API
|
||||
|
||||
|
||||
3. **Modell-Empfehlung**
|
||||
4. **Konfiguration**
|
||||
|
||||
Nach wiederholten Tests (auf chinesischen und englischen Aufgaben) empfehlen wir für **GET_INFO_MODEL**, **REWRITE_MODEL**, und **HTML_PARSE_MODEL** die folgenden Modelle für optimale Gesamteffekt und Kosten: **"zhipuai/glm4-9B-chat"**, **"alibaba/Qwen2-7B-Instruct"**, **"alibaba/Qwen2-7B-Instruct"**.
|
||||
Kopieren Sie `env_sample` aus dem Verzeichnis und benennen Sie es in `.env` um, füllen Sie dann Ihre Konfigurationsinformationen (wie LLM-Dienst-Token) wie folgt aus:
|
||||
|
||||
Diese Modelle passen gut zum Projekt, sind in der Befolgung von Anweisungen stabil und haben hervorragende Generierungseffekte. Die zugehörigen Prompts für dieses Projekt sind ebenfalls für diese drei Modelle optimiert. (**HTML_PARSE_MODEL** kann auch **"01-ai/Yi-1.5-9B-Chat"** verwenden, das in den Tests ebenfalls sehr gut abgeschnitten hat)
|
||||
|
||||
⚠️ Wir empfehlen dringend, den **SiliconFlow** Online-Inference-Service für niedrigere Kosten, schnellere Geschwindigkeiten und höhere kostenlose Quoten zu verwenden! ⚠️
|
||||
|
||||
Der SiliconFlow Online-Inference-Service ist mit dem OpenAI SDK kompatibel und bietet Open-Service für die oben genannten drei Modelle. Konfiguriere LLM_API_BASE als "https://api.siliconflow.cn/v1" und LLM_API_KEY, um es zu verwenden.
|
||||
|
||||
😄 Oder Sie möchten vielleicht meinen [Einladungslink](https://cloud.siliconflow.cn?referrer=clx6wrtca00045766ahvexw92) verwenden, damit ich auch mehr Token-Belohnungen erhalten kann 😄
|
||||
- LLM_API_KEY # API-Schlüssel für Großes Sprachmodell-Inferenzdienst
|
||||
- LLM_API_BASE # Dieses Projekt verwendet das OpenAI SDK. Konfigurieren Sie diese Option, wenn Ihr Modellsystem die OpenAI-API unterstützt. Falls Sie den OpenAI-Dienst nutzen, können Sie diese Option weglassen.
|
||||
- WS_LOG="verbose" # Setzen, um Debug-Beobachtung zu aktivieren. Löschen, falls nicht erforderlich.
|
||||
- GET_INFO_MODEL # Modell für Informationsentnahme und Tag-Matching-Aufgaben, standardmäßig gpt-3.5-turbo
|
||||
- REWRITE_MODEL # Modell für annähernde Informationsfusion und Umschreibaufgaben, standardmäßig gpt-3.5-turbo
|
||||
- HTML_PARSE_MODEL # Modell für Webseiten-Parsing (intelligent aktiviert, wenn der GNE-Algorithmus schlecht funktioniert), standardmäßig gpt-3.5-turbo
|
||||
- PROJECT_DIR # Speicherort für Daten, Cache und Protokolldateien, relativ zum Repository. Standardmäßig im Repository.
|
||||
- PB_API_AUTH='email|password' # E-Mail und Passwort für den pb-Datenbank-Admin (muss eine E-Mail sein, kann eine fiktive E-Mail sein)
|
||||
- PB_API_BASE # Normalerweise nicht erforderlich. Nur konfigurieren, wenn Sie nicht die Standard-poketbase-Local-Schnittstelle (8090) verwenden.
|
||||
|
||||
|
||||
4. **Lokale Bereitstellung**
|
||||
5. **Modell-Empfehlungen**
|
||||
|
||||
Wie du sehen kannst, verwendet dieses Projekt 7B/9B-LLMs und benötigt keine Vektormodelle, was bedeutet, dass du dieses Projekt vollständig lokal mit nur einer RTX 3090 (24 GB VRAM) bereitstellen kannst.
|
||||
Basierend auf umfangreichen Tests (für chinesische und englische Aufgaben), empfehlen wir **"zhipuai/glm4-9B-chat"** für **GET_INFO_MODEL**, **"alibaba/Qwen2-7B-Instruct"** für **REWRITE_MODEL**, und **"alibaba/Qwen2-7B-Instruct"** für **HTML_PARSE_MODEL**.
|
||||
|
||||
Stelle sicher, dass dein lokaler LLM-Dienst mit dem OpenAI SDK kompatibel ist und konfiguriere LLM_API_BASE entsprechend.
|
||||
Diese Modelle sind gut für dieses Projekt geeignet, mit stabiler Einhaltung der Anweisungen und ausgezeichneter Generationsqualität. Die Prompts dieses Projekts wurden für diese drei Modelle optimiert. (**HTML_PARSE_MODEL** kann auch **"01-ai/Yi-1.5-9B-Chat"** verwenden, was ebenfalls hervorragende Ergebnisse zeigt.)
|
||||
|
||||
|
||||
5. **Programm ausführen**
|
||||
⚠️ Wir empfehlen dringend die Nutzung des **SiliconFlow**-Online-Inferenzdienstes für geringere Kosten, schnellere Geschwindigkeit und höhere Freikontingente! ⚠️
|
||||
|
||||
```bash
|
||||
docker compose up
|
||||
```
|
||||
Der Online-Inferenzdienst von SiliconFlow ist kompatibel mit dem OpenAI SDK und bietet Open-Source-Dienste für die oben genannten drei Modelle. Konfigurieren Sie einfach `LLM_API_BASE` auf "https://api.siliconflow.cn/v1" und setzen Sie `LLM_API_KEY`, um ihn zu nutzen.
|
||||
|
||||
**Hinweis:**
|
||||
- Führen Sie die obigen Befehle im Stammverzeichnis des wiseflow-Code-Repositories aus.
|
||||
- Erstellen und bearbeiten Sie vor dem Ausführen die `.env`-Datei im selben Verzeichnis wie die Dockerfile (Stammverzeichnis des wiseflow-Code-Repositories). Die `.env`-Datei kann sich auf `env_sample` beziehen.
|
||||
- Beim ersten Ausführen des Docker-Containers können Fehler auftreten. Dies ist normal, da Sie noch kein Admin-Konto für das `pb`-Repository erstellt haben.
|
||||
|
||||
Lassen Sie den Container in diesem Fall weiterlaufen, öffnen Sie `http://127.0.0.1:8090/_/` in Ihrem Browser und folgen Sie den Anweisungen, um ein Admin-Konto zu erstellen (verwenden Sie unbedingt eine E-Mail). Füllen Sie dann die erstellte Admin-E-Mail (nochmals, verwenden Sie unbedingt eine E-Mail) und das Passwort in die `.env`-Datei ein und starten Sie den Container neu.
|
||||
😄 Alternativ können Sie meinen [Einladungslink](https://cloud.siliconflow.cn?referrer=clx6wrtca00045766ahvexw92) verwenden, wodurch ich auch mehr Token-Belohnungen erhalte 😄
|
||||
|
||||
|
||||
6. **Geplanten Quellen-Scan hinzufügen**
|
||||
6. **Fokuspunkte und Hinzufügen von geplanten Quellenscans**
|
||||
|
||||
Nach dem Start des Programms öffnen Sie die PocketBase Admin-Dashboard-UI unter [http://127.0.0.1:8090/_/](http://127.0.0.1:8090/_/).
|
||||
Nach dem Start des Programms öffnen Sie die pocketbase Admin-Dashboard-Oberfläche (http://127.0.0.1:8090/_/)
|
||||
|
||||
6.1 Öffnen Sie das **tags-Formular**
|
||||
6.1 Öffnen Sie das **tags-Formular**
|
||||
|
||||
Dieses Formular ermöglicht es Ihnen, Ihre Interessenschwerpunkte anzugeben. Das LLM wird die Informationen entsprechend verfeinern, filtern und kategorisieren.
|
||||
Verwenden Sie dieses Formular, um Ihre Fokuspunkte anzugeben. Das LLM wird Informationen basierend auf diesen extrahieren, filtern und klassifizieren.
|
||||
|
||||
**Beschreibung des Tags-Felds:**
|
||||
- `name`: Beschreibung des Interessenschwerpunkts. **Hinweis: Seien Sie spezifisch**. Ein gutes Beispiel ist `Trends im Wettbewerb zwischen den USA und China`; ein schlechtes Beispiel ist `Internationale Situation`.
|
||||
- `activated`: Gibt an, ob der Tag aktiviert ist. Wenn deaktiviert, wird dieser Interessenschwerpunkt ignoriert. Das Ein- und Ausschalten erfordert keinen Neustart des Docker-Containers und wird beim nächsten geplanten Task aktualisiert.
|
||||
Beschreibung des tags-Felds:
|
||||
|
||||
6.2 Öffnen Sie das **sites-Formular**
|
||||
- name, Beschreibung des Fokuspunkts. **Hinweis: Seien Sie spezifisch.** Gutes Beispiel: `Trends im Wettbewerb zwischen den USA und China`. Schlechtes Beispiel: `Internationale Lage`.
|
||||
- activated, Ob aktiviert. Wenn deaktiviert, wird der Fokuspunkt ignoriert. Er kann später wieder aktiviert werden. Aktivierung und Deaktivierung erfordern keinen Neustart des Docker-Containers und werden bei der nächsten geplanten Aufgabe aktualisiert.
|
||||
|
||||
Dieses Formular ermöglicht es Ihnen, benutzerdefinierte Informationsquellen anzugeben. Das System wird geplante Hintergrundaufgaben starten, um diese Quellen lokal zu scannen, zu analysieren und zu verarbeiten.
|
||||
6.2 Öffnen Sie das **sites-Formular**
|
||||
|
||||
**Felderbeschreibung des Formulars sites:**
|
||||
- url: Die URL der Quelle. Die Quelle muss nicht die spezifische Artikelseite angeben, nur die Artikelliste-Seite.
|
||||
- per_hours: Häufigkeit des Scannens, in Stunden, ganzzahlig (Bereich 1~24; wir empfehlen eine Scanfrequenz von einmal pro Tag, also auf 24 eingestellt).
|
||||
- activated: Ob aktiviert. Wenn deaktiviert, wird die Quelle ignoriert; sie kann später wieder aktiviert werden.
|
||||
Verwenden Sie dieses Formular, um benutzerdefinierte Quellen anzugeben. Das System startet Hintergrundaufgaben, um diese Quellen lokal zu scannen, zu analysieren und auszuwerten.
|
||||
|
||||
Beschreibung des sites-Felds:
|
||||
|
||||
- url, URL der Quelle. Geben Sie eine URL zur Listen-Seite anstelle einer spezifischen Artikel-Seite an.
|
||||
- per_hours, Scanhäufigkeit in Stunden, als Ganzzahl (Bereich 1-24; wir empfehlen nicht mehr als einmal täglich, d.h. auf 24 eingestellt).
|
||||
- activated, Ob aktiviert. Wenn deaktiviert, wird die Quelle ignoriert. Sie kann später wieder aktiviert werden. Aktivierung und Deaktivierung erfordern keinen Neustart des Docker-Containers und werden bei der nächsten geplanten Aufgabe aktualisiert.
|
||||
|
||||
|
||||
7. **Lokale Bereitstellung**
|
||||
|
||||
Wie Sie sehen können, verwendet dieses Projekt 7B/9B LLMs und benötigt keine Vektormodelle, was bedeutet, dass Sie nur eine RTX 3090 (24 GB VRAM) benötigen, um dieses Projekt vollständig lokal bereitzustellen.
|
||||
|
||||
Stellen Sie sicher, dass Ihr lokaler LLM-Dienst mit dem OpenAI SDK kompatibel ist und konfigurieren Sie `LLM_API_BASE` entsprechend.
|
||||
|
||||
|
||||
## 🛡️ Lizenz
|
||||
|
156
README_FR.md
156
README_FR.md
@ -2,7 +2,7 @@
|
||||
|
||||
**[中文](README_CN.md) | [日本語](README_JP.md) | [English](README.md) | [Deutsch](README_DE.md)**
|
||||
|
||||
**Wiseflow** est un outil agile de fouille d'informations capable d'extraire des messages concis à partir de diverses sources telles que des sites web, des comptes officiels WeChat, des plateformes sociales, etc. Il classe automatiquement les informations par étiquettes et les télécharge dans une base de données.
|
||||
**Wiseflow** est un outil agile d'extraction d'informations qui peut extraire des informations à partir de diverses sources telles que des sites Web, des comptes officiels WeChat et des plateformes de médias sociaux, en fonction des points d'intérêt prédéfinis, catégoriser automatiquement les tags et les télécharger dans la base de données.
|
||||
|
||||
Nous ne manquons pas d'informations, mais nous avons besoin de filtrer le bruit pour faire ressortir les informations de valeur !
|
||||
|
||||
@ -39,127 +39,139 @@ https://github.com/TeamWiseFlow/wiseflow/assets/96130569/bd4b2091-c02d-4457-9ec6
|
||||
😄 **Wiseflow est particulièrement bon pour extraire des informations à partir des articles de comptes officiels WeChat**; pour cela, nous avons configuré un parseur dédié aux articles mp !
|
||||
|
||||
|
||||
- 🌍 **Peut Être Intégré dans Tout Projet RAG**
|
||||
Peut servir de base de connaissances dynamique pour tout projet RAG, sans besoin de comprendre le code de Wiseflow, il suffit de lire via la base de données !
|
||||
- 🌍 **Peut Être Intégré dans Tout Projet Agent**
|
||||
Peut servir de base de connaissances dynamique pour tout projet Agent, sans besoin de comprendre le code de Wiseflow, il suffit de lire via la base de données !
|
||||
|
||||
|
||||
- 📦 **Base de Données Populaire Pocketbase**
|
||||
La base de données et l'interface utilisent PocketBase. Outre l'interface web, des API pour les langages Go/Javascript/Python sont disponibles.
|
||||
La base de données et l'interface utilisent PocketBase. Outre l'interface web, des SDK pour les langages Go/Javascript/Python sont disponibles.
|
||||
|
||||
- Go : https://pocketbase.io/docs/go-overview/
|
||||
- Javascript : https://pocketbase.io/docs/js-overview/
|
||||
- Python : https://github.com/vaphes/pocketbase
|
||||
|
||||
## 🔄 Quelles Sont les Différences et Connexions entre Wiseflow et les Outils de Crawling, les Projets RAG Communs ?
|
||||
## 🔄 Quelles Sont les Différences et Connexions entre Wiseflow et les Outils de Crawling, les Projets LLM-Agent Communs ?
|
||||
|
||||
| Caractéristique | Wiseflow | Crawler / Scraper | Projets RAG |
|
||||
|-----------------------|-------------------------------------|-------------------------------------------|--------------------------|
|
||||
| **Problème Principal Résolu** | Traitement des données (filtrage, extraction, étiquetage) | Acquisition de données brutes | Applications en aval |
|
||||
| Caractéristique | Wiseflow | Crawler / Scraper | LLM-Agent |
|
||||
|-----------------------|-------------------------------------|-------------------------------------------|--------------------------------------------------------------|
|
||||
| **Problème Principal Résolu** | Traitement des données (filtrage, extraction, étiquetage) | Acquisition de données brutes | Applications en aval |
|
||||
| **Connexion** | | Peut être intégré dans Wiseflow pour une acquisition de données brutes plus puissante | Peut intégrer Wiseflow comme base de connaissances dynamique |
|
||||
|
||||
## 📥 Installation et Utilisation
|
||||
|
||||
WiseFlow n'a pratiquement aucune exigence matérielle, avec une empreinte système minimale, et ne nécessite pas de GPU dédié ni CUDA (en utilisant des services LLM en ligne).
|
||||
1. **Cloner le dépôt**
|
||||
|
||||
1. **Cloner le Dépôt de Code**
|
||||
|
||||
😄 Liker et forker est une bonne habitude
|
||||
😄 Starring et forker sont de bonnes habitudes
|
||||
|
||||
```bash
|
||||
git clone https://github.com/TeamWiseFlow/wiseflow.git
|
||||
cd wiseflow
|
||||
|
||||
```
|
||||
|
||||
2. **Fortement recommandé : Utiliser Docker**
|
||||
|
||||
```bash
|
||||
docker compose up
|
||||
```
|
||||
Vous pouvez modifier `compose.yaml` selon vos besoins.
|
||||
|
||||
**Remarque :**
|
||||
- Exécutez la commande ci-dessus dans le répertoire racine du dépôt wiseflow.
|
||||
- Avant d'exécuter, créez et éditez un fichier `.env` dans le même répertoire que le Dockerfile (répertoire racine du dépôt wiseflow). Référez-vous à `env_sample` pour le fichier `.env`.
|
||||
- La première fois que vous exécutez le conteneur Docker, une erreur peut se produire car vous n'avez pas encore créé de compte administrateur pour le dépôt pb.
|
||||
|
||||
À ce stade, gardez le conteneur en cours d'exécution, ouvrez `http://127.0.0.1:8090/_/` dans votre navigateur, et suivez les instructions pour créer un compte administrateur (assurez-vous d'utiliser un e-mail). Ensuite, entrez l'email administrateur créé (encore une fois, assurez-vous qu'il s'agit d'un e-mail) et le mot de passe dans le fichier `.env`, et redémarrez le conteneur.
|
||||
|
||||
_Si vous souhaitez modifier le fuseau horaire et la langue du conteneur [ce qui déterminera la langue de l'invite, mais a peu d'effet sur les résultats], exécutez l'image avec la commande suivante_
|
||||
|
||||
```bash
|
||||
docker run -e LANG=fr_FR.UTF-8 -e LC_CTYPE=fr_FR.UTF-8 your_image
|
||||
```
|
||||
|
||||
3. **[Alternative] Exécuter directement avec Python**
|
||||
|
||||
```bash
|
||||
conda create -n wiseflow python=3.10
|
||||
conda activate wiseflow
|
||||
cd core
|
||||
pip install -r requirement.txt
|
||||
```
|
||||
|
||||
Vous pouvez démarrer `pb`, `task` et `backend` en utilisant les scripts dans le répertoire `core/scripts` (déplacez les fichiers de script dans le répertoire `core`).
|
||||
|
||||
**Remarque :**
|
||||
- Démarrez toujours `pb` en premier. `task` et `backend` sont des processus indépendants et peuvent être démarrés dans n'importe quel ordre ou seulement l'un d'entre eux peut être démarré selon les besoins.
|
||||
- Téléchargez d'abord le client PocketBase correspondant à votre appareil depuis [ici](https://pocketbase.io/docs/) et placez-le dans le répertoire `/core/pb`.
|
||||
- Pour les problèmes de fonctionnement de `pb` (y compris les erreurs lors de la première exécution, etc.), consultez [`core/pb/README.md`](/core/pb/README.md).
|
||||
- Avant l'utilisation, créez et modifiez le fichier `.env` et placez-le dans le répertoire racine du dépôt de code wiseflow (un niveau au-dessus du répertoire `core`). Le fichier `.env` peut se référer à `env_sample`. Les instructions de configuration détaillées sont ci-dessous.
|
||||
- Il est fortement recommandé d'utiliser l'approche Docker, voir le cinquième point ci-dessous.
|
||||
Vous pouvez ensuite démarrer pb, task, et backend individuellement en utilisant les scripts dans core/scripts (déplacez les fichiers de script dans le répertoire core).
|
||||
|
||||
📚 Pour les développeurs, voir [/core/README.md](/core/README.md) pour plus d'informations.
|
||||
|
||||
Accéder aux données obtenues via PocketBase :
|
||||
- http://127.0.0.1:8090/_/ - Interface du tableau de bord admin
|
||||
- http://127.0.0.1:8090/api/ - API REST
|
||||
Remarque :
|
||||
- Commencez par démarrer pb ; task et backend sont des processus indépendants, et l'ordre n'a pas d'importance. Vous pouvez démarrer l'un d'entre eux selon vos besoins.
|
||||
- Téléchargez le client pocketbase adapté à votre appareil depuis https://pocketbase.io/docs/ et placez-le dans le répertoire /core/pb.
|
||||
- Pour les problèmes avec pb (y compris les erreurs au premier démarrage), référez-vous à [core/pb/README.md](/core/pb/README.md).
|
||||
- Avant utilisation, créez et éditez un fichier `.env` et placez-le dans le répertoire racine du dépôt wiseflow (le répertoire supérieur à core). Référez-vous à `env_sample` pour le fichier `.env`, et consultez ci-dessous pour une configuration détaillée.
|
||||
|
||||
|
||||
2. **Configuration**
|
||||
📚 Pour les développeurs, consultez [/core/README.md](/core/README.md) pour plus d'informations.
|
||||
|
||||
Copier `env_sample` dans le répertoire et le renommer `.env`, puis remplir vos informations de configuration (comme les tokens de service LLM) comme suit :
|
||||
|
||||
- LLM_API_KEY # Clé API pour le service d'inférence de grand modèle (si vous utilisez le service OpenAI, vous pouvez omettre cela en supprimant cette entrée)
|
||||
- LLM_API_BASE # URL de base pour le service de modèle compatible avec OpenAI (à omettre si vous utilisez le service OpenAI)
|
||||
- WS_LOG="verbose" # Activer la journalisation de débogage, à supprimer si non nécessaire
|
||||
- GET_INFO_MODEL # Modèle pour les tâches d'extraction d'informations et d'étiquetage, par défaut gpt-3.5-turbo
|
||||
- REWRITE_MODEL # Modèle pour les tâches de fusion et de réécriture d'informations proches, par défaut gpt-3.5-turbo
|
||||
- HTML_PARSE_MODEL # Modèle de parsing de page web (activé intelligemment lorsque l'algorithme GNE est insuffisant), par défaut gpt-3.5-turbo
|
||||
- PROJECT_DIR # Emplacement pour stocker données le cache et les fichiers journaux, relatif au dépôt de code ; par défaut, le dépôt de code lui-même si non spécifié
|
||||
- PB_API_AUTH='email|password' # E-mail et mot de passe admin pour la base de données pb (**il peut être fictif mais doit être un e-mail**)
|
||||
- PB_API_BASE # Non requis pour une utilisation normale, seulement nécessaire si vous n'utilisez pas l'interface PocketBase locale par défaut (port 8090)
|
||||
Accédez aux données via pocketbase :
|
||||
- http://127.0.0.1:8090/_/ - Interface de tableau de bord administrateur
|
||||
- http://127.0.0.1:8090/api/ - REST API
|
||||
|
||||
|
||||
3. **Recommandation de Modèle**
|
||||
4. **Configuration**
|
||||
|
||||
Après des tests approfondis (sur des tâches en chinois et en anglais), pour un effet global et un coût optimaux, nous recommandons les suivants pour **GET_INFO_MODEL**, **REWRITE_MODEL**, et **HTML_PARSE_MODEL** : **"zhipuai/glm4-9B-chat"**, **"alibaba/Qwen2-7B-Instruct"**, **"alibaba/Qwen2-7B-Instruct"**.
|
||||
Copiez `env_sample` du répertoire et renommez-le en `.env`, puis remplissez vos informations de configuration (comme les tokens de service LLM) comme suit :
|
||||
|
||||
Ces modèles s'adaptent bien au projet, avec une adhésion stable aux commandes et d'excellents effets de génération. Les prompts liés à ce projet sont également optimisés pour ces trois modèles. (**HTML_PARSE_MODEL** peut également utiliser **"01-ai/Yi-1.5-9B-Chat"**, qui performe également très bien dans les tests)
|
||||
|
||||
⚠️ Nous recommandons vivement d'utiliser le service d'inférence en ligne **SiliconFlow** pour des coûts plus bas, des vitesses plus rapides, et des quotas gratuits plus élevés ! ⚠️
|
||||
|
||||
Le service d'inférence en ligne SiliconFlow est compatible avec le SDK OpenAI et fournit des services open-source pour les trois modèles ci-dessus. Il suffit de configurer LLM_API_BASE comme "https://api.siliconflow.cn/v1" et de configurer LLM_API_KEY pour l'utiliser.
|
||||
|
||||
😄 Ou peut-être préférez-vous utiliser mon [lien d'invitation](https://cloud.siliconflow.cn?referrer=clx6wrtca00045766ahvexw92), afin que je puisse également obtenir plus de récompenses en tokens 😄
|
||||
- LLM_API_KEY # Clé API pour les services d'inférence de modèles de langue large
|
||||
- LLM_API_BASE # Ce projet repose sur le SDK OpenAI. Configurez cette option si votre service de modèle prend en charge l'API OpenAI. Si vous utilisez le service OpenAI, vous pouvez omettre cette option.
|
||||
- WS_LOG="verbose" # Définir pour activer l'observation du débogage. Supprimez si non nécessaire.
|
||||
- GET_INFO_MODEL # Modèle pour les tâches d'extraction d'informations et de correspondance de tags, par défaut gpt-3.5-turbo
|
||||
- REWRITE_MODEL # Modèle pour les tâches de fusion approximative et de réécriture d'informations, par défaut gpt-3.5-turbo
|
||||
- HTML_PARSE_MODEL # Modèle pour l'analyse des pages Web (activé intelligemment si l'algorithme GNE fonctionne mal), par défaut gpt-3.5-turbo
|
||||
- PROJECT_DIR # Emplacement de stockage pour les données, le cache et les fichiers journaux, par rapport au dépôt. Par défaut, dans le dépôt.
|
||||
- PB_API_AUTH='email|password' # Email et mot de passe pour l'admin de la base de données pb (doit être un email, peut être fictif)
|
||||
- PB_API_BASE # Normalement inutile. Configurez-le seulement si vous n'utilisez pas l'interface locale pocketbase par défaut (8090).
|
||||
|
||||
|
||||
4. **Déploiement Local**
|
||||
5. **Recommandations de Modèle**
|
||||
|
||||
Comme vous pouvez le voir, ce projet utilise des LLM de 7B/9B et ne nécessite pas de modèles vectoriels, ce qui signifie que vous pouvez déployer complètement ce projet en local avec juste un RTX 3090 (24GB VRAM).
|
||||
Basé sur des tests intensifs (pour les tâches en chinois et en anglais), nous recommandons **"zhipuai/glm4-9B-chat"** pour **GET_INFO_MODEL**, **"alibaba/Qwen2-7B-Instruct"** pour **REWRITE_MODEL**, et **"alibaba/Qwen2-7B-Instruct"** pour **HTML_PARSE_MODEL**.
|
||||
|
||||
Assurez-vous que votre service LLM local est compatible avec le SDK OpenAI et configurez LLM_API_BASE en conséquence.
|
||||
Ces modèles sont bien adaptés à ce projet, avec une adhérence stable aux instructions et une qualité de génération excellente. Les invites de ce projet ont été optimisées pour ces trois modèles. (**HTML_PARSE_MODEL** peut également utiliser **"01-ai/Yi-1.5-9B-Chat"**, qui a été testé et fonctionne très bien.)
|
||||
|
||||
|
||||
5. **Exécuter le Programme**
|
||||
⚠️ Nous recommandons fortement d'utiliser le service d'inférence en ligne de **SiliconFlow** pour des coûts inférieurs, des vitesses plus rapides, et des quotas gratuits plus élevés ! ⚠️
|
||||
|
||||
```bash
|
||||
docker compose up
|
||||
```
|
||||
Le service d'inférence en ligne de SiliconFlow est compatible avec le SDK OpenAI et fournit des services open-source pour les trois modèles ci-dessus. Configurez simplement `LLM_API_BASE` à "https://api.siliconflow.cn/v1" et définissez `LLM_API_KEY` pour l'utiliser.
|
||||
|
||||
**Remarque :**
|
||||
- Exécutez les commandes ci-dessus dans le répertoire racine du dépôt de code wiseflow.
|
||||
- Avant de les exécuter, créez et modifiez le fichier `.env` dans le même répertoire que le Dockerfile (répertoire racine du dépôt de code wiseflow). Le fichier `.env` peut se référer à `env_sample`.
|
||||
- Vous pouvez rencontrer des erreurs lors de la première exécution du conteneur Docker. C'est normal car vous n'avez pas encore créé de compte admin pour le dépôt `pb`.
|
||||
|
||||
À ce stade, laissez le conteneur en cours d'exécution, ouvrez `http://127.0.0.1:8090/_/` dans votre navigateur, et suivez les instructions pour créer un compte admin (assurez-vous d'utiliser une adresse e-mail). Ensuite, remplissez l'adresse e-mail de l'admin créée (encore une fois, assurez-vous d'utiliser une adresse e-mail) et le mot de passe dans le fichier `.env`, puis redémarrez le conteneur.
|
||||
😄 Alternativement, vous pouvez utiliser mon [lien d'invitation](https://cloud.siliconflow.cn?referrer=clx6wrtca00045766ahvexw92), ce qui me récompense également avec plus de tokens 😄
|
||||
|
||||
|
||||
6. **Ajouter un Scanning de Source Programmé**
|
||||
6. **Points d'Intérêt et Ajout de Sources de Scannage Programmées**
|
||||
|
||||
Après avoir démarré le programme, ouvrez l'interface de gestion PocketBase Admin à l'adresse [http://127.0.0.1:8090/_/](http://127.0.0.1:8090/_/).
|
||||
Après avoir démarré le programme, ouvrez l'interface de tableau de bord administrateur pocketbase (http://127.0.0.1:8090/_/)
|
||||
|
||||
6.1 Ouvrez le **formulaire des tags**
|
||||
6.1 Ouvrez le **formulaire tags**
|
||||
|
||||
Ce formulaire vous permet de spécifier vos points d'intérêt. Le LLM affinera, filtrera et catégorisera les informations en conséquence.
|
||||
Utilisez ce formulaire pour spécifier vos points d'intérêt. Le LLM extraira, filtrera, et classera les informations en fonction de ces points.
|
||||
|
||||
**Description des champs des tags :**
|
||||
- `name` : Description du point d'intérêt. **Remarque : Soyez précis**. Un bon exemple est `Tendances dans la concurrence entre les États-Unis et la Chine`; un mauvais exemple est `Situation internationale`.
|
||||
- `activated` : Indique si le tag est activé. S'il est désactivé, ce point d'intérêt sera ignoré. Il peut être activé et désactivé sans redémarrer le conteneur Docker ; les mises à jour seront appliquées lors de la prochaine tâche planifiée.
|
||||
Description des champs tags :
|
||||
|
||||
6.2 Ouvrez le **formulaire des sites**
|
||||
- name, Description du point d'intérêt. **Remarque : Soyez spécifique.** Bon exemple : `Tendances dans la compétition USA-Chine`. Mauvais exemple : `Situation internationale`.
|
||||
- activated, Activé ou non. Si désactivé, le point d'intérêt sera ignoré. Il peut être réactivé plus tard. L'activation et la désactivation ne nécessitent pas de redémarrage du conteneur Docker et seront mises à jour lors de la prochaine tâche programmée.
|
||||
|
||||
Ce formulaire vous permet de spécifier des sources d'information personnalisées. Le système lancera des tâches planifiées en arrière-plan pour scanner, analyser et traiter ces sources localement.
|
||||
6.2 Ouvrez le **formulaire sites**
|
||||
|
||||
**Description des champs du formulaire sites :**
|
||||
- url : L'URL de la source. La source n'a pas besoin de spécifier la page de l'article spécifique, juste la page de la liste des articles.
|
||||
- per_hours : Fréquence de scanning, en heures, type entier (intervalle 1~24 ; nous recommandons une fréquence de scanning d'une fois par jour, soit réglée à 24).
|
||||
- activated : Si activé. Si désactivé, la source sera ignorée ; elle peut être réactivée plus tard
|
||||
Utilisez ce formulaire pour spécifier des sources personnalisées. Le système démarrera des tâches en arrière-plan pour scanner, analyser et interpréter ces sources localement.
|
||||
|
||||
Description des champs sites :
|
||||
|
||||
- url, URL de la source. Fournissez une URL vers la page de liste plutôt qu'une page d'article spécifique.
|
||||
- per_hours, Fréquence de scannage en heures, sous forme d'entier (intervalle 1-24 ; nous recommandons pas plus d'une fois par jour, c.-à-d. réglé sur 24).
|
||||
- activated, Activé ou non. Si désactivé, la source sera ignorée. Elle peut être réactivée plus tard. L'activation et la désactivation ne nécessitent pas de redémarrage du conteneur Docker et seront mises à jour lors de la prochaine tâche programmée.
|
||||
|
||||
|
||||
7. **Déploiement Local**
|
||||
|
||||
Comme vous pouvez le voir, ce projet utilise des LLMs de taille 7B/9B et ne nécessite aucun modèle vectoriel, ce qui signifie que vous n'avez besoin que d'un seul RTX 3090 (24 Go de VRAM) pour déployer complètement ce projet localement.
|
||||
|
||||
Assurez-vous que votre service LLM local est compatible avec le SDK OpenAI et configurez `LLM_API_BASE` en conséquence.
|
||||
|
||||
|
||||
## 🛡️ Licence
|
||||
|
158
README_JP.md
158
README_JP.md
@ -2,7 +2,7 @@
|
||||
|
||||
**[中文](README_CN.md) | [English](README.md) | [Français](README_FR.md) | [Deutsch](README_DE.md)**
|
||||
|
||||
**チーフインテリジェンスオフィサー** (Wiseflow) は、ウェブサイト、WeChat公式アカウント、ソーシャルプラットフォームなどのさまざまな情報源から簡潔なメッセージを抽出し、タグ付けしてデータベースに自動的にアップロードするためのアジャイルな情報マイニングツールです。
|
||||
**チーフインテリジェンスオフィサー** (Wiseflow) は、ウェブサイト、WeChat公式アカウント、ソーシャルメディアなどのさまざまな情報源から、事前に設定された関心点に基づいて情報を抽出し、自動的にタグ付けしてデータベースにアップロードすることができるアジャイルな情報抽出ツールです。
|
||||
|
||||
私たちが必要なのは情報ではなく、膨大な情報の中からノイズを取り除き、価値のある情報を浮き彫りにすることです!
|
||||
|
||||
@ -36,127 +36,141 @@ https://github.com/TeamWiseFlow/wiseflow/assets/96130569/bd4b2091-c02d-4457-9ec6
|
||||
😄 **Wiseflowは特にWeChat公式アカウントの記事から情報を抽出するのが得意です**。そのため、mp記事専用パーサーを設定しました!
|
||||
|
||||
|
||||
- 🌍 **任意のRAGプロジェクトに統合可能**
|
||||
任意のRAGプロジェクトの動的ナレッジベースとして機能し、Wiseflowのコードを理解せずとも、データベースからの読み取り操作だけで利用できます!
|
||||
- 🌍 **任意のAgentプロジェクトに統合可能**
|
||||
任意のAgentプロジェクトの動的ナレッジベースとして機能し、Wiseflowのコードを理解せずとも、データベースからの読み取り操作だけで利用できます!
|
||||
|
||||
|
||||
- 📦 **人気のPocketBaseデータベース**
|
||||
データベースとインターフェースにPocketBaseを使用。Webインターフェースに加え、Go/JavaScript/PythonなどのAPIもあります。
|
||||
データベースとインターフェースにPocketBaseを使用。Webインターフェースに加え、Go/JavaScript/PythonなどのSDKもあります。
|
||||
|
||||
- Go: https://pocketbase.io/docs/go-overview/
|
||||
- JavaScript: https://pocketbase.io/docs/js-overview/
|
||||
- Python: https://github.com/vaphes/pocketbase
|
||||
|
||||
## 🔄 Wiseflowと一般的なクローラツール、RAGプロジェクトとの違いと関連性
|
||||
## 🔄 Wiseflowと一般的なクローラツール、LLM-Agentプロジェクトとの違いと関連性
|
||||
|
||||
| 特徴 | チーフインテリジェンスオフィサー (Wiseflow) | クローラ / スクレイパー | RAGプロジェクト |
|
||||
|---------------|---------------------------------|------------------------------------------|--------------------------|
|
||||
| **解決する主な問題** | データ処理(フィルタリング、抽出、タグ付け) | 生データの取得 | 下流アプリケーション |
|
||||
| 特徴 | チーフインテリジェンスオフィサー (Wiseflow) | クローラ / スクレイパー | LLM-Agent |
|
||||
|---------------|---------------------------------|------------------------------------------|---------------------------|
|
||||
| **解決する主な問題** | データ処理(フィルタリング、抽出、タグ付け) | 生データの取得 | 下流アプリケーション |
|
||||
| **関連性** | | Wiseflowに統合して、より強力な生データ取得能力を持たせる | 動的ナレッジベースとしてWiseflowを統合可能 |
|
||||
|
||||
## 📥 インストールと使用方法
|
||||
|
||||
チーフインテリジェンスオフィサーはハードウェアの要件がほとんどなく、システム負荷が小さく、専用GPUやCUDAを必要としません(オンラインLLMサービスを使用する場合)。
|
||||
チーフインテリジェンスオフィサーはハードウェアの要件がほとんどなく、システム負荷が小さく、GPUやCUDAを必要としません(オンラインLLMサービスを使用する場合)。
|
||||
|
||||
1. **コードリポジトリをクローン**
|
||||
1. **リポジトリをクローン**
|
||||
|
||||
😄 いいねやフォークは良い習慣です
|
||||
😄 いいねやforkは良い習慣です
|
||||
|
||||
```bash
|
||||
git clone https://github.com/TeamWiseFlow/wiseflow.git
|
||||
cd wiseflow
|
||||
|
||||
```
|
||||
|
||||
2. **Dockerの使用を強く推奨**
|
||||
|
||||
```bash
|
||||
docker compose up
|
||||
```
|
||||
必要に応じて`compose.yaml`を変更できます。
|
||||
|
||||
**注意:**
|
||||
- 上記のコマンドはwiseflowリポジトリのルートディレクトリで実行してください。
|
||||
- 実行前に`.env`ファイルを作成し、Dockerfileと同じディレクトリ(wiseflowリポジトリのルートディレクトリ)に配置します。.envファイルの参考例は`env_sample`です。
|
||||
- 最初にDockerコンテナを実行するとエラーが発生する可能性があります。これは正常で、まだpbリポジトリにadminアカウントを作成していないためです。
|
||||
|
||||
この場合、コンテナを閉じずに、ブラウザで`http://127.0.0.1:8090/_/`を開き、指示に従ってadminアカウント(必ずメールアドレスを使用してください)を作成し、作成したadminメールアドレス(再度、必ずメールアドレスを使用してください)とパスワードを.envファイルに記入してコンテナを再起動してください。
|
||||
|
||||
_コンテナのタイムゾーンと言語を変更したい場合 [プロンプトの言語を決定しますが、結果にはあまり影響しません] は、以下のコマンドでイメージを実行してください_
|
||||
|
||||
```bash
|
||||
docker run -e LANG=ja_JP.UTF-8 -e LC_CTYPE=ja_JP.UTF-8 your_image
|
||||
```
|
||||
|
||||
3. **【代替】Pythonで直接実行**
|
||||
|
||||
```bash
|
||||
conda create -n wiseflow python=3.10
|
||||
conda activate wiseflow
|
||||
cd core
|
||||
pip install -r requirement.txt
|
||||
```
|
||||
|
||||
`core/scripts` ディレクトリのスクリプトを使用して `pb`、`task`、`backend` を起動できます(スクリプトファイルを `core` ディレクトリに移動してください)。
|
||||
|
||||
**注意:**
|
||||
- 必ず最初に `pb` を起動してください。`task` と `backend` は独立したプロセスであり、どちらを先に起動しても構いませんし、必要に応じてどちらか一方だけを起動することもできます。
|
||||
- まず、[ここ](https://pocketbase.io/docs/) から自分のデバイスに対応する PocketBase クライアントをダウンロードし、`/core/pb` ディレクトリに配置してください。
|
||||
- `pb` の実行に関する問題(初回実行時のエラーなどを含む)については、[`core/pb/README.md`](/core/pb/README.md) を参照してください。
|
||||
- 使用する前に、`.env` ファイルを作成し編集して、wiseflow コードリポジトリのルートディレクトリ(`core` ディレクトリの上位)に配置してください。.env ファイルは `env_sample` を参照できます。詳細な設定手順は下記をご覧ください。
|
||||
- Docker 方式の使用を強くお勧めします。詳細は以下の 5 番目の項目をご覧ください。
|
||||
その後、core/scriptsにあるスクリプトでpb、task、backendを個別に起動できます(スクリプトファイルをcoreディレクトリに移動)。
|
||||
|
||||
📚 開発者向けの詳細については、[/core/README.md](/core/README.md) を参照してください。
|
||||
|
||||
PocketBase を通じて取得したデータにアクセスするには:
|
||||
- http://127.0.0.1:8090/_/ - 管理者ダッシュボード UI
|
||||
- http://127.0.0.1:8090/api/ - REST API
|
||||
注意:
|
||||
- pbを最初に起動してください。taskとbackendは独立したプロセスなので、順番は問いません。また、必要に応じてどれか一つだけを起動することもできます。
|
||||
- 自分のデバイスに適したpocketbaseクライアントをhttps://pocketbase.io/docs/ からダウンロードし、/core/pbディレクトリに配置してください。
|
||||
- pbに関する問題(初回実行時のエラーなど)は [core/pb/README.md](/core/pb/README.md) を参照してください。
|
||||
- 使用前に`.env`ファイルを作成して編集し、wiseflowリポジトリのルートディレクトリ(coreディレクトリの上位)に配置します。.envファイルの参考例は`env_sample`で、詳細な設定については以下を参照してください。
|
||||
|
||||
|
||||
2. **設定**
|
||||
📚 開発者向けには [/core/README.md](/core/README.md) を参照してください。
|
||||
|
||||
ディレクトリ内の `env_sample` をコピーして `.env` に名前を変更し、以下に従って設定情報(LLMサービスのトークンなど)を入力します。
|
||||
|
||||
- LLM_API_KEY # 大規模モデル推論サービスのAPIキー(OpenAIサービスを使用する場合は、この項目を削除しても問題ありません)
|
||||
- LLM_API_BASE # 本プロジェクトはOpenAI SDKに依存しているため、モデルサービスがOpenAIインターフェースをサポートしていれば、この項目を設定することで正常に使用できます(OpenAIサービスを使用する場合は、この項目を削除しても問題ありません)
|
||||
- WS_LOG="verbose" # デバッグ観察を有効にするかどうかを設定(必要がなければ削除してください)
|
||||
- GET_INFO_MODEL # 情報抽出とタグ付けタスクのモデル(デフォルトは gpt-3.5-turbo)
|
||||
- REWRITE_MODEL # 類似情報の統合と再書きタスクのモデル(デフォルトは gpt-3.5-turbo)
|
||||
- HTML_PARSE_MODEL # ウェブ解析モデル(GNEアルゴリズムの効果が不十分な場合に自動で有効化)(デフォルトは gpt-3.5-turbo)
|
||||
- PROJECT_DIR # データ キャッシュおよびログファイルの保存場所(コードリポジトリからの相対パス)。デフォルトではコードリポジトリ。
|
||||
- PB_API_AUTH='email|password' # pbデータベースの管理者のメールアドレスとパスワード(注意:メールアドレスは必須で、架空のメールアドレスでも構いません)
|
||||
- PB_API_BASE # 通常の使用ではこの項目は不要です。PocketBaseのデフォルトのローカルインターフェース(8090)を使用しない場合にのみ必要です。
|
||||
pocketbaseでデータにアクセス:
|
||||
- http://127.0.0.1:8090/_/ - 管理ダッシュボードUI
|
||||
- http://127.0.0.1:8090/api/ - REST API
|
||||
|
||||
|
||||
3. **モデルの推奨**
|
||||
4. **設定**
|
||||
|
||||
何度もテストを行った結果(中国語と英語のタスク)、総合的な効果と価格の面で、**GET_INFO_MODEL**、**REWRITE_MODEL**、**HTML_PARSE_MODEL** の三つについては、 **"zhipuai/glm4-9B-chat"**、**"alibaba/Qwen2-7B-Instruct"**、**"alibaba/Qwen2-7B-Instruct"** をそれぞれ推奨します。
|
||||
`env_sample`をコピーし、`.env`に名前を変更してから、以下のように設定情報(LLMサービスのトークンなど)を記入します。
|
||||
|
||||
これらのモデルは本プロジェクトに非常に適合し、指示の遵守性が安定しており、生成効果も優れています。本プロジェクトに関連するプロンプトもこれら三つのモデルに対して最適化されています。(**HTML_PARSE_MODEL** には **"01-ai/Yi-1.5-9B-Chat"** も使用可能で、実際にテストしたところ非常に良好な結果が得られました)
|
||||
|
||||
⚠️ また、より低価格でより速い速度とより高い無料クオータを提供する **SiliconFlow** のオンライン推論サービスを強く推奨します!⚠️
|
||||
|
||||
SiliconFlow のオンライン推論サービスはOpenAI SDKと互換性があり、上記の三つのモデルのオープンサービスも提供しています。LLM_API_BASE を "https://api.siliconflow.cn/v1" に設定し、LLM_API_KEY を設定するだけで使用できます。
|
||||
|
||||
😄 もしよろしければ、私の[招待リンク](https://cloud.siliconflow.cn?referrer=clx6wrtca00045766ahvexw92)を使ってください。私もトークン報酬をさらに受け取ることができます 😄
|
||||
- LLM_API_KEY # 大規模言語モデル推論サービスのAPIキー
|
||||
- LLM_API_BASE # このプロジェクトはOpenAI SDKに依存しています。モデルサービスがOpenAI APIをサポートしている場合、この項目を設定することで正常に使用できます。OpenAIサービスを使用する場合はこの項目を削除してください。
|
||||
- WS_LOG="verbose" # デバッグ観察を開始するかどうかの設定。必要がない場合は削除してください。
|
||||
- GET_INFO_MODEL # 情報抽出とタグマッチングタスクモデル。デフォルトは gpt-3.5-turbo
|
||||
- REWRITE_MODEL # 近似情報の統合と書き換えタスクモデル。デフォルトは gpt-3.5-turbo
|
||||
- HTML_PARSE_MODEL # ウェブページ解析モデル(GNEアルゴリズムがうまく機能しない場合に自動的に使用)。デフォルトは gpt-3.5-turbo
|
||||
- PROJECT_DIR # データ、キャッシュ、およびログファイルの保存場所。リポジトリに対する相対パス。デフォルトではリポジトリ内。
|
||||
- PB_API_AUTH='email|password' # pbデータベースのadminのメールアドレスとパスワード(必ずメールアドレスで、仮のメールアドレスでも可)
|
||||
- PB_API_BASE # 通常は不要。この項目は、デフォルトのポケットベースローカルインターフェース(8090)を使用しない場合にのみ設定してください。
|
||||
|
||||
|
||||
4. **ローカルデプロイメント**
|
||||
5. **モデルの推奨**
|
||||
|
||||
ご覧の通り、このプロジェクトは 7B/9B LLM を使用しており、ベクトルモデルを必要としません。つまり、RTX 3090 (24GB VRAM) を使用するだけで、このプロジェクトを完全にローカルにデプロイできます。
|
||||
多くのテスト(中国語と英語のタスク向け)に基づき、**GET_INFO_MODEL**、**REWRITE_MODEL**、**HTML_PARSE_MODEL** の3項目に対してそれぞれ **"zhipuai/glm4-9B-chat"**、**"alibaba/Qwen2-7B-Instruct"**、**"alibaba/Qwen2-7B-Instruct"** を推奨します。
|
||||
|
||||
ローカルの LLM サービスが OpenAI SDK と互換性があることを確認し、LLM_API_BASE を適切に設定してください。
|
||||
これらは本プロジェクトに非常に適しており、指示の遵守が安定していて、生成結果が優れています。本プロジェクトに関連するプロンプトもこれらの3つのモデルに最適化されています。(**HTML_PARSE_MODEL**は **"01-ai/Yi-1.5-9B-Chat"** も使用可能で、非常に良好な結果を示しています。)
|
||||
|
||||
|
||||
5. **プログラムの実行**
|
||||
⚠️ **SiliconFlow**のオンライン推論サービスの使用も強くお勧めします。低価格、高速、無料枠が多い!⚠️
|
||||
|
||||
```bash
|
||||
docker compose up
|
||||
```
|
||||
SiliconFlowのオンライン推論サービスはOpenAI SDKと互換性があり、上記3つのモデルのオープンソースサービスも提供しています。`LLM_API_BASE`を "https://api.siliconflow.cn/v1" に設定し、`LLM_API_KEY`を設定するだけで利用できます。
|
||||
|
||||
**注意:**
|
||||
- 上記のコマンドを wiseflow コードリポジトリのルートディレクトリで実行してください。
|
||||
- 実行前に、`.env` ファイルを Dockerfile と同じディレクトリ(wiseflow コードリポジトリのルートディレクトリ)に作成して編集してください。.env ファイルは `env_sample` を参照できます。
|
||||
- 初めて Docker コンテナを実行する際にエラーが発生することがあります。これは、`pb` リポジトリにまだ管理者アカウントを作成していないためで、通常の現象です。
|
||||
|
||||
この時、コンテナを閉じずに、ブラウザで `http://127.0.0.1:8090/_/` を開き、指示に従って管理者アカウントを作成してください(必ずメールを使用してください)。その後、作成した管理者のメールアドレス(再度強調しますが、必ずメールを使用してください)とパスワードを `.env` ファイルに記入し、コンテナを再起動してください。
|
||||
😄 または、私の[招待リンク](https://cloud.siliconflow.cn?referrer=clx6wrtca00045766ahvexw92)を使用して、私がより多くのトークンを得られるようにすることもできます 😄
|
||||
|
||||
|
||||
6. **スケジュールされたソーススキャンの追加**
|
||||
6. **注目点と定期スキャンソースの追加**
|
||||
|
||||
プログラムを起動した後、PocketBase 管理ダッシュボードの UI を [http://127.0.0.1:8090/_/](http://127.0.0.1:8090/_/) で開きます。
|
||||
プログラムを起動した後、pocketbaseの管理ダッシュボードUI (http://127.0.0.1:8090/_/) を開きます。
|
||||
|
||||
6.1 **tagsフォーム**を開く
|
||||
6.1 **tagsフォーム**を開く
|
||||
|
||||
このフォームでは、関心のあるポイントを指定できます。LLMはこの情報に基づいて、情報を精査、フィルタリング、分類します。
|
||||
このフォームで関心事項を指定できます。LLMはこれに基づいて情報を抽出、フィルタリング、分類します。
|
||||
|
||||
**tags フィールドの説明:**
|
||||
- `name`:関心のあるポイントの説明。**注意:具体的に記載すること**。良い例は `米中競争動向`、悪い例は `国際情勢`。
|
||||
- `activated`:タグが有効かどうかを示します。無効にすると、このポイントは無視されます。オンとオフはDockerコンテナを再起動することなく切り替えでき、次回の定期タスク時に更新されます。
|
||||
tagsフィールドの説明:
|
||||
|
||||
6.2 **sitesフォーム**を開く
|
||||
- name, 関心事項の説明。**注意: より具体的にしてください。** 良い例: `米中競争動向`。悪い例: `国際情勢`。
|
||||
- activated, アクティブかどうか。無効にするとその関心事項は無視されます。無効化後に再度有効化できます。有効化と無効化にはDockerコンテナの再起動は不要で、次回の定期タスク時に更新されます。
|
||||
|
||||
このフォームでは、カスタム情報源を指定できます。システムはバックグラウンドで定期タスクを開始し、これらの情報源をローカルでスキャン、解析、および分析します。
|
||||
6.2 **sitesフォーム**を開く
|
||||
|
||||
このフォームでカスタムソースを指定できます。システムはバックグラウンドで定期タスクを起動し、これらのソースをローカルでスキャン、解析、分析します。
|
||||
|
||||
sitesフィールドの説明:
|
||||
|
||||
- url, ソースのURL。特定の記事ページではなく、記事リストのページを指定してください。
|
||||
- per_hours, スキャン頻度。単位は時間。整数(1〜24範囲で、1日1回を超えない頻度(24を設定)を推奨)。
|
||||
- activated, アクティブかどうか。無効にするとそのソースは無視されます。無効化後に再度有効化できます。有効化と無効化にはDockerコンテナの再起動は不要で、次回の定期タスク時に更新されます。
|
||||
|
||||
|
||||
7. **ローカルデプロイ**
|
||||
|
||||
ご覧の通り、本プロジェクトは7B/9BのLLMを使用しており、ベクトルモデルを必要としません。つまり、RTX 3090(24 GB VRAM)1台で完全にローカルデプロイできます。
|
||||
|
||||
お使いのローカルLLMサービスがOpenAI SDKと互換性があることを確認し、`LLM_API_BASE`を適切に設定してください。
|
||||
|
||||
**sites フィールドの説明:**
|
||||
- url: ソースの URL。特定の記事ページを指定する必要はなく、記事リストページを指定するだけで構いません。
|
||||
- per_hours: スキャン頻度、単位は時間、整数型(範囲 1~24;1日1回以上のスキャン頻度は推奨しないため、24に設定してください)。
|
||||
- activated: 有効化するかどうか。オフにするとソースが無視され、後で再びオンにできます。オンとオフの切り替えには Docker コンテナの再起動は不要で、次のスケジュールタスク時に更新されます。
|
||||
|
||||
|
||||
## 🛡️ ライセンス
|
||||
|
@ -20,7 +20,7 @@ class Request(BaseModel):
|
||||
app = FastAPI(
|
||||
title="WiseFlow Union Backend",
|
||||
description="From Wiseflow Team.",
|
||||
version="0.1.1",
|
||||
version="0.3.0",
|
||||
openapi_url="/openapi.json"
|
||||
)
|
||||
|
||||
@ -35,7 +35,7 @@ app.add_middleware(
|
||||
|
||||
@app.get("/")
|
||||
def read_root():
|
||||
msg = "Hello, this is Wise Union Backend, version 0.1.1"
|
||||
msg = "Hello, this is Wise Union Backend, version 0.3.0"
|
||||
return {"msg": msg}
|
||||
|
||||
|
||||
|
@ -1,7 +1,7 @@
|
||||
import asyncio
|
||||
from insights import pipeline, pb, logger
|
||||
|
||||
counter = 0
|
||||
counter = 1
|
||||
|
||||
|
||||
async def process_site(site, counter):
|
||||
@ -16,7 +16,7 @@ async def schedule_pipeline(interval):
|
||||
global counter
|
||||
while True:
|
||||
sites = pb.read('sites', filter='activated=True')
|
||||
logger.info(f'task execute loop {counter + 1}')
|
||||
logger.info(f'task execute loop {counter}')
|
||||
await asyncio.gather(*[process_site(site, counter) for site in sites])
|
||||
|
||||
counter += 1
|
||||
|
Loading…
Reference in New Issue
Block a user