Paper-style evaluation note
Semantic Text Search Evaluation
MobileCLIP2-S3 FP16 mixed text encoder를 Flutter 앱 자연어 검색에 연결하기 위해 생성한 text index, tokenizer parity, query regression 결과를 논문화 기록 방식으로 정리한다.
Research Question
기존 SQLite keyword-only 검색 대신 text encoder embedding을 사용하면 한글/영문/별칭/설명형 query를 같은 결과 schema로 처리할 수 있는가? 또한 범위 밖 query를 확정 결과처럼 보여주지 않는 최소 정책을 만들 수 있는가?
Artifact Lineage
| Model candidate | mobileclip2_s3_server_full_ce_hardneg_fold3_20260611_214421 |
|---|---|
| Artifact source | D:/mobileclip2_s3_server_full_ce_hardneg_fold3_20260611_214421/mobile_artifacts/fp16 |
| App asset target | assets/mobile_artifacts_fp16/ |
| Generated semantic files | tokenizer_bundle.json, text_index.json, text_search_policy.json, text_query_regression_set.json, text_search_eval_report.json |
| Generator | scripts/generate_semantic_text_artifacts.py |
Method
assets/landmark_info.json의 official name, alias, Korean/English description을
검색 대상 catalog text로 사용했다. 각 text는 MobileCLIP2-S3 text encoder ONNX로 512차원 embedding을 만들고
L2 normalize한 뒤 text_index.json에 저장했다.
query regression set은 catalog text 179개와 out-of-scope query 5개로 구성했다.
keyword score는 SQLite LIKE 기반 exact/partial match이고,
semantic score는 query embedding과 catalog text embedding의 cosine similarity다.
final_text_score = 0.75 * semantic_score + 0.25 * keyword_score
Result Summary
저장된 결과 파일 기준:
top1_accuracy=0.9888268156424581,
top3_recall=1.0,
out_of_scope_accuracy=1.0.
Failure and Low-margin Cases
주요 실패는 경복궁 parent/sub-landmark 및 광화문/근정문처럼 같은 상위 공간 안에서 같은 alias를 공유하는 경우다.
예를 들어 경복궁 query는 parent class와 child class가 모두 강하게 매칭되므로
Top-3 안에는 들어가지만 Top-1은 문맥에 따라 달라질 수 있다.
이 케이스는 앱에서 틀린 확정으로 밀어붙이기보다 ambiguous 또는 parent/sub 표시로 처리하는 것이 맞다.
Sprint 2 이후에는 parent query와 sub-landmark query를 분리한 query set이 더 필요하다.
OOS Calibration
초기 정책은 OOS query를 ambiguous로 남기는 경향이 있었다.
최종 정책에서는 keyword hit가 전혀 없는 query에 대해 semantic score와 margin을 더 보수적으로 본다.
if no keyword hit and final_text_score < 0.60:
out_of_scope
if no keyword hit and margin < 0.05:
out_of_scope
이 보정은 현재 regression set에서는 OOS 5/5를 잡지만, 실제 사용자 query가 쌓이면 재보정해야 한다.
Reproducibility
python scripts/generate_semantic_text_artifacts.py --assets-dir assets/mobile_artifacts_fp16 --landmark-info assets/landmark_info.json
python scripts/check_model_contract.py
python -m unittest scripts.test_model_integration_contract
flutter test
flutter analyze --no-fatal-infos
Validation Status
- Python contract: pass, warnings only for missing hero image fallback.
- Python unittest: 9 tests pass.
- Flutter test: 5 tests pass.
- Flutter analyze: strict mode reports existing info-level lint;
--no-fatal-infospasses. - Android device/emulator ONNX runtime: not verified in this environment.