AI_Homework_Correcttion/README.md
2025-04-01 00:33:51 +08:00

63 lines
1.6 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.

# AI作业批改系统
本项目通过调用Dify Workflow API实现自动化AI作业批改功能。系统读取本地Excel作业提交记录和随作业提交的YML配置文件自动完成作业批改流程。
## 功能特点
- 自动读取学生作业提交记录Excel格式
- 解析学生提交的YML配置文件
- 调用Dify API进行作业批改
- 支持文件上传和API结果返回
## 安装依赖
```bash
pip install -r requirements.txt
```
## 配置说明
1. 在`source/grade_assignments.py`中配置Dify API参数
```python
# API配置
DIFY_API_KEY = "your_api_key_here" # 替换为实际API Key
DIFY_API_URL = "http://192.168.100.143/v1" # Dify API地址
FILE_UPLOAD_URL = f"{DIFY_API_URL}/files/upload" # 文件上传地址
```
2. 准备学生作业提交Excel文件格式如下
| 学生姓名 | 学号 | 提交时间 | 作业状态 |
|----------|------|----------|----------|
3. 每个学生作业需包含一个YML配置文件描述作业内容
## 使用说明
1. 将学生作业Excel文件放在`data/`目录下
2. 将学生作业YML文件放在`assignments/`目录下
3. 运行主程序:
```bash
python source/grade_assignments.py
```
4. 查看批改结果,结果将保存在`results/`目录下
## 测试
运行测试用例验证系统功能:
```bash
python source/test_grade.py
```
## API文档
详细API调用规范请参考[docs/workflow_api.md](docs/workflow_api.md)
## 注意事项
- 确保网络可以访问Dify API服务器
- 上传文件大小不超过API限制
- 作业YML文件需符合规范格式