0

我已经实现了一个香草版本的 DistilBERT,它为我的 NER 任务提供了一个相当糟糕的 F1-Score。这可以在下面看到。但是我在任何论文或网站上都找不到对这个香草版本的任何可能的改进。有没有添加更多图层的有用方法?例如,添加 LSTM 层是否有意义?

encoder = TFDistilBertForTokenClassification.from_pretrained('distilbert-base-uncased', 
num_labels=n_tags)

# Input layers
input_ids_layer = Input(shape=(180, ), dtype=np.int32)
attention_mask_layer = Input(shape=(180, ), dtype=np.int32)

# Bert layer, return first output
embedding = encoder(
    input_ids_layer, attention_mask=attention_mask_layer
)[0]

dropout = Dropout(0.1)(embedding)
dense_output = Dense(n_tags, activation='softmax') (lstm)

model = Model(inputs=[input_ids_layer, attention_mask_layer], outputs=dense_output)
4

0 回答 0