Skip to content

Sentiment analysis, a branch of natural language processing (NLP), involves the automated process of determining sentiment or opinion expressed in textual data. It aims to identify whether a piece of text conveys positive, negative, or neutral sentiment.

Notifications You must be signed in to change notification settings

caio-moliveira/sentiment-analysis

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 
 
 
 
 

Repository files navigation

Semantic Analysis and Sentiment Classification with NLP

This repository contains Python code for performing semantic analysis and sentiment classification using Natural Language Processing (NLP) techniques. The code leverages various libraries and tools, including TensorFlow, Keras, Scikit-learn, NLTK, TextBlob, and Imbalanced-learn, to preprocess textual data, build machine learning models, and evaluate sentiment.

Introduction

Semantic analysis, a crucial aspect of NLP, involves understanding the relationships and meaning of words, sentences, and entire texts within a given context. Sentiment classification, on the other hand, focuses on determining the sentiment or emotion expressed in textual data, whether positive, negative, or neutral. This project combines both semantic analysis and sentiment classification to extract insights from textual data, particularly focusing on hotel reviews.

Features

  • Data Processing: Preprocesses textual data by removing punctuation, converting to lowercase, tokenizing, and removing stopwords.
  • Semantic Analysis with TextBlob: Utilizes TextBlob for semantic analysis, extracting sentiment polarity to classify reviews as positive, negative, or neutral.
  • Tf-idf Transformation: Applies term frequency-inverse document frequency (tf-idf) transformation to represent textual data numerically.
  • SMOTE for Imbalanced Data: Uses Synthetic Minority Over-sampling Technique (SMOTE) to address imbalanced data issues.
  • Deep Learning with Keras: Implements a deep learning model using Keras Sequential API for sentiment classification.
  • Evaluation Metrics: Evaluates model performance using confusion matrix and classification report.

Usage

To use this code:

  1. Ensure you have Python installed along with the required libraries.
  2. Clone this repository to your local machine.
  3. Run the provided Python scripts or Jupyter notebooks to preprocess data, build and train the model, and evaluate sentiment classification.
  4. Customize the code as needed for your specific application or dataset.

Visualization

image

About

Sentiment analysis, a branch of natural language processing (NLP), involves the automated process of determining sentiment or opinion expressed in textual data. It aims to identify whether a piece of text conveys positive, negative, or neutral sentiment.

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages