Skip to content

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

11 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Sentiment Analysis Tool

A simple web application for analyzing the sentiment (positive or negative) of user-input text using a pre-trained NLP model from Hugging Face.

Features

  • Real-time Sentiment Analysis: Classifies text as positive or negative.
  • Confidence Score: Displays the model's confidence in its prediction.

Demo

Link to live demo

Getting Started

Prerequisites

  • Node.js (use the latest version for best compatibility)
  • Hugging Face API Key for access to the pre-trained model

Installation

  1. Clone the repository:
git clone https://github.com/robdll/sentiment-analysis-tool.git
  1. Move to the project directory:
cd sentiment-analysis-tool
  1. Install dependencies:
npm install
  1. Set up environment variables:
  • Create a .env.local file in the root directory.
  • Add your Hugging Face API key:
  HUGGING_FACE_API_KEY=your_hugging_face_api_key

Running the Project

Start the development server:

  npm run dev

Visit http://localhost:3000 in your browser to access the app.

Deployment

This app can be deployed on Vercel:

  • Push your code to a GitHub repository.
  • Import the repository to Vercel.
  • Add the HUGGING_FACE_API_KEY environment variable in Vercel's settings.

Usage

  1. Enter text into the input box.
  2. Click "Analyze Sentiment" to view the sentiment and confidence score.

Technologies Used

  • Next.js: React framework for server-side rendering and API routes.
  • Hugging Face Transformers: Pre-trained NLP models for sentiment analysis.
  • Vercel: Deployment and hosting.

License

This project is licensed under the MIT License. See the LICENSE file for details.

About

Sentiment Analysis Tool that classifies text as positive or negative using a pre-trained NLP model via Hugging Face API

Resources

Stars

0 stars

Watchers

1 watching

Forks

Releases

Packages

Used by

Contributors

Languages