A method and apparatus for classifying a class to which a sentence belongs by using deep neural network are provided. According to an embodiment of the present disclosure, a first sentence and a second sentence are respectively learned through a first neural network and a second neural network. Based on whether A first feature vector and a second feature vector generated from the output data of the learning is same as a class to which the first sentence and the second sentence belongs, a contrast loss is obtained. The learning is repeated so as to maximize the contrast loss value. It is possible to improve the classification accuracy of the first sentence.
展开▼