Skip to content

Latest commit

 

History

History
30 lines (16 loc) · 951 Bytes

File metadata and controls

30 lines (16 loc) · 951 Bytes

Sentiment Analysis using Support Vector Machine (SVM)

This Python script performs sentiment analysis on text data using a Support Vector Machine (SVM) classifier. It reads data from a CSV file, preprocesses the text, and trains an SVM model to classify the sentiment of each text into positive or negative.

Requirements

  • Python 3.x
  • scikit-learn
  • numpy
  • pandas

Install the required libraries using the following command: pip install scikit-learn numpy pandas

Usage

  1. Prepare your data: Create a CSV file (data.csv) with two columns: 'text' containing the text data (sentences, reviews, etc.), and 'label' containing the corresponding sentiment labels (e.g., positive or negative).

  2. Run the script: Execute the Python script Sentiment_Analysis.py to perform sentiment analysis on the data.

Output

The script will print the accuracy and classification report of the SVM model on the test set.

Author(s)

Srujana