Abstract The input-output relationship of inductive displacement sensors is typically nonlinear, which demands numerous computational resources for precise calculation. Therefore, the traditional analytical methods for the inductive displacement sensors cannot meet the real-time high-precision measurement requirements. In response to the aforementioned issues, this paper proposes an optimized Long Short-Term Memory (LSTM) neural networks based on one-dimensional convolutional neural networks (1DCNN) to modeling the input-output relationship of the inductive displacement sensor. First, the measurement principle of the inductive displacement sensors was analyzed, and the analytical model of the sensor output was derived. And the influences of the key parameters of sensors on the relationship between the induced voltage and the displacement were studied. Then, the 1DCNN-LSTM-AT network for modelling the input-output relationship of the inductive displacement sensor was studied. The spatial features of historical induced electromotive force (EMF) data generated by the induction coil were initially extracted using the 1DCNN network. And these spatial features were then utilized as input to the LSTM neural network to capture the temporal features of the historical induced EMF data. Subsequently, the spatiotemporal features of the induced EMF data were fed into the regression prediction layer to compute the displacement measurement results corresponding to the current input. Moreover, the attention mechanism was used for the 1DCNN-LSTM model to enhance the prediction accuracy and stability of the model. Finally, the experimental results demonstrate that the proposed 1DCNN-LSTM-AT model achieves an average absolute percentage error (MAPE) of 3.1%, significantly outperforming traditional models such as LSTM (29.3%), CNN (4.7%), and ANN (4.3%). This paper provides a new method for modelling the nonlinear relationships of the inductive displacement sensor, and presents a fresh perspective for research in the data processing of nonlinear sensors.