(profile: Dict[str, Any], idf: Dict[str, float])
| 317 | |
| 318 | |
| 319 | def make_state(profile: Dict[str, Any], idf: Dict[str, float]) -> UserNaturalProfileState: |
| 320 | return UserNaturalProfileState( |
| 321 | profile_text=str(profile.get("profile_text") or ""), |
| 322 | directions=list(profile.get("directions") or []), |
| 323 | terms=list(profile.get("terms") or []), |
| 324 | profile_vector=vectorize_text(profile.get("profile_text"), idf), |
| 325 | ) |
| 326 | |
| 327 | |
| 328 | def phrase_alignment_score(text: str, phrases: Sequence[str]) -> float: |
no test coverage detected