Created
December 7, 2017 09:30
-
-
Save rajeshmr/03b9d03f07c23862cf33b3fa8b76618c to your computer and use it in GitHub Desktop.
cnn import libs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import numpy as np | |
import pandas as pd | |
from gensim.models import KeyedVectors | |
from keras.layers import Flatten | |
from keras.layers import MaxPooling1D | |
from keras.models import Model | |
from keras.preprocessing.sequence import pad_sequences | |
from keras.preprocessing.text import Tokenizer | |
from keras.utils import to_categorical | |
from nltk.corpus import stopwords | |
MAX_NB_WORDS = 200000 | |
MAX_SEQUENCE_LENGTH = 30 | |
EMBEDDING_DIM = 300 | |
EMBEDDING_FILE = "../lib/GoogleNews-vectors-negative300.bin" | |
category_index = {"clothing":0, "camera":1, "home-appliances":2} | |
category_reverse_index = dict((y,x) for (x,y) in category_index.items()) | |
STOPWORDS = set(stopwords.words("english")) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment