Use Sentiment Analysis

This guide will help you set up and use Sentiment Analysis by NeurochainAI for monitoring sentiment in Telegram group chats. With this setup, you'll be able to analyze group messages, track sentiment, and collect insights using Docker and Python.


Prerequisites

Before starting, ensure you have the following software installed:


Step 1: Clone the Repository

Begin by cloning the Sentiment Analysis repository and navigating to the project directory:

# Clone the repository
git clone https://github.com/NeuroChainAi/python-telegram-sentiment.git

# Navigate to the project directory
cd python-telegram-sentiment
    

  1. Install Dependencies

Install the Python dependencies from the requirements file


  1. Configure Environment Variables

Create a `.env` file with the following environment variables:


  1. Setup Docker Compose

Docker Compose sets up both PostgreSQL and the Telegram bot. Use the following command to start the services:

This command will:

  • Start a PostgreSQL container

  • Build and run the Telegram bot container

  1. Docker Compose File Structure

The `docker-compose.yml` file defines both PostgreSQL and the bot containers. Below is the structure:


  1. Running the Bot

Once the containers are running, the bot should start interacting with the Telegram API and PostgreSQL. You can monitor logs to check the status:


  1. Stopping the Containers

To stop and remove the containers, use the following command:

Last updated