-
Notifications
You must be signed in to change notification settings - Fork 17
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 to use it in Python script instead of shell script. #22
Comments
I have run the --data_path /home/irfan/PycharmProjects/disambiguate/model/model_wsd_train_sc_wngt_dev_random4000_clear_compress_bert_large_cased_transformer_2048_single --weights /home/irfan/PycharmProjects/disambiguate/model/model_wsd_train_sc_wngt_dev_random4000_clear_compress_bert_large_cased_transformer_2048_single/model_weights_wsd0 But when I type on the console and press enter it throws the following error. he walked the dog
Traceback (most recent call last):
File "/home/irfan/PycharmProjects/disambiguate/python/getalp/wsd/predict.py", line 31, in <module>
main()
File "/home/irfan/PycharmProjects/disambiguate/python/getalp/wsd/predict.py", line 27, in main
predicter.predict(text)
File "/home/irfan/PycharmProjects/disambiguate/python/getalp/wsd/predicter.py", line 67, in predict
self.predict_and_output(ensemble, batch_x, batch_z, self.data_config.input_clear_text)
File "/home/irfan/PycharmProjects/disambiguate/python/getalp/wsd/predicter.py", line 104, in predict_and_output
batch_wsd = Predicter.generate_wsd_on_batch(output_wsd, batch_z)
File "/home/irfan/PycharmProjects/disambiguate/python/getalp/wsd/predicter.py", line 166, in generate_wsd_on_batch
batch_wsd.append(Predicter.generate_wsd_on_sample(output[i], batch_z[0][i]))
IndexError: index 1 is out of bounds for dimension 0 with size 1
Process finished with exit code 1 |
Same issue. How do I use it from Python to disambiguate a simple sentence like 'he walked the dog' ? |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Is there a way to use the model in Python script. I'm trying to do it but having lots of errors with modules importing etc.
The text was updated successfully, but these errors were encountered: