Provided are a method and an apparatus for classifying a class, to which a sentence belongs, using a deep neural network. One embodiment of the present disclosure provides a method and an apparatus for: learning a first sentence and a second sentence through a first neural network and a second neural network, respectively; acquiring a contrastive loss value on the basis of whether a first feature vector and a second feature vector, which are generated as output data of learning, are identical to classes to which the first and second sentences belong; and repeating learning so as to maximize the contrastive loss value.
展开▼