Skip to content

Commit c160c81

Browse files
berntpoppclaude
andcommitted
refactor: Remove NLI-specific comments from hpo_extraction_orchestrator
Update array output handling comments to be model-agnostic, matching the style already applied to reranker.py. The code logic remains for backward compatibility with any model returning array outputs, but NLI models are no longer mentioned since BGE cross-encoder is the recommended approach. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com>
1 parent d0e0517 commit c160c81

1 file changed

Lines changed: 3 additions & 6 deletions

File tree

phentrieve/text_processing/hpo_extraction_orchestrator.py

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -150,20 +150,17 @@ def orchestrate_hpo_extraction(
150150
)
151151

152152
# Add scores to candidates
153-
# Handle different output formats from various cross-encoder models:
154-
# - NLI models return arrays: [P(entailment), P(neutral), P(contradiction)]
155-
# - Rerankers return single float: relevance_score
153+
# Handle different output formats from various cross-encoder models
156154
for idx, match in enumerate(current_hpo_matches[:]):
157155
raw_score = scores[idx]
158156
if (
159157
isinstance(raw_score, (list, np.ndarray))
160158
and len(raw_score) > 1
161159
):
162-
# NLI model: use entailment probability (index 0)
163-
# Note: Suboptimal for semantic relevance - dedicated reranker recommended
160+
# For models returning array outputs: use first score
164161
match["score"] = float(raw_score[0])
165162
else:
166-
# Proper reranker: single relevance score
163+
# For standard cross-encoders: single relevance score
167164
match["score"] = float(raw_score)
168165

169166
# Sort by score

0 commit comments

Comments
 (0)