MCPcopy Create free account
hub / github.com/HzaCode/OneCite / identify

Method identify

onecite/pipeline/identifier.py:51–75  ·  view source on GitHub ↗

Identify and standardize entries, finding a DOI for each. Args: raw_entries: List of raw entries produced by :meth:`ParserModule.parse`. interactive_callback: A callable that receives a list of candidate dictionaries and returns the in

(self, raw_entries: List[RawEntry], 
                interactive_callback: Callable[[List[Dict]], int])

Source from the content-addressed store, hash-verified

49
50
51 def identify(self, raw_entries: List[RawEntry],
52 interactive_callback: Callable[[List[Dict]], int]) -> List[IdentifiedEntry]:
53 """Identify and standardize entries, finding a DOI for each.
54
55 Args:
56 raw_entries: List of raw entries produced by
57 :meth:`ParserModule.parse`.
58 interactive_callback: A callable that receives a list of
59 candidate dictionaries and returns the index of the
60 selected candidate.
61
62 Returns:
63 A list of :class:`IdentifiedEntry` dictionaries.
64 """
65 self.logger.info(f"Starting to identify {len(raw_entries)} entries")
66 identified_entries = []
67
68 for entry in raw_entries:
69 identified_entry = self._identify_single_entry(entry, interactive_callback)
70 identified_entries.append(identified_entry)
71
72 successful_count = sum(1 for e in identified_entries if e['status'] == 'identified')
73 self.logger.info(f"Identification completed: {successful_count}/{len(identified_entries)} entries successfully identified")
74
75 return identified_entries
76
77 def _identify_single_entry(self, raw_entry: RawEntry,
78 interactive_callback: Callable[[List[Dict]], int]) -> IdentifiedEntry:

Callers 1

processMethod · 0.80

Calls 1

Tested by

no test coverage detected