A method of configuring a search engine to classify a search query includes receiving a search query data set, the search query data set comprising a plurality of search queries, defining a first set of candidate labels and a second set of candidate labels according to the search queries in the search query data set, concatenating the first set of candidate labels with the second set of candidate labels to generate a concatenated candidate label set, generating a compatibility matrix comprising a similarity between the concatenated candidate label set and the search query data set, and training a classification network according to the compatibility matrix.