Skip to content

This repository hosts a Sentiment Analysis Dashboard. It provides features for analysing text input, performing batch processing on files (TXT, CSV, JSON), and evaluating model performance. Users can also review their analysis history. The dashboard offers a comprehensive tool for understanding and assessing sentiment.

Notifications You must be signed in to change notification settings

SiyamthandaD/Sentiment-Application

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

11 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

πŸ“Š Sentiment Analysis Tool

A powerful web application that analyzes text sentiment in real-time, providing deep insights into emotional tone, polarity, and emotional characteristics. Built with modern web technologies for accurate and instant sentiment detection.

πŸ–₯️ Home Page Preview

image

🌐 Live Demo

Access the live application at: https://sentimentv1.netlify.app/

✨ Features

⚑ Real-time sentiment analysis

  • Instant Sentiment Detection: Get immediate feedback as you type.
  • Live Polarity Scoring: Dynamic positive/negative/neutral scoring.
  • Continuous Emotion Tracking: Real-time emotion detection updates.

πŸ“Š Comprehensive Insights

  • Detailed Polarity Breakdown: Percentage-based sentiment scoring.
  • Emotion Classification: Identify specific emotions (joy, anger, sadness, etc.)
  • Visual Analytics: Interactive charts and graphs for data visualization.

πŸ’Ύ Data Management

  • Analysis History: Automatic logging of previous sentiment analyses.
  • Session Persistence: Maintain your analysis history across sessions.
  • Export Capabilities: Save or export results for further analysis.

πŸ“± User Experience

  • Responsive Design: Optimized for desktop, tablet, and mobile devices.
  • Intuitive Interface: Clean, modern, and user-friendly design.
  • Accessibility Focused: Built with accessibility best practices.

πŸ› οΈ Technology Stack

Frontend Development

  • ⚑ JavaScript (ES6+) - Core programming language.
  • 🎨 HTML5 & CSS3 - Modern web standards and styling.
  • βš›οΈ React - Component-based UI library.
  • πŸ’¨ Tailwind CSS - Utility-first CSS framework.

APIs & Services

  • 🧠 Gemini API - Advanced Natural Language Processing.
  • ☁️ Netlify - Cloud hosting and deployment platform.

Data Visualization

  • πŸ“ˆ Chart.js - Interactive charts and data visualization.
  • πŸ“Š Custom Visualizations - Tailored sentiment display components.

πŸš€ Getting Started

Prerequisites

  • βš™οΈ Node.js (version 16.0 or higher).
  • πŸ“¦ npm (version 8.0 or higher)/yarn.

Installation

  • Clone the repository:
    git clone https://github.com/SiyamthandaD/Sentiment-Application.git
    cd Sentiment-Application
  • Install dependencies:
     npm install
     # or
     yarn install
  • Set up environment variables (if required)
    # Create a .env file in the root directory
    # Add your API keys and configuration
    REACT_APP_GEMINI_API_KEY=your_api_key_here
  • Run the development server:
    npm start
    # or
    yarn start
  • Open your browser Navigate to http://localhost:3000 to view the application

Available Scripts

  • npm start - Runs the app in development mode.
  • npm run build - Builds the app for production.
  • npm test - Launches the test runner.
  • npm run eject - Ejects from Create React App (one-way operation)

πŸ’‘ Usage Guide

  • Basic Text Analysis
    • Enter your text in the input field.
    • View real-time sentiment results.
    • Analyze polarity scores and emotional tone.
  • Advanced Features
    • Explore detailed emotion breakdowns.
    • Review historical analysis data.
    • Export results for reporting.
  • API Integration
    • Connect with Google Cloud Natural Language API.
    • Customize analysis parameters.
    • Scale for high-volume text processing.

πŸ“ Project Structure

  • Sentiment Application
    Sentiment-Application/
    β”œβ”€β”€ public/                     # Static assets
    β”‚   β”œβ”€β”€ index.html              # Main HTML template
    β”‚   β”œβ”€β”€ favicon.ico             # Application favicon
    β”‚   └── manifest.json           # PWA manifest
    β”œβ”€β”€ src/                        # Source code
    β”‚   β”œβ”€β”€ components/             # React components
    β”‚   β”‚   β”œβ”€β”€ AnalysisChart/      # Data visualization components
    β”‚   β”‚   β”œβ”€β”€ EmotionDisplay/     # Emotion visualization
    β”‚   β”‚   β”œβ”€β”€ HistoryPanel/       # Analysis history
    β”‚   β”‚   β”œβ”€β”€ InputArea/          # Text input components
    β”‚   β”‚   └── ResultsPanel/       # Results display
    β”‚   β”œβ”€β”€ services/               # API and external services
    β”‚   β”‚   β”œβ”€β”€ geminiAPI.js        # Gemini API integration
    β”‚   β”‚   └── sentimentService.js # Sentiment analysis logic
    β”‚   β”œβ”€β”€ utils/                  # Utility functions
    β”‚   β”‚   β”œβ”€β”€ textProcessor.js    # Text preprocessing
    β”‚   β”‚   └── formatters.js       # Data formatting
    β”‚   β”œβ”€β”€ hooks/                  # Custom React hooks
    β”‚   β”‚   β”œβ”€β”€ useSentiment.js     # Sentiment analysis hook
    β”‚   β”‚   └── useHistory.js       # History management
    β”‚   β”œβ”€β”€ styles/                 # Styling files
    β”‚   β”‚   β”œβ”€β”€ tailwind.css        # Tailwind imports
    β”‚   β”‚   └── components.css      # Component-specific styles
    β”‚   β”œβ”€β”€ App.js                  # Root application component
    β”‚   β”œβ”€β”€ App.css                 # Main application styles
    β”‚   └── index.js                # Application entry point
    β”œβ”€β”€ package.json                # Project dependencies and scripts
    └── netlify.toml                # Netlify deployment configuration
    

Key Components

  • InputArea - Text input and real-time processing.
  • ResultsPanel - Display sentiment scores and analysis.
  • AnalysisChart - Visual representation of sentiment data.
  • EmotionDisplay - Detailed emotion classification.
  • HistoryPanel - Previous analysis tracking.

πŸ”Œ API Integration

Gemini API Configuration

  • The application integrates with Google's Gemini API for advanced natural language processing:
    // Example API integration
    const analyzeSentiment = async (text) => {
      const response = await fetch('https://api.gemini.google.com/v1/analyze', {
        method: 'POST',
        headers: {
          'Authorization': `Bearer ${apiKey}`,
          'Content-Type': 'application/json'
        },
        body: JSON.stringify({ text: text })
      });
      return await response.json();
    };
    

πŸš€ Deployment

Netlify Deployment

  • The application is configured for seamless deployment on Netlify:
    • Automatic Deployments: Connected to GitHub for CI/CD.
    • Environment Variables: Secure API key management.
    • Performance Optimization: Built-in caching and CDN.

Build for Production

  • This creates an optimized production build in the build folder.
    npm run build
    

🀝 Contributing

We welcome contributions from the community! Whether you're fixing bugs, adding new features, or improving documentation, your help is appreciated.

Contribution Workflow

  • Fork the repository.
  • Create a feature branch
    git checkout -b feature/amazing-feature
  • Commit your changes
    git commit -m 'Add some amazing feature'
  • Push to the branch
    git push origin feature/amazing-feature
  • Open a Pull Request

Development Guidelines

  • Follow React best practices and component patterns.
  • Ensure responsive design for all components.
  • Maintain accessibility standards.
  • Write clear commit messages.
  • Update documentation for new features.

πŸ“„ License

  • This project is licensed under the MIT License - see the LICENSE file for details.

πŸ™ Acknowledgments

  • Technologies & Services
    • Google Gemini API - For powerful natural language processing capabilities.
    • React Community - For excellent documentation and ecosystem.
    • Chart.js - For beautiful and accessible data visualizations.
    • Tailwind CSS - For efficient and consistent styling.
    • Netlify - For seamless deployment and hosting.
  • Inspiration
    • Natural Language Processing research and applications.
    • User experience design principles for data visualization.
    • Open-source sentiment analysis tools and libraries.
πŸ’« Support This Project If you find this sentiment analysis tool helpful, please consider giving it a ⭐️ on GitHub!

Built with ❀️ by Siyamthanda Dlakavu

Understanding emotions through technology, one analysis at a time.

About

This repository hosts a Sentiment Analysis Dashboard. It provides features for analysing text input, performing batch processing on files (TXT, CSV, JSON), and evaluating model performance. Users can also review their analysis history. The dashboard offers a comprehensive tool for understanding and assessing sentiment.

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published