pyevoc.features.term_indices#

Term-level AFE/AOE-style indices and EVOC quadrant assignment.

This module computes the term-level indicators used by PyEvoc to reconstruct computational Hierarchical Evocation Analysis (HEM) structures from token-level tables.

The module implements three analytical layers:

  1. term-level statistics;

  2. POS-specific AFE/AOE thresholds;

  3. EVOC quadrant assignment.

It supports both user-level diffusion and document-level diffusion, preserves temporal information when available, and remains backward compatible with the earlier compute_term_indices interface.

class pyevoc.features.term_indices.SalienceConfig(alpha=0.5, max_rank_value=5.0, use_users_for_frequency=True, focal_upos=<factory>)[source]#

Bases: object

Configuration for term-level salience and diffusion indicators.

Parameters:
alpha: float = 0.5#
max_rank_value: float = 5.0#
use_users_for_frequency: bool = True#
focal_upos: set[str]#
pyevoc.features.term_indices.compute_term_statistics(tokens, *, term_col='term', upos_col='upos', user_col='user_id', doc_col='doc_id', time_col='time', r_pos_col='r_pos', r_str_col='r_str', term_type_col='term_type', config=SalienceConfig(), human_readable_quadrants=False, show_progress=True)[source]#

Compute term-level statistics, thresholds and quadrant summaries.

Parameters:
Return type:

tuple[DataFrame, DataFrame, DataFrame]

pyevoc.features.term_indices.compute_term_indices(tokens, *, term_col='term', upos_col='upos', user_col='user_id', doc_col='doc_id', r_pos_col='r_pos', r_str_col='r_str', config=SalienceConfig(), return_thresholds=False, return_quadrants=False)[source]#

Backward-compatible wrapper for term-level index computation.

Parameters:
Return type:

DataFrame | tuple[DataFrame, DataFrame, DataFrame]

pyevoc.features.term_indices.term_statistics_summary(term_stats, *, upos_col='upos', quadrant_col='quadrant')[source]#

Return a compact summary of term-level statistics by UPOS and quadrant.

Parameters:
  • term_stats (DataFrame)

  • upos_col (str)

  • quadrant_col (str)

Return type:

DataFrame