Skip to content

Instantly share code, notes, and snippets.

View dbonadiman's full-sized avatar

Daniele Bonadiman dbonadiman

  • University of Trento
  • Trento
View GitHub Profile
x = Input(shape=(max_len,))
emb = Embedding(max_features,
embedding_dims,
input_length=max_len))(x)
for filter_len in [2, 3, 4]:
branch = Sequential()
branch.add(Convolution1D(nb_filter=filters,
filter_length=filter_len,
border_mode='valid',
@dbonadiman
dbonadiman / twitter-stream.py
Last active December 20, 2015 17:59
a simple way to access the twitter stream
import json
import tweepy
class StdOutListener(tweepy.StreamListener):
def do_stuff(self, pdata):
print pdata['text']
def on_data(self, data):
pdata = ""