JUHE API Marketplace
igorpavlov-mgr avatar
MCP Server

Sentiment + Sarcasm Analyzer

A lightweight Gradio application that analyzes text for sentiment (positive/negative) and sarcasm detection using Hugging Face Transformers, designed to run on CPU and compatible with the MCP server architecture.

0
GitHub Stars
11/17/2025
Last Updated
No Configuration
Please check the documentation below.
  1. Home
  2. MCP Servers
  3. mcp-sentiment

README Documentation

Sentiment + Sarcasm Analyzer (Gradio + MCP)

This project is a lightweight Gradio application that performs sentiment analysis and sarcasm detection using Hugging Face Transformers. It is designed to run on CPU and was developed as part of the Hugging Face MCP Course. The app is fully compatible with the Hugging Face MCP server architecture.

Live Demo

šŸ‘‰ Launch the app on Hugging Face Spaces

Architecture Overview

  • Models (CPU-only):

    • distilbert-base-uncased-finetuned-sst-2-english: Sentiment analysis
    • helinivan/english-sarcasm-detector: Sarcasm detection
  • Frontend: Gradio UI

  • Backend: Python with Hugging Face Transformers

  • MCP Integration: Hugging Face MCP-compatible (gradio[mcp])

Features

  • Sentiment classification: "positive" or "negative"
  • Sarcasm detection with a probability score
  • CPU-compatible (no GPU required)
  • Simple and clean Gradio interface

Output Format

The app returns a structured JSON response with four fields:

{
  "assessment": "positive",
  "confidence": 1.0,
  "sarcasm_detected": true,
  "sarcasm_confidence": 0.97
}

Gradio Interface

The interface provides the following controls:

ElementDescription
TextboxEnter text to be analyzed
SubmitRun the sentiment and sarcasm analysis
ClearReset the input/output

Setup Instructions

1. Clone the repository

git clone https://github.com/YOUR_USERNAME/mcp-sentiment
cd mcp-sentiment

2. Create a virtual environment

python -m venv .venv
# Then activate:
.venv\Scripts\activate      # Windows
source .venv/bin/activate     # macOS/Linux

3. Install dependencies

pip install -r requirements.txt

Make sure gradio[mcp] is included for MCP compatibility.

4. Add Hugging Face token

Create a .env file:

HF_TOKEN=your_token_here

5. Run the app locally

python app.py

Deploy to Hugging Face Spaces

git init
git remote add origin https://huggingface.co/spaces/YOUR_USERNAME/mcp-sentiment
git add .
git commit -m "Deploy MCP app"
git push -u origin main

Once pushed, the MCP server endpoint will be live at:

https://YOUR_USERNAME-mcp-sentiment.hf.space/gradio_api/mcp/sse

Credits

  • Hugging Face MCP Course
  • Model: distilbert-base-uncased-finetuned-sst-2-english
  • Model: helinivan/english-sarcasm-detector
  • Gradio

Quick Actions

View on GitHubView All Servers

Key Features

Model Context Protocol
Secure Communication
Real-time Updates
Open Source

Boost your projects with Wisdom Gate LLM API

Supporting GPT-5, Claude-4, DeepSeek v3, Gemini and more.

Enjoy a free trial and save 20%+ compared to official pricing.

Learn More
JUHE API Marketplace

Accelerate development, innovate faster, and transform your business with our comprehensive API ecosystem.

JUHE API VS

  • vs. RapidAPI
  • vs. API Layer
  • API Platforms 2025
  • API Marketplaces 2025
  • Best Alternatives to RapidAPI

For Developers

  • Console
  • Collections
  • Documentation
  • MCP Servers
  • Free APIs
  • Temp Mail Demo

Product

  • Browse APIs
  • Suggest an API
  • Wisdom Gate LLM
  • Global SMS Messaging
  • Temp Mail API

Company

  • What's New
  • Welcome
  • About Us
  • Contact Support
  • Terms of Service
  • Privacy Policy
Featured on Startup FameFeatured on Twelve ToolsFazier badgeJuheAPI Marketplace - Connect smarter, beyond APIs | Product Huntai tools code.marketDang.ai
Copyright Ā© 2025 - All rights reserved