← Về thư mục
skills/retrosynthesis_planning/condition_benchmark.py
- _reaction_signature · function · L26-L37 — def _reaction_signature( reactants: Any, product: Any, canonicalizer: Canonicalizer ) -> tuple[str, str]
- validate_condition_inputs · function · L40-L67 — def validate_condition_inputs( rows: Iterable[Mapping[str, Any]], *, canonicalizer: Canonicalizer = rdkit_canonicalize, ) -> tuple[dict[str, str], ...]
- normalize_vocabulary · function · L70-L83 — def normalize_vocabulary( vocabulary: Mapping[str, Iterable[str]], ) -> dict[str, frozenset[str]]
- _condition_tuple · function · L86-L96 — def _condition_tuple(value: Any, *, field: str) -> tuple[str | None, ...]
- normalize_condition_outputs · function · L99-L188 — def normalize_condition_outputs( inputs: Sequence[Mapping[str, str]], payloads: Iterable[Mapping[str, Any]], *, vocabulary: Mapping[str, Iterable[str]], top_k: int, ) -> tuple[dict[str, Any], ...]
- evaluate_condition_predictions · function · L191-L286 — def evaluate_condition_predictions( predictions: Sequence[Mapping[str, Any]], reference_rows: Iterable[Mapping[str, Any]], , top_k: int, ) -> dict[str, Any]: # The non-empty invariant is enforced on the normalize side by every # validate_ helper; without it here the metric divisions below reduce # to a bare ZeroDivisionError instead of a protocol refusal.