PitchHut logo
emotion-server-demo
Streamlined Emotion API experiments with Docker and Gradio UI.
Pitch

The Emotion Server Demo provides an integrated Docker Compose setup for the Emotion API, complete with a Gradio UI for easy interaction and an MCP server for efficient experimentation. Featuring real-time sentiment analysis and user-friendly interfaces, it enables extensive testing and application of emotion-based services.

Description

Emotion Server Demo

The Emotion Server Demo provides a robust and complete Docker Compose setup for the Emotion API service. It features an intuitive Gradio UI enabling users to easily interact with the emotion analysis capabilities and an MCP server designed to streamline experimentation and access to the API.

User Interface


Key Features

  • Performance Testing: A dedicated Performance Tab facilitates load testing of the container to gauge performance under stress.
  • Live Demo: A walkthrough of the emotion service in action can be viewed on YouTube.

Additional Projects Included

  1. Demo_Firehose: A React-based social media sentiment monitoring dashboard featuring:

    • Real-time message streaming with sentiment analysis
    • An interactive dashboard with color-coded sentiment visualization
    • Configurable message generation speeds from 1x to 100x TPS
    • API status monitoring capabilities
    • Location in the repository: src/Demo_Firehose/
  2. Demo_Agentic_Routing: A demonstration of a CrewAI-powered customer service application showcasing emotion-based routing and escalation capabilities:

    • Multi-agent sentiment analysis and response generation
    • Simulated workflows emphasizing intelligent emotion detection
    • Location in the repository: src/Demo_Agentic_Routing/

Architecture Overview

The project consists of three main components:

  1. Emotion API (emotion-api): The core service built with Go, using the llama.cpp integration for emotion predictions. This component is powered by a fine-tuned gemma3:120 model encapsulated within a Docker container. For further details, refer to the Docker Hub repository.
  2. Gradio UI (emotion-ui): A simple web interface that enables users to send requests to the Emotion API and analyze predictions easily.
  3. MCP Server (emotion-mcp): Serves as a proxy to demonstrate the Model Context Protocol (MCP), routing requests from the UI to the Emotion API.

Quick Testing Instructions

For quick testing, users can utilize curl to interact with the Emotion API directly from the command line:

  • Basic Prediction Request:

    curl -s -X POST http://localhost:8000/predict \
    -H "Content-Type: application/json" \
    -d '{"text":"I am so happy today!"}'
    

    Expected response:

    {"emotion":"happy","confidence":1}
    
  • Detailed Emotion Analysis: To get comprehensive results including probabilities for all emotions:

    curl -s -X POST http://localhost:8000/predict_detailed \
    -H "Content-Type: application/json" \
    -d '{"text":"I am so happy today!"}'
    

    Sample response:

    {
      "predicted_emotion": "happiness",
      "confidence": 0.67,
      "all_emotions": {
        "happiness": 0.67,
        "anger": 0.0,
        ...
      }
    }
    

Service Details

  • Gradio UI runs on port 7860, offering a straightforward way to interact with the emotion service. Users can input text and receive real-time emotion predictions.
  • Emotion API operates on port 8000, handling the core emotion analysis logic.
  • MCP Server is accessible on port 9000 to facilitate the Model Context Protocol.

Important Considerations

  • This project is intended for educational/experimental purposes only. It is not optimized for production use without further enhancements for security and stability.
  • Users are encouraged to explore and modify the stack to fit their experimentation needs.
  • Refer to the repository's README for exhaustive guidelines, troubleshooting tips, and management commands.

The Emotion Server Demo offers a comprehensive and user-friendly interaction with state-of-the-art emotion analysis technologies, making it an ideal tool for developers and researchers in the field of sentiment analysis.

0 comments

No comments yet.

Sign in to be the first to comment.