There are many data from published scientific literature in the professional database of titanium alloy corrosion. The current problem is that the sample size of annotated documents is insufficient, which leads to insufficient knowledge digging in the material field, and the low accuracy of named entity recognition. Therefore, this paper proposes a domain-adaptive named entity recognition method based on attention mechanism. First, a bidirectional long and short-term memory conditional random field (BERT-BiLSTM-CRF) named entity recognition model based on the BERT (bidirectional encoder representations from transformers) pre-trained language model is constructed on the general domain data set. The network is improved, and an attention network is added between the BiLSTM and CRF layers to assist CRF in the serialization of named entities; the results of comparative experiments show that the model can fully extract the feature information of the material field and improve the accuracy of sequence annotation, and then improve the effect of named entity recognition in the field of materials science.