Skip to content

Commit 9d599d5

Browse files
realmarcinclaude
andcommitted
Address Copilot review: drop dead title param from guess_evidence_source
Copilot flagged that title was assigned None and then passed through guess_evidence_source as a parameter that the classifier merged into its keyword-matching text via filter(None, ...). With title always None the parameter was dead code that just clutters the call sites. Remove the title parameter from guess_evidence_source and from both caller blocks. PubMed abstracts already embed the title in the abstract text (so PMID-driven classification is unchanged), and CrossRef titles for DOI references are available via LiteratureFetcher.fetch_doi_metadata() if richer classification is wanted later — that's now a clear future-work hook rather than a hard-coded-None pretense. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
1 parent 7c555f6 commit 9d599d5

1 file changed

Lines changed: 11 additions & 14 deletions

File tree

scripts/add_evidence_source.py

Lines changed: 11 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -81,13 +81,12 @@ def guess_evidence_source(
8181
self,
8282
snippet: str,
8383
abstract: str = None,
84-
title: str = None,
8584
community_origin: str = None
8685
) -> Optional[str]:
8786
"""Guess evidence source using heuristics"""
8887

8988
# Combine text for keyword matching
90-
text = ' '.join(filter(None, [snippet, abstract, title])).lower()
89+
text = ' '.join(filter(None, [snippet, abstract])).lower()
9190

9291
# Check for review first (highest specificity)
9392
if any(kw in text for kw in self.review_keywords):
@@ -150,20 +149,19 @@ def process_yaml(
150149
reference = ev.get('reference', '')
151150

152151
# Try to fetch abstract for better classification
152+
# Title is not threaded into the classifier — PubMed
153+
# abstracts already embed the title, and CrossRef
154+
# titles for DOIs are available via fetch_doi_metadata()
155+
# if richer classification is wanted later.
153156
abstract = None
154-
title = None # LiteratureFetcher.fetch_paper returns
155-
# (abstract, pdf_url); the title is embedded
156-
# in PubMed abstracts and can be pulled from
157-
# CrossRef metadata via fetch_doi_metadata()
158-
# if richer classification is needed later.
159157
try:
160158
abstract, _ = self.fetcher.fetch_paper(reference)
161159
except Exception:
162160
pass
163161

164162
# Guess evidence source
165163
guessed_source = self.guess_evidence_source(
166-
snippet, abstract, title, community_origin
164+
snippet, abstract, community_origin
167165
)
168166

169167
if auto_mode and guessed_source:
@@ -225,19 +223,18 @@ def process_yaml(
225223
snippet = ev.get('snippet', '')
226224
reference = ev.get('reference', '')
227225

226+
# Title is not threaded into the classifier — PubMed
227+
# abstracts already embed the title, and CrossRef
228+
# titles for DOIs are available via fetch_doi_metadata()
229+
# if richer classification is wanted later.
228230
abstract = None
229-
title = None # LiteratureFetcher.fetch_paper returns
230-
# (abstract, pdf_url); the title is embedded
231-
# in PubMed abstracts and can be pulled from
232-
# CrossRef metadata via fetch_doi_metadata()
233-
# if richer classification is needed later.
234231
try:
235232
abstract, _ = self.fetcher.fetch_paper(reference)
236233
except Exception:
237234
pass
238235

239236
guessed_source = self.guess_evidence_source(
240-
snippet, abstract, title, community_origin
237+
snippet, abstract, community_origin
241238
)
242239

243240
if auto_mode and guessed_source:

0 commit comments

Comments
 (0)