base_rag/DIRECTORY_CLEANUP.md

118 lines
3.4 KiB
Markdown
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

# 项目目录整理总结
## 🗂️ 整理前的问题
- 存在多个重复的测试目录:`test_files/`, `test_docs/`, `documents/`
- 测试文件分散在不同位置,管理混乱
- 大量临时测试脚本和数据库文件
- 重复的测试文件和配置
## 🧹 清理操作
### 删除的目录和文件
1. **重复目录**:
- `test_docs/` - 删除
- `documents/` - 删除
2. **临时测试脚本**:
- `create_docx.py`
- `test_docx.py`
- `test_file_formats.py`
- `comprehensive_test.py`
- `final_test.py`
3. **多余数据库文件**:
- `demo_file_status.db`
- `file_status.db`
- `test_status.db`
- `final_test.db`
4. **临时文档**:
- `CLEANUP_SUMMARY.md`
- `TEST_REPORT.md`
5. **重复测试文件**:
- `test_files/test_document.txt`
- `test_files/test_markdown.md`
## 📁 整理后的目录结构
```
base_rag/
├── src/ # 源代码
│ └── base_rag/
│ ├── __init__.py
│ └── core.py
├── examples/ # 示例代码
│ ├── simple_test.py # 基础功能测试
│ └── multi_format_test.py # 多格式文件测试
├── test_files/ # 统一的测试文件目录
│ ├── knowledge.txt # TXT格式测试文件
│ ├── python_basics.txt # Python基础知识
│ ├── web_frameworks.txt # Web框架知识
│ ├── data_science.txt # 数据科学知识
│ ├── python_guide.md # Python指南(MD格式)
│ ├── machine_learning.md # 机器学习(MD格式)
│ └── deep_learning_guide.docx # 深度学习(DOCX格式)
├── chroma_db/ # 向量数据库
├── scripts/ # 构建脚本
├── venv/ # Python虚拟环境
├── README.md # 项目说明
├── requirements.txt # 依赖包
└── pyproject.toml # 项目配置
```
## 🎯 统一的测试配置
### 测试目录统一为 `test_files/`
- 所有测试文件集中在 `test_files/` 目录
- 包含 TXT、MD、DOCX 三种格式的测试文件
- 涵盖不同主题Python、机器学习、深度学习、数据科学
### 数据库统一为 `status.db`
- 使用单一的状态数据库文件
- 避免多个测试脚本创建重复的数据库
### 示例脚本优化
1. **`simple_test.py`** - 基础功能测试
- 测试基本的文件处理和查询功能
- 使用 TXT 格式文件进行测试
2. **`multi_format_test.py`** - 多格式文件测试
- 测试 TXT、MD、DOCX 三种格式
- 验证跨格式查询功能
- 展示异步处理能力
## ✅ 整理效果
1. **目录结构清晰**: 消除了重复目录,统一了测试文件位置
2. **文件管理规范**: 删除了临时和重复文件
3. **测试配置统一**: 所有测试使用相同的目录和数据库配置
4. **代码组织优化**: 保留了两个核心的测试示例
## 🚀 后续测试指南
### 运行基础测试
```bash
cd /Users/liruwei/Documents/code/project/demo/base_rag
python examples/simple_test.py
```
### 运行多格式测试
```bash
cd /Users/liruwei/Documents/code/project/demo/base_rag
python examples/multi_format_test.py
```
### 添加新测试文件
将新的测试文件直接放入 `test_files/` 目录即可,支持的格式:
- `.txt` - 纯文本文件
- `.md` - Markdown文件
- `.docx` - Word文档
现在项目结构更加清晰,便于后续的开发和测试!