International Journal of Innovative Research in                 Electrical, Electronics, Instrumentation and Control Engineering

A monthly Peer-reviewed & Refereed journal

ISSN Online 2321-2004
ISSN Print 2321-5526

Since 2013

Abstract: This document presents Sentiment Analysis, an AI-powered sentiment analysis system that leverages advanced large language models (LLMs) via the LangChain framework. The primary objective of this project is to analyse and classify textual input into sentiment categories such as Positive, Neutral, and Negative, with potential applications in content moderation, user feedback analysis, and social media monitoring. The system is built using a modular Python backend, integrated with LangChain to streamline prompt engineering and model interaction. By utilizing APIs from state-of-the-art language models (e.g., Gemini or GPT), SENTIMENT ANALYSIS delivers high-accuracy, context-aware sentiment classification. This paper describes the architectural components, implementation methodology, and output results of the SENTIMENT ANALYSIS framework. The proposed approach demonstrates the effectiveness of combining LLMs with LangChain’s orchestration layer for building adaptable, intelligent sentiment analysis tools.
Sentiment Analysis is built around the idea of creating a communication platform that values thoughtful expression, emotional context, and user control. One of the core features we’re working on is an intelligent flow for handling user posts, called Echoes. When a user writes an Echo, it goes through a validation process using Zod both on the frontend and at the Cloudflare middleware layer to ensure the data is clean and safe. Instead of immediately storing the Echo in the database, it’s first passed through backend functions that handle specific logic as needed.
The Echo is then temporarily saved with a private flag and sent to an Azure-based API powered by FastAPI, where the data is validated again using Pydantic. From there, the Echo enters a custom sentiment analysis pipeline built using LangChain. This model, trained specifically for the kind of conversations expected on Sentiment Analysis, classifies the Echo as positive, neutral, or negative. If it’s found to be positive, the system updates the Echo in the database, changes its visibility from private to public, and reflects the change on the user interface in real time. For Echoes that come back as neutral or negative, the system holds them in private, generates alternative phrasings using the LangChain suggestion engine, and saves those suggestions in the database for the user to review. The user can choose to rephrase and publish, or keep it as is. Throughout this process, LangMemo keeps track of context to ensure a smooth and consistent experience. This entire flow helps users communicate more thoughtfully, while giving them tools to refine their messages and maintain control over what they share. It’s a step toward building a platform where expression feels safe, supported, and emotionally aware.

Keywords: Sentiment Analysis, LangChain, Large Language Models (LLMs), Text Classification, PromptEngineering, Artificial Intelligence


PDF | DOI: 10.17148/IJIREEICE.2025.13518

Open chat