Convert keyword coverage into a conservative single-PDF confidence score.
(match_count: int, keyword_count: int)
| 539 | |
| 540 | |
| 541 | def score_direction_confidence(match_count: int, keyword_count: int) -> float: |
| 542 | """Convert keyword coverage into a conservative single-PDF confidence score.""" |
| 543 | if match_count < 2 or keyword_count <= 0: |
| 544 | return 0.0 |
| 545 | |
| 546 | coverage = match_count / keyword_count |
| 547 | return round(min(0.70, 0.45 + coverage * 0.25), 4) |
| 548 | |
| 549 | |
| 550 | def infer_research_directions(text: str) -> List[Dict]: |
no outgoing calls
no test coverage detected