fix: improve chatbot schedule and contact responses - #151
Conversation
📝 WalkthroughWalkthrough일정 질의 헤딩 정규화와 일정 라우팅 검증이 강화되었습니다. 연락처 단위 후보 필터와 문자열 유사도 기반 점수 계산이 추가되었고, 약어·오타 매칭 품질 검증이 확장되었습니다. Changes일정 헤딩 정규화
연락처 단위 매칭
Estimated code review effort: 3 (Moderate) | ~20 minutes 🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✨ Finishing Touches 💡 1🛠️ Fix failing CI checks 💡
📝 Generate docstrings
🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
There was a problem hiding this comment.
Actionable comments posted: 1
🧹 Nitpick comments (2)
tests/regression/chatbot/check_query_index_metadata_quality.py (1)
386-390: 📐 Maintainability & Code Quality | 🔵 Trivial | ⚡ Quick win실제 연락처 답변 경로도 회귀 테스트하세요.
현재 검증은 private helper인
_unit_term_score의 숫자 결과만 확인합니다. 새로 변경된score_row의 제목·본문·source marker 가중치와metadata_direct_answer의 최종 후보 선택은 테스트되지 않으므로, 약어와 오타 질의가 실제 전화번호/이메일 및 올바른 URL을 반환하는지 직접 검증하는 케이스를 추가하세요.🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the rest with a brief reason, keep changes minimal, and validate. In `@tests/regression/chatbot/check_query_index_metadata_quality.py` around lines 386 - 390, Replace the `_unit_term_score`-only assertions in the regression test with end-to-end cases through `metadata_direct_answer`, using the abbreviation and typo queries. Verify each result returns the expected phone number/email and correct URL, thereby exercising `score_row` title, body, and source-marker weighting and final candidate selection.tests/regression/chatbot/check_chatbot_tool_routing.py (1)
70-75: 📐 Maintainability & Code Quality | 🔵 Trivial | ⚡ Quick win추가된 헤딩 정규화 분기를 모두 회귀 테스트해 주세요.
현재는
언제야?와알려줘만 검증합니다.언제,알려주세요,보여줘,보여주세요,학사 일정,일정케이스도 테이블 기반 테스트로 추가하면 정규식 변경으로 인한 회귀를 방지할 수 있습니다.🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the rest with a brief reason, keep changes minimal, and validate. In `@tests/regression/chatbot/check_chatbot_tool_routing.py` around lines 70 - 75, 테스트의 도구 라우팅 검증을 테이블 기반으로 확장하세요. `tools.run_mode_tools`를 사용하는 회귀 테스트에 `언제야?`, `언제`, `알려줘`, `알려주세요`, `보여줘`, `보여주세요`, `학사 일정`, `일정` 입력을 모두 추가하고, 각 입력이 기대하는 정규화된 헤딩으로 시작하는지 검증해 정규식 분기를 포괄적으로 확인하세요.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In `@LLM/OSS/formatter.py`:
- Around line 68-76: 정규식 기반 텍스트 정리 로직에서 `언제요`, `언제에요` 및 관련 종결 표현과 선택적 물음표를 제거하도록
종료 패턴을 확장하세요. 기존 표현과 기본 헤딩 변환 동작은 유지하고, `개강 언제요?`, `개강 언제에요?`가 올바른 헤딩으로 정규화되는 회귀
테스트를 추가하세요.
---
Nitpick comments:
In `@tests/regression/chatbot/check_chatbot_tool_routing.py`:
- Around line 70-75: 테스트의 도구 라우팅 검증을 테이블 기반으로 확장하세요. `tools.run_mode_tools`를
사용하는 회귀 테스트에 `언제야?`, `언제`, `알려줘`, `알려주세요`, `보여줘`, `보여주세요`, `학사 일정`, `일정` 입력을 모두
추가하고, 각 입력이 기대하는 정규화된 헤딩으로 시작하는지 검증해 정규식 분기를 포괄적으로 확인하세요.
In `@tests/regression/chatbot/check_query_index_metadata_quality.py`:
- Around line 386-390: Replace the `_unit_term_score`-only assertions in the
regression test with end-to-end cases through `metadata_direct_answer`, using
the abbreviation and typo queries. Verify each result returns the expected phone
number/email and correct URL, thereby exercising `score_row` title, body, and
source-marker weighting and final candidate selection.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: Path: .coderabbit.yaml
Review profile: CHILL
Plan: Pro Plus
Run ID: 52d2d034-daf2-4962-b251-c13e9c21fd99
📒 Files selected for processing (5)
LLM/OSS/formatter.pyLLM/sub_model/index_utils.pyLLM/sub_model/query_index.pytests/regression/chatbot/check_chatbot_tool_routing.pytests/regression/chatbot/check_query_index_metadata_quality.py
| text = re.sub( | ||
| r"\s*(?:언제(?:야|예요|인가요)?|알려\s*줘|알려\s*주세요|보여\s*줘|보여\s*주세요)$", | ||
| "", | ||
| text, | ||
| ).strip() | ||
| if not text: | ||
| return "학사일정 안내" | ||
| if text in {"학사일정", "학사 일정", "일정"}: | ||
| return "학사일정 안내" |
There was a problem hiding this comment.
🎯 Functional Correctness | 🟡 Minor | ⚡ Quick win
언제요 계열 종결 표현도 제거해 주세요.
현재 정규식은 개강 언제요?나 개강 언제에요?를 제거하지 못해 개강 언제요 일정 같은 잘못된 헤딩을 생성합니다. 요, 에요 등 지원할 표현을 추가하고 회귀 테스트로 고정해 주세요.
권장 수정
- r"\s*(?:언제(?:야|예요|인가요)?|알려\s*줘|알려\s*주세요|보여\s*줘|보여\s*주세요)$",
+ r"\s*(?:언제(?:야|요|예요|에요|인가요|죠)?|알려\s*줘|알려\s*주세요|보여\s*줘|보여\s*주세요)$",📝 Committable suggestion
‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.
| text = re.sub( | |
| r"\s*(?:언제(?:야|예요|인가요)?|알려\s*줘|알려\s*주세요|보여\s*줘|보여\s*주세요)$", | |
| "", | |
| text, | |
| ).strip() | |
| if not text: | |
| return "학사일정 안내" | |
| if text in {"학사일정", "학사 일정", "일정"}: | |
| return "학사일정 안내" | |
| text = re.sub( | |
| r"\s*(?:언제(?:야|요|예요|에요|인가요|죠)?|알려\s*줘|알려\s*주세요|보여\s*줘|보여\s*주세요)$", | |
| "", | |
| text, | |
| ).strip() | |
| if not text: | |
| return "학사일정 안내" | |
| if text in {"학사일정", "학사 일정", "일정"}: | |
| return "학사일정 안내" |
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
In `@LLM/OSS/formatter.py` around lines 68 - 76, 정규식 기반 텍스트 정리 로직에서 `언제요`, `언제에요`
및 관련 종결 표현과 선택적 물음표를 제거하도록 종료 패턴을 확장하세요. 기존 표현과 기본 헤딩 변환 동작은 유지하고, `개강 언제요?`,
`개강 언제에요?`가 올바른 헤딩으로 정규화되는 회귀 테스트를 추가하세요.
🎯 배경
기 연락처로 시작하는 문제가 발생했습니다.호텔과,호탤과와 같은 학과 축약어 및 오타 질의에서 호텔관광학과가 아닌 연락처가 반환됐습니다.🔍 주요 내용
변경 요약
학사일정 응답 제목을 자연스럽게 정리하고, 연락처 검색의 부서명·약어·오타 매칭 정확도를 개선했습니다. 관련 회귀 테스트도 추가했습니다.
주요 변경점
학사일정 안내형식으로 표준화주의/리스크
다음 액션