How to embed lexical features
I want to embed the part of speech feature and person feature into the word vector
The part of speech feature and the person feature can be encoded into one-hot vectors x
and y
, respectively. We can get the embedded vector v
from x
and y
:
z = concat([x, y])
v = z * E
where E is a trainable embedding matrix.