Giter Club home page Giter Club logo

ieor4577-sentiment-analysis's Introduction

Sentiment Analysis for Tweets

Set Up Python Environment

python3 -m venv venv
source ./venv/bin/activate
pip install -r requirements.txt

Run pylint and pytest for Preprocessing

pytest --cov=preprocessing
pylint preprocessing/test_preprocess.py
pylint pylint preprocessing/preprocess.py

Glue ETL

The Glue ETL script is available at glue_preprocess.py

Run training

export SM_CHANNEL_EVAL="s3://ieore4577-klm2190/twitter/eval"
export SM_CHANNEL_VALIDATION="s3://ieore4577-klm2190/twitter/dev"
export SM_CHANNEL_TRAIN="s3://ieore4577-klm2190/twitter/train"
export S3_REQUEST_TIMEOUT_MSEC=600000
python3 -m model_training.sentiment_training 2>&1 | grep -v "Connection has been released. Continuing."

Screenshot of results can be found at Training_results.png

Run Training on AI Platform

Train locally

gcloud ai-platform local train \
  --package-path gcp_model_training \
  --module-name gcp_model_training.sentiment_training \
  --job-dir gs://internal-klm/sentiment-analysis/model/sentiment_analysis_$(date +%Y%m%d%H%M%S)

Train on AI Platform

gcloud ai-platform jobs submit training sentiment_analysis_$(date +%Y%m%d%H%M%S) \
  --package-path gcp_model_training \
  --module-name gcp_model_training.sentiment_training \
  --job-dir gs://internal-klm/sentiment-analysis/model/sentiment_analysis_$(date +%Y%m%d%H%M%S) \
  --region us-central1 \
  --python-version 3.5 \
  --runtime-version 1.14 \
  --stream-logs

Hyperparameter Tuning

gcloud ai-platform jobs submit training sentiment_analysis_$(date +%Y%m%d%H%M%S) \
  --package-path gcp_model_training \
  --config gcp_model_training/hptuning.yaml \
  --module-name gcp_model_training.sentiment_training \
  --job-dir gs://internal-klm/sentiment-analysis/model/sentiment_analysis_$(date +%Y%m%d%H%M%S) \
  --region us-central1 \
  --python-version 3.5 \
  --runtime-version 1.14 \
  --stream-logs

ieor4577-sentiment-analysis's People

Contributors

klmilam avatar

Watchers

James Cloos avatar  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.