fix: add room floor resolver(호수 질문 해결 로직 추가)#29
Conversation
There was a problem hiding this comment.
Code Review
This pull request introduces a rule-based floor resolver for dormitory room numbers and enhances the handling of cooking-related queries, particularly regarding eating ramen in rooms. Key updates include the addition of the room_floor_resolver.py service, refined LLM system prompts to avoid speculative answers, and expanded query expansion rules. Review feedback focuses on simplifying redundant logic in the floor resolver, improving room number extraction via more robust regex, and correcting indentation and keyword redundancy in the cooking trigger lists.
kimssirr
left a comment
There was a problem hiding this comment.
추가로 테스트 코드 작성하고 커밋했습니다.
변경사항
chat_grouped_dormitory_top_k기본값 변경에 맞춰 config 테스트 기대값을 3으로 갱신했습니다.room_floor_resolver정상/예외 케이스 단위 테스트를 추가했습니다.- 호실 층수 질문이 임베딩, 검색, LLM 호출 없이 규칙 기반으로 바로 응답하는지 검증했습니다.
| top_k=settings.chat_grouped_dormitory_top_k, | ||
| ) | ||
|
|
||
| print("===== GROUPED SEARCH DEBUG =====") |
There was a problem hiding this comment.
디버그용으로는 좋은데 많아지면 로그가 너무 많아질 거 같아서 실제 운영땐 빼는 게 좋을 거 같습니다!
There was a problem hiding this comment.
디버그용으로 썻던 코든데 제가 깜빡하고 삭제를 안했네요..수정했습니다
| "라면먹어", | ||
| "라면먹어도", | ||
| "라면 먹어", | ||
| "라면 먹어도" |
There was a problem hiding this comment.
쉼표가 누락된 부분이 있어서 한 단어로 취급될 수 있을 거 같은데 의도된건지 궁금합니다
유형
작업 배경
호실 층수 질문에서 RAG 검색 결과가 잘못 잡히거나, 존재하지 않는 호실에 대해 LLM이 임의로 층수를 추론하는 문제가 있었습니다. -> 3011처럼 입력하면 잘못된 호수임에도 불구하고 내용의 일부인 301이 검색되어 301호에 대한 정보를 반환하는 문제
예시:
401호 몇층이야?+제3학생생활관4013호 몇층이야?+제3학생생활관변경 사항
room_floor_resolver.py파일 추가함-그리고 chat_grouped_dormitory_top_k: int = 2를 3으로 올려서 dormitory = null일 때 전체 생활관 검색에서 상위 3개 청크를 가져오도록함
스크린샷