Table 1 ERNIE-MCBMA algorithm.
From: A novel approach for multiclass sentiment analysis on Chinese social media with ERNIE-MCBMA
Inputs: \(\:X=({x}_{1},{x}_{2},{x}_{3},\ldots,{x}_{n})\), where \(\:X\) is the input text sequence Outputs: sentiment classification labels | |
---|---|
1. encoder_out, text-cls = ERNIE(context, attention-Mask = mask) 2. _, pooled = ERNIE(context, attention-Mask = mask) 3. out = Reshape(encoder_out, [batch_size, 1, seq_len, hidden_size]) 4. out = Permute(out, [0, 3, 1, 2]) 5. cnn_out = Mish(Conv2d(out, kernel_size = 3, padding = 1)) 6. cnn_out = Permute(cnn_out, [0, 3, 1, 2]).squeeze(2) 7. out, _ = BiLSTM(cnn_out) 8. Att_out = Mutil-Attention(out, out, out, mask = None) 9. combined_out = Concatenate(encoder_out, cnn_out, Att_out, axis = 2) 10. combined_out = Permute(combined_out, [0, 2, 1]) 11. combined_out = MaxPool1d(combined_out, kernel_size = seq_len).squeeze(1) 12. combined_out = Mish(Concatenate(pooled, combined_out, axis = 1)) 13. final_out = FullyConnected(combined_out) 14. return final_out |