Skip to content
Open
Show file tree
Hide file tree
Changes from 3 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 12 additions & 0 deletions setup.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
#!/usr/bin/env python

from distutils.core import setup

setup(name='Skip Thoughts',
version='1.0',
description='Sent2Vec encoder and training code from the paper Skip-Thought Vectors.',
author='Ryan Kiros',
url='https://github.com/ryankiros/skip-thoughts',
packages=['skipthoughts', 'skipthoughts.training','skipthoughts.decoding'],
install_requires=['theano','keras','nltk','scikit-learn','gensim','scipy']
)
18 changes: 5 additions & 13 deletions skipthoughts.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,21 +17,13 @@

profile = False

#-----------------------------------------------------------------------------#
# Specify model and table locations here
#-----------------------------------------------------------------------------#
path_to_models = '/u/rkiros/public_html/models/'
path_to_tables = '/u/rkiros/public_html/models/'
#-----------------------------------------------------------------------------#

path_to_umodel = path_to_models + 'uni_skip.npz'
path_to_bmodel = path_to_models + 'bi_skip.npz'


def load_model():
def load_model(path_to_models='./models/'):
"""
Load the model with saved tables
"""
path_to_umodel = path_to_models + 'uni_skip.npz'
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can you please replace the '+' operator with os.path.join()?

path_to_bmodel = path_to_models + 'bi_skip.npz'

# Load model options
print 'Loading model parameters...'
with open('%s.pkl'%path_to_umodel, 'rb') as f:
Expand Down Expand Up @@ -71,7 +63,7 @@ def load_model():
return model


def load_tables():
def load_tables(path_to_tables = './models/'):
"""
Load the tables
"""
Expand Down