reach.overlap¶
Rank and analyze lexical overlap between skill descriptions using BM25.
Rank and analyze lexical overlap between skill descriptions using BM25.
Competition ¶
Bases: BaseModel
Summarize lexical competition against a target skill across the corpus.
Source code in src/reach/overlap.py
nearest_rival
property
¶
nearest_rival: Rival | None
Return the top-scoring rival, or None if no rivals exist.
outranked_by
property
¶
Count the number of rivals with a score strictly higher than self_score.
ranked_rivals
property
¶
ranked_rivals: tuple[Rival, ...]
Return rivals sorted by descending score, then ascending name.
rival_ratio
property
¶
Calculate the nearest rival's score relative to the target's self score.
scoring_rival
property
¶
scoring_rival: Rival | None
Return the top rival only if it has a non-zero overlap score.
standings
property
¶
standings: tuple[Standing, ...]
Return full competition standings including target skill placement.
model_post_init ¶
Cache pre-sorted rivals after initialization.
CorpusOverlap ¶
Bases: BaseModel
Hold competition rankings for all skills across the corpus.
Source code in src/reach/overlap.py
find ¶
find(skill: str) -> Competition
Retrieve the Competition model for a named skill.
Source code in src/reach/overlap.py
Rival ¶
Standing ¶
Bases: BaseModel
Represent a skill's ranked standing in a competition field.
Source code in src/reach/overlap.py
compete ¶
compete(
skill: Skill,
corpus: Sequence[Skill],
scorer: Bm25Scorer,
) -> Competition
Score a target skill against itself and all other corpus skills.
Source code in src/reach/overlap.py
rank_corpus ¶
rank_corpus(skills: Sequence[Skill]) -> CorpusOverlap
Compute and rank lexical overlap competition across a corpus of skills.