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

WordVectorSerializer.readParagraphVectors(file) didn't init the SourceLabel #5806

Closed
tvanh opened this issue Jul 5, 2018 · 3 comments

Comments

@tvanh
Copy link

commented Jul 5, 2018

The paragraph vector loaded using WordVectorSerializer.readParagraphVectors(file) has null label source.

Cause:
During reading paragraph vector, the list of label is read (and extracted by the ParagraphVectors.extractLabels()), but not pass to source label.

Effect:
[1] ParagraphVectors.getLabelSource() is always null if the model is load from file.
[2] ParagraphVectors.predict(String text) will get error since
for (String s : labelsSource.getLabels()) {
will cause the NullPointerException error.

@tvanh

This comment has been minimized.

Copy link
Author

commented Jul 5, 2018

Fix:
just add labelSource = new LabelSource(labelsList);
at the function extractLabels() of ParagraphVectors to init the values for labelSource.

@raver119 raver119 self-assigned this Jul 5, 2018

raver119 added a commit that referenced this issue Jul 5, 2018
@raver119 raver119 referenced this issue Jul 5, 2018
raver119 added a commit that referenced this issue Jul 5, 2018
@raver119

This comment has been minimized.

Copy link
Contributor

commented Jul 5, 2018

Fixed thanks for highlighting this one. However, mind telling how you're using your model? You shouldn't need this object usually.

@raver119 raver119 closed this Jul 5, 2018

@lock

This comment has been minimized.

Copy link

commented Sep 21, 2018

This thread has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.

@lock lock bot locked and limited conversation to collaborators Sep 21, 2018

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
2 participants
You can’t perform that action at this time.