#Keras Invalid reduction dimension 2 for input with 2 dimensions.
在跑Bert-CRF的时候发现公司的电脑带不动,就把Bert改成了BiLSTM,因为之前没有试过中文命名实体识别的代码,所以出了一个小失误…花了半天才发现(这里用了(双向)最大熵隐马尔可夫模型,作用和用法都类似CRF,但是比CRF更快更简单。)原代码如下: input_id = Input(batch_shape=(None, None), ) x = Embedding(21128, 8)(input_id) x = Bidirectional(LSTM(256))(x) x
原创
2021-07-20 10:05:13 ·
1184 阅读 ·
0 评论