The word j = arg max k P (y = k|h i ) will have the largest value of h T i w j + b j .
the arg max problem can be converted to finding the nearest neighbor of vector [h i ; 1] among the vectors [w j ; b j ] under the distance measure of dot-product.