You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository has been archived by the owner on Dec 16, 2022. It is now read-only.
And that's it! The PretrainedTransformerEmbedder or PretrainedTransformerMismatchedEmbedder will then automatically resize the embeddings by adding randomly initialized rows.
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
-
This short post shows you how to extend the vocabulary of a pretrained transformer model with AllenNLP.
We assume you're using the
PretrainedTransformerTokenizer
with either thePretrainedTransformerIndexer
+PretrainedTransformerEmbedder
orPretrainedTransformerMismatchedIndexer
+PretrainedTransformerMismatchedEmbedder
, in which case your configuration file would look something like this:Then all you need to do is specify the tokens you want to add to the
additional_special_tokens
parameter intokenizer_kwargs
:And that's it! The
PretrainedTransformerEmbedder
orPretrainedTransformerMismatchedEmbedder
will then automatically resize the embeddings by adding randomly initialized rows.Beta Was this translation helpful? Give feedback.
All reactions