BERT-NER icon indicating copy to clipboard operation
BERT-NER copied to clipboard

How can I add LSTM before CRF layer

Open zwd13122889 opened this issue 5 years ago • 2 comments

zwd13122889 avatar Nov 16 '19 06:11 zwd13122889

you add LSTM in hidden2tag function, then both crf and softmax can use it

def hidden2tag(hiddenlayer,numclass):
    bi = tf.keras.layers.Bidirectional(tf.keras.layers.LSTM(100, return_sequences=True))
    linear = tf.keras.layers.Dense(numclass,activation=None)
    hiddenlayer = bi(hiddenlayer)
    hiddenlayer = linear(hiddenlayer)
    return hiddenlayer

azmat21 avatar Dec 05 '19 05:12 azmat21

thank you . In my data , i hava 80 categories , the FBI = 55. How can i improve my accuracy ?

zwd13122889 avatar Dec 05 '19 07:12 zwd13122889