Giter Site home page Giter Site logo

quotes_toscrape_sentimentanalysis's Introduction

Sentiment Analysis of Scraped Quotes

Perform sentiment analysis on a collection of scraped quotes using Natural Language Processing (NLP) techniques and the NLTK library.


Introduction

This project demonstrates how to perform sentiment analysis on a set of quotes that have been scraped from a website. The sentiment analysis is based on the sentiment intensity provided by the NLTK library's Sentiment Intensity Analyzer. The quotes are preprocessed by tokenization, removing punctuation, stopwords, and lemmatization before performing sentiment analysis.

In addition to sentiment analysis, this project includes an example of how to scrape quotes from a target website. The scraping process involves fetching HTML content, parsing it using the BeautifulSoup library, and extracting relevant information such as quotes, authors, and tags.

Dependancies

pip install nltk 
pip install beautifulsoup4
pip install requests
pip install pandas

Output

The "main.py" script will create a CSV file named "quotes.csv", which will contain the following information for each quote:

  • Quote
  • Author
  • Tags

The "SentimentAnalysis.py" script will analyze the quotes and give them a score based on the language used, based on the score it will either be classified as "Positive", "Neutral", or "Negative". Then a new CSV file will be added named "quotes_with_sentiment.csv" adding the "Sentiment" column.

Note

This script is provided for educational purposes only and is meant to demonstrate basic web scraping techniques. Before scraping any website, please review the website's Terms of Service and Robots.txt file to ensure you are not violating any rules or policies.

quotes_toscrape_sentimentanalysis's People

Contributors

brycenab 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.