Machine learning for reconstruction of polarity inversion lines from solar filaments