Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Low performance when testing with saved models #11

Open
Mehrnoom opened this issue Feb 5, 2020 · 0 comments
Open

Low performance when testing with saved models #11

Mehrnoom opened this issue Feb 5, 2020 · 0 comments

Comments

@Mehrnoom
Copy link

Mehrnoom commented Feb 5, 2020

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant