when object 'char_embed' doesn't exist #1521
Comments
All elmo weight files provided should have the |
Thank you for your response. For my project I have removed the white spaces between words and would like to have the contextualized character embeddings in the sentence. I only work on the characters and have no words. So I have removed 'char_cnn' key from the options in the training of ELMo. The training was successful and now would like to get the contextualized embedding for each character from the hdf5 file I have. I think since I don't have 'char_cnn' I am getting this error. Is there any straightforward solution to this? This is the content of my 'options':
Also may I ask what is the straightforward way to get the embedding of a sub-sentence using the trained model in hdf5 format? Thank you |
If you are trying to load a custom elmo model into allennlp, you will need to modify this file: Above is the section where the weights are loaded. Perhaps you could modify that to match your custom model? It's possible you might find it easier to modify the original tensorflow code to dump embeddings using your model: https://github.com/allenai/bilm-tf/blob/master/bilm/training.py#L1060 Hopefully that's helpful? |
Thank you so much for the explanation. I tried both, but no success so far. My only modification to the model was removing the char_cnn params and I hoped that the "programmatically ELMo" code would still run on the character level. Please let me know if you decided to add this functionality. |
Hi, sorry we won't be adding this functionality. |
Is your feature request related to a problem? Please describe.
Hi there, thank you very much for the great work.
I am trying to use the code for char-level prediction where I don't have char_embedding in my elmo config. In this case I get the following error:
The text was updated successfully, but these errors were encountered: