Infer methodology preferences while keeping no-evidence cases neutral.
(text_lower: str)
| 1564 | |
| 1565 | |
| 1566 | def _derive_methodology_preferences(text_lower: str) -> Dict[str, Any]: |
| 1567 | """Infer methodology preferences while keeping no-evidence cases neutral.""" |
| 1568 | data_driven_count = sum(1 for keyword in METHODOLOGY_KEYWORDS["data_driven"] if keyword in text_lower) |
| 1569 | theory_count = sum(1 for keyword in METHODOLOGY_KEYWORDS["theory"] if keyword in text_lower) |
| 1570 | systematic_count = sum(1 for keyword in METHODOLOGY_KEYWORDS["systematic"] if keyword in text_lower) |
| 1571 | incremental_count = sum(1 for keyword in METHODOLOGY_KEYWORDS["incremental"] if keyword in text_lower) |
| 1572 | open_source_count = sum(1 for keyword in METHODOLOGY_KEYWORDS["open_source"] if keyword in text_lower) |
| 1573 | bio_count = sum(1 for keyword in ("bio", "science", "scientific", "molecular", "protein") if keyword in text_lower) |
| 1574 | |
| 1575 | preferences: Dict[str, Any] = {} |
| 1576 | if data_driven_count > theory_count and data_driven_count > 0: |
| 1577 | preferences["preference_data_driven_over_theory"] = True |
| 1578 | elif theory_count > data_driven_count and theory_count > 0: |
| 1579 | preferences["preference_data_driven_over_theory"] = False |
| 1580 | |
| 1581 | if systematic_count > incremental_count and systematic_count > 0: |
| 1582 | preferences["preference_systematic_work_over_incremental"] = True |
| 1583 | elif incremental_count > systematic_count and incremental_count > 0: |
| 1584 | preferences["preference_systematic_work_over_incremental"] = False |
| 1585 | |
| 1586 | if open_source_count > 0: |
| 1587 | preferences["preference_open_source_code"] = True |
| 1588 | if bio_count > 0: |
| 1589 | preferences["preference_bio_science_application"] = True |
| 1590 | |
| 1591 | return preferences |
| 1592 | |
| 1593 | |
| 1594 | def _build_taste_profile_from_methodology(methodology_preferences: Dict[str, Any]) -> Dict[str, List[str]]: |
no outgoing calls
no test coverage detected