Skip to content

Instantly share code, notes, and snippets.

@sujitpal
sujitpal / babi_memnn.py
Last active October 3, 2016 01:21
My modified version of keras/examples/babi_memnn.py using the new functional API instead of Sequential API (changes between comment lines "construct network" and "compile network"). Originally driven by keras issue 3927.
'''Trains a memory network on the bAbI dataset.
References:
- Jason Weston, Antoine Bordes, Sumit Chopra, Tomas Mikolov, Alexander M. Rush,
"Towards AI-Complete Question Answering: A Set of Prerequisite Toy Tasks",
http://arxiv.org/abs/1502.05698
- Sainbayar Sukhbaatar, Arthur Szlam, Jason Weston, Rob Fergus,
"End-To-End Memory Networks",
http://arxiv.org/abs/1503.08895
@sujitpal
sujitpal / alice_lstm_seq2seq.ipynb
Created May 12, 2016 15:21
LSTM for Sequence to Sequence Generation - Deep Learning Learners Meetup Presentation May-12-2016
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@sujitpal
sujitpal / alice_chargen_rnn.ipynb
Created May 12, 2016 15:19
RNN for Character Generation - Deep Learning Learners Meetup Presentation May-12-2016
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@sujitpal
sujitpal / junit_opennlp_extract_np_from_text.java
Created April 24, 2016 17:15
JUnit/OpenNLP code to extract Noun Phrases from text. Originally from my pastebin (http://pastebin.com/bUDY7fb0).
@Test
public void testNounPhraseExtractionStandalone() throws Exception {
SentenceDetectorME sentenceDetector;
TokenizerME tokenizer;
POSTaggerME posTagger;
ChunkerME chunker;
InputStream smis = null;
InputStream tmis = null;
InputStream pmis = null;
InputStream cmis = null;
@sujitpal
sujitpal / wmd_short_sentences_scala.html
Created April 24, 2016 16:41
Databricks HTML export of Scala Notebook for computing Word Mover's Distance for Similarity between Short Sentences.
<!DOCTYPE html>
<html>
<head>
<meta name="databricks-html-version" content="1">
<title>wmd_short_sentences - Databricks</title>
<meta charset="utf-8">
<meta name="google" content="notranslate">
<meta http-equiv="Content-Language" content="en">
<meta http-equiv="Content-Type" content="text/html; charset=UTF8">
@sujitpal
sujitpal / redis-server
Created June 13, 2014 18:00
Init script for redis-server
#! /bin/sh
### BEGIN INIT INFO
# Provides: redis-server
# Required-Start: $remote_fs $syslog
# Required-Stop: $remote_fs $syslog
# Default-Start: 2 3 4 5
# Default-Stop: 0 1 6
# Short-Description: Start and stop redis-server
### END INIT INFO
@sujitpal
sujitpal / cms_benefits_data_analysis.ipynb
Created April 28, 2014 22:24
Basic Data Analysis of Medicaid Benefits data from CMS.gov
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@sujitpal
sujitpal / cms_data_download.ipynb
Created April 28, 2014 22:23
Some simple Python code to parse the CMS.gov site and extract links to all the dataset zips.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@sujitpal
sujitpal / lung_cancer_data_analysis.ipynb
Last active August 29, 2015 13:57
Using Correlation Coefficients to select most predictive Gene Expressions in Lung Cancer Data
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@sujitpal
sujitpal / big_data_kids_pres.ipynb
Created March 8, 2014 23:57
Presentation to demonstrate using Hadoop Streaming and Python to group/collect and join/exclude operations on Database data.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.