Commit fd389784 authored by develob's avatar develob

PEP8, remove unused variable

parent df4d99ad
......@@ -47,7 +47,7 @@ class Model(object):
# Remove the last to normalize dirname
if self.save_dirname[len(self.save_dirname) - 1] == "/":
self.save_dirname = self.save_dirname[:len(self.save_dirname)-1]
self.save_dirname = self.save_dirname[:len(self.save_dirname) - 1]
####################################################################################################################
# Public methods #################################################################################################
......@@ -126,7 +126,7 @@ class Model(object):
features = self._text_to_word_indexes(features)
features = tf.keras.preprocessing.sequence.pad_sequences(features, maxlen=400, padding="post")
loss, acc = self.model.evaluate(features, labels)
print('Test Accuracy: %f' % (acc*100))
print('Test Accuracy: %f' % (acc * 100))
def predict(self, feature):
"""
......
......@@ -51,4 +51,3 @@ def train(db_manager):
model.build(number_of_label)
model.train(x_train, y_train, save=True)
model.eval(x_eval, y_eval)
......@@ -197,7 +197,6 @@ def preprocess_all_and_add_to_database(db_manager, file_name):
:param db_manager: database manager
:rtype db_manager: DatabaseManager
"""
model = load_word2vec()
with open(file_name, encoding='utf-8', mode="r") as f:
reader = csv.DictReader(f)
for i, row in enumerate(reader):
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment