GithubHelp home page GithubHelp logo

nlp-reddit-model's Introduction

Subreddit NLP Model

Slides: NLP-slide-deck.pdf in this same directory

This project uses NLP to differentiate between two different subreddits that have somewhat similar content. Both subreddit chosen have posts that follow the format of a long-form question post seeking indepth answers: r/askhistorians and r/askscience. The text-based nature of both of these subreddits make them well suited for this project.

There was minimal cleaning needed for this modeling. There was over 5000 rows gathered in total from both subreddits. And after de-duping and dropping all NaN values (where posts may have been photo-based), there was still well over 3500 rows. Leaving a good amount of data to run our models on.

Some interesting observations was that tri-grams were nearly useless as they did not offer topic-specific insight. They were merely "reddit phrases", as such only unigrams and bi-grams were explored.

The model was fitted using a gridsearch with a count vectorizer and a MultinomialNB model. The following data shows the best parameters three different text formats.

Basic model with no tuning parameters:
(0.9993009437259699, 0.9475890985324947)


Orginal Text
(0.9905627403005942, 0.9685534591194969)
{'cvec__binary': False,
 'cvec__max_df': 0.5,
 'cvec__max_features': None,
 'cvec__min_df': 1,
 'cvec__ngram_range': (1, 1)}

Stemmed Text
(0.9902132121635792, 0.9664570230607966)
{'cvec__binary': True,
 'cvec__max_df': 0.5,
 'cvec__min_df': 1,
 'cvec__ngram_range': (1, 1)}

Lemmatized Text
(0.9891646277525341, 0.960167714884696)
 'cvec__max_df': 0.5,
 'cvec__min_df': 1,
 'cvec__ngram_range': (1, 1)}

nlp-reddit-model's People

Contributors

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