Just like using "textfieldembedder" to embed "textfieldtensors", I want to embed labels and convert them into tensors with the same dimension as embedded input texts.
Do you know about LabelField
? Just put the appropriate LabelField
s into your instances, and AllenNLP will add the labels to the vocabulary for you. When Model.__init__()
runs, you can query the size of the label namespace to find out how big to make your embedding matrix.