6c1a69af0d
Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
测试文件说明
本目录包含所有测试脚本。
测试文件列表
1. test_basic.py
基础功能测试,包括:
- 模块导入测试
- 本体模型测试
- Prompt模板测试
运行方式:
uv run python tests/test_basic.py
2. test_siliconflow.py
测试硅基流动API配置,验证API密钥和连接是否正常。
运行方式:
uv run python tests/test_siliconflow.py
3. test_documents.py
测试文档解析功能,包括:
- 文档解析(.docx文件)
- TextUnit切分
- 不调用LLM,仅测试解析逻辑
运行方式:
uv run python tests/test_documents.py
4. test_model.py
测试硅基流动平台上的多个模型,找出可用模型。
运行方式:
uv run python tests/test_model.py
5. test_my_models.py
测试项目配置使用的两个指定模型:
deepseek-ai/DeepSeek-R1-Distill-Qwen-7BQwen/Qwen2.5-7B-Instruct
运行方式:
uv run python tests/test_my_models.py
6. test_quick.py
快速测试完整流程,处理少量TextUnit(1个文档的前2个),验证:
- 文档解析
- 实体识别(NER)
- 关系抽取(RE)
- 知识图谱构建
- 社区检测
运行方式:
uv run python tests/test_quick.py
注意事项
- 测试脚本需要使用配置的API密钥(
.env文件) - 部分测试会调用LLM API,可能需要一些时间
- 确保已安装所有依赖包:
uv sync