Skip to content

Low performance when testing with saved models #11

@Mehrnoom

Description

@Mehrnoom

Hello,

I noticed that when I ran the code in the test mode, I get almost zero performance, as if the model is not trained at all, but I was getting high scores when I ran the code end to end.

I did a little bit of debugging and found out that when you run in test mode, you make "symbol2id" from the scratch which is different with the symbol2id used during the training. "symbol2id" is then used in the build_connection function, resulting in wrong meta information.

I added the following line to the end of the load_embed() function to save symbol2id during the training:
with open(self.dataset + '/symbol2ids', 'w') as fp:
json.dump(symbol_id, fp)

and changed the load_symbol2id functions:
def load_symbol2id(self):
symbol_id = json.load(open(self.dataset + '/symbol2ids'))
self.symbol2id = symbol_id
self.symbol2vec = None

This solved the problem for me.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions