Sentiment Analysis on Steroids: A Hybrid Model Using LLMs and Symbolic AI for Affective Reasoning in a Compassionate System
摘要
In this paper we present a hybrid model for extracting social-emotional content from user narratives, storing indexed versions of the salient data, and generating structured, computable, explainable (XAI), compassionate responses. We use (a) a Python-implemented subset of the Affective Reasoner (AR)—a traditional symbolic AI system that implements a cognitive-appraisal model of emotions—and (b) integrated input and output natural language processing based on various large language models (LLMs) such as the LLaMA set, and including the recently released DeepSeek-R1 model. We give example manipulations of one user narrative, which is processed in the following way: a) Generate real- time prompts and use LLMs to analyze the emotion content of the narrative in multiple passes to extract emotion instances, agents having the emotions, relationships between agents, emotion intensity, described emotion-eliciting situation within the narrative, and the triggering sentences; b) generate indexes for the extracted emotion data; c) collect emotion instances and perspective for each agent; d) generate more in-depth prompts in real time for better delineation of each emotion instance within the context of the full narrative; e) generate compassionate responses for each emotion instance; f) process the individual responses into a single cohesive response, prepared for a target agent (including the user); g) analyze the generated full compassionate response itself for emotion content “intended” by the [LLM] sympathetic responder; h) return the response; i) index all the interactions and analyses and save them in a permanent database as a record of the persistent relationship between the AR and the user.