From Computational Text ANalysis to Social Representation Theory

Advancing
Hierarchical
Evocation
Analysis

PyEvoc extends the Hierarchical Evocation Method to large-scale digital corpora — reconstructing the central nucleus and peripheral structure of social representations from naturally occurring online discourse.

v0.2.1 Python 3.9+ MIT License FAIR DOI 10.5281/zenodo.20545334
PyEvoc

EVOC Structure

The four-quadrant framework

Lexical units are placed in a two-dimensional representational space defined by user-level diffusion (AFE) and discursive salience (AOE), using POS-specific thresholds computed separately for nouns, adjectives, and emojis.

HIGH DIFFUSION · HIGH SALIENCE
Central Nucleus

The most stable, consensual, and collectively shared representational elements. Strongly linked to collective memory, social norms, and group identity. These terms provide coherence and organisational stability to the overall representation.

HIGH DIFFUSION · LOW SALIENCE
First Periphery

Widely shared but contextually flexible elements that support adaptation to situational contingencies. They protect the stability of the central core while enabling representational evolution and contextual adjustment.

LOW DIFFUSION · HIGH SALIENCE
Contrast Zone

Salient but less diffused elements associated with minority positions, contested meanings, or emerging interpretative framings. Often represents heterodox viewpoints that challenge the dominant symbolic configuration.

LOW DIFFUSION · LOW SALIENCE
Peripheral System

Weakly diffused and low-salience elements characterised by contextual variability and lower representational stability. Sensitive to emerging controversies and episodic discursive activations.

Example EVOC target map
Multistage Pipeline

End-to-end representational workflow

From raw social media data to publication-ready EVOC maps — every stage is modular, resumable, and parameterised.

01
upload_file
Dataset Ingestion
Flexible CSV/XLSX/JSON loading with configurable schema mapping and metadata preservation.
02
language
Language Identification
Two-stage hybrid pipeline: fastText primary, Lingua secondary for ambiguous cases.
03
filter_alt
Thematic Filtering
Anchor-based lexical matching + cosine-similarity semantic expansion for domain subcorpora.
04
bar_chart
Corpus Statistics
Token counts, type/token ratio, hapax legomena, and temporal distribution diagnostics.
05
cleaning_services
Text Cleaning
URL removal, contraction expansion, elongation reduction, emoji spacing, punctuation normalisation.
06
spellcheck
Linguistic Annotation
Stanza-based POS tagging, lemmatisation, and dependency parsing at token level.
07
sentiment_satisfied
Emoji Assignment
Unicode-aware emoji identification; reassigned to EMOJI UPOS class for separate analysis.
08
format_bold
Structural Foregrounding
Opening-sentence detection, emphasis spans, list/quote context, typographic intensification.
09
abc
Unigram Selection
Filters to NOUN / ADJ / EMOJI with minimum document and user frequency thresholds.
10
calculate
AFE / AOE Indices
Computes diffusion (AFE), composite salience rank (AOE), and per-term statistics.
11
label
Concreteness Labels
Automated labelling using bundled English concreteness norms (Brysbaert et al.).
12
grid_view
EVOC Quadrants
POS-specific AFE/AOE thresholding; assigns each term to one of four representational zones.
13
hub
Collocations & NER
Dependency-based bigram extraction with G² significance testing; optional named entity recognition.
14
timeline
Temporal Stability
Per-period quadrant re-assignment, Jaccard/Spearman transition diagnostics, stability indices.
15
insert_chart
Visualisations
EVOC target maps, semantic trees, emoji maps, Sankey diagrams — static PNG + interactive HTML.
Installation

Get started

PyEvoc requires Python 3.9+ and installs directly from GitHub. Bundled models load automatically at runtime — no separate download steps needed for most use-cases.

table_view Expected Input Schema

A pandas.DataFrame with at least four columns:

ColumnTypeDescription
user_idstr / intAuthor or account identifier
doc_idstr / intDocument or post identifier
timedatetimePublication timestamp
textstrRaw text content

All additional source columns are preserved throughout the pipeline via DatasetConfig.

book Step-by-step Notebook functions Methodology
bash — install
# From GitHub (recommended)
pip install git+https://github.com/text-lab/pyevoc.git
# Development mode (editable install)
git clone https://github.com/text-lab/pyevoc.git cd pyevoc && pip install -e .
# Optional: Lingua secondary language validator
pip install lingua-language-detector
# Download Stanza model (once) - e.g. English
python -c "import stanza; stanza.download('en')"
python — quickstart
import pandas as pd from pyevoc.data.dataset
import DatasetConfig, load_dataset from pyevoc.analysis.quadrants
import assign_evoc_quadrants

# - Load and standardise
config = DatasetConfig( column_map={"account_ID": "user_id", "tweet_ID": "doc_id", "tweet_pub_time": "time", "tweet_text": "text"}, start_date="2022-10-01", )
corpus = load_dataset("AGI.xlsx", config=config)

# ... run preprocessing, annotation, feature steps ...

# - EVOC quadrant assignment
evoc_quadrants, counts, thresholds = assign_evoc_quadrants( term_stats, generate_html=True, html_output_dir="evoc_outputs", )
Step-by-Step Guide

Package documentation

Each step exposes a dedicated config object for fine-grained control. Intermediate outputs can be saved and reloaded to resume long annotation runs.

01
table_view
Load & standardise dataset

Map source columns to the four standard names (user_id, doc_id, time, text) via DatasetConfig. Supports CSV, XLSX, TSV, Parquet, JSON. Date filtering and timezone normalisation applied here.

pyevoc.data.dataset
02
language
Language filtering

fastText (lid.176.bin) primary classification; Lingua secondary validator for ambiguous cases (default confidence window: 0.50–0.90). Supports English, Italian, French, German, Spanish, Portuguese.

pyevoc.preprocessing.language_filtering
03
filter_alt
Thematic filtering

Provide a plain-text anchor file (one term per line). First stage: regex matching with word-boundary constraints. Second stage: cosine-similarity expansion on a sparse count matrix. Optional — skip if corpus is already domain-specific.

pyevoc.preprocessing.thematic_filtering
04
bar_chart
Corpus statistics

Descriptive summary: document count, token count, unique types, type/token ratio, hapax legomena rate, temporal distribution, and user/document metadata.

pyevoc.preprocessing.corpus_statistics
05
cleaning_services
Text cleaning

Produces a clean_text column. Options: lowercase, URL removal/placeholder, contraction expansion, emoji spacing, elongated vowel reduction, punctuation spacing. Progress bar available.

pyevoc.preprocessing.cleaning
06
spellcheck
Linguistic annotation

Stanza-based token-level annotation: UPOS tags, lemmas, dependency relations, sentence and token position. GPU support; batch size configurable. Saves Parquet for resumability.

pyevoc.preprocessing.annotation
07
sentiment_satisfied
Emoji UPOS assignment

Identifies Unicode emoji tokens and reassigns them to the EMOJI UPOS class, enabling their treatment as a distinct lexical category with separate AFE/AOE thresholds.

pyevoc.features.emoji_assignment
08
format_bold
Structural foregrounding

Computes four binary salience indicators per token: I_first (opening sentence), I_emph (emphasis), I_list (list/quote), I_intens (caps/typographic). Weights configurable via ForegroundingWeights.

pyevoc.features.foregrounding
09
abc
Unigram selection

Filters token table to NOUN, ADJ, and EMOJI. Applies minimum document (min_docs_per_term) and user (min_users_per_term) frequency thresholds to exclude noise terms.

pyevoc.features.unigram_selection
10
calculate
Compute AFE / AOE indices

Produces per-term statistics: user diffusion, composite salience rank, absolute and relative frequency. Returns POS-specific AFE/AOE thresholds and a quadrant summary table. Configurable via SalienceConfig (α, R_max, diffusion mode).

pyevoc.features.term_indices
11
label
Concreteness labelling

Adds concreteness labels to term_stats using the bundled English norms lexicon. Reports coverage statistics. Useful for interpreting the objectification dimension of representational structures.

pyevoc.features.concreteness
12
emoji_objects
Emoji labelling

Adds human-readable descriptions to emoji terms using the bundled lookup table. Falls back to standard Unicode names with fuzzy matching (configurable min_similarity) for unknown symbols.

pyevoc.features.emoji_labelling
13
grid_view
EVOC quadrant assignment

Assigns each term to one of four zones using POS-specific AFE/AOE thresholds. Generates an HTML report (generate_html=True) with the top-N terms per quadrant per POS class.

pyevoc.analysis.quadrants
14
hub
Collocations & Named Entities

Dependency-based bigram extraction, G² significance testing, minimum frequency/document/user thresholds. Optional NER with overlap resolution (prefer_overlap="evidence"). HTML output available.

pyevoc.analysis.collocations_entities
15
timeline
Temporal stability analysis

Segments corpus into periods (equal-interval or custom cuts with labels). Re-runs EVOC per period. Returns Core Jaccard similarity, Diffusion Spearman correlation, stability indices, and per-period quadrant assignments.

pyevoc.analysis.temporal_stability
16
insert_chart
Visualisations

Four plot types: EVOC target maps (NOUN/ADJ scatter), collocation semantic trees (arc diagrams coloured by quadrant), emoji EVOC map, and temporal Sankey flow diagram. Static PNG + interactive HTML via Plotly.

pyevoc.visualisation
Associated Research

References

PyEvoc was developed alongside and applied in a peer-reviewed study to appear.

format_quote BibTeX Citation
@software{misuraca2026pyevoc,
author = {Misuraca, Michelangelo},
title = {PyEvoc: Computational Hierarchical Evocation Analysis for Digital Corpora},
year = {2026},
version = {0.2.1},
publisher = {Zenodo},
doi = {10.5281/zenodo.20545334},
url = {https://doi.org/10.5281/zenodo.20545334} }