Last active
June 16, 2019 02:37
-
-
Save Adilmar/208adc587e81856a833e32fce15704b8 to your computer and use it in GitHub Desktop.
Chatbot response 1
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
# NLP | |
import nltk | |
from nltk.stem.lancaster import LancasterStemmer | |
stemmer = LancasterStemmer() | |
# importando bibliotecas | |
import numpy as np | |
import tflearn | |
import tensorflow as tf | |
import random | |
# In[2]: | |
# carregando a estrutura da rede | |
import pickle | |
data = pickle.load( open( "training_data", "rb" ) ) | |
words = data['words'] | |
classes = data['classes'] | |
train_x = data['train_x'] | |
train_y = data['train_y'] | |
# carregando as intencoes | |
import json | |
with open('intents.json') as json_data: | |
intents = json.load(json_data) | |
# In[3]: | |
# Construindo a rede | |
net = tflearn.input_data(shape=[None, len(train_x[0])]) | |
net = tflearn.fully_connected(net, 8) | |
net = tflearn.fully_connected(net, 8) | |
net = tflearn.fully_connected(net, len(train_y[0]), activation='softmax') | |
net = tflearn.regression(net) | |
# Deinindo configuracoes do Tensorboard - proxima postagem .... | |
model = tflearn.DNN(net, tensorboard_dir='tflearn_logs') |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment