From a Poet’s “Kid-Showing” Posts to Computable Text: A Framework for Sentiment and Event Extraction in Classical Chinese Poetry

    This article reframes the ancient Chinese poet Bai Juyi’s extensive writings about parenthood—from the joy of a daughter’s birth to the grief of her death—as a computational research problem. It introduces a structured workflow that combines a weakly supervised annotation schema, interpretable feature engineering, and general-purpose cloud services to analyze kinship terms, lifecycle events, and emotional paradoxes across classical verse. The discussion emphasizes four recurring narrative patterns in Bai Juyi’s work, outlines the limits of modern affective computing when applied to historical text, and defines clear governance and ethics boundaries for digital humanities projects.

    From “Sharing Kids Online” to Computable Text: Defining the Problem

    Bai Juyi’s poems about his children were not modern “sharenting.” He wrote continuously about fatherhood in the context of official career setbacks, aging, illness, and the fate of his offspring—recording the joy of having a daughter, the pain of losing her, the comfort of new children, and the anxiety of late fatherhood. To treat this phenomenon as a technical problem, we can define it as: high-frequency emotional expression and lifecycle event extraction in the parent-child writings of classical Chinese literati. The research goal is not to judge who “showed off” their kids more, but to answer three computable questions: First, which kinship terms and age clues appear in the texts? Second, which life events do these clues correspond to—birth, first birthday, language acquisition, marriage, illness, or death? Third, how does the poet create semantic tension between “tenderness” and “worry”?

    This perspective sits at the intersection of digital humanities and affective computing. It demands both the openness of literary interpretation and the determinism of machine processing: we cannot reduce a poem to a sentiment score, nor can we rely solely on impressionistic annotation. A more reliable path is a workflow of “weak labels + manual verification + interpretable features,” where the model assists in pattern discovery and the scholar retains final judgment.

    Corpus Layer: From Full Texts to Retrievable Samples

    The first step in building a corpus is not to rush into modeling but to unify text granularity. Classical poetry operates at the level of the poem, the couplet, and the line; for modern applications, we can segment into “work—sentence—sub-clause—phrase.” In Bai Juyi’s case, works such as Jinluanzi on Her First Birthday, Weeping for Jinluanzi in Illness, Playing with Gui Luo, and My Little Ones correspond to four scenarios: having a daughter, losing her, children playing, and the father-daughter contrast. If we only classify emotion as positive or negative, we lose the structure where joy contains fear and sweetness breeds worry. It is therefore recommended to retain the work context and annotate events at the sentence level.

    A neutral data structure for a verse record can be designed as follows, using core Python data class concepts:

    1. import json
    2. from dataclasses import dataclass, asdict
    3. @dataclass
    4. class VerseRecord:
    5. work: str
    6. line: str
    7. kinship: str # daughter, son, nephew, child, etc.
    8. age_stage: str # first birthday, age three, age seven, etc.
    9. event: str # birth, mourning, play, marriage_anxiety
    10. affect_valence: int # -2..2, serving as a weak label only
    11. affect_arousal: int # 0..3
    12. evidence: str # the original phrase that justifies the label
    13. rec = VerseRecord(
    14. work="My Little Ones",
    15. line="My teeth now about to fall, your teeth just began to grow.",
    16. kinship="daughter",
    17. age_stage="childhood_tooth_vs_parental_decline",
    18. event="aging_contrast",
    19. affect_valence=1,
    20. affect_arousal=2,
    21. evidence="teeth falling / teeth emerging"
    22. )
    23. print(json.dumps(asdict(rec), ensure_ascii=False))

    This example only illustrates a general data design. The core principle is that every judgment must point back to an evidence snippet, avoiding what might be called “black-box literary verdicts.” On the engineering side, raw texts can be stored in object storage with versioning; annotation tasks can be distributed via a message queue; inference services can run on container platforms; logging services can track sample provenance; and monitoring can watch for failure rates and latency. If deployed on a cloud platform such as Baidu AI Cloud, only generic cloud capabilities should be used, following least-privilege access, data masking, and audit trails.

    Annotation Scheme: Kinship, Event, Emotion, and Time

    The difficulty of annotating parent-child writing lies in the fact that emotion is often implied rather than stated. The annotation schema therefore requires at least four layers.

    1. Kinship and Appellation Layer: Identify proper names such as “Jinluan,” “A Luo,” “My Little Ones,” and “Luo’er,” as well as relational words such as “having a daughter,” “no son,” and “brothers.” Classical appellations mix honorifics, childhood names, birth order, and generic terms, which cannot be simply mapped onto a modern kinship tree.

    2. Lifecycle Event Layer: Birth, the first-year feast, learning to sit, learning to speak, reciting poetry, drawing eyebrows, losing baby teeth, expected marriage, illness, death, burial. Events are more stable than emotions and are better suited as main labels; emotions can be treated as attributes triggered by events.

    3. Emotion and Cognition Layer: This goes beyond a simple positive/negative split. Bai Juyi’s texts often contain compound states such as tenderness, self-reproach, consolation, attachment, and anxiety. These can be annotated as parental love, sense of burden, impermanence, inheritance anxiety, or delayed retirement. It is especially important to capture paradoxes such as “love and affection are but the capital of worry”—intimacy is both a source of meaning and a source of concern.

    4. Time and Aging Layer: Age differences are a key variable. Expressions such as “I am nearly forty,” “I am already in decline,” and “father weak, child a babe” show how the poet repeatedly juxtaposes his child’s new life with his own mortality. Four features can be extracted—parent_age, child_age, age_gap, and decline_marker—to explain why “sharenting” so often shifts quickly to the limits of life.

    Model Approach: Interpretable Features First, Semantic Representations Second

    In technical selection, it is recommended to begin with an interpretable baseline. The first layer uses dictionaries and rules: kinship terms, age words, illness words, funeral words, and marriage words. The second layer uses syntax and co-occurrence: for example, “imitating my chanting voice” points to mimicry and inheritance, while “old clothes / leftover medicine” points to relics that trigger memories. The third layer can introduce general semantic vector representations for clustering, similar-work retrieval, and sentiment trend analysis. No specific framework is required; a standard pipeline can be described as: word or character sequence input, candidate pattern matching, context-window scoring, and manual inspection.

    Evaluation metrics must serve humanistic questions. Event extraction can use precision, recall, and F1; emotional intensity is better suited to agreement rates and ordinal error; topic discovery can look at cluster coherence and expert readability. For classical poetry, cross-period transfer risk is high: the character “lian,” for example, can mean cute, pitiful, or affectionate, and must be judged in context with its object and event. If the modern meaning of “sharenting” is directly mapped back onto ancient texts, the analysis will overstate the role of showing off and ignore ritual norms, pressure to produce heirs, and medical uncertainty.

    Deep Reading: Four Patterns in the Bai Juyi Sample

    Applying the above methods to the material yields four recurring patterns.

    Pattern one: Late fatherhood. Having a daughter in middle age, the joy is immediately discounted into future liabilities—marriage arrangements, delayed plans to retire to the mountains. The emotional structure is “joy—responsibility—delayed retirement.”

    Pattern two: Grief from premature death. From the shock of weeping during illness to old clothes and leftover medicine, to a grave three li away, spatial distance is compressed into permanent farewell. The high arousal in the text does not rely on rhetorical exaggeration but on concrete material evidence.

    Pattern three: Revitalization through companionship. The nephew and daughter “play at dawn clinging to my feet, at night sleeping on my sleeve.” Physical contact creates a sense of security, but “wine is fine but must spoil; the moon is round but must wane” discounts completeness in advance.

    Pattern four: Aging contrast. The father’s teeth fall while the child’s teeth grow; the father’s hair recedes while the child’s hair ties up. Parent and child in the same frame become a living exposure of time asymmetry.

    These patterns show that beneath the playful label of a “sharenting fanatic” lies the combined effect of high infant mortality, family inheritance pressure, and the literati ideal of withdrawal from public life. Technically, simply counting mentions of children yields a shallow ranking. Only by joint extraction of events, age gaps, and emotional paradoxes can we identify whether high-frequency writing is actually showing off, healing, praying, or resisting impermanence.

    Engineering Implementation and Governance Boundaries

    Implementation can adopt a batch-and-stream hybrid approach: historical texts are loaded offline into a data lake; annotation and collation are performed asynchronously; newly discovered materials enter an incremental queue. Object storage holds the original text, versions, and intermediate artifacts; message queues decouple cleaning, annotation, and training; container platforms host stateless inference services; logging tracks sample provenance; monitoring looks for annotation drift and abnormal rule hits. When using a cloud platform like Baidu AI Cloud, or any general cloud service, data classification, access auditing, key management, and reversible results should all be in place. Literary samples should not be misused for commercial profiling.

    Ethical boundaries must also be set. The ancient figures are deceased, but the texts involve premature death, illness, and marriage. Research should avoid sensationalizing the grief of losing a child. If the scope extends to modern genealogies, diaries, or content involving minors, privacy protection, authorization chains, and purpose restrictions are required. Model outputs should be labeled as “machine-assisted clues,” not final verdicts. Quotations from poems should note edition differences. Public-facing presentations should favor aggregated trends over individual shaming rankings.

    Ultimately, this topic offers a key takeaway for engineers: the best text intelligence does not substitute for human empathy—it lays out the chain of evidence for empathy. When we reframe “sharenting” from gossip into a combined model of events, relationships, time, and emotion, Bai Juyi ceases to be merely a “father who loved to show off his daughter.” He becomes a window into pre-modern family risk, paternal responsibility, and the consciousness of life’s fragility.