-
Notifications
You must be signed in to change notification settings - Fork 20
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
Cannot use trained model for validation or prediction #5
Comments
Seems that it must be this code for line 388 (with addition of punctuation label): print(cased_token + punctuation_syms[punc_label], end='') Maybe this is also the case for #3 |
Thanks for reporting those issues. For the first one, could you be more specific about the sequence of commands you have run and the data you used. Do you observe the same problem with the released models? For the second one, the error is cryptic. It looks like x is not a tensor. Can you add a line with print(type(x)) or print(x) to check the type of x? |
Hello! Thanks for this repository! I'm facing the same issue when tying to evaluate the model. The code reports the error just like: When I print the "x", I've found that the x is of type <class 'dict'>. Any suggestions regarding this issue? |
@khusainovaidar and @caiolibanio It could be an arguments order problem, try rewriting the command like this:
If that works, please tell me so I fix the eval usage example into the file README.md. |
Yes! That works! It was an arguments order problem as you said. Thanks! |
Hi, thank you for this repo! I'm trying to reproduce results for different language, so I'm using multilingual-bert fine-tuned to my language dataset.
Everything goes well during preprocessing and training, the resuls are comparable with those for English and French (97-99% for case and punctuation).
But when I try to use trained model, it gives very poor results even for sentences from training dataset. It works, sometimes it puts capital letters or dots, but it's rare and mostly model can't handle.
Also when I try to evaluate model with command from the README (also tried it for already used validation sets, for instance with command python recasepunc.py eval bertugan_casepunc.24000 valid.case+punc.x valid.case+punc.y) it gives error:
File "recasepunc.py", line 220, in batchify
x = x[:(len(x) // max_length) * max_length].reshape(-1, max_length)
TypeError: unhashable type: 'slice'
Sorry for pointing to two different problems in one Issue, but I though maybe it can be one common mistake for both cases.
The text was updated successfully, but these errors were encountered: