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

How model predicts directly given a sequence text? #12

Open
swicaksono opened this issue Jul 23, 2019 · 0 comments
Open

How model predicts directly given a sequence text? #12

swicaksono opened this issue Jul 23, 2019 · 0 comments

Comments

@swicaksono
Copy link

swicaksono commented Jul 23, 2019

Hi, I just finished training the model by using the sample dataset, but when I tried to predict by using some a random text, it throws the following error:

# load the model after evaluation ended i added this print predicts
print (model.predict("Youth minister and Street General, Charles Ble Goude, who is under UN sanctions for acts of violence by street militias, including beatings, rapes and extrajudicial killings, vows to fight for Ivory Coast's sovereignty"))
line 161, in forward
seq_lens = list(masks.data.eq(constant.PAD_ID).long().sum(1).squeeze())
AttributeError: 'str' object has no attribute 'data'

How solve this issue?
Thank you in advance.

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