Negation is an important expression form in natural language, playing a critical role in conveying textual meaning. In natural language inference, the presence of negation can directly affect semantic relationships between texts. However, current pre-trained models exhibit significant accuracy degradation in semantic relationship judgment when processing negative sentences. Therefore, this study proposes a method to enhance the ability of pre-trained models to recognize and comprehend negative sentences in natural language inference. By enhancing the attention score weights for negative structures in text, the proposed method significantly improves the accuracy of natural language inference tasks involving negative sentences without sacrificing the original performance on affirmative sentences of the model. The effectiveness of the proposed method has been verified on a public natural language inference dataset for negation analysis.