Giter Site home page Giter Site logo

swaraj-khan / shawshank-redemption-script-for-nlp Goto Github PK

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

natural language processing (NLP) analysis on the script of "The Shawshank Redemption"

License: MIT License

HTML 53.96% Jupyter Notebook 46.04%
nlp tokenization tokenizer

shawshank-redemption-script-for-nlp's Introduction

The Shawshank Redemption NLP Analysis

This project conducts natural language processing (NLP) analysis on the script of "The Shawshank Redemption". The analysis includes text extraction from a PDF, text cleaning, named entity recognition (NER), sentiment analysis, and network visualization of character interactions.

Project Description

This project comprises Python scripts utilizing various NLP libraries and techniques to analyze the script of "The Shawshank Redemption". Below is a brief overview of the functionalities:

  • Text Extraction: The script is extracted from a PDF file using PyPDF2 and Textract libraries.
  • Text Cleaning: The extracted text is cleaned by removing punctuation, stopwords, and lemmatizing words using NLTK.
  • Named Entity Recognition (NER): Potential names are identified using regular expressions and NLTK.
  • Sentiment Analysis: Sentiment analysis is performed using TextBlob and VADER Sentiment Analysis tools.
  • Word Cloud Generation: A word cloud of the most common words is generated using the WordCloud library.
  • Summarization: Text summarization is implemented using the Hugging Face transformers library.
  • Character Interaction Network Visualization: The interactions between characters are visualized using NetworkX and Matplotlib.

Dataset Source

Shawshank Redemption Script for NLP

Installation

  1. Clone the repository:

    git clone https://github.com/swaraj-khan/shawshank-nlp-analysis.git
    

Usage

  1. Ensure you have the PDF file containing the script named ssr.pdf in the project directory.
  2. Take a look at the Jupyter notebook app.ipynb to understand the NLP analysis:
  3. The notebook will help you understand various analyses and generate visualizations in the project directory.

Results

  • The cleaned text is saved as clean_data.txt.
  • A word cloud image (Manifesto_top_100.jpeg) of the top 100 most common words is generated.
  • Sentiment analysis results are printed to the console.
  • A network graph of character interactions is displayed using Matplotlib.

Acknowledgements

  • The script extraction and text cleaning processes are inspired by various NLP tutorials and documentation.
  • The named entity recognition and sentiment analysis implementations utilize NLTK and TextBlob libraries.
  • Character interaction network visualization is achieved using NetworkX and Matplotlib.

shawshank-redemption-script-for-nlp's People

Contributors

swaraj-khan 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.