Skip to content

Instantly share code, notes, and snippets.

@weavermonkey
weavermonkey / understanding-word-vectors.ipynb
Created April 12, 2018 12:04 — forked from aparrish/understanding-word-vectors.ipynb
Understanding word vectors: A tutorial for "Reading and Writing Electronic Text," a class I teach at ITP. (Python 2.7) Code examples released under CC0 https://creativecommons.org/choose/zero/, other text released under CC BY 4.0 https://creativecommons.org/licenses/by/4.0/
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@weavermonkey
weavermonkey / sentiment_analysis_keras.py
Last active March 30, 2018 07:10
Keras Sentiment Analyzer
import gensim
from tqdm import tqdm
from nltk.tokenize import TweetTokenizer
import pandas as pd
from sklearn.model_selection import train_test_split
from gensim.models.word2vec import Word2Vec
from sklearn.feature_extraction.text import TfidfVectorizer
from sklearn.preprocessing import scale
import numpy as np
from keras import models,layers