GithubHelp home page GithubHelp logo

manaswini123456 / sentiment-analysis Goto Github PK

View Code? Open in Web Editor NEW
0.0 1.0 0.0 11.32 MB

Python 99.53% C 0.05% Shell 0.01% Roff 0.06% JavaScript 0.12% CSS 0.04% PowerShell 0.18% Batchfile 0.01% HTML 0.01%

sentiment-analysis's Introduction

Sentiment Analysis Application

This project is a sentiment analysis application built using React.js and integrates with a machine learning backend for sentiment analysis.

Overview

This application allows users to input text and receive sentiment analysis results. It consists of a frontend built with React.js for the user interface and a backend service for analyzing sentiment using machine learning models.

Features

  • Sentiment Input: Users can enter text for sentiment analysis.

  • Result Display: Displays the sentiment analysis result (positive, negative, neutral) based on the input text.

  • Info Cards: Informational cards explaining different sentiment types (positive, negative, neutral).

    image

Getting Started

To get a local copy up and running, follow these steps:

Prerequisites

  • Node.js installed on your local machine.
  • Git installed on your local machine.

Installation

  1. Clone the repo:

    git clone https://github.com/your-username/your-repo.git
    cd your-repo
  2. Install dependencies:

    npm install

Running the Application

To run the application locally:

npm start

Open http://localhost:3000 to view it in your browser.

The page will reload if you make edits.
You will also see any lint errors in the console.

Testing

To run tests:

npm test

Launches the test runner in the interactive watch mode.

Building for Production

To build the app for production:

npm run build

Builds the app for production to the build folder.
It correctly bundles React in production mode and optimizes the build for the best performance.

Deployment

This project is set up to be deployed using Vercel or any other hosting platform of your choice. See the Create React App documentation on deployment for more information.

Learn More

You can learn more in the Create React App documentation.

Additional Documentation

For Backend

Prerequisites

  • Python 3.x
  • NLTK (Natural Language Toolkit)
  • Flask
  • Flask-CORS

Installation

  1. Clone the repository:

    git clone <repository-url>
    cd <repository-name>
  2. Install dependencies:

    pip install -r requirements.txt

Running the Server

To start the Flask server:

python app.py

The server will start running at http://localhost:5000.

API Endpoint

Analyze Sentiment

  • Endpoint: /analyze

  • Method: POST

  • Request Body:

    {
        "text": "Text to analyze"
    }
  • Response:

    {
        "sentiment": "positive|negative|neutral"
    }

Example Usage

curl -X POST -H "Content-Type: application/json" -d '{"text": "I love this product!"}' http://localhost:5000/analyze

Response

{
    "sentiment": "positive"
}

Notes

  • This API uses NLTK's VADER sentiment analysis tool.
  • It supports CORS to allow cross-origin requests.

Contributions are what make the open source community such an amazing place to learn, inspire, and create. Any contributions you make are greatly appreciated.

  1. Fork the Project
  2. Create your Feature Branch (git checkout -b feature/AmazingFeature)
  3. Commit your Changes (git commit -m 'Add some AmazingFeature')
  4. Push to the Branch (git push origin feature/AmazingFeature)
  5. Open a Pull Request

License

Distributed under the MIT License. See LICENSE for more information.

sentiment-analysis's People

Contributors

manaswini123456 avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.