rea
morluto
Reverse engineer anything with agents, from app behavior down to native binaries.
PROJECT TOPICS
INSTALL REFERENCE
dsh plugin --profile web add github:elegymythos/exam-paper-plugin
该命令指向仓库当前默认分支;尚无绑定当前 commit 的完整验证结果。
PROJECT README
DeepSeek Harness 插件:解析 Word / PDF 题目,生成带书写空隙的可打印试卷,并内置一套纯 Python 智能试题引擎,用于本地多视图特征提取、聚类、语义检索与多样性抽题,从而减少大模型 Token 消耗。
.doc / .docx / .pdf / .txt / .md 题目文件has_image 标记).docx + .html 试卷exam-paper-plugin/
├── src/
│ ├── plugin.mjs # Cordis 插件入口,注册工具
│ └── exam_paper.py # 文档解析与试卷生成引擎
├── smart_engine/ # 纯 Python 智能试题引擎
│ ├── cli.py # CLI 命令入口
│ ├── pipeline.py # 编程调用门面(供插件/二次开发)
│ ├── features.py # 多视图特征提取
│ ├── clustering.py # HDBSCAN 聚类与报告
│ ├── labels.py # 簇标签映射
│ ├── index.py # FAISS 向量索引
│ ├── mmr.py # 多样性重排
│ └── eval/ # 评估工具
├── install.sh # Linux/macOS 安装脚本
├── install.ps1 # Windows 安装脚本
├── install.bat # Windows 双击入口
├── requirements.txt # 智能引擎 Python 依赖
├── environment.yml # Conda 环境模板(国内镜像)
└── data/sample/questions.json # 示例题目数据
git clone <your-repo-url> exam-paper-plugin
cd exam-paper-plugin
./install.sh
可选参数:
./install.sh --with-doc # 额外询问安装 .doc 转换后端
./install.sh --install-deps # 自动安装缺失依赖(含智能引擎)
./install.sh --skip-deps # 跳过所有依赖安装
./install.sh --skip-smart # 只装插件,不装智能引擎依赖
./install.sh --uninstall # 卸载
安装脚本会:
plugin.mjs、exam_paper.py、smart_engine/ 到 Harness 插件目录;@deepseek-ai 依赖作用域链接;[1] 在插件目录创建 .venv 虚拟环境(推荐);[2] 指定你已有的 Python 解释器;[3] 跳过智能引擎依赖。smart_python.txt,插件运行时优先使用该 Python。powershell -ExecutionPolicy Bypass -File install.ps1
powershell -ExecutionPolicy Bypass -File install.ps1 -InstallDeps
powershell -ExecutionPolicy Bypass -File install.ps1 -SkipSmart
powershell -ExecutionPolicy Bypass -File install.ps1 -Uninstall
安装智能引擎依赖时同样支持选择“创建 .venv”或“指定现有 Python”。
dsh plugin --profile <name> add "github:<owner>/exam-paper-plugin"
# 或本地路径
dsh plugin --profile <name> add "/path/to/exam-paper-plugin"
上传题目文件后对 Agent 说:
解析 /path/to/数学试卷.docx 里的题目
然后:
要第 1、3、5 题,标题「数学单元测验(一)」,解答题留 8 行横线
插件提供两个新增工具:
| 工具 | 作用 |
|---|---|
index_question_bank |
解析题目并建立本地智能索引 |
smart_select_questions |
按查询词与分类条件智能抽题,返回多样性候选 |
对 Agent 说:
用智能抽题从这些文件里选 5 道数学函数题
引擎会执行:解析 → 导入题库 → 建索引 → 向量召回 → MMR 多样性重排 → 返回少量候选。
独立开发/测试时可直接使用:
# 使用 conda 或 venv 创建 Python 3.10 环境
pip install -r requirements.txt
python -m smart_engine.cli --workdir ./data/engine init
python -m smart_engine.cli --workdir ./data/engine import data/sample/questions.json
python -m smart_engine.cli --workdir ./data/engine build-index
python -m smart_engine.cli --workdir ./data/engine cluster
python -m smart_engine.cli --workdir ./data/engine report --markdown
python -m smart_engine.cli --workdir ./data/engine label set 1 一次函数
python -m smart_engine.cli --workdir ./data/engine search --query "二次函数" --top-k 5
python -m smart_engine.cli --workdir ./data/engine select --query "二次函数" --count 3
python -m smart_engine.cli --workdir ./data/engine eval quick
python -m smart_engine.cli --workdir ./data/engine eval full
python -m smart_engine.cli --workdir ./data/engine eval compare <old> <new>
安装好 Ollama 并下载模型后:
python -m smart_engine.cli --workdir ./data/engine eval token \
--model deepseek-r1:1.5b \
--sample-questions 20 \
--num-ctx 16384
输出示例:
{
"full_context_tokens": 9438,
"smart_context_tokens": 1035,
"token_savings_ratio": 0.8903
}
shell 服务调用 Python 脚本,输入输出为 JSON。plugin.mjs 调用,也可以被其他脚本导入。smart_select_questions 在会话工作区 .exam-paper/smart-engine/ 下保存索引和标签,不污染全局环境。requirements.txt,安装脚本默认创建 .venv 隔离,避免影响系统 Python。parse_question_file / generate_exam_paper 不受影响。SmartExamEngine 支持 init → import → build-index → search/select → close 的明确生命周期。exam_paper.py 解析结果保持一致。generate_exam_paper 生成试卷,无需额外转换。python -m pytest -q tests/
评估维度:
data/sample/questions.json 是随仓库保留的示例数据。data/ 下,但已被 .gitignore 排除,不会进入 Git 历史。data/engine*/ 或会话工作区的 .exam-paper/,同样不会提交。CLASSIFICATION EVIDENCE
系统优先读取 GitHub Topics,再与站内分类词典和词根规则比对。当前命中: deepseek。