Skip to content

Instantly share code, notes, and snippets.

@zdepablo
zdepablo / brand-sentiment.py
Created March 3, 2014 15:19
Analyze Twitter sentiment for your brand using Textalytics Media Analysis API
import smaclient
from TwitterAPI import TwitterAPI
import matplotlib.pyplot as plt
# Go to http://dev.twitter.com and create an app.
# The consumer key and secret will be generated for you after
consumer_key = <consumer-key>
consumer_secret = <consumer-secret>
@zdepablo
zdepablo / install_submodules.R
Last active December 5, 2017 21:00
R: how to Install submodules from git
install_submodule_git <- function(x, ...) {
install_dir <- tempfile()
system(paste("git clone --recursive", shQuote(x), shQuote(install_dir)))
devtools::install(install_dir, ...)
}
install_submodule_git("https://github.com/jonkeane/mocapGrip")
@zdepablo
zdepablo / dynet-tagger.py
Created December 22, 2017 20:21 — forked from neubig/dynet-tagger.py
A small sequence labeler in DyNet
"""
DyNet implementation of a sequence labeler (POS taggger).
This is a translation of this tagger in PyTorch: https://gist.github.com/hal3/8c170c4400576eb8d0a8bd94ab231232
Basic architecture:
- take words
- run though bidirectional GRU
- predict labels one word at a time (left to right), using a recurrent neural network "decoder"
The decoder updates hidden state based on:
- most recent word