MCPcopy Create free account
hub / github.com/OpenRaiser/PaperFlow / build_profile_map

Function build_profile_map

experiments/baselines/nl_profile/runner.py:408–426  ·  view source on GitHub ↗
(
    user_metadata: Dict[str, Dict[str, Any]],
    roles: Dict[str, Dict[str, Any]],
    episode_rows: Sequence[Dict[str, Any]],
)

Source from the content-addressed store, hash-verified

406
407
408def build_profile_map(
409 user_metadata: Dict[str, Dict[str, Any]],
410 roles: Dict[str, Dict[str, Any]],
411 episode_rows: Sequence[Dict[str, Any]],
412) -> Dict[str, Dict[str, Any]]:
413 user_ids = sorted(
414 {
415 str(row.get("user_id") or "").strip()
416 for row in episode_rows
417 if str(row.get("user_id") or "").strip()
418 }
419 | set(user_metadata.keys())
420 )
421 profiles: Dict[str, Dict[str, Any]] = {}
422 for user_id in user_ids:
423 meta = user_metadata.get(user_id, {"user_id": user_id})
424 role_name = str(meta.get("role_name") or user_id.replace("user_", "")).strip()
425 profiles[user_id] = build_natural_language_profile(meta, roles.get(role_name, {}))
426 return profiles
427
428
429def clone_output_row(

Callers 1

rerank_episodesFunction · 0.70

Calls 2

getMethod · 0.80

Tested by

no test coverage detected