An improved algorithm based on residual shrinkage network with soft threshold module was proposed to solve the problem of noise caused by interference between words within a sentence in relation extraction. Firstly, the threshold was trained in each feature channel of the residual network. The threshold had two characteristics: first, its absolute value would not be too large, if it was too large, effective information would be eliminated; second, the threshold had different results for different input training. Secondly, according to the characteristics of soft threshold, the channel features lower than the threshold were deleted, and those higher than the threshold were reduced. Compared with direct deletion of negative features, soft threshold was able to save useful information of negative features. Finally, an optimization model of attention module was added to reduce the influence of mislabeling problem in distant supervision. Piecewise Convolutional Neural Network (PCNN), Bi-directional Long Short-Term Memory (BiLSTM) network and ordinary Residual Network (ResNet) were selected as baseline models for comparison experiments. Experimental results show that the precision-recall curves of the proposed model include the curves of other models and the F1 scores of the proposed model are increased by 6.0 percentage points, 3.9 percentage points and 1.4 percentage points respectively compared to the baseline models, which verifies that addition of soft thresholding network model can improve accuracy of relation extraction by reducing in-sentence noise.