Commit e8b4154e authored by develob's avatar develob

Add trained model and print information in eval (Model)

parent fd389784
......@@ -113,7 +113,7 @@ class Contact(Base):
role = Column(String(100), unique=False, nullable=True)
id_field = Column(Integer, ForeignKey('field.id'), unique=False, nullable=False)
def init__(self, name, surname, email, phone, role, id_field):
def __init__(self, name, surname, email, phone, role, id_field):
self.name = name
self.surname = surname
self.email = email
......
......@@ -123,6 +123,7 @@ class Model(object):
if self.model is None:
raise ModelInitialisationError("Model not build. Consider using build (and train) or load methods before.")
print("Eval on " + str(len(features)) + " offers")
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)
......
......@@ -34,7 +34,7 @@ def train(db_manager):
"""
Train a convolutional neuronal network and save it in a file in /runs
@:param: the database manager
:param: the database manager
:type db_manager: DbManager
"""
x, y = get_offers(db_manager)
......
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