Text this: A cosine similarity-based method for improving the accuracy of GIS discharge spectrum recognition