pelinker.kb_out¶
KB-out catalog: provenance-bearing cluster entity ids, display names, and ambiguity indices.
KbOutFitProvenance
dataclass
¶
Fit-time parameters stored in the KB-out catalog.
Source code in pelinker/kb_out.py
KbOutNamingConfig
dataclass
¶
Parameters for composite cluster display names.
Source code in pelinker/kb_out.py
build_entity_membership(composition, cluster_id_to_entity_id)
¶
KB-in entity label → all emergent clusters where it has mass.
Source code in pelinker/kb_out.py
build_kb_out_catalog(composition, assignments, kb_in_labels_map, *, kb_config, fit_provenance, naming=None, kb_in_labels_map_path=None)
¶
Build the canonical KB-out catalog (schema pelinker.kb_out.v1).
Source code in pelinker/kb_out.py
224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 | |
cluster_labels_from_catalog(catalog, *, label_kind='display')
¶
Build cluster_id → label from a KB-out catalog.
Injects HDBSCAN noise (-1 → noise) when the catalog has a noise block
or when any assignment-side consumer needs a display label for outliers.
Source code in pelinker/kb_out.py
find_ambiguous_entities(entity_membership, *, min_capture)
¶
Entities with capture ≥ min_capture in two or more clusters (polysemy).
Source code in pelinker/kb_out.py
find_split_mentions(assignments, *, min_clusters=2, max_rows=_MAX_SPLIT_MENTIONS)
¶
Mentions assigned to more than one emergent cluster (homonymy signal).
Groups by (pmid, mention, a_abs) when a_abs is present; otherwise
(pmid, mention).
Source code in pelinker/kb_out.py
format_cluster_display_name(mass_frac, *, min_fraction=0.05, top_n=3, pct_decimals=0)
¶
Composite display name from within-cluster entity fractions.
Example: alpha-67--beta-33--gamma-15 (top components above min_fraction).
Falls back to the single top entity when none meet the threshold.
Source code in pelinker/kb_out.py
format_kb_out_entity_id(kb_slug, cluster_id)
¶
kb_slug_from_config(kb_config, *, fallback='kb')
¶
Sanitized {name}_{version} slug for KB-out entity id prefixes.