Skip to content

Commit

Permalink
fix path module bugs
Browse files Browse the repository at this point in the history
  • Loading branch information
stephenhky committed Nov 4, 2016
1 parent 4f5cc82 commit 81e37fe
Show file tree
Hide file tree
Showing 7 changed files with 19 additions and 8 deletions.
6 changes: 5 additions & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,11 @@ def readme():
author="Kwan-Yuet Ho",
author_email="stephenhky@yahoo.com.hk",
license='MIT',
packages=['shorttext'],
packages=['shorttext',
'shorttext.classifiers',
'shorttext.data',
'shorttext.nnlib',
'shorttext.utils',],
install_requires=[
'numpy', 'scipy', 'keras', 'theano', 'nltk', 'gensim', 'pandas',
],
Expand Down
5 changes: 5 additions & 0 deletions shorttext/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
from .classifiers.CNNEmbedVecClassification import CNNEmbeddedVecClassifier
from .classifiers.SumWord2VecClassification import SumEmbeddedVecClassifier
from .classifiers.VarNNEmbedVecClassification import VarNNEmbeddedVecClassifier

from .utils.classification_exceptions import ModelNotTrainedException, Word2VecModelNotExistException, AlgorithmNotExistException
4 changes: 2 additions & 2 deletions shorttext/classifiers/AutoencoderEmbedVecClassification.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,8 @@
from nltk import word_tokenize
from scipy.spatial.distance import cosine

import utils.kerasmodel_io as kerasio
from utils import ModelNotTrainedException
from ..utils import kerasmodel_io as kerasio
from ..utils import ModelNotTrainedException


# Reference: Francois Chollet, "Building Autoencoders in Keras"
Expand Down
4 changes: 2 additions & 2 deletions shorttext/classifiers/CNNEmbedVecClassification.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import nnlib.frameworks as fr
from ..nnlib import frameworks as fr

import classifiers.VarNNEmbedVecClassification as vnn
import VarNNEmbedVecClassification as vnn


# wrapper for VarNNEmbedVecClassification for using CNN only
Expand Down
2 changes: 1 addition & 1 deletion shorttext/classifiers/SumWord2VecClassification.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
from nltk import word_tokenize
from scipy.spatial.distance import cosine

from utils import ModelNotTrainedException
from .. utils import ModelNotTrainedException


class SumEmbeddedVecClassifier:
Expand Down
4 changes: 2 additions & 2 deletions shorttext/classifiers/VarNNEmbedVecClassification.py
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
import numpy as np
from nltk import word_tokenize

import utils as kerasio
from utils import ModelNotTrainedException
from ..utils import kerasmodel_io as kerasio
from ..utils import ModelNotTrainedException


class VarNNEmbeddedVecClassifier:
Expand Down
2 changes: 2 additions & 0 deletions shorttext/classifiers/__init__.py
Original file line number Diff line number Diff line change
@@ -1,2 +1,4 @@
import AutoencoderEmbedVecClassification, CNNEmbedVecClassification, SumWord2VecClassification, VarNNEmbedVecClassification

# allowed algorithms
allowed_algos = {'sumword2vec', 'autoencoder', 'cnn', 'vnn'}

0 comments on commit 81e37fe

Please sign in to comment.