Merged
Conversation
added 2 commits
March 15, 2026 14:11
- 移除旧的交集计算函数,优化问题处理流程 - 添加2-gram分词和标准化预处理功能 - 实现基于倒排索引的快速问题匹配算法 - 引入缓存机制支持多答案选项存储 - 重构answer_one方法,新增多个处理策略分支 - 实现相似题匹配和选项模糊匹配功能 - 添加未知问题记录功能到CSV文件 - 更新测试用例覆盖各种匹配场景 - 优化Quiz任务中的日志输出和变量初始化
- 移除 cached_property 依赖并替换为直接文件操作 - 集成 filelock 库以确保多线程安全的日志写入 - 将日志文件创建逻辑封装到专用方法中 - 修改文件写入逻辑以支持并发访问控制 - 移除不再需要的文件关闭方法 - 添加文件操作同步机制确保数据完整性
gaoxinkai1999
pushed a commit
to gaoxinkai1999/OnmyojiAutoScript
that referenced
this pull request
Apr 6, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
修复多个脚本在执行quiz任务时,同时使用debugger追加同一个文件导致的多进程问题
重构和优化answer流程
简单流程图如下,效率提升30-50倍,且大幅提高题目和选项识别率
flowchart TD A[答题] --> B{缓存是否命中} B -->|命中| L{缓存中是否有问题的答案} B -->|未命中| D{dict是否有题目key} D -->|有| E{答案是否在选项中} E -->|在| F(添加缓存) F -->C[返回答案在选项中对应的索引] D -->|没有|G{倒排索引是否有top_n相似的题目} E -->|不在|H{是否有和答案相似的选项} G -->|有|F H -->|有|F H -->|没有|I{选项是否在总答案中存在} G -->|没有|I I -->|存在|J{是否有低相似度的题目} I -->|不存在|K[None] J -->|有|F J -->|没有|K L -->|有|C L -->|没有|D