  Identifying spurious reduction artefacts in galaxy spectra is a challenge for
large surveys. We present an algorithm for identifying and repairing residual
spurious features in sky-subtracted galaxy spectra with application to the
VIPERS survey. The algorithm uses principal component analysis (PCA) applied to
the galaxy spectra in the observed frame to identify sky line residuals
imprinted at characteristic wavelengths. We further model the galaxy spectra in
the rest-frame using PCA to estimate the most probable continuum in the
corrupted spectral regions, which are then repaired. We apply the method to
90,000 spectra from the VIPERS survey and compare the results with a subset
where careful editing was performed by hand. We find that the automatic
technique does an extremely good job in reproducing the time-consuming manual
cleaning and does it in a uniform and objective manner across a large data
sample. The mask data products produced in this work are released together with
the VIPERS second public data release (PDR-2).
