Giter Club home page Giter Club logo

savithakj / sarcasmdetection Goto Github PK

View Code? Open in Web Editor NEW
2.0 2.0 1.0 18.3 MB

The goal of this project is to identify sarcasm in plain text.the project plans to exploit the property of a general sarcastic statement of possessing contrasting sentiments by using Natural Language Processing.The project aims at training a machine learning model using TensorFlow to detect if a given statement is a sarcastic or regular sentence.

Python 100.00%
natural-language-processing tensorflow tensorboard sentiment-analysis sarcasm-detection sentimental-analysis

sarcasmdetection's Introduction

Sarcasm detection using tensorflow

A deep learning model to detect sarcasm in plain text.

Dependencies:

  • Anaconda 4.3.1*
  • Python 3.5.x
  • TextBlob 0.12.0
  • Tensorflow 1.0.1**
  • Scikit-learn 0.18.1
  • Scipy 0.18.1
  • Numpy 1.12.1
  • Nltk 3.2.2
There are 4 files in the project:
  • create_feature_sets.py
  • train_and_test.py
  • exp_replace.py
  • Use_NN.py
There are two dataset files in the project:
  • negproc.npy
  • posproc.npy

Feature-sets are stored in featuresets.npy The model is stored inside folder /model/

Steps

  • Run create_feature_sets.py to extract features from the two dataset files and get featuresets.npy file.

  • Run train_and_test.py file after the create_feature_sets.py to use the featuresets.npy just created and train the neural network. After train_and_test.py is finished, the model will be saved inside /model/ and can be accessed from there.

  • exp_replace.py is used by create_feature_sets.py to preprocess the data.

  • Use_NN.py can be used after we have model saved inside /model/ to use the neural network to make predictions. The input sentence needs to be supplied as a method argument to โ€˜use_neural_network()โ€™ at the end of the file.

Visualization:

To get visualization in Tensorboard, do the following steps:

  • After running train_and_test.py, the logs are collected in /tmp/logs/. Tensorflow uses these logs to generate the visualization.

  • Go to terminal, make sure the location is same as the project location. Run the following command there: tensorboard --logdir=/tmp/logs

  • As part of the output, a URL is provided. The visualization could be accessed by navigating to that URL.

*Install Anaconda: https://docs.continuum.io/anaconda/install **Install Tensorflow: https://www.tensorflow.org/install

sarcasmdetection's People

Contributors

dependabot[bot] avatar sanjaykhatwani avatar savithakj avatar

Stargazers

 avatar

Watchers

 avatar  avatar

Forkers

ijk2-faylewate

sarcasmdetection's Issues

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.