KR102375874B1 - A chat service system based on semantic relationships inferred sentence using artificial intelligence technology - Google Patents
A chat service system based on semantic relationships inferred sentence using artificial intelligence technology Download PDFInfo
- Publication number
- KR102375874B1 KR102375874B1 KR1020190015863A KR20190015863A KR102375874B1 KR 102375874 B1 KR102375874 B1 KR 102375874B1 KR 1020190015863 A KR1020190015863 A KR 1020190015863A KR 20190015863 A KR20190015863 A KR 20190015863A KR 102375874 B1 KR102375874 B1 KR 102375874B1
- Authority
- KR
- South Korea
- Prior art keywords
- learning
- sentence
- classification
- sentences
- input
- Prior art date
Links
Images
Classifications
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06N—COMPUTING ARRANGEMENTS BASED ON SPECIFIC COMPUTATIONAL MODELS
- G06N3/00—Computing arrangements based on biological models
- G06N3/02—Neural networks
- G06N3/08—Learning methods
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F16/00—Information retrieval; Database structures therefor; File system structures therefor
- G06F16/30—Information retrieval; Database structures therefor; File system structures therefor of unstructured textual data
- G06F16/33—Querying
- G06F16/332—Query formulation
- G06F16/3329—Natural language query formulation or dialogue systems
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F16/00—Information retrieval; Database structures therefor; File system structures therefor
- G06F16/30—Information retrieval; Database structures therefor; File system structures therefor of unstructured textual data
- G06F16/33—Querying
- G06F16/3331—Query processing
- G06F16/334—Query execution
- G06F16/3344—Query execution using natural language analysis
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F16/00—Information retrieval; Database structures therefor; File system structures therefor
- G06F16/30—Information retrieval; Database structures therefor; File system structures therefor of unstructured textual data
- G06F16/35—Clustering; Classification
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F16/00—Information retrieval; Database structures therefor; File system structures therefor
- G06F16/30—Information retrieval; Database structures therefor; File system structures therefor of unstructured textual data
- G06F16/36—Creation of semantic tools, e.g. ontology or thesauri
- G06F16/367—Ontology
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F40/00—Handling natural language data
- G06F40/20—Natural language analysis
- G06F40/205—Parsing
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F40/00—Handling natural language data
- G06F40/30—Semantic analysis
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06N—COMPUTING ARRANGEMENTS BASED ON SPECIFIC COMPUTATIONAL MODELS
- G06N5/00—Computing arrangements using knowledge-based models
- G06N5/04—Inference or reasoning models
Landscapes
- Engineering & Computer Science (AREA)
- Theoretical Computer Science (AREA)
- Physics & Mathematics (AREA)
- General Physics & Mathematics (AREA)
- General Engineering & Computer Science (AREA)
- Computational Linguistics (AREA)
- Artificial Intelligence (AREA)
- Data Mining & Analysis (AREA)
- Mathematical Physics (AREA)
- Databases & Information Systems (AREA)
- General Health & Medical Sciences (AREA)
- Health & Medical Sciences (AREA)
- Life Sciences & Earth Sciences (AREA)
- Evolutionary Computation (AREA)
- Computing Systems (AREA)
- Software Systems (AREA)
- Audiology, Speech & Language Pathology (AREA)
- Biophysics (AREA)
- Biomedical Technology (AREA)
- Molecular Biology (AREA)
- Animal Behavior & Ethology (AREA)
- Human Computer Interaction (AREA)
- Information Retrieval, Db Structures And Fs Structures Therefor (AREA)
- Machine Translation (AREA)
Abstract
본 발명은 사용자단말과, 서비스 제공장치와, 학습장치로 이루어지고, 상기 학습장치는 학습 대상인 학습 문서 데이터를 입력받는 입력부; 상기 학습 문서의 단어들을 벡터 공간상에 맵핑하는 단어 벡터 변환 처리를 수행하는 단어-벡터 변환부; 상기 단어 벡터를 이용하여, 상기 학습 문서의 문장들에 대응하는 문장 벡터 변환 처리를 수행하는 문장-벡터 변환부; 및 상기 문장 벡터간 관계 정도에 따라, 문장 간 의미 관계 분류 학습을 수행하고, 상기 의미 관계 분류 학습에 따라 의미 관계가 학습된 문장 기반의 분류기를 생성하며, 상기 생성된 분류기에 기초한 사용자 입력 문서의 의도 분류 처리를 수행하는 의미 관계 분류부를 포함하며, 상기 서비스 제공장치가, 상기 의미관계 분류부에서 분류된 사용자 입력 문장의 의미관계 추론에 의해 대화서비스를 제공할 수 있는 것이다.The present invention comprises a user terminal, a service providing device, and a learning device, the learning device comprising: an input unit for receiving learning document data to be learned; a word-vector conversion unit that performs a word vector conversion process for mapping the words of the learning document onto a vector space; a sentence-vector converting unit that performs sentence vector conversion processing corresponding to the sentences of the learning document by using the word vector; And according to the degree of the relationship between the sentence vectors, perform semantic relationship classification learning between sentences, generate a sentence-based classifier in which the semantic relationship is learned according to the semantic relationship classification learning, and the user input document based on the generated classifier. and a semantic relation classifying unit for performing intention classification processing, wherein the service providing apparatus can provide a conversation service by inferring a semantic relation of a user input sentence classified by the semantic relation classifying unit.
Description
본 발명은 인공지능 기술을 이용한 문장의 의미 관계를 추론하는 대화 서비스 시스템에 관한 것이다.The present invention relates to a conversation service system for inferring a semantic relationship of a sentence using artificial intelligence technology.
인공지능(Artificial Intelligence)은 비즈니스, 조직운영, 생활방식 그리고 커뮤니케이션 방법에 혁신을 일으키고 있다. 매일매일 빠르게 변화하는 현대적 문화의 생활 방식과 다양하게 끊임없이 변화되는 고객의 요구사항에 최적의 서비스를 제공하기 위한 다양한 정보화 프로젝트가 진행되고 있다.Artificial intelligence is revolutionizing business, how organizations operate, how they live, and how they communicate. Various informatization projects are underway to provide optimal services to the rapidly changing lifestyles of modern culture and diverse and constantly changing customer requirements.
그중에서도 최근 빅데이터와 딥러닝 관련 기술이 빠른 속도로 발전하여 특정 분야에서는 실생활에 적용되고 있는 인공지능 기술이 구현되었으며, 특정 데이터에 대한 분석과, 개개인에게 특화된 다양한 분야의 정보를 통합 제공 및 활용하는 지능화된 개인 서비스에도 적용되고 있다.Among them, as technologies related to big data and deep learning have developed at a rapid pace in recent years, artificial intelligence technology that is being applied to real life has been implemented in certain fields. It is also being applied to intelligent personal services.
이와 같이 인공지능 및 데이터 분석 서비스 등 다양한 사용자 서비스들을 제공하기 위해, 매우 방대한 양의 텍스트 및 기타 언어 기반 정보에 대한 데이터 마이닝이 요구되고 있으며, 이를 위해 주로 기계학습 방식이 이용되고 있다.In order to provide various user services such as artificial intelligence and data analysis services as described above, data mining for a very large amount of text and other language-based information is required, and for this, a machine learning method is mainly used.
이러한 문서의 기계학습은 현재 문서가 가진 단어들을 임베딩한 벡터 값으로 문장만을 나타내는 문서 벡터를 이용한 분류 방식이 주로 이용되고 있다.In machine learning of such a document, a classification method using a document vector representing only a sentence as a vector value in which words of the current document are embedded is mainly used.
그러나, 기존의 분류 방식은 문장들 사이의 의미 관계를 파악하기 어려운 문제점이 있다. 이와 같은 문제점은 결과적으로 분류기의 성능에 한계를 보여주게 된다.However, the existing classification method has a problem in that it is difficult to grasp the semantic relationship between sentences. As a result, such problems show limitations in the performance of the classifier.
예를 들어, 서로 다른 주제를 가진 '유럽'이라는 클래스와 '축구'라는 클래스가 있을 때 '유럽'이라는 문서 데이터 안에 '유럽의 축구'와 관련된 내용이 있다면 '유럽' 클래스와 '축구' 관련된 문장과 '축구' 클래스의 문장들은 의미 관계를 갖고 있다고 할 수 있으나, 현재의 분류기에서는 이와 관련한 어떠한 정보도 연관되어 처리되고 있지 못하고 있는 실정이다.For example, if there is a class called 'Europe' and a class called 'Soccer' that have different topics, and there is content related to 'European soccer' in the document data 'Europe', sentences related to 'Europe' and 'Soccer' It can be said that the sentences of the 'soccer' class and 'soccer' have a semantic relationship, but the current classifier does not process any related information in relation to it.
즉, 기존의 방식들은 정해진 문장 클래스별 데이터로 학습을 하고 분류하기 때문에 서로 다른 클래스의 문장 즉, 문서 내에서도 서로 다른 주제를 가진 문장들 사이에서 어떠한 의미 관계가 나타난다고 하더라도 현재의 방식으로는 그 연관된 의미 관계를 파악할 수 없다.In other words, since the existing methods learn and classify data for each given sentence class, even if any semantic relationship appears between sentences of different classes, that is, sentences with different subjects, even within the document, in the current method, the relevant I can't figure out the semantic relationship.
이러한 문제점은 기계학습 기반 챗봇, 상담 서비스 등의 대화 서비스에 있어서, 사전 분류되지 않은 새로운 문장에 대한 클래스 구분력 저하로 이어지게 되며, 결과적으로 정상적 대화로 이어지지 않고, 서비스의 품질 저하를 가져오게 된다.This problem leads to a decrease in class distinction for new sentences that are not pre-classified in conversation services such as machine learning-based chatbots and counseling services, and as a result, it does not lead to a normal conversation and leads to a decrease in service quality.
또한, 현재는 문장 벡터 및 분류 프로세스가 통합적으로 구성되어 있어, 문서의 도메인이 변경되더라도 분류 모델을 가변적으로 적용하기 어려운 측면이 있는 바, 분류 효율 또한 떨어지는 문제점이 있다.In addition, since the sentence vector and the classification process are currently integrated, it is difficult to apply the classification model variably even if the domain of the document is changed, so there is a problem in that classification efficiency also decreases.
본 발명은 상기한 바와 같은 문제점을 해결하고자 안출된 것으로, 문장 사이의 관계를 추론하여 새로운 문장의 의미를 파악해 클래스를 결정하도록 하여 최종적으로 분류기 성능 향상 및 의미관계 해석을 용이하게 하는 문장 의미 관계 추론 대화 서비스 시스템을 제공하는 데 그 목적이 있다.The present invention has been devised to solve the above-described problems, and by inferring the relationship between sentences to determine the meaning of a new sentence to determine the class, finally improving the classifier performance and facilitating the interpretation of the semantic relation. An object of the present invention is to provide a dialogue service system.
상기한 바와 같은 과제를 해결하기 위한 본 발명의 실시 예에 따른 문장 의미 관계 추론 대화 서비스 시스템은, Sentence semantic relation inference dialogue service system according to an embodiment of the present invention for solving the above problems,
사용자와의 음성 입력 및 출력에 의한 대화 서비스를 제공할 수 있는 사용자 단말과; 상기 사용자 단말을 통해 입력되는 입력 문장에 대한 문장 의미 관계 분류에 의거하고, 문장 간 의미 관계 모델을 이용한 데이터 처리기반 사용자 대화 서비스를 사용자 단말로 제공하는 서비스 제공장치와; 학습 데이터 베이스의 학습 문서를 기초하여 상기 사용자 입력문서의 학습 모델 생성 프로세스를 수행하여 생성된 학습 모델 정보를 상기 학습 데이터 베이스에 저장하고, 상기 학습 문서에 기초하여 문장 간 의미 관계 분류 학습을 수행하고, 상기 의미 관계 분류 학습에 따라 문장 기반의 분류기를 생성하며, 상기 생성된 분류기에 기초하여 상기 서비스 제공장치를 통해 입력된 사용자 입력 문장에 대해 문장 의미 관계 분류 처리를 수행하여 상기 서비스 제공장치로 출력하는 학습장치; 를 포함한다.a user terminal capable of providing a conversation service by voice input and output with a user; a service providing device for providing a data processing-based user conversation service using a semantic relation model between sentences to a user terminal based on sentence semantic relation classification for input sentences input through the user terminal; On the basis of the learning document of the learning database, the learning model information generated by performing the learning model generation process of the user input document is stored in the learning database, and semantic relation classification learning between sentences is performed based on the learning document, and , a sentence-based classifier is generated according to the semantic relation classification learning, and sentence semantic relation classification processing is performed on the user input sentence input through the service providing device based on the generated classifier and output to the service providing device learning device; includes
상기 학습장치는, The learning device,
대화 서비스 제공을 위한 학습 장치에 있어서, 학습 대상인 학습 문서 데이터를 입력받는 입력부; 상기 학습 문서의 단어들을 벡터 공간상에 맵핑하는 단어 벡터 변환 처리를 수행하는 단어-벡터 변환부; 상기 단어 벡터를 이용하여, 상기 학습 문서의 문장들에 대응하는 문장 벡터 변환 처리를 수행하는 문장-벡터 변환부; 및 상기 문장 벡터간 관계 정도에 따라, 문장 간 의미 관계 분류 학습을 수행하고, 상기 의미 관계 분류 학습에 따라 의미 관계가 학습된 문장 기반의 분류기를 생성하며, 상기 생성된 분류기에 기초한 사용자 입력 문서의 의도 분류 처리를 수행하는 의미 관계 분류부를 포함한다.A learning apparatus for providing a conversation service, comprising: an input unit for receiving learning document data to be learned; a word-vector conversion unit that performs a word vector conversion process for mapping the words of the learning document onto a vector space; a sentence-vector converting unit that performs sentence vector conversion processing corresponding to the sentences of the learning document by using the word vector; And according to the degree of the relationship between the sentence vectors, perform semantic relationship classification learning between sentences, generate a sentence-based classifier in which the semantic relationship is learned according to the semantic relationship classification learning, and the user input document based on the generated classifier. and a semantic relation classification unit that performs intention classification processing.
또한, 상기한 바와 같은 과제를 해결하기 위한 본 발명의 실시 예에 따른 학습방법은, In addition, the learning method according to an embodiment of the present invention for solving the above problems,
대화 서비스 제공을 위한 학습 장치의 동작 방법에 있어서, 학습 대상인 학습 문서 데이터를 입력받는 단계; 상기 학습 문서의 단어들을 벡터 공간상에 맵핑하는 단어 벡터 변환 처리를 수행하는 단계; 상기 단어 벡터를 이용하여, 상기 학습 문서의 문장들에 대응하는 문장 벡터 변환 처리를 수행하는 단계; 상기 문장 벡터간 관계 정도에 따라, 문장 간 의미 관계 분류 학습을 수행하는 단계; 상기 의미 관계 분류 학습에 따라 의미 관계가 학습된 문장 기반의 분류기를 생성하는 단계; 및 상기 생성된 분류기에 기초한 사용자 입력 문서의 의도 분류 처리를 수행하는 단계를 포함한다.A method of operating a learning apparatus for providing a conversation service, the method comprising: receiving learning document data as a learning object; performing word vector conversion processing for mapping the words of the learning document onto a vector space; performing sentence vector conversion processing corresponding to the sentences of the learning document by using the word vector; performing semantic relation classification learning between sentences according to the degree of relation between the sentence vectors; generating a sentence-based classifier in which a semantic relationship is learned according to the semantic relationship classification learning; and performing intention classification processing of the user input document based on the generated classifier.
한편, 상기한 바와 같은 과제를 해결하기 위한 본 발명의 실시 예에 따른 방법은 상기 방법을 컴퓨터에서 실행시키기 위한 프로그램 및 상기 프로그램이 기록된 기록 매체로 구현될 수 있다.On the other hand, the method according to an embodiment of the present invention for solving the above problems may be implemented as a program for executing the method in a computer and a recording medium in which the program is recorded.
본 발명의 실시 예에 따르면, 학습 문서의 단어들을 벡터 공간상에 맵핑하고, 상기 단어 벡터를 이용하여 상기 학습 문서의 문장들에 대응하는 문장 벡터 변환 처리를 수행하며, 상기 문장 벡터간 관계 정도에 따라, 문장 간 의미 관계 분류 학습을 수행하여 상기 의미 관계 분류 학습에 따라 의미 관계가 학습된 문장 기반의 분류기를 생성할 수 있다.According to an embodiment of the present invention, the words of the learning document are mapped on a vector space, and sentence vector conversion processing corresponding to the sentences of the learning document is performed using the word vector, and the degree of relationship between the sentence vectors is determined. Accordingly, by performing semantic relationship classification learning between sentences, a sentence-based classifier in which the semantic relationship is learned according to the semantic relationship classification learning may be generated.
이에 따라, 본 발명의 실시 예에 따르면 문장 사이의 관계를 추론하여 새로운 문장의 의미를 파악해 클래스를 결정할 수 있는 의미 관계가 학습된 문장 기반의 분류기를 제공할 수 있으며, 이에 따른 대화 서비스에 있어서의 의미 관계 기반 문장 분류 처리를 통해, 보다 풍부한 응답을 가능하게 하는 바, 분류기 성능 향상 및 의미관계 해석을 용이하게 하는 대화 서비스 제공을 위한 문장 의미 관계 학습 장치 및 그 동작 방법을 제공할 수 있게 된다.Accordingly, according to an embodiment of the present invention, it is possible to provide a sentence-based classifier in which a semantic relation is learned that can determine the class by inferring the relation between sentences to determine the meaning of a new sentence, and accordingly, Through semantic relation-based sentence classification processing, it is possible to provide a sentence semantic relation learning apparatus and an operating method thereof for providing a dialogue service that improves classifier performance and facilitates semantic relation interpretation as it enables a richer response.
또한, 본 발명은 단어 벡터화, 문장 벡터 및 분류 프로세스 각각의 개별적 분류 프로세스들을 제공함으로써, 문서의 도메인이 변경되더라도 분류 모델을 가변적으로 적용할 수 있게 됨에 따라, 시스템 응용성 및 분류 효율을 높일 수 있게 되는 장점이 있다.In addition, the present invention provides individual classification processes for each of the word vectorization, sentence vector, and classification process, so that the classification model can be variably applied even if the domain of the document is changed, thereby increasing system applicability and classification efficiency. has the advantage of being
도 1은 본 발명의 실시 예에 따른 전체 시스템을 개략적으로 도시한 개념도이다.
도 2는 본 발명의 실시 예에 따른 학습 장치를 보다 구체적으로 설명하기 위한 블록도이다.
도 3은 본 발명의 실시 예에 따른 학습 장치의 동작 방법을 보다 구체적으로 설명하기 위한 흐름도이다.
도 4는 본 발명의 실시 예에 따른 벡터 변환 처리를 설명하기 위한 도면이다.
도 5 및 도 6은 본 발명의 실시 예에 따른 분류 프로세스 및 결과 예시도이다.
도 7은 본 발명의 실시 예에 따른 서비스 제공 프로세스를 설명하기 위한 흐름도이다.
도 8 및 도 9는 본 발명의 실시 예에 따른 컨볼루션 뉴럴 네트워크 기반 샘플링 및 트리플렛 로스 함수 적용에 따른 결과 데이터를 도시한 도면이다.1 is a conceptual diagram schematically illustrating an entire system according to an embodiment of the present invention.
2 is a block diagram illustrating a learning apparatus according to an embodiment of the present invention in more detail.
3 is a flowchart for explaining in more detail a method of operating a learning apparatus according to an embodiment of the present invention.
4 is a diagram for explaining a vector conversion process according to an embodiment of the present invention.
5 and 6 are diagrams illustrating a classification process and results according to an embodiment of the present invention.
7 is a flowchart illustrating a service providing process according to an embodiment of the present invention.
8 and 9 are diagrams illustrating result data according to convolutional neural network-based sampling and application of a triplet loss function according to an embodiment of the present invention.
이하의 내용은 단지 본 발명의 원리를 예시한다. 그러므로 당업자는 비록 본 명세서에 명확히 설명되거나 도시되지 않았지만 본 발명의 원리를 구현하고 본 발명의 개념과 범위에 포함된 다양한 장치를 발명할 수 있는 것이다. 또한, 본 명세서에 열거된 모든 조건부 용어 및 실시예들은 원칙적으로, 본 발명의 개념이 이해되도록 하기 위한 목적으로만 명백히 의도되고, 이와 같이 특별히 열거된 실시예들 및 상태들에 제한적이지 않는 것으로 이해되어야 한다.The following is merely illustrative of the principles of the invention. Therefore, those skilled in the art will be able to devise various devices that, although not explicitly described or shown herein, embody the principles of the present invention and are included within the spirit and scope of the present invention. Further, it is to be understood that all conditional terms and examples listed herein are, in principle, expressly intended solely for the purpose of enabling the concept of the present invention to be understood, and not limited to the specifically enumerated embodiments and states as such. should be
또한, 본 발명의 원리, 관점 및 실시예들 뿐만 아니라 특정 실시예를 열거하는 모든 상세한 설명은 이러한 사항의 구조적 및 기능적 균등물을 포함하도록 의도되는 것으로 이해되어야 한다. 또한 이러한 균등물들은 현재 공지된 균등물뿐만 아니라 장래에 개발될 균등물 즉 구조와 무관하게 동일한 기능을 수행하도록 발명된 모든 소자를 포함하는 것으로 이해되어야 한다.Moreover, it is to be understood that all detailed description reciting the principles, aspects, and embodiments of the invention, as well as specific embodiments, are intended to cover structural and functional equivalents of such matters. It should also be understood that such equivalents include not only currently known equivalents, but also equivalents developed in the future, i.e., all devices invented to perform the same function, regardless of structure.
따라서, 예를 들어, 본 명세서의 블럭도는 본 발명의 원리를 구체화하는 예시적인 회로의 개념적인 관점을 나타내는 것으로 이해되어야 한다. 이와 유사하게, 모든 흐름도, 상태 변환도, 의사 코드 등은 컴퓨터가 판독 가능한 매체에 실질적으로 나타낼 수 있고 컴퓨터 또는 프로세서가 명백히 도시되었는지 여부를 불문하고 컴퓨터 또는 프로세서에 의해 수행되는 다양한 프로세스를 나타내는 것으로 이해되어야 한다.Thus, for example, the block diagrams herein are to be understood as representing conceptual views of illustrative circuitry embodying the principles of the present invention. Similarly, all flowcharts, state transition diagrams, pseudo code, etc. may be tangibly embodied on computer-readable media and be understood to represent various processes performed by a computer or processor, whether or not a computer or processor is explicitly shown. should be
또한 프로세서, 제어 또는 이와 유사한 개념으로 제시되는 용어의 명확한 사용은 소프트웨어를 실행할 능력을 가진 하드웨어를 배타적으로 인용하여 해석되어서는 아니되고, 제한 없이 디지털 신호 프로세서(DSP) 하드웨어, 소프트웨어를 저장하기 위한 롬(ROM), 램(RAM) 및 비 휘발성 메모리를 암시적으로 포함하는 것으로 이해되어야 한다. 주지관용의 다른 하드웨어도 포함될 수 있다.In addition, the clear use of terms presented as processor, control, or similar concepts should not be construed as exclusively referring to hardware having the ability to execute software, and without limitation, digital signal processor (DSP) hardware, ROM for storing software. It should be understood to implicitly include (ROM), RAM (RAM) and non-volatile memory. Other common hardware may also be included.
상술한 목적, 특징 및 장점은 첨부된 도면과 관련한 다음의 상세한 설명을 통하여 보다 분명해질 것이며, 그에 따라 본 발명이 속하는 기술분야에서 통상의 지식을 가진 자가 본 발명의 기술적 사상을 용이하게 실시할 수 있을 것이다. 또한, 본 발명을 설명함에 있어서 본 발명과 관련된 공지 기술에 대한 구체적인 설명이 본 발명의 요지를 불필요하게 흐릴 수 있다고 판단되는 경우에 그 상세한 설명을 생략하기로 한다. The above objects, features and advantages will become more apparent through the following detailed description in relation to the accompanying drawings, and accordingly, those of ordinary skill in the art to which the present invention pertains can easily implement the technical idea of the present invention. There will be. In addition, in the description of the present invention, if it is determined that a detailed description of a known technology related to the present invention may unnecessarily obscure the gist of the present invention, the detailed description thereof will be omitted.
이하, 첨부된 도면을 참조하여 본 발명에 따른 바람직한 일실시예를 상세히 설명하기로 한다.Hereinafter, a preferred embodiment according to the present invention will be described in detail with reference to the accompanying drawings.
도 1은 본 발명의 실시 예에 따른 전체 시스템을 개략적으로 도시한 도면이다.1 is a diagram schematically illustrating an entire system according to an embodiment of the present invention.
도 1을 참조하면 본 발명의 일 실시 예에 따른 시스템은, 학습 장치(100), 서비스 제공 장치(200), 사용자 단말(300)을 포함할 수 있으며, 학습 장치(100)는 학습 데이터베이스(180)를 포함하거나 상기 학습 데이터베이스(180)에 연결되어 있을 수 있다.Referring to FIG. 1 , a system according to an embodiment of the present invention may include a
보다 구체적으로, 학습 장치(100)는, 학습 데이터베이스(180)에서 저장된 학습 문서 데이터에 기초하여, 기계학습(machine learning)을 수행하여 문서 학습 모델을 생성할 수 있으며, 생성된 학습 모델을 이용하여, 서비스 제공 장치(200)로부터 입력되는 사용자 입력 문장에 대응한 분류 정보를 출력하거나, 이에 대응한 응답 문장을 서비스 제공 장치(200)로 제공할 수 있다.More specifically, the
특히, 본 발명의 실시 예에 따른 학습 장치(100)는, 서비스 제공 장치(200)의 대화 서비스 제공에 이용될 수 있으며, 학습 대상인 학습 문서 데이터를 입력받아, 상기 학습 문서의 단어들을 벡터 공간상에 맵핑하는 단어 벡터 변환 처리를 수행하고, 상기 단어 벡터를 이용하여, 상기 학습 문서의 문장들에 대응하는 문장 벡터 변환 처리를 수행하며, 상기 문장 벡터간 관계 정도에 따라, 문장 간 의미 관계 분류 학습을 수행하고, 상기 의미 관계 분류 학습에 따라 의미 관계가 학습된 문장 기반의 분류기를 생성하며, 상기 생성된 분류기에 기초한 사용자 입력 문서의 의도 분류 처리를 수행할 수 있다.In particular, the
나아가, 학습 장치(100)는, 상기 문장 벡터간 컨볼루션 뉴럴 네트워크(Convilutional Neural Network) 기반의 학습 처리를 수행하여 문장 벡터 학습 모델을 생성하고, 상기 문장 벡터 학습 모델에 대응한 문장 벡터간 트리플렛 로스(Triplet-loss) 함수를 처리하며, 상기 트리플렛 로스 함수 처리 결과에 따라, 상기 문장 벡터간 관계 정도에 기초한 문장 간 의미 관계 학습 모델을 출력할 수 있는 바, 이는 문장 사이의 관계를 추론하여 같은 분류의 문장이 서로 가까워지도록 학습하게 하는 것으로. 학습 장치(100)의 출력 레이어에는 문장 사이의 관계 추론 학습이 모두 끝난 후의 문장 사이의 관계를 표현한 문장 벡터가 포함될 수 있다.Furthermore, the
그리고, 서비스 제공 장치(200)는 이와 같이 처리된 문장 간 의미 관계 모델을 이용한 데이터 처리기반 사용자 대화 서비스를 사용자 단말(300)로 제공할 수 있다. 사용자 대화 서비스는 본 발명의 실시 예에 따른 학습 장치(100)의 동작에 의해 생성된 학습 데이터베이스(180) 및 이에 따른 문장 의미 관계 모델을 이용하여, 사용자 단말(300)의 입력 문장에 응답하는 대화 서비스를 포함할 수 있다.In addition, the service providing apparatus 200 may provide a data processing-based user conversation service using the semantic relationship model between the processed sentences to the
예를 들어, 서비스 제공 장치(200)는 챗봇 서비스, 상담 서비스 등을 사용자 단말(300)로 제공할 수 있다.For example, the service providing apparatus 200 may provide a chatbot service, a consultation service, and the like to the
예를 들어, 사용자의 표현 방법은 항시 달라지기 때문에 분류되지 않은 문장이 입력된다면, 응답에 대한 한계가 존재 할 수 있다. 이를 위해 딥러닝 기술이 챗봇에 활용되고 있으나, 모든 문의에 대한 응답을 처리하기에는 학습 데이터가 현저하게 적은 문제가 있으며, 기존 상담 데이터를 활용하기에는 데이터가 분류 되지 않았으며, 사람이 분류하기에는 오랜 시간이 사용되는 문제점이 있다.For example, since the user's expression method always changes, if an unclassified sentence is input, there may be a limit to the response. For this purpose, deep learning technology is being used in chatbots, but there is a problem that there is significantly less learning data to process responses to all inquiries. There is a problem with its use.
따라서, 본 발명의 실시 예에 따른 학습 장치(100)는, 분류되지 않는 문장들이 입력되더라도, 문장 간 의미 관계 모델에 따라, 유사 문장들로의 효과적인 분류 처리를 수행할 수 있게 되는 장점이 있다.Therefore, the
한편, 사용자 단말(300) 및 서비스 제공 장치(200)는 네트워크를 통해 유선 또는 무선으로 연결될 수 있으며, 네트워크간 상호간 통신을 위해 각 사용자 단말(100) 및 서비스 제공 장치(300)는 인터넷 네트워크, LAN, WAN, PSTN(Public Switched Telephone Network), PSDN(Public Switched Data Network), 케이블 TV 망, WIFI, 이동 통신망 및 기타 무선 통신망 등을 통하여 데이터를 송수신할 수 있다. 또한, 각 사용자 단말(300) 및 서비스 제공 장치(200)는 각 통신망에 상응하는 프로토콜로 통신하기 위한 각각의 통신 모듈을 포함할 수 있다.Meanwhile, the
그리고, 본 명세서에서 설명되는 사용자 단말(100)에는 휴대폰, 스마트 폰(smart phone), 노트북 컴퓨터(laptop computer), 디지털방송용 단말, PDA(Personal Digital Assistants), PMP(Portable Multimedia Player), 네비게이션 등이 포함될 수 있으나, 본 발명은 이에 한정되지 아니하며 그 이외에 사용자 입력 및 정보 표시 등이 가능한 다양한 장치일 수 있다.In addition, the
이와 같은 시스템에 있어서, 사용자 단말(300)은 서비스 제공 장치(200)와 연결되어 상술한 데이터 기반 대화 서비스를 제공받을 수 있다.In such a system, the
도 2는 본 발명의 실시 예에 따른 학습 장치를 보다 구체적으로 설명하기 위한 블록도이다.2 is a block diagram illustrating a learning apparatus according to an embodiment of the present invention in more detail.
도 2를 참조하면, 본 발명의 실시 예에 따른 학습 장치(100)는, 입력부(110), 학습부(120), 운영부(140) 및 학습 데이터베이스(180)를 포함할 수 있으며, 운영부(140)는, 단어-벡터 변환부(141), 문장-벡터 변환부(142), 의미 관계 분류부(143) 및 결과 출력부(144)를 포함한다.Referring to FIG. 2 , the
먼저, 입력부(110)는, 학습을 위한 학습 문서를 학습 데이터베이스(180)로부터 입력받아 학습부(120)로 전달하여 학습에 이용되도록 처리하거나, 서비스 제공 장치(200)로부터 전달된 사용자 입력 문서를 운영부(140)로 전달하여 분류 처리된 결과 데이터가 결과 출력부(144)에서 출력되도록 처리할 수 있다. 결과 출력부(144)의 결과 데이터는 다시 서비스 제공 장치(200)로 전달될 수 있다.First, the
한편, 학습부(120)는 운영부(140)의 동작 및 입력부(110)로부터 입력된 학습 데이터에 기초한 학습 모델 생성 프로세스를 수행할 수 있다. 이와 같이 생성된 학습 모델 정보는 학습 데이터베이스(180)에 저장될 수 있다.Meanwhile, the
특히, 본 발명의 실시 예에 따른 운영부(140)는 학습 모델 생성에 있어서, 문장 간 의미 관계 학습 모델이 생성되도록 처리함으로써, 문장의 의미 관계 분류를 가능하게 한다.In particular, in generating the learning model, the operation unit 140 according to an embodiment of the present invention makes it possible to classify the semantic relationship of sentences by processing to generate a semantic relationship learning model between sentences.
이를 위해, 운영부(140)는 상기 학습 문서의 단어들을 벡터 공간상에 맵핑하는 단어 벡터 변환 처리를 수행하는 단어-벡터 변환부(141)와, 상기 단어 벡터를 이용하여, 상기 학습 문서의 문장들에 대응하는 문장 벡터 변환 처리를 수행하는 문장-벡터 변환부(142)와, 상기 문장 벡터간 관계 정도에 따라, 문장 간 의미 관계 분류 학습을 수행하고, 상기 의미 관계 분류 학습에 따라 의미 관계가 학습된 문장 기반의 분류기를 생성하며, 상기 생성된 분류기에 기초한 사용자 입력 문서의 의도 분류 처리를 수행하는 의미 관계 분류부(143)를 포함할 수 있다.To this end, the operation unit 140 includes a word-
그리고, 결과 출력부(144)는 상기 분류 처리 결과를 출력하기 위한 하나 이상의 출력 모듈로 구성될 수 있다.In addition, the
보다 구체적으로, 의미 관계 분류부(143)는, 상기 문장 벡터간 컨볼루션 뉴럴 네트워크(Convilutional Neural Network, CNN) 기반의 학습 처리를 수행하여 문장 벡터 학습 모델을 생성하고, 상기 문장 벡터 학습 모델에 대응한 문장 벡터간 트리플렛 로스(Triplet-loss) 함수를 처리하며, 상기 트리플렛 로스 함수 처리 결과에 따라, 상기 문장 벡터간 관계 정도에 기초한 문장 간 의미 관계 학습 모델을 생성한다.More specifically, the semantic
여기서, 문장-벡터 변환부(142)는, 단어-벡터 변환부(141)에서 학습 문서의 단어들에 대응하는 단어 벡터 변환 값들이 산출되면, 상기 단어 벡터를 이용한 문장 벡터 변환 처리에 따라 상기 단어 벡터로 표현되는 문장 벡터들을 생성할 수 있다. 이와 같이 단어 벡터들로 표현된 문장 벡터들은 상기 컨볼루션 뉴럴 네트워크의 입력 데이터로서 사용될 수 있다.Here, the sentence-
여기서, 단어 인식 수용력 증대를 위하여, 학습 문서는 미리 결정된 정보 사이트, 예를 들어 위키피디아 사이트 등으로부터 수집된 문서로 사전 결정될 수 있다. 이러한 문서들로부터 다양한 어휘가 수용될 수 있으며, 다양한 어휘의 단어 벡터들로 표현된 문장들 간의 의미 관계 정보가 효과적으로 분류될 수 있다.Here, in order to increase the word recognition capacity, the learning document may be predetermined as a document collected from a predetermined information site, for example, a Wikipedia site. Various vocabularies can be accommodated from these documents, and semantic relation information between sentences expressed by word vectors of various vocabularies can be effectively classified.
한편, 의미 관계 분류부(143)는 컨볼루션 뉴럴 네트워크의 필터 사이즈의 크기를 조절함에 따라, 문장 내에서 원하는 범위를 획득할 수 있고, 따라서 서로 다른 사이즈의 필터들을 이용해서 레이어를 적층함에 따라 문장 내에서도 여러 범위의 단어부터 구절, 문장까지 점진적인 문장 분류를 처리할 수 있다.On the other hand, the
그리고, 의미 관계 분류부(143)는 트리플렛 로스(Triplet-loss) 함수 적용을 위해, 상기 컨볼루션 뉴럴 네트워크 학습에 따라 1차 분류된 분류 클래스에 따른 앵커(Anchor) 데이터에 기초하여, 문장 벡터들이 같은 클래스인 긍정(Positive) 데이터와, 다른 클래스인 부정(Negative) 데이터로 분류되도록 한다.In addition, the semantic
그리고, 의미 관계 분류부(143)는 앵커 데이터와 같은 클래스인 긍정 데이터들이 상기 앵커 데이터와의 유클리드 거리가 더 가까이 위치하도록 하고, 다른 클래스인 부정 데이터와의 거리는 더 멀리 위치하도록 조절함에 따라, 군집 데이터간 균형있는 분류 처리할 수 있다. 이와 같은 트리플렛 로스 함수는 데이터 군집간 분류를 용이하게 하는 손실함수일 수 있다.And, the semantic
이에 따라, 본 발명의 실시 예에 따른 의미 관계 분류부(143)는, 상기 문장 벡터들에 대응한 주제 분류에 따라, 각 분류 클래스별 앵커, 긍정 및 부정 데이터를 샘플링하고, 상기 각 샘플링 데이터간 유클리디안 거리 값이 일정 범위 이내가 될 때까지 샘플링 데이터간 손실(loss) 값을 가변할 수 있으며, 상기 손실 값 가변을 위하여, 상기 문장 벡터 학습 모델에 대응한 신경망 가중치 값을 조절을 처리할 수 있다.Accordingly, the semantic
그리고, 의미 관계 분류부(143)는 상기 샘플링 데이터간 유클리디안 거리 값이 일정 범위 이내인 경우, 현재 조절된 가중치 값에 따른 문장 벡터 학습 모델을 문장 간 의미 관계 학습 모델로 출력할 수 있다.In addition, when the value of the Euclidean distance between the sampling data is within a predetermined range, the semantic
또한, 의미 관계 분류부(143)는 상기 문장 간 의미 관계 학습 모델을 이용한 문장 의도 분류기를 생성할 수 있으며, 상기 사용자 입력 문서가 사전 설정된 분류 기준에 포함되어 있는 경우, 상기 분류 기준에 대응하는 분류 처리를 수행하고, 상기 사용자 입력 문서가 사전 설정된 분류 기준에 포함되어 있지 않은 경우, 상기 문장 간 의미 관계 학습 모델을 이용한 문장 의도 분류기에 기초하여, 상기 사용자 입력 문서와 유사 의도를 갖는 유사 문장을 색인할 수 있다.In addition, the
결과 출력부(144)는 상기 색인된 유사 문장에 대응하는 분류 정보를 출력할 수 있는 바, 분류 기준에 없는 문장이라 하더라도 유사 문장이 사용자에게 제공되도록 처리할 수 있다.The
도 3은 본 발명의 실시 예에 따른 학습 장치의 동작 방법을 보다 구체적으로 설명하기 위한 흐름도이다.3 is a flowchart illustrating in more detail a method of operating a learning apparatus according to an embodiment of the present invention.
도 3을 참조하면, 본 발명의 실시 예에 따른 학습 장치(100)는, 먼저 입력부(110)를 통해 학습 문서가 입력되면(S101), 학습 문서의 단어들에 대응하는 단어 벡터 변환 처리를 수행한다(S109).Referring to FIG. 3 , when a learning document is first inputted through the input unit 110 ( S101 ), the
그리고, 학습 장치(100)는, 학습 문서에서, 단어 벡터를 이용한 문장 벡터 변환을 처리한다(S111).Then, the
이후, 학습 장치(100)는, 문장 벡터 임베딩에 따른 문장 간 의미 관계 분류 학습 처리를 수행하고(S113), 의미 관계가 학습된 문장들을 이용한 분류기를 생성한다(S115).Thereafter, the
이후, 학습 장치(100)는 분류기를 이용한 사용자 입력 문서의 의도 분류 처리를 수행한다(S117).Thereafter, the
도 4는 본 발명의 실시 예에 따른 벡터 변환 처리를 설명하기 위한 도면이다.4 is a diagram for explaining a vector conversion process according to an embodiment of the present invention.
도 4를 참조하면, 기존 분류기준 기반 챗봇에 사용되는 데이터가 학습 문서 데이터로 입력될 수 있으며, 학습 문서는 사용자가 입력할 수 있는 예상 시나리오에 맞게 작성된 문장 30건이 예시될 수 있다. 학습 문서는 도 4에 도시된 바와 같이, 레이블과 콘텐트로 구분 저장 되어, 학습부(120)의 의미 관계 분류부(143) 기반 단어 벡터화 프로세스의 입력 값으로 사용될 수 있다.Referring to FIG. 4 , data used in the existing classification criterion-based chatbot may be input as learning document data, and the learning document may include 30 sentences written according to an expected scenario that a user can input. As shown in FIG. 4 , the learning document is stored as a label and content, and may be used as an input value of the word vectorization process based on the semantic
벡터화 프로세스에 따라, 단어-벡터 변환부(141)는, 각 문장의 단어들을 단어 벡터화 하여 벡터 공간상에 맵핑하게 되며, 문장-벡터 변환부(142)는 단어 벡터 데이터를 이용한 문장 벡터 데이터를 획득할 수 있다.According to the vectorization process, the word-
이후, 의미 관계 분류부(143)는 상기 단어 벡터로 표현된 문장 벡터를 샘플링 모듈의 입력 값으로 입력할 수 있으며, 샘플링된 벡터 데이터를 이용하여, 전술한 컨볼루션 뉴럴 네트워크 생성 및 트리플렛 로스 함수 적용을 통해 문장 간 의미 관계를 나타내도록 처리할 수 있다.Thereafter, the semantic
예를 들어, 도 4에 도시된 바와 같이, 샘플링에 의해 군집화된 임베딩 벡터 데이터가 생성될 수 있으며, 상기와 같이 군집화 된 벡터 공간상의 데이터는 의미 관계 분류부(143)의 함수 처리를 위한 임베딩 벡터 데이터 입력값으로 사용될 수 있고, 의미 관계 분류부(143)는 상기 군집화 된 문장들을 이용하여 각 문장들의 관계를 학습함으로써, 문장 간 의미 관계 학습 모델을 생성할 수 있다.For example, as shown in FIG. 4 , embedding vector data clustered by sampling may be generated, and the data on the vector space clustered as described above is an embedding vector for function processing of the
도 5 및 도 6은 본 발명의 실시 예에 따른 분류 프로세스 및 결과 예시도이다.5 and 6 are diagrams illustrating a classification process and results according to an embodiment of the present invention.
도 5에 도시된 바와 같이, 문장 간 의미 관계 학습 모델에 따른 분류기(143)가 생성되면, 운영부(140)는 전술한 바와 같이, 단어-벡터 변환부(141)와, 문장-벡터 변환부(142)와, 분류기(143)에 기초한 대화 서비스를 제공할 수 있다.As shown in FIG. 5 , when the
특히, 본 발명의 실시 예에 따른 단어-벡터 변환부(141)와 문장-벡터 변환부(142) 및 분류기(143)는 각각 독립적으로 생성될 수 있는 바, 향후의 기술 발전 및 도메인 변경이 이루어지더라도 분류 모델을 변경하기 용이하게 구성될 수 있으며, 독립적으로 다른 프로세스와 연결될 수 있도록 처리할 수 있다. 따라서, 본 발명의 실시 예에 따른 분류 프로세스는 별도 서비스 프로세스들과도 용이하게 결합하여 구성될 수 있다.In particular, the word-
입력 데이터로 사용되는 샘플 데이터는 사용자가 챗봇 상에서 입력하는 데이터일 수 있으며, 실제 학습 되지 않아 기존 분류에 정의되어 있지 않은 문장일 수 있다. 통상적으로 도 6 상단에 개시된 바와 같이 기존 분류 방식의 경우, 문장 의도가 파악되지 못할 수 있다.The sample data used as input data may be data input by the user on the chatbot, or it may be a sentence that is not actually learned and is not defined in the existing classification. In general, as disclosed in the upper part of FIG. 6 , in the case of the existing classification method, the intention of the sentence may not be grasped.
이에 반해, 도 5를 참조하면, 학습 되지 않은 샘플 데이터가 입력되더라도, 운영부(140)는 어떠한 문장과 의미 관계를 가지는지 확인할 수 있는 바, 각 단어 및 문장에 대응하는 분류 결과는, 예측 값이 가장 높은 10번 레이블을 가지고 있는 문장과 벡터 공간 상 가장 가까움을 나타낼 수 있다.On the other hand, referring to FIG. 5 , even if unlearned sample data is input, the operation unit 140 can check which sentence and semantic relationship it has. As a result, the classification result corresponding to each word and sentence is the predicted value. It can represent the closestness to the sentence with the
이에 따라, 운영부(140)는 결과 출력부(144)를 통해, 예측 값이 가장 높은 10번 레이블을 가지고 있는 문장들을 출력하게 할 수 있는 바, 이는 도 6 하단에 도시된 바와 같이, 의미가 연관된 다양하고 풍부한 답변이 이루어질 수 있도록 한다.Accordingly, the operation unit 140 may output the sentences having the
도 7은 본 발명의 실시 예에 따른 서비스 제공 프로세스를 설명하기 위한 흐름도이다.7 is a flowchart illustrating a service providing process according to an embodiment of the present invention.
도 7을 참조하면, 본 발명의 실시 예에 따른 학습 장치(100)는 기존 룰(기존 규칙) 기반의 문장 학습 처리를 수행하되(S201), 입력부(110)를 통해 사용자 정의 문장이 입력되면(S203), 상기 룰 기반의 문장인지를 판단한다(S205).Referring to FIG. 7 , the
먼저, 룰 기반의 문장인 경우 학습 장치(100)는 룰 기반 응답 내용을 출력하도록 서비스 제공 장치(200)로 응답할 수 있다(S207).First, in the case of a rule-based sentence, the
그러나, 룰 기반 문장이 아닌 경우, 학습 장치(100)는 운영부(140)로 전달하여, 문장 의미 관계 추론을 통한 유사 문장이 추론되도록 처리할 수 있으며(S209), 추론된 유사 문장에 대응하는 응답 내용이 출력되도록 서비스 제공 장치(200)로 응답할 수 있다(S211).However, if it is not a rule-based sentence, the
이와 같이, 기존 룰 기반 챗봇 서비스는 작성된 시나리오에 따른 사용자 문의만 대응할 수 있도록 되어 있어, 저장 되지 않은 문장이 들어오는 경우 챗봇 서비스에서 알아 듣지 못하는 문제가 있으나,As such, the existing rule-based chatbot service can only respond to user inquiries according to the written scenario, so there is a problem that the chatbot service cannot understand when an unsaved sentence comes in.
본 발명의 실시 예에 따른 문장 의미 관계 분류가 가능한 학습 장치(100)를 이용하는 경우, 학습 또는 분류 저장 되지 않은 문장이 들어 오더라도 학습된 문장 의미 관계 분류기를 통해 어떠한 문장과 의미 관계가 유사한지 판단하여 해당 내용에 맞게 응답 할 수 있게 된다.In the case of using the
도 8 및 도 9는 본 발명의 실시 예에 따른 컨볼루션 뉴럴 네트워크 기반 샘플링 및 트리플렛 로스 함수 적용에 따른 결과 데이터를 도시한 도면이다.8 and 9 are diagrams illustrating result data according to convolutional neural network-based sampling and application of a triplet loss function according to an embodiment of the present invention.
먼저 도 8을 참조하면, 도 8은 컨볼루션 뉴럴 네트워크를 학습하기 위해 각 Anchor, Negative, Positive 데이터를 샘플링 하는 과정의 예시를 설명하기 위한 도면이다.First, referring to FIG. 8, FIG. 8 is a diagram for explaining an example of a process of sampling each anchor, negative, and positive data in order to learn a convolutional neural network.
먼저, 하기 수학식 1을 참고하면, 트리플렛 로스 함수 적용을 위한 컨볼루션 뉴럴 네트워크 변수는 아래와 같이 설정될 수 있다.First, referring to
여기서, C를 데이터에 존재하는 모든 클래스의 집합이라고 할 때, Positive 데이터 개수를 표현한P는 C에 포함된 임의의 클래스의 데이터 집합 사이즈를 나타낼 수 있다. 또한 Anchor 역시 P와 같은 클래스이므로 P와 같이 C가 가진 클래스 중 하나를 나타낼 수 있다. Negative 의 데이터 개수를 표현한 N은 C에 속한 클래스중 P와 다른 클래스이면서 P보다는 데이터 집합 수가 적은 클래스의 데이터 수를 나타낼 수 있다.Here, when C is a set of all classes existing in data, P representing the number of positive data may represent the data set size of any class included in C. Also, since Anchor is the same class as P, it can represent one of the classes of C like P. N, which expresses the number of negative data, can represent the number of data of a class different from P among the classes belonging to C, but with a smaller number of data sets than P.
그리고, 본 발명의 실시 예에 따른 트리플렛 로스 함수는 Positive, Anchor 의 데이터 샘플의 수를 N만큼 즉, Negative 와 똑같이 맞춤으로써, 분류기를 구현하고자 하는 것이다.And, the triplet loss function according to an embodiment of the present invention is to implement a classifier by adjusting the number of positive and anchor data samples to N, that is, equal to the negative.
예를 들어, 도 8을 참조하면, 도면에서 class 는 같은 주제를 가지고 있는 문장들의 분류를 나타ㅐㄹ 수 있다. 각 S는 워드 임베딩의 벡터로 문장을 표현한 것이고 번호는 문장의 식별번호를 나타낸다. 도 8에 도시된 바와 같이 데이터에 총 3개의 클래스가 존재하고 class A 는 문장이 총 100개, class B 는 문장이 총 120개, class C 는 문장이 총 30개 있을 수 있다.For example, referring to FIG. 8 , in the drawing, class may indicate a classification of sentences having the same subject. Each S represents a sentence as a vector of word embeddings, and the number indicates the identification number of the sentence. As shown in FIG. 8 , a total of three classes exist in the data, class A may have a total of 100 sentences, class B may have a total of 120 sentences, and class C may have a total of 30 sentences.
여기서 특정 문장 분류에 대응하는 Positive 문장 집합이 class A 에 포함된 문장인 경우, Negative 문장 집합은 class A 가 아닌 나머지 클래스인 class B 또는 class C 중에 Class A 가 가진 데이터 수보다 더 적은 데이터를 가지고 있는 클래스인 Class C 의 문장을 포함할 수 있다.Here, if the positive sentence set corresponding to a specific sentence classification is a sentence included in class A, the negative sentence set is a sentence that has fewer data than the number of data in class A among other classes other than class A, class B or class C. It can contain statements of Class C, which is a class.
이에 따라, Negative, Positive 집합의 데이터 수에 차이가 존재하게 되며, Anchor 와의 거리가 계산될 수 있고, 정확한 분류를 위해, 거리에 따른 균형이 맞춰질 수 있다. 거리 계산을 위한 샘플 데이터의 수를 정하는 기준은 클래스 중 문장의 수가 가장 적은 클래스를 기준으로 할 수 있으며, 따라서 class C 의 데이터 개수인 30 이 샘플 데이터 수의 기준이 될 수 있다.Accordingly, a difference exists in the number of data in the negative and positive sets, the distance to the anchor can be calculated, and a balance according to the distance can be balanced for accurate classification. The criterion for determining the number of sample data for distance calculation can be based on the class with the smallest number of sentences among the classes, and therefore 30, the number of data of class C, can be the criterion for the number of sample data.
이에 따라, 의미 관계 분류부(143)는 상기 문장들의 관계를 학습하는 문장 임베딩을 위해, 상기 트리플렛 로스 함수를 샘플 데이터에 적용할 수 있으며 거리 계산 및 조절에 따라, 각 문장들의 의미 관계를 학습하여 추론하는 학습 모델이 생성되도록 처리 할 수 있다. 아래 수학식 2는 트리플렛 로스 함수 적용식을 나타낸다.Accordingly, the semantic
상기 수학식 2에서, f 는 임베딩 함수, a 는 achor, p 는 positive, n 은 negative 이다. 따라서 는 anchor 의 임베딩 값, 는 positive 의 임베딩 값, 는 negative 의 임베딩 값이라고 할 수 있다. In
그리고, 의미 관계 분류부(143)는, 유클리디안 거리를 이용해서 anchor 와 positive 의 거리, anchor 와 negative 거리의 차가 이 만족하도록 anchor 와 positive 사이의 거리는 작아지게 하고 negative 사이의 거리는 커지게 조절할 수 있다. 는 와 가 0 이 되지 않게 하기 위한 즉 두 개의 값이 너무 가깝지 않게 하는 margin 을 조절하는 하이퍼파라미터이다.And, the semantic
도 9는 트리플렛 로스 함수 적용을 위한 샘플링 과정 이후, CNN(Convolutional Neural Network) 및 트리플렛 로스 함수에 따라 일정 범위 내의 loss 를 조절하는 과정까지의 입력 데이터 및 결과 데이터의 사이즈 변화를 나타낸 것이다.9 shows changes in the size of input data and result data from the sampling process for applying the triplet loss function to the process of adjusting the loss within a certain range according to a convolutional neural network (CNN) and the triplet loss function.
이와 같이, 의미 관계 분류부(143)는 트리플렛 로스를 이용한 손실 함수를 이용하여 같은 클래스인 Anchor, Positive 의 데이터의 loss 는 작게 만들어서 거리를 더 가깝게 하고, 다른 클래스인 Anchor 와 Negative 사이의 loss 를 크게 만들도록 컨볼루션 신경망의 weight 를 조정할 수 있다. 이에 따라, 의미 관계 분류부(143)는 여러 클래스에 대한 문장 의미 관계가 학습된 벡터 모델 분류기를 생성할 수 있게 된다.In this way, the semantic
한편, 상술한 본 발명의 다양한 실시 예들에 따른 방법은 프로그램으로 구현되어 다양한 비일시적 판독 가능 매체(non-transitory computer readable medium)에 저장된 상태로 각 서버 또는 기기들에 제공될 수 있다. 이에 따라, 사용자 단말(100)은 서버 또는 기기에 접속하여, 상기 프로그램을 다운로드할 수 있다.Meanwhile, the above-described method according to various embodiments of the present invention may be implemented as a program and provided to each server or device while being stored in various non-transitory computer readable media. Accordingly, the
비일시적 판독 가능 매체란 레지스터, 캐쉬, 메모리 등과 같이 짧은 순간 동안 데이터를 저장하는 매체가 아니라 반영구적으로 데이터를 저장하며, 기기에 의해 판독(reading)이 가능한 매체를 의미한다. 구체적으로는, 상술한 다양한 어플리케이션 또는 프로그램들은 CD, DVD, 하드 디스크, 블루레이 디스크, USB, 메모리카드, ROM 등과 같은 비일시적 판독 가능 매체에 저장되어 제공될 수 있다.The non-transitory readable medium refers to a medium that stores data semi-permanently, rather than a medium that stores data for a short moment, such as a register, cache, memory, and the like, and can be read by a device. Specifically, the above-described various applications or programs may be provided by being stored in a non-transitory readable medium such as a CD, DVD, hard disk, Blu-ray disk, USB, memory card, ROM, and the like.
또한, 이상에서는 본 발명의 바람직한 실시예에 대하여 도시하고 설명하였지만, 본 발명은 상술한 특정의 실시예에 한정되지 아니하며, 청구범위에서 청구하는 본 발명의 요지를 벗어남이 없이 당해 발명이 속하는 기술분야에서 통상의 지식을 가진자에 의해 다양한 변형실시가 가능한 것은 물론이고, 이러한 변형실시들은 본 발명의 기술적 사상이나 전망으로부터 개별적으로 이해되어서는 안될 것이다.In addition, although preferred embodiments of the present invention have been illustrated and described above, the present invention is not limited to the specific embodiments described above, and the technical field to which the present invention belongs without departing from the gist of the present invention as claimed in the claims In addition, various modifications are possible by those of ordinary skill in the art, and these modifications should not be individually understood from the technical spirit or perspective of the present invention.
Claims (5)
사용자와의 음성 입력 및 출력에 의한 대화 서비스를 제공할 수 있는 사용자 단말과;
상기 사용자 단말을 통해 입력되는 입력 문장에 대한 문장 의미 관계 분류에 의거하고, 문장 간 의미 관계 모델을 이용한 데이터 처리기반 사용자 대화 서비스를 사용자 단말로 제공하는 서비스 제공장치와;
학습 데이터 베이스의 학습 문서를 기초하여 상기 입력 문장의 학습 모델 생성 프로세스를 수행하여 생성된 학습 모델 정보를 상기 학습 데이터 베이스에 저장하고, 상기 학습 문서에 기초하여 문장 간 의미 관계 분류 학습을 수행하고, 상기 의미 관계 분류 학습에 따라 문장 기반의 분류기를 생성하며, 상기 생성된 분류기에 기초하여 상기 서비스 제공장치를 통해 입력된 상기 입력 문장에 대해 문장 의미 관계 분류 처리를 수행하여 상기 서비스 제공장치로 출력하는 학습장치;를 포함하고,
상기 학습장치는,
학습 대상인 학습 문서 데이터를 입력받는 입력부;
상기 학습 문서의 단어들을 벡터 공간상에 맵핑하는 단어 벡터 변환 처리를 수행하는 단어-벡터 변환부;
상기 단어 벡터를 이용하여, 상기 학습 문서의 문장들에 대응하는 문장 벡터 변환 처리를 수행하는 문장-벡터 변환부; 및
상기 문장 벡터간 관계 정도에 따라, 문장 간 의미 관계 분류 학습을 수행하고, 상기 의미 관계 분류 학습에 따라 의미 관계가 학습된 문장 기반의 분류기를 생성하며, 상기 생성된 분류기에 기초한 상기 입력 문장의 의도 분류 처리를 수행하는 의미 관계 분류부를 포함하고,
상기 의미 관계 분류부는,
상기 문장 벡터들에 대응한 주제 분류에 따라, 각 분류 클래스별 앵커, 긍정 및 부정 데이터를 샘플링하고, 각 샘플링 데이터간 유클리디안 거리 값이 일정 범위 이내가 될 때까지 샘플링 데이터간 손실(loss) 값을 가변하기 위하여 문장 벡터 학습 모델에 대응한 신경망 가중치 값을 조절하고,
상기 샘플링 데이터간 유클리디안 거리 값이 일정 범위 이내인 경우, 현재 조절된 가중치 값에 따른 문장 벡터 학습 모델을 문장 간 의미 관계 학습 모델로 출력하고,
상기 입력 문장이 사전 설정된 분류 기준에 포함되어 있는 경우, 상기 분류 기준에 대응하는 분류 처리를 수행하고, 상기 입력 문장이 사전 설정된 분류 기준에 포함되어 있지 않은 경우, 상기 문장 간 의미 관계 학습 모델을 이용한 문장 의도 분류기에 기초하여, 상기 입력 문장과 유사 의도를 갖는 유사 문장을 색인하고,
상기 의미 관계 분류부는,
상기 문장 벡터들에 대응한 주제 분류에 따른 복수의 분류 클래스들 중에서 상기 앵커 데이터 및 상기 긍정 데이터가 속하는 제1 클래스를 제외한 나머지 클래스들 중 제2 클래스를 결정하고,
상기 제2 클래스는 상기 제1 클래스를 제외한 나머지 클래스들 중에서 샘플링 데이터의 개수가 가장 적은 클래스로 선택되며,
손실 계산을 위한 샘플링 데이터의 개수는 상기 제1 클래스 및 상기 제2 클래스가 동일하게 되도록 상기 제1 클래스 및 상기 제2 클래스 중 샘플링 데이터의 개수가 더 적은 클래스를 기준으로 설정되는
대화 서비스 시스템.In the conversation service system,
a user terminal capable of providing a conversation service by voice input and output with a user;
a service providing apparatus for providing a data processing-based user conversation service using a semantic relation model between sentences to a user terminal based on sentence semantic relation classification for input sentences input through the user terminal;
Based on the learning document of the learning database, the learning model information generated by performing the learning model generation process of the input sentence is stored in the learning database, and semantic relation classification learning between sentences is performed based on the learning document, generating a sentence-based classifier according to the semantic relation classification learning, performing sentence semantic relation classification processing on the input sentence input through the service providing device based on the generated classifier, and outputting it to the service providing device learning device; including,
The learning device,
an input unit for receiving learning document data as a learning target;
a word-vector conversion unit that performs word-vector conversion for mapping the words of the learning document onto a vector space;
a sentence-vector converting unit that performs sentence vector conversion processing corresponding to the sentences of the learning document by using the word vector; and
According to the degree of the relationship between the sentence vectors, a semantic relationship classification learning between sentences is performed, a sentence-based classifier in which the semantic relationship is learned according to the semantic relationship classification learning is generated, and the intent of the input sentence based on the generated classifier. A semantic relation classification unit that performs classification processing,
The semantic relation classification unit,
According to the subject classification corresponding to the sentence vectors, the anchor, positive and negative data for each classification class are sampled, and the loss between the sampling data until the value of the Euclidean distance between each sampling data is within a certain range. Adjust the neural network weight value corresponding to the sentence vector learning model to vary the value,
When the value of the Euclidean distance between the sampling data is within a certain range, the sentence vector learning model according to the currently adjusted weight value is output as a semantic relationship learning model between sentences,
When the input sentence is included in the preset classification criterion, a classification process corresponding to the classification criterion is performed, and when the input sentence is not included in the preset classification criterion, a semantic relationship learning model between sentences is used. Based on the sentence intent classifier, index similar sentences having similar intent to the input sentence,
The semantic relation classification unit,
determining a second class from among the remaining classes except for the first class to which the anchor data and the positive data belong from among a plurality of classification classes according to the subject classification corresponding to the sentence vectors;
The second class is selected as a class having the smallest number of sampling data among the remaining classes except for the first class,
The number of sampling data for loss calculation is set based on a class having a smaller number of sampling data among the first class and the second class so that the first class and the second class are the same
Conversation service system.
상기 학습장치는,
상기 입력부를 통해 입력된 상기 학습 데이터 베이스의 학습 문서를 기초하여 상기 입력 문장의 학습 모델 생성 프로세스를 수행하여 생성된 학습 모델 정보를 상기 학습 데이터 베이스에 저장하는 학습부와;
상기 학습문서를 입력받아 문장간 의미 관계 분류 학습을 수행하고, 의미 관계가 학습된 문장 기반의 분류기를 생성하며, 상기 생성된 분류기에 기초한 상기 입력 문장의 의도 분류 처리를 수행하여 분류 처리 결과를 출력하는 운영부;를 포함하는
대화 서비스 시스템.The method according to claim 1,
The learning device,
a learning unit configured to store learning model information generated by performing a learning model generation process of the input sentence based on the learning document of the learning database input through the input unit in the learning database;
Receive the learning document, perform semantic relation classification learning between sentences, generate a sentence-based classifier in which semantic relation is learned, and perform intention classification processing of the input sentence based on the generated classifier to output a classification processing result operating department that includes;
Conversation service system.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
KR1020190015863A KR102375874B1 (en) | 2019-02-12 | 2019-02-12 | A chat service system based on semantic relationships inferred sentence using artificial intelligence technology |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
KR1020190015863A KR102375874B1 (en) | 2019-02-12 | 2019-02-12 | A chat service system based on semantic relationships inferred sentence using artificial intelligence technology |
Publications (2)
Publication Number | Publication Date |
---|---|
KR20200103153A KR20200103153A (en) | 2020-09-02 |
KR102375874B1 true KR102375874B1 (en) | 2022-03-18 |
Family
ID=72449852
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
KR1020190015863A KR102375874B1 (en) | 2019-02-12 | 2019-02-12 | A chat service system based on semantic relationships inferred sentence using artificial intelligence technology |
Country Status (1)
Country | Link |
---|---|
KR (1) | KR102375874B1 (en) |
Families Citing this family (1)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
KR102445841B1 (en) * | 2020-10-16 | 2022-09-22 | 성균관대학교산학협력단 | Medical Chatbot System Using Multiple Search Methods |
Family Cites Families (2)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
US7496500B2 (en) | 2004-03-01 | 2009-02-24 | Microsoft Corporation | Systems and methods that determine intent of data and respond to the data based on the intent |
KR101100830B1 (en) * | 2009-10-27 | 2012-01-02 | 주식회사 버즈니 | Entity searching and opinion mining system of hybrid-based using internet and method thereof |
-
2019
- 2019-02-12 KR KR1020190015863A patent/KR102375874B1/en active IP Right Grant
Non-Patent Citations (1)
Title |
---|
Jinfeng Rao et al., "Noise-Contrasive Estimation for Answer Selection with Deep Neural Networks," Proceedings of the 25th ACM International on Conference on Information and Knowledge Management (2016.10.28.)* |
Also Published As
Publication number | Publication date |
---|---|
KR20200103153A (en) | 2020-09-02 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
CN109582793B (en) | Model training method, customer service system, data labeling system and readable storage medium | |
KR102375873B1 (en) | A device for learning the semantic relationship of a sentence using an artificial neural network | |
KR20200103165A (en) | A program of classificating semantic relations between sentences for providing conversation services | |
US11928985B2 (en) | Content pre-personalization using biometric data | |
KR102225858B1 (en) | An apparatus of learning semantic relations between sentences for providing conversation services | |
KR20210043894A (en) | Electronic apparatus and method of providing sentence thereof | |
KR20200103156A (en) | A program of learning semantic relations between sentences for providing conversation services | |
KR102375874B1 (en) | A chat service system based on semantic relationships inferred sentence using artificial intelligence technology | |
KR102375876B1 (en) | A method for learning the semantic relationship of sentences using artificial intelligence technology | |
KR102376570B1 (en) | A device for classifying the semantic relationship of sentences using artificial intelligence technology | |
CN114756677A (en) | Sample generation method, training method of text classification model and text classification method | |
KR20200098394A (en) | An apparatus and a method of learning semantic relations between sentences for providing conversation services | |
KR102375875B1 (en) | A method of operating an apparatus for learning the semantic relationship of a sentence using a model generated by adjusting the neural network weight value | |
KR102402744B1 (en) | A chat service method based on semantic relationships inferred sentence | |
KR20200103157A (en) | Recording midium | |
KR20200103159A (en) | A program of learning semantic relations between sentences for providing conversation services | |
KR102376577B1 (en) | A method of classificating semantic relations between sentences for providing conversation services using deep learning technology | |
KR20200103160A (en) | Recording midium | |
KR20200103163A (en) | A recording midium of chat service program based on semantic relationships inferred sentence | |
KR20200103166A (en) | Recording midium | |
KR20200103162A (en) | A chat service program based on semantic relationships inferred sentence | |
KR102410239B1 (en) | A recording medium recording a document learning program using a variable classifier | |
KR102410237B1 (en) | A method for providing an efficient learning process using a variable classifier | |
KR102375877B1 (en) | A device for efficiently learning documents based on big data and deep learning technology | |
CN113095083A (en) | Entity extraction method and device |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
E902 | Notification of reason for refusal | ||
E902 | Notification of reason for refusal | ||
E701 | Decision to grant or registration of patent right | ||
GRNT | Written decision to grant |