KR102464121B1 - Apparatus for providing query answering based on relation between query and response and method there of - Google Patents

Apparatus for providing query answering based on relation between query and response and method there of Download PDF

Info

Publication number
KR102464121B1
KR102464121B1 KR1020200159325A KR20200159325A KR102464121B1 KR 102464121 B1 KR102464121 B1 KR 102464121B1 KR 1020200159325 A KR1020200159325 A KR 1020200159325A KR 20200159325 A KR20200159325 A KR 20200159325A KR 102464121 B1 KR102464121 B1 KR 102464121B1
Authority
KR
South Korea
Prior art keywords
query
token
user
expression vector
answer
Prior art date
Application number
KR1020200159325A
Other languages
Korean (ko)
Other versions
KR20220071791A (en
Inventor
박성배
김소언
박형준
박규민
윤수환
이준범
임연수
김아영
나지라 카이발리나
권성구
Original Assignee
경희대학교 산학협력단
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by 경희대학교 산학협력단 filed Critical 경희대학교 산학협력단
Priority to KR1020200159325A priority Critical patent/KR102464121B1/en
Publication of KR20220071791A publication Critical patent/KR20220071791A/en
Application granted granted Critical
Publication of KR102464121B1 publication Critical patent/KR102464121B1/en

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/30Information retrieval; Database structures therefor; File system structures therefor of unstructured textual data
    • G06F16/33Querying
    • G06F16/332Query formulation
    • G06F16/3329Natural language query formulation or dialogue systems
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/30Information retrieval; Database structures therefor; File system structures therefor of unstructured textual data
    • G06F16/33Querying
    • G06F16/3331Query processing
    • G06F16/334Query execution
    • G06F16/3347Query execution using vector based model
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F40/00Handling natural language data
    • G06F40/20Natural language analysis
    • G06F40/279Recognition of textual entities
    • G06F40/284Lexical analysis, e.g. tokenisation or collocates
    • G06N3/0454
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06NCOMPUTING ARRANGEMENTS BASED ON SPECIFIC COMPUTATIONAL MODELS
    • G06N3/00Computing arrangements based on biological models
    • G06N3/02Neural networks
    • G06N3/04Architecture, e.g. interconnection topology
    • G06N3/045Combinations of networks
    • G06N3/0455Auto-encoder networks; Encoder-decoder networks
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06NCOMPUTING ARRANGEMENTS BASED ON SPECIFIC COMPUTATIONAL MODELS
    • G06N3/00Computing arrangements based on biological models
    • G06N3/02Neural networks
    • G06N3/08Learning methods
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06NCOMPUTING ARRANGEMENTS BASED ON SPECIFIC COMPUTATIONAL MODELS
    • G06N3/00Computing arrangements based on biological models
    • G06N3/02Neural networks
    • G06N3/08Learning methods
    • G06N3/096Transfer learning

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • Computational Linguistics (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Artificial Intelligence (AREA)
  • Mathematical Physics (AREA)
  • Data Mining & Analysis (AREA)
  • General Health & Medical Sciences (AREA)
  • Health & Medical Sciences (AREA)
  • Databases & Information Systems (AREA)
  • Life Sciences & Earth Sciences (AREA)
  • Biomedical Technology (AREA)
  • Biophysics (AREA)
  • Evolutionary Computation (AREA)
  • Molecular Biology (AREA)
  • Computing Systems (AREA)
  • Software Systems (AREA)
  • Human Computer Interaction (AREA)
  • Audiology, Speech & Language Pathology (AREA)
  • Information Retrieval, Db Structures And Fs Structures Therefor (AREA)

Abstract

본 개시는 사용자 질의에 대한 답변을 제공하는 방법 및 이를 수행하는 전자 장치에 관한 것이다. 일 실시 예에 의하면, 전자 장치가 사용자 질의에 대한 답변을 제공하는 방법은 상기 사용자로부터 질의를 획득하는 단계; 상기 질의가 입력되면, 상기 질의의 토큰 별 중요도를 결정하고, 상기 결정된 상기 질의의 토큰 별 중요도에 기초하여, 상기 질의 및 상기 질의에 대한 전체 답변의 유사도를 출력하는 제1 신경망 모델로부터 상기 질의의 토큰 별 중요도를 획득하는 단계; 및 상기 질의 및 상기 획득된 질의의 토큰 별 중요도가 입력되면 상기 질의에 대한 답변을 출력하는 제2 신경망 모델에 상기 질의 및 상기 획득된 질의의 토큰 별 중요도를 입력함으로써, 상기 질의에 대한 응답을 생성하는 단계; 를 포함할 수 있다.The present disclosure relates to a method of providing an answer to a user's query and an electronic device for performing the same. According to an embodiment, a method for an electronic device to provide an answer to a user's query includes: acquiring a query from the user; When the query is input, the first neural network model determines the importance of each token of the query, and outputs the similarity of the query and all answers to the query based on the determined importance of each token of the query. acquiring importance for each token; and by inputting the importance of each token of the query and the obtained query to a second neural network model that outputs an answer to the query when the importance of each token of the query and the obtained query is input, the response to the query is generated to do; may include.

Figure R1020200159325
Figure R1020200159325

Description

응답과 질의 토큰의 관계에 기초하여 상기 질의에 대한 답변을 제공하는 방법 및 전자 장치 {APPARATUS FOR PROVIDING QUERY ANSWERING BASED ON RELATION BETWEEN QUERY AND RESPONSE AND METHOD THERE OF}{APPARATUS FOR PROVIDING QUERY ANSWERING BASED ON RELATION BETWEEN QUERY AND RESPONSE AND METHOD THERE OF}

본 개시는 질의에 대한 답변을 제공하는 방법 및 장치에 관한 것이다. 보다 상세하게는 신경망 기반의 모델을 이용하여 질의에 대한 답변을 제공하는 방법 및 장치에 관한 것이다.The present disclosure relates to a method and apparatus for providing an answer to a query. More particularly, it relates to a method and apparatus for providing an answer to a query using a neural network-based model.

인터넷 상에 존재하는 데이터의 양이 기하급수적으로 증가함에 따라 오늘날 사용자가 원하는 정보를 제공하기 위한 데이터 처리 기술 개발이 활발하게 연구되고 있다. 이에 따라 사용자의 질의와 관련된 응답을 제공하는 기술 역시 활발하게 진행되고 있다.As the amount of data existing on the Internet increases exponentially, the development of data processing technology to provide information desired by users is being actively studied today. Accordingly, a technology for providing a response related to a user's query is also being actively developed.

최근 시퀀스 투 시퀀스(sequence to sequence) 모델을 이용하여 질의에 대한 응답을 제공하기 위한 기술들이 연구되고 있다. 시퀀스 투 시퀀스 모델을 이용한 답변 생성기는 어느 질의에도 답변이 될 수 있는 일반적인 답변의 생성 확률이 높은 한계가 있다. 종래의 시퀀스 투 시퀀스 모델은 토큰 단위로 디코딩 시 질의에 대한 답변 전체 내용에 대한 정보가 반영되지 않는 한계가 있기 때문이다.Recently, techniques for providing an answer to a query using a sequence-to-sequence model are being studied. The answer generator using the sequence-to-sequence model has a high limitation in generating a general answer that can be answered to any query. This is because the conventional sequence-to-sequence model has a limitation in that information on the entire contents of answers to queries is not reflected when decoding in token units.

따라서, 답변 전체에 대한 내용에 대한 정보를 반영하여 질의에 대한 답변을 효과적으로 제공하기 위한 기술개발이 요구되고 있다.Therefore, technology development is required to effectively provide answers to questions by reflecting information on the contents of the entire answer.

한국공개특허 제2020-0023620호Korean Patent Publication No. 2020-0023620

일 실시 예에 의하면, 질의에 대한 답변을 제공하는 방법 및 이를 수행하는 전자 장치가 제공될 수 있다.According to an embodiment, a method for providing an answer to a query and an electronic device for performing the same may be provided.

보다 상세하게는 질의의 토큰 별 중요도에 기초하여, 질의에 대한 답변을 제공하는 방법 및 이를 수행하는 전자 장치가 제공될 수 있다.In more detail, a method of providing an answer to a query based on the importance of each token of the query and an electronic device for performing the same may be provided.

상술한 기술적 과제를 달성하기 위한 기술적 수단으로서, 일 실시 예에 의하면, 전자 장치가 사용자의 질의에 대한 답변을 제공하는 방법은 상기 사용자로부터 질의를 획득하는 단계; 상기 질의가 입력되면, 상기 질의의 토큰 별 중요도를 결정하고, 상기 결정된 상기 질의의 토큰 별 중요도에 기초하여, 상기 질의 및 상기 질의에 대한 전체 답변의 유사도를 출력하는 제1 신경망 모델로부터 상기 질의의 토큰 별 중요도를 획득하는 단계; 및 상기 질의 및 상기 획득된 질의의 토큰 별 중요도가 입력되면 상기 질의에 대한 답변을 출력하는 제2 신경망 모델에 상기 질의 및 상기 획득된 질의의 토큰 별 중요도를 입력함으로써, 상기 질의에 대한 응답을 생성하는 단계; 를 포함할 수 있다.As a technical means for achieving the above-described technical problem, according to an embodiment, a method for providing an answer to a user's query by an electronic device includes: acquiring a query from the user; When the query is input, the first neural network model determines the importance of each token of the query, and outputs the similarity of the query and all answers to the query based on the determined importance of each token of the query. acquiring importance for each token; and by inputting the importance of each token of the query and the obtained query to a second neural network model that outputs an answer to the query when the importance of each token of the query and the obtained query is input, the response to the query is generated to do; may include.

상술한 기술적 과제를 달성하기 위한 기술적 수단으로서 또 다른 실시 예에 의하면, 사용자의 질의에 대한 답변을 제공하는 전자 장치에 있어서, 네트워크 인터페이스; 하나 이상의 인스트럭션을 저장하는 메모리; 및 상기 하나 이상의 인스트럭션을 실행하는 적어도 하나의 프로세서; 를 포함하고, 상기 적어도 하나의 프로세서는 상기 사용자로부터 질의를 획득하고, 상기 질의가 입력되면, 상기 질의의 토큰 별 중요도를 결정하고, 상기 결정된 상기 질의의 토큰 별 중요도에 기초하여, 상기 질의 및 상기 질의에 대한 전체 답변의 유사도를 출력하는 제1 신경망 모델로부터 상기 질의의 토큰 별 중요도를 획득하고, 상기 질의 및 상기 획득된 질의의 토큰 별 중요도가 입력되면 상기 질의에 대한 답변을 출력하는 제2 신경망 모델에 상기 질의 및 상기 획득된 질의의 토큰 별 중요도를 입력함으로써, 상기 질의에 대한 응답을 생성하는, 전자 장치가 제공될 수 있다.According to another embodiment as a technical means for achieving the above-described technical problem, an electronic device for providing an answer to a user's query, comprising: a network interface; a memory storing one or more instructions; and at least one processor executing the one or more instructions. wherein the at least one processor obtains a query from the user, and when the query is input, determines the importance of each token of the query, and based on the determined importance of each token of the query, the query and the A second neural network that obtains the importance of each token of the query from a first neural network model that outputs the similarity of all answers to a query, and outputs an answer to the query when the importance of each token of the query and the obtained query is input An electronic device may be provided that generates a response to the query by inputting the query and the importance of each token of the obtained query to a model.

상술한 기술적 과제를 달성하기 위한 기술적 수단으로서 또 다른 실시 예에 의하면, 전자 장치가 사용자의 질의에 대한 답변을 제공하는 방법에 있어서, 상기 사용자로부터 질의를 획득하는 단계; 상기 질의가 입력되면, 상기 질의의 토큰 별 중요도를 결정하고, 상기 결정된 상기 질의의 토큰 별 중요도에 기초하여, 상기 질의 및 상기 질의에 대한 전체 답변의 유사도를 출력하는 제1 신경망 모델로부터 상기 질의의 토큰 별 중요도를 획득하는 단계; 및 상기 질의 및 상기 획득된 질의의 토큰 별 중요도가 입력되면 상기 질의에 대한 답변을 출력하는 제2 신경망 모델에 상기 질의 및 상기 획득된 질의의 토큰 별 중요도를 입력함으로써, 상기 질의에 대한 응답을 생성하는 단계; 를 포함하는, 방법을 수행하도록 하는 프로그램이 저장된 컴퓨터로 읽을 수 있는 기록 매체가 제공될 수 있다.According to another embodiment as a technical means for achieving the above technical problem, there is provided a method for providing an answer to a user's query by an electronic device, the method comprising: acquiring a query from the user; When the query is input, the first neural network model determines the importance of each token of the query, and outputs the similarity of the query and all answers to the query based on the determined importance of each token of the query. acquiring importance for each token; and by inputting the importance of each token of the query and the obtained query to a second neural network model that outputs an answer to the query when the importance of each token of the query and the obtained query is input, the response to the query is generated to do; A computer-readable recording medium in which a program for performing the method is stored, including a computer-readable recording medium may be provided.

일 실시 예에 의하면 질의에 대한 답변을 효과적으로 제공할 수 있다.According to an embodiment, it is possible to effectively provide an answer to a query.

일 실시 예에 의하면 질의에 대한 답변 전체 내용에 대한 정보를 반영하는, 질의에 대한 답변을 제공하는 방법이 제공될 수 있다.According to an embodiment, there may be provided a method of providing an answer to a query that reflects information on the entire content of the answer to the query.

도 1은 일 실시 예에 따라 전자 장치가 사용자 질의에 대한 답변을 제공하는 과정을 개략적으로 설명하기 위한 도면이다.
도 2는 일 실시 예에 따른 전자 장치가 사용자의 질의에 대한 답변을 제공하는 방법의 흐름도이다.
도 3은 또 다른 실시 예에 따라 전자 장치가 복수의 신경망 모델을 이용하여 사용자 질의에 대한 답변을 제공하는 과정을 설명하기 위한 도면이다.
도 4는 일 실시 예에 따른 전자 장치의 블록도이다.
1 is a diagram schematically illustrating a process in which an electronic device provides an answer to a user's query, according to an exemplary embodiment.
2 is a flowchart of a method for providing an answer to a user's query by an electronic device according to an exemplary embodiment.
3 is a diagram for describing a process in which an electronic device provides an answer to a user's query by using a plurality of neural network models, according to another embodiment.
4 is a block diagram of an electronic device according to an embodiment.

본 명세서에서 사용되는 용어에 대해 간략히 설명하고, 본 개시에 대해 구체적으로 설명하기로 한다.Terms used in this specification will be briefly described, and the present disclosure will be described in detail.

본 개시에서 사용되는 용어는 본 개시에서의 기능을 고려하면서 가능한 현재 널리 사용되는 일반적인 용어들을 선택하였으나, 이는 당 분야에 종사하는 기술자의 의도 또는 판례, 새로운 기술의 출현 등에 따라 달라질 수 있다. 또한, 특정한 경우는 출원인이 임의로 선정한 용어도 있으며, 이 경우 해당되는 발명의 설명 부분에서 상세히 그 의미를 기재할 것이다. 따라서 본 개시에서 사용되는 용어는 단순한 용어의 명칭이 아닌, 그 용어가 가지는 의미와 본 개시의 전반에 걸친 내용을 토대로 정의되어야 한다.The terms used in the present disclosure have been selected as currently widely used general terms as possible while considering the functions in the present disclosure, but these may vary depending on the intention or precedent of a person skilled in the art, the emergence of new technology, and the like. In addition, in a specific case, there is a term arbitrarily selected by the applicant, and in this case, the meaning will be described in detail in the description of the corresponding invention. Therefore, the terms used in the present disclosure should be defined based on the meaning of the term and the contents of the present disclosure, rather than the simple name of the term.

명세서 전체에서 어떤 부분이 어떤 구성요소를 "포함"한다고 할 때, 이는 특별히 반대되는 기재가 없는 한 다른 구성요소를 제외하는 것이 아니라 다른 구성요소를 더 포함할 수 있음을 의미한다. 또한, 명세서에 기재된 "...부", "모듈" 등의 용어는 적어도 하나의 기능이나 동작을 처리하는 단위를 의미하며, 이는 하드웨어 또는 소프트웨어로 구현되거나 하드웨어와 소프트웨어의 결합으로 구현될 수 있다.In the entire specification, when a part "includes" a certain component, it means that other components may be further included, rather than excluding other components, unless otherwise stated. In addition, terms such as "...unit" and "module" described in the specification mean a unit that processes at least one function or operation, which may be implemented as hardware or software, or a combination of hardware and software. .

아래에서는 첨부한 도면을 참고하여 본 개시의 실시 예에 대하여 본 개시가 속하는 기술 분야에서 통상의 지식을 가진 자가 용이하게 실시할 수 있도록 상세히 설명한다. 그러나 본 개시는 여러 가지 상이한 형태로 구현될 수 있으며 여기에서 설명하는 실시 예에 한정되지 않는다. 그리고 도면에서 본 개시를 명확하게 설명하기 위해서 설명과 관계없는 부분은 생략하였으며, 명세서 전체를 통하여 유사한 부분에 대해서는 유사한 도면 부호를 붙였다.Hereinafter, with reference to the accompanying drawings, embodiments of the present disclosure will be described in detail so that those of ordinary skill in the art to which the present disclosure pertains can easily implement them. However, the present disclosure may be implemented in several different forms and is not limited to the embodiments described herein. And in order to clearly explain the present disclosure in the drawings, parts irrelevant to the description are omitted, and similar reference numerals are attached to similar parts throughout the specification.

도 1은 일 실시 예에 따라 전자 장치가 사용자 질의에 대한 답변을 제공하는 과정을 개략적으로 설명하기 위한 도면이다.1 is a diagram schematically illustrating a process in which an electronic device provides an answer to a user's query, according to an exemplary embodiment.

일 실시 예에 의하면, 전자 장치(1000)는 질의(102)를 획득하고, 획득된 질의(102)에 대한 응답으로써 답변(104)을 제공할 수 있다. 일 실시 예에 의하면, 전자 장치(1000)는 질의에 대한 답변을 생성하기 위해 서버(2000) 또는 다른 전자 장치(1002)와 연동함으로써 질의에 대한 답변(104)으 제공할 수도 있다. 일 실시 예에 의하면, 전자 장치(1000)는 적어도 하나의 신경망 모델을 이용하여 질의(102)에 대한 답변(104)을 제공할 수 있다. 일 실시 예에 의하면 전자 장치(1000)는 전자 장치(1002)로부터 제1 신경망 모델의 출력 값 중 일부를 획득하고, 획득된 제1 신경망 모델의 출력 값을 이용하여 질의(102)에 대한 답변(104)을 제공할 수 있다. According to an embodiment, the electronic device 1000 may obtain the query 102 and provide the answer 104 as a response to the obtained query 102 . According to an embodiment, the electronic device 1000 may provide an answer to the query 104 by interworking with the server 2000 or another electronic device 1002 to generate an answer to the query. According to an embodiment, the electronic device 1000 may provide an answer 104 to the query 102 using at least one neural network model. According to an embodiment, the electronic device 1000 obtains some of the output values of the first neural network model from the electronic device 1002, and uses the obtained output values of the first neural network model to answer ( 104) can be provided.

그러나 또 다른 실시 예에 의하면, 전자 장치(1000)는 전자 장치(1002)로부터 제1 신경망 모델(162) 또는 제1 신경망 모델(162)의 출력 값 중 일부를 획득하고, 획득된 제1 신경망 모델(162) 또는 제1 신경망 모델(162)의 출력 값 및 제2 신경망 모델(134)을 이용하여 질의(102)에 대한 답변(104)을 제공할 수도 있다. 또 다른 실시 예에 의하면, 전자 장치(1000)는 서버(2000)로부터 제1 신경망 모델(162) 또는 제1 신경망 모델(162)의 출력 값 중 적어도 하나를 획득하고, 서버(2000)로부터 획득된 제1 신경망 모델에 대한 정보를 이용하여 질의(102)에 대한 답변(104)을 제공할 수도 있다.However, according to another embodiment, the electronic device 1000 obtains the first neural network model 162 or some of the output values of the first neural network model 162 from the electronic device 1002, and the obtained first neural network model 162 or the output value of the first neural network model 162 and the second neural network model 134 may be used to provide an answer 104 to the query 102 . According to another embodiment, the electronic device 1000 obtains at least one of the first neural network model 162 or the output value of the first neural network model 162 from the server 2000, and obtains the The answer 104 to the query 102 may be provided by using the information on the first neural network model.

일 실시 예에 의하면, 전자 장치(1000)가 이용하는 신경망 모델은 시퀀스 투 시퀀스 모델 구조의 신경망 모델일 수 있다. 일 실시 예에 의하면, 전자 장치(1000)가 이용하는 신경망 모델은 심층 신경망(DNN:Deep Neural Network)을 포함할 수도 있다. 예를 들어, 전자 장치(1000)가 질의에 대한 답변을 제공하기 위해 이용하는 신경망 모델은 CNN (Convolutional Neural Network), DNN (Deep Neural Network), RNN (Recurrent Neural Network), RBM (Restricted Boltzmann Machine), DBN (Deep Belief Network), BRDNN(Bidirectional Recurrent Deep Neural Network) 또는 심층 Q-네트워크 (Deep Q-Networks) 등이 있으나, 역시 이에 한정되는 것은 아니다.According to an embodiment, the neural network model used by the electronic device 1000 may be a neural network model having a sequence-to-sequence model structure. According to an embodiment, the neural network model used by the electronic device 1000 may include a deep neural network (DNN). For example, a neural network model used by the electronic device 1000 to provide an answer to a query may include a Convolutional Neural Network (CNN), a Deep Neural Network (DNN), a Recurrent Neural Network (RNN), a Restricted Boltzmann Machine (RBM), DBN (Deep Belief Network), BRDNN (Bidirectional Recurrent Deep Neural Network), or deep Q-networks, etc., but are also not limited thereto.

일반적으로 종래의 시퀀스 투 시퀀스 모델은, 어느 질의에도 답변이 될 수 있는 일반적인 답변(복수의 질의에 대한 공통 답변이 될 수 있는 응답)을 제공하는 한계가 있다. 이는 일반적인 답변 생성기의 경우, 디코딩 시 토큰 단위 답변 토큰 생성을 통하여, 매 순간 마다 정답 답변 전체 내용에 대한 정보가 반영되지 않기 때문인데, 따라서, 질의에 대한 답변 토큰 생성 시, 매 순간마다 정답 답변 전체에 대한 내용 반영을 통하여 질의에 대한 답변을 효과적으로 생성하기 위한 기술 개발이 요구되고 있다.In general, the conventional sequence-to-sequence model has a limitation in providing a general answer that can be answered to any question (answer that can be a common answer to a plurality of questions). This is because, in the case of a general answer generator, information about the entire correct answer is not reflected at every moment through token unit answer token generation during decoding. Technology development is required to effectively generate answers to questions by reflecting the contents of

본 개시에 따른 전자 장치(1000)는 전자 장치(1002)로부터 질의(102)에 대한 토큰 별 중요도를 획득하고, 획득된 질의의 토큰 별 중요도 값을 이용하여 질의에 대한 답변을 제공함으로써, 질의에 대한 답변(104)을 효과적으로 제공할 수 있다. 예를 들어, 전자 장치(1002)는 네트워크 인터페이스(140), 프로세서(150) 및 메모리(160)를 포함할 수 있다. 전자 장치(1002)내 프로세서(150)는 메모리(160)내 하나 이상의 인스트럭션을 수행함으로써, 질의(102)와 예상 답변 사이의 관계를 추출할 수 있다. The electronic device 1000 according to the present disclosure obtains the importance of each token for the query 102 from the electronic device 1002 and provides an answer to the query by using the obtained importance value for each token of the query, thereby responding to the query. An answer 104 can be effectively provided. For example, the electronic device 1002 may include a network interface 140 , a processor 150 , and a memory 160 . The processor 150 in the electronic device 1002 may extract a relationship between the query 102 and the expected answer by executing one or more instructions in the memory 160 .

보다 상세하게는, 프로세서(150)는 메모리(160)에 저장된 제1 신경망 모델(162)을 이용하여 질의 토큰 별 중요도를 결정할 수 있다. 일 실시 예에 의하면, 제1 신경망 모델은 질의 토큰 별 중요도에 기초하여 질의 및 상기 질의에 대한 전체 답변의 유사도를 출력하도록 학습된 신경망 모델일 수 있다. 전자 장치(1002)는 소정의 대화쌍 데이터를 포함하는 데이터 베이스를 이용하여 제1 신경망 모델을 미리 학습시킬 수 있다. 전자 장치(1000)는 학습된 제1 신경망 모델에 질의가 입력됨에 따라, 상기 제1 신경망 모델로부터 질의의 토큰 별 중요도를 획득할 수 있다. 전자 장치(1002) 내 프로세서(150)는 제1 신경망 모델로부터 결정된 질의의 토큰 별 중요도에 대한 정보를, 네트워크 인터페이스(140)를 통하여 전자 장치(1000)로 전송할 수 있다.In more detail, the processor 150 may determine the importance of each query token by using the first neural network model 162 stored in the memory 160 . According to an embodiment, the first neural network model may be a neural network model trained to output a similarity of a query and all answers to the query based on the importance of each query token. The electronic device 1002 may train the first neural network model in advance by using a database including predetermined conversation pair data. As a query is input to the learned first neural network model, the electronic device 1000 may acquire the importance of each token of the query from the first neural network model. The processor 150 in the electronic device 1002 may transmit information on the importance of each token of the query determined from the first neural network model to the electronic device 1000 through the network interface 140 .

또 다른 실시 예에 의하면, 전자 장치(1002)는 제1 신경망 모델(162)에 대한 정보 전체를 전자 장치(1000)로 전송할 수도 있다. 이 경우, 전자 장치(1000)는 질의(102)를 획득하고, 획득된 질의(102)를 제1 신경망 모델(162)에 입력하며, 제1 신경망 모델(162)로부터 질의의 토큰 별 중요도 값을 획득하고, 획득된 질의의 토큰 별 중요도 값을 이용하여 질의에 대한 답변을 효과적으로 제공할 수 있다.According to another embodiment, the electronic device 1002 may transmit all information on the first neural network model 162 to the electronic device 1000 . In this case, the electronic device 1000 obtains the query 102 , inputs the obtained query 102 to the first neural network model 162 , and obtains the importance value for each token of the query from the first neural network model 162 . It is possible to effectively provide an answer to a query by acquiring and using the importance value for each token of the acquired query.

일 실시 예에 의하면, 전자 장치(1000)는 전자 장치(1002)에 대응되는 구성을 포함할 수 있다. 예를 들어, 전자 장치(1000)는 네트워크 인터페이스(110), 프로세서(120) 및 메모리(130)를 포함할 수 있다. 프로세서(120)는 메모리(130)내 하나 이상의 인스트럭션을 수행함으로써, 질의에 대한 답변을 제공하기 위한 방법을 수행한다. 예를 들어, 프로세서(120)는 네트워크 인터페이스(110)를 제어함으로써, 전자 장치(1002)로부터 제1 신경망 모델(162)에 대한 정보 또는 제1 신경망 모델(162)로부터 질의의 토큰 별 중요도에 대한 정보를 획득할 수 있다. 프로세서(120)는 전자 장치(1002)로부터 획득되는 제1 신경망 모델(162) 또는 제1 신경망 모델(162)로부터 획득 가능한 질의의 토큰 별 중요도 값을 이용하여 질의에 대한 답변을 제공할 수 있다.According to an embodiment, the electronic device 1000 may include a configuration corresponding to the electronic device 1002 . For example, the electronic device 1000 may include a network interface 110 , a processor 120 , and a memory 130 . The processor 120 performs a method for providing an answer to a query by executing one or more instructions in the memory 130 . For example, by controlling the network interface 110 , the processor 120 provides information on the first neural network model 162 from the electronic device 1002 or the importance of each token of a query from the first neural network model 162 . information can be obtained. The processor 120 may provide an answer to the query using the first neural network model 162 obtained from the electronic device 1002 or the importance value for each query token obtainable from the first neural network model 162 .

보다 상세하게는, 전자 장치(1000)는 질의의 토큰 별 중요도에 대한 정보를 전자 장치(1000)로부터 획득하고, 질의(102) 및 질의의 토큰 별 중요도 값을 제2 신경망 모델(134)에 입력함으로써, 질의에 대한 답변(104)을 생성할 수 있다. 그러나 또 다른 실시 예에 의하면, 전자 장치(1000)는 전자 장치(1002)로부터 질의의 토큰 별 중요도 값을 획득하는 것이 아니고, 전자 장치(1000)가 학습 시킨 제1 신경망 모델에 대한 정보를 획득한 후, 전자 장치(1000)에 저장된 제1 신경망 모델을 이용하여, 질의에 대한 토큰 별 중요도 값을 직접 획득할 수도 있다. In more detail, the electronic device 1000 obtains information on the importance of each token of the query from the electronic device 1000 , and inputs the query 102 and the importance value of each token of the query into the second neural network model 134 . By doing so, it is possible to generate an answer 104 to the query. However, according to another embodiment, the electronic device 1000 does not acquire the importance value for each query token from the electronic device 1002 , but acquires information about the first neural network model learned by the electronic device 1000 . Thereafter, by using the first neural network model stored in the electronic device 1000 , the importance value for each token for the query may be directly obtained.

또 다른 실시 예에 의하면, 전자 장치(1000)는 제1 신경망 모델(162)의 구성 중 질의 토큰 중요도 결정부(132)에 대한 정보만을 획득함으로써, 제1 신경망 모델(162)의 일부 구성에 대한 모델만을 전자 장치(1000)에 저장해둘 수도 있다. 전자 장치(1000)는 메모리(130)에 미리 저장된 질의 토큰 중요도 결정부(132) 및 제2 신경망 모델(134)을 이용하여 질의에 대한 답변(104)을 효과적으로 제공할 수도 있다.According to another embodiment, the electronic device 1000 obtains only information on the query token importance determiner 132 among the configurations of the first neural network model 162 , thereby Only the model may be stored in the electronic device 1000 . The electronic device 1000 may effectively provide the answer 104 to the query using the query token importance determiner 132 and the second neural network model 134 previously stored in the memory 130 .

일 실시 예에 의하면, 전자 장치(1000)는 소정의 네트워크를 통하여 서버(2000)와 연결될 수 있다. 일 실시 예에 의하면, 전자 장치(1000)는 소정의 네트워크를 통하여 전자 장치(1002) 또는 서버(2000)와 연결됨으로써, 사용자 질의에 대한 답변을 제공하기 위해 필요한 신경망 모델, 질의 토큰 정보, 질의의 토큰 별 중요도 정보 등을 서로 송수신할 수도 있다.According to an embodiment, the electronic device 1000 may be connected to the server 2000 through a predetermined network. According to an embodiment, the electronic device 1000 is connected to the electronic device 1002 or the server 2000 through a predetermined network, thereby providing a neural network model, query token information, and query information necessary to provide an answer to a user query. It is also possible to transmit/receive importance information, etc. for each token.

즉, 전자 장치(1002)는 질의 토큰 및 전체 답변 과의 관계를 추출하도록, 제1 신경망 모델을 학습시키고, 제1 신경망 모델을 이용하여 질의 및 전체 답변 과의 관계(예컨대 질의 토큰 별 중요도)를 추출할 수 있다. 전자 장치(1002)는 질의 토큰 별 중요도 값을 전자 장치(1000)로 전송할 수도 있지만, 제1 신경망 모델 자체에 대한 정보 또는 제1 신경망 모델 내 질의 토큰 중요도 결정부와 같은 일부 모델에 대한 정보를 직접 전자 장치(1000)로 전송할 수도 있다. 전자 장치(1000)는 전자 장치(1002)로부터 획득된 질의 토큰 별 중요도 값 또는 전자 장치(1002)로부터 획득된 질의 토큰 중요도 결정부(134) 또는 제1 신경망 모델(162)을 직접 운용함으로써 스스로 결정한 질의 토큰 별 중요도 값을 이용하여 질의에 대한 답변을 제공할 수 있다.That is, the electronic device 1002 trains the first neural network model to extract the relationship between the query token and the entire answer, and uses the first neural network model to determine the relationship between the query and the overall answer (eg, the importance of each query token). can be extracted. Although the electronic device 1002 may transmit the importance value for each query token to the electronic device 1000, information on the first neural network model itself or information on some models such as the query token importance determiner in the first neural network model is directly transmitted. It may also be transmitted to the electronic device 1000 . The electronic device 1000 determines by itself by directly operating the importance value for each query token obtained from the electronic device 1002 or the query token importance determining unit 134 or the first neural network model 162 obtained from the electronic device 1002 . An answer to a query can be provided by using the importance value for each query token.

도 2는 일 실시 예에 따른 전자 장치가 사용자의 질의에 대한 답변을 제공하는 방법의 흐름도이다.2 is a flowchart of a method for providing an answer to a user's query by an electronic device according to an exemplary embodiment.

S210에서, 전자 장치(1000)는 사용자로부터 질의를 획득할 수 있다. 일 실시 예에 의하면, 전자 장치(1000)는 사용자 입력에 기초하여 텍스트 형태(예컨대 단어 또는 문장)로 질의를 획득할 수 있다. 그러나 또 다른 실시 예에 의하면, 전자 장치(1000)는 이미지 또는 오디오 형태로 질의를 획득할 수도 있음은 물론이다.In S210 , the electronic device 1000 may obtain a query from the user. According to an embodiment, the electronic device 1000 may acquire a query in a text form (eg, a word or a sentence) based on a user input. However, according to another embodiment, of course, the electronic device 1000 may acquire the query in the form of an image or audio.

S220에서, 전자 장치(1000)는 질의가 입력되면, 질의의 토큰 별 중요도를 결정하고, 상기 결정된 질의의 토큰 별 중요도에 기초하여 질의 및 상기 질의에 대한 전체 답변의 유사도를 출력하는 제1 신경망 모델로부터 질의 토큰 별 중요도를 획득할 수 있다. 예를 들어, 전자 장치(1000)는 제1 신경망 모델을 이용하여 질의의 토큰 별 중요도를 결정할 수 있다. 토큰은 질의에 대하여 문법적으로 더 이상으로 나눌 수 없는 언어 요소를 의미할 수 있다. 전자 장치(1000) 또는 전자 장치(1002)는 제1 신경망 모델을 이용하여 질의를 토큰화함으로써 질의 별 토큰을 획득할 수 있다.In S220 , when a query is input, the electronic device 1000 determines the importance of each token of the query, and outputs the similarity of the query and all answers to the query based on the determined importance of each token of the query. Importance of each query token can be obtained from For example, the electronic device 1000 may determine the importance of each token of the query by using the first neural network model. A token may mean a language element that cannot be further grammatically divided into a query. The electronic device 1000 or the electronic device 1002 may acquire a token for each query by tokenizing the query using the first neural network model.

일 실시 예에 의하면, 제1 신경망 모델은 소정의 질의 및 상기 질의에 대한 답변을 포함하는 대화쌍들이 저장된 데이터 베이스로부터, 상기 질의를 획득하고, 상기 질의를 인코딩함으로써 상기 질의에 대한 표현 벡터를 생성하는 질의 표현 벡터 인코더 및 상기 질의에 대한 답변을 획득하고, 상기 획득된 답변 전체를 인코딩함으로써 상기 답변 전체에 대한 표현 벡터를 생성하는 답변 전체 표현 벡터 인코더를 포함할 수 있다. 즉, 본 개시에 따른 제1 신경망 모델은 2이상의 인코더를 포함할 수 있다.According to an embodiment, the first neural network model obtains the query from a database in which conversation pairs including a predetermined query and an answer to the query are stored, and generates an expression vector for the query by encoding the query. and a full answer expression vector encoder for obtaining an answer to the query and encoding the entire obtained answer to generate an expression vector for the entire answer. That is, the first neural network model according to the present disclosure may include two or more encoders.

일 실시 예에 의하면, 제1 신경망 모델은 질의에 대한 표현 벡터인 질의 표현 벡터와 답변 전체에 대한 표현 벡터인 답변 전체 표현 벡터가 서로 유사해지도록 학습될 수 있다. 일 실시 예에 의하면, 질의 표현 벡터 및 답변 전체 표현 벡터가 유사하면(예컨대 유사도가 1에 가까우면) 질의 표현 벡터에 대응되는 질의 및 답변 전체 표현 벡터에 대응되는 답변은 언어적으로 의미 있는 질의 및 답변 쌍(예컨대 실제 사람들이 나누는 유의미한 실제 대화쌍)을 나타낼 수 있다. According to an embodiment, the first neural network model may be trained so that a query expression vector that is an expression vector for a query and an entire answer expression vector that is an expression vector for all answers are similar to each other. According to an embodiment, if the query expression vector and the full answer expression vector are similar (eg, the similarity is close to 1), the query and answer corresponding to the full answer expression vector corresponding to the query expression vector are linguistically meaningful query and It can represent answer pairs (eg, meaningful real conversation pairs that real people have).

그러나 질의 표현 벡터 및 답변 전체 표현 벡터가 유사하지 않을 경우, 질의 표현 벡터에 대응되는 질의 및 답변 전체 표현 벡터에 대응되는 답변은 언어적으로 의미가 없는 질의 및 답변 쌍(예컨대 실제 사람들이 나누는 대화가 아닌 거짓 대화쌍으로, 언어적으로 무의미한 대화쌍)을 나타낼 수 있다.However, if the query expression vector and the full answer expression vector are not similar, the answer corresponding to the query expression vector and the full answer expression vector corresponding to the query expression vector is a linguistically meaningless query and answer pair (e.g., conversations between real people It can represent a linguistically meaningless conversational pair).

또한, 일 실시 예에 의하면, 상기 제1 신경망 모델 내 질의 표현 벡터 인코더는 상기 질의를 토큰화함으로써 질의에 대한 적어도 하나의 토큰을 생성하고, 상기 생성된 토큰 별 표현 벡터를 생성하는 질의 토큰 표현 벡터 생성부 및 상기 생성된 토큰 별 표현 벡터의 중요도를 결정하는 질의 토큰 중요도 결정부를 포함할 수 있다. 예를 들어, 질의 토큰 표현 벡터 생성부는 질의를 토큰화하고, 질의의 토큰들을 인코딩함으로써 표현 벡터를 생성할 수 있다. 일 실시 예에 의하면, 질의 토큰 중요도 결정부는 토큰 별 표현 벡터의 중요도를 결정할 수 있다.Also, according to an embodiment, the query expression vector encoder in the first neural network model generates at least one token for a query by tokenizing the query, and generates a query token expression vector for each generated token expression vector. It may include a generating unit and a query token importance determining unit that determines the importance of the generated expression vector for each token. For example, the query token expression vector generator may generate the expression vector by tokenizing the query and encoding tokens of the query. According to an embodiment, the query token importance determining unit may determine the importance of the expression vector for each token.

보다 상세하게는, 질의 표현 벡터 인코더는 결정된 질의 토큰 중요도에 기초하여 토큰 별 표현 벡터를 가중합함으로써 질의에 대한 표현 벡터를 생성할 수 있다. 제1 신경망 모델은 상술한 방법에 따라 생성된 질의 표현 벡터가 답변 전체 표현 벡터가 유사해지도록 신경망 모델 내 레이어들 및 상기 레이어들 사이의 연결 강도에 관한 가중치를 수정 및 갱신함으로써 학습될 수 있다. 제1 신경망 모델이 질의 표현 벡터가 답변 전체 표현 벡터가 유사해지도록 학습이 완료되면, 전자 장치(1000)는 제1 신경망 모델 내 질의 토큰 중요도 결정부에서 출력되는 질의 토큰 별 중요도 값에 기초하여 질의에 대한 답변 생성에 이용할 수 있다.In more detail, the query expression vector encoder may generate the expression vector for the query by weight summing the expression vectors for each token based on the determined query token importance. The first neural network model may be learned by modifying and updating the weights of the layers in the neural network model and the connection strength between the layers so that the query expression vector generated according to the above-described method is similar to the entire answer expression vector. When learning of the first neural network model is completed so that the query expression vector and the entire answer expression vector are similar to each other, the electronic device 1000 makes a query based on the importance value for each query token output from the query token importance determiner in the first neural network model. It can be used to generate answers to

상술한 제1 신경망 모델 내 상기 질의 표현 벡터 인코더 및 상기 답변 전체 표현 벡터 인코더가, 상기 질의에 대한 표현 벡터 및 상기 답변 전체에 대한 표현 벡터가 서로 유사해지도록 미리 학습되면, 질의 토큰 중요도 결정부는, 답변 전체에 대한 내용이 충분히 반영된, 토큰 별 중요도를 결정할 수 있게 된다. 일 실시 예에 의하면, 제1 신경망 모델 내 질의 토큰 중요도 결정부가 결정하는 중요도는 질의 토큰 별 전체 답변에 대한 유사도를 의미할 수도 있다. 상술한, 제1 신경망 모델의 학습 과정은 전자 장치(1000)에 의해서 수행될 수 있다. 그러나 또 다른 실시 예에 의하면, 제1 신경망 모델의 학습은 전자 장치(1000)와 연결된 서버(2000) 또는 전자 장치(1000)와 연결된 다른 전자 장치(1002)에 의해서도 수행될 수 있음은 물론이다.When the query expression vector encoder and the full answer expression vector encoder in the above-described first neural network model are pre-trained so that the expression vector for the query and the expression vector for the entire answer are similar to each other, the query token importance determining unit, It is possible to determine the importance of each token that sufficiently reflects the contents of the entire answer. According to an embodiment, the importance determined by the query token importance determining unit in the first neural network model may mean a degree of similarity to all answers for each query token. The above-described learning process of the first neural network model may be performed by the electronic device 1000 . However, according to another embodiment, it goes without saying that the learning of the first neural network model may also be performed by the server 2000 connected to the electronic device 1000 or another electronic device 1002 connected to the electronic device 1000 .

S230에서, 전자 장치(1000)는 질의 및 상기 획득된 질의의 토큰 별 중요도가 입력되면 상기 질의에 대한 답변을 출력하는 제2 신경망 모델에 상기 질의 및 상기 획득된 질의의 토큰 별 중요도를 입력함으로써, 상기 질의에 대한 응답을 생성할 수 있다. 일 실시 예에 의하면, 제2 신경망 모델은 시퀀스 투 시퀀스 모델 구조의 신경망 모델로써 인코더 및 디코더를 포함할 수 있다. 전자 장치(1000)가 이용하는 제2 신경망 모델은, 제1 신경망 모델 내 일부의 신경망 구조(예컨대 질의 토큰 중요도 결정부)로부터 획득되는 질의 토큰 별 중요도 값 및 질의가 입력되면, 답변 전체에 대한 질의 토큰 별 중요도가 반영된, 답변을 생성할 수 있다.In S230, the electronic device 1000 inputs the importance of each token of the query and the obtained query to the second neural network model that outputs an answer to the query when the query and the obtained query are of importance for each token are input, A response to the above query may be generated. According to an embodiment, the second neural network model is a neural network model having a sequence-to-sequence model structure and may include an encoder and a decoder. The second neural network model used by the electronic device 1000 includes the importance value for each query token obtained from a partial neural network structure (eg, the query token importance determiner) in the first neural network model and, when a query is input, a query token for the entire answer. You can create an answer that reflects the importance of each.

일 실시 예에 의하면, 상기 제2 신경망 모델은 상기 사용자로부터 질의가 입력되면 상기 질의를 인코딩하는 인코더 및 상기 인코더의 출력 값 및 상기 인코더의 출력 값에 상기 질의의 토큰 별 중요도를 반영함으로써 결정되는 인코더 출력 변환 값을 획득하고, 상기 획득된 인코더의 출력 값 및 상기 인코더 출력 변환 값을 디코딩하는 디코더를 포함할 수 있다. 일 실시 예에 의하면 제2 신경망 모델 내 디코더는 인코더의 출력 값 및 상기 인코더 출력 변환 값을 순차로 또는 함께 획득할 수도 있다.According to an embodiment, when a query is input from the user, the second neural network model is an encoder that encodes the query, an output value of the encoder, and an encoder determined by reflecting the importance of each token of the query in an output value of the encoder and a decoder to obtain an output transform value, and to decode the obtained output value of the encoder and the encoder output transform value. According to an embodiment, the decoder in the second neural network model may acquire the encoder output value and the encoder output transform value sequentially or together.

예를 들어, 인코더는 질의가 입력되면 질의를 인코딩함으로써 인코더 출력 값을 생성할 수 있다. 제1 신경망 모델은 인코더의 출력 값에, 질의 토큰 별 중요도 값을 토큰 별로 스칼라배 하여, 전체 답변과의 관계가 반영된 중요성이 곱해진 인코더 출력 변환 값을 결정할 수 있다. 제1 신경망 모델은 상술한 인코더의 출력 값 및 인코더 출력 변환 값을 디코더에 입력함으로써 디코딩하고, 디코딩 결과에 기초하여 질의에 대한 답변을 생성할 수 있다.For example, the encoder may generate an encoder output value by encoding the query when the query is input. The first neural network model may determine the encoder output transformation value multiplied by the importance reflecting the relation with the overall answer by scalar-multiplying the importance value of each query token to the output value of the encoder for each token. The first neural network model may decode the above-described encoder output value and encoder output transform value by inputting the decoder, and generate an answer to the query based on the decoding result.

도 2에는 도시되지 않았지만, 전자 장치(1000)는 생성된 응답을 사용자의 질의에 대한 답변으로 제공할 수 있다. 일 실시 예에 의하면, 전자 장치(1000)는 전자 장치에 포함된 스피커 또는 디스플레이를 이용하여, 생성된 답변을 이미지, 비디오 또는 오디오 형태로 출력할 수 있다.Although not shown in FIG. 2 , the electronic device 1000 may provide the generated response as an answer to the user's query. According to an embodiment, the electronic device 1000 may output the generated answer in the form of an image, video, or audio by using a speaker or a display included in the electronic device.

도 3은 또 다른 실시 예에 따라 전자 장치가 복수의 신경망 모델을 이용하여 사용자 질의에 대한 답변을 제공하는 과정을 설명하기 위한 도면이다.3 is a diagram for describing a process in which an electronic device provides an answer to a user's query by using a plurality of neural network models, according to another embodiment.

도 3을 참조하여 전자 장치(1000)가 복수의 신경망 모델을 이용하여 질의에 대한 답변을 제공하는 과정을 설명하기로 한다. 일 실시 예에 의하면, 전자 장치(1000)는 제1 신경망 모델(310) 및 제2 신경망 모델(330)을 이용하여 질의 토큰 별 중요도에 기초하여, 질의에 대한 답변을 제공할 수 있다. 일 실시 예에 의하면, 제1 신경망 모델(310)은 질의와 답변의 관계를 추출하는 관계 추출기, 제2 신경망 모델은, 관계 추출기로부터 추출된 질의 및 답변 사이의 관계에 기초하여, 질의에 대한 답변을 제공하는 답변 생성기에 대응될 수 있다.A process in which the electronic device 1000 provides an answer to a query using a plurality of neural network models will be described with reference to FIG. 3 . According to an embodiment, the electronic device 1000 may use the first neural network model 310 and the second neural network model 330 to provide an answer to a query based on the importance of each query token. According to an embodiment, the first neural network model 310 is a relationship extractor that extracts a relationship between a query and an answer, and the second neural network model answers the query based on the relationship between the query and the answer extracted from the relationship extractor. may correspond to an answer generator that provides

일 실시 예에 의하면, 전자 장치(1000)가 이용하는 제1 신경망 모델(310) 및 제2 신경망 모델(330)은 전자 장치의 메모리에 저장될 수 있다. 그러나 또 다른 실시 예에 의하면, 제1 신경망 모델(310)내 질의 토큰 중요도 결정부 및 제2 신경망 모델에 대한 정보가 전자 장치의 메모리에 저장될 수도 있다. 그러나 또 다른 실시 예에 의하면, 전자 장치(1000)의 메모리에는 제2 신경망 모델(330)에 대한 정보만이 저장될 수도 있다.According to an embodiment, the first neural network model 310 and the second neural network model 330 used by the electronic device 1000 may be stored in a memory of the electronic device. However, according to another embodiment, information about the query token importance determiner in the first neural network model 310 and the second neural network model may be stored in the memory of the electronic device. However, according to another embodiment, only information about the second neural network model 330 may be stored in the memory of the electronic device 1000 .

일 실시 예에 의하면, 제1 신경망 모델(310)은 소정의 대화쌍들이 저장된 데이터 베이스(312), 질의 토큰 표현 벡터 생성기(314), 질의 토큰 중요도 계산기(316), 답변 전체 표현 벡터 생성기(318) 및 유사도 검사부(320)를 포함할 수 있다. 일 실시 예에 의하면, 데이터 베이스(312)는 제1 신경망 모델(310)에 포함되지 않고, 제1 신경망 모델에 대화쌍 학습 데이터를 제공하기 위한 외부에 마련될 수도 있다.According to an embodiment, the first neural network model 310 includes a database 312 in which predetermined conversation pairs are stored, a query token expression vector generator 314 , a query token importance calculator 316 , and an answer full expression vector generator 318 . ) and a similarity checker 320 . According to an embodiment, the database 312 is not included in the first neural network model 310, but may be provided externally for providing conversation pair learning data to the first neural network model.

일 실시 예에 의하면, 질의 토큰 표현 벡터 생성기(314)는 인코더로써 상술한 질의 토큰 표현 벡터 생성부에 대응될 수 있고, 질의 토큰 중요도 계산기는 상술한 질의 토큰 중요도 결정부에 대응될 수 있다. 또한, 일 실시 예에 의하면, 답변 전체 표현 벡터 생성기(318)은 상술한 답변 전체 표현 벡터 인코더에 대응될 수 있다. 전자 장치(1000)가 이용하는 제1 신경망 모델(310)은 전자 장치(1000) 또는 전자 장치와 연결된 전자 장치(1002)에 의해 학습될 수 있다. 일 실시 예에 의하면, 제1 신경망 모델 내 질의 토큰 표현 벡터 생성기(314)는 대화쌍 데이터 베이스(312)로부터 질의 학습 데이터를 획득하고, 답변 전체 표현 벡터 생성기(318)은 대화쌍 데이터 베이스(312)로부터 학습 답변 데이터를 획득한다.According to an embodiment, the query token expression vector generator 314 may correspond to the above-described query token expression vector generator as an encoder, and the query token importance calculator may correspond to the above-described query token importance determiner. Also, according to an embodiment, the full answer expression vector generator 318 may correspond to the above-described full answer expression vector encoder. The first neural network model 310 used by the electronic device 1000 may be learned by the electronic device 1000 or the electronic device 1002 connected to the electronic device. According to an embodiment, the query token expression vector generator 314 in the first neural network model obtains query learning data from the conversation pair database 312 , and the answer full expression vector generator 318 generates the conversation pair database 312 . ) to obtain the learning answer data.

질의 토큰 표현 벡터 생성기(314)는 질의 학습 데이터를 인코딩함으로써 질의 표현 벡터를 생성하고, 답변 전체 표현 벡터 생성기(318)은 학습 답변 데이터를 인코딩함으로써 답변 전체에 대한 표현 벡터를 생성한다. 질의 토큰 중요도 계산기(316)은 질의 토큰 별 표현 벡터에 대한 중요도를 결정하고, 결정된 중요도를 가중치로써, 질의 토큰 별 표현 벡터에 반영한다. 질의 토큰 표현 벡터 생성기(314)은 질의 토큰 표현 벡터에 질의 토큰 별 중요도를 가중치로 반영함으로써 전체 질의에 대한 표현 벡터를 생성할 수 있다. The query token expression vector generator 314 generates a query expression vector by encoding the query learning data, and the answer full expression vector generator 318 generates an expression vector for the entire answer by encoding the learning answer data. The query token importance calculator 316 determines the importance of the expression vector for each query token, and reflects the determined importance as a weight in the expression vector for each query token. The query token expression vector generator 314 may generate an expression vector for the entire query by reflecting the importance of each query token as a weight in the query token expression vector.

유사도 검사부(320)는 질의 표현 벡터 및 답변 전체 표현 벡터의 유사도를 비교할 수 있다. 일 실시 예에 의하면, 유사도 검사부(320)는 질의 표현 벡터 및 답변 전체 표현 벡터의 유사도 값이 1인 경우, 질의 표현 벡터 및 답변 전체 표현 벡터가 유사한 것으로 결정하고, 현재 입력된 질의 및 답변은 실제 대화쌍을 구성하는 것으로 결정할 수 있다. 그러나 또 다른 실시 예에 따라 유사도 검사부(320)가 질의 표현 벡터 및 답변 전체 표현 벡터의 유사도 값을 0으로 식별하는 경우, 현재 제1 신경망 모델로 입력된 질의 및 답변은 거짓 대화쌍을 구성하는 것으로 결정될 수도 있다.The similarity checker 320 may compare the similarity between the query expression vector and the entire answer expression vector. According to an embodiment, when the similarity value of the query expression vector and the full answer expression vector is 1, the similarity check unit 320 determines that the query expression vector and the full answer expression vector are similar, and the currently input query and answer are actually You can decide to form a conversation pair. However, according to another embodiment, when the similarity check unit 320 identifies the similarity value of the query expression vector and the entire answer expression vector as 0, the query and answer currently input to the first neural network model constitute a false conversation pair. may be decided.

제1 신경망 모델(310)은 질의 표현 벡터 및 답변 전체 표현 벡터가 유사해지도록 학습됨에 따라, 각 질의의 각 토큰의 중요도를 계산할 때, 실제 정답 답변과 유사한 표현 벡터가 최종적으로 생성될 수 있도록, 질의 표현 벡터 및 유사도 검사부가 학습될 수 있다. 제1 신경망 모델(310)의 학습 과정이 완료되면, 이후에는 답변이 입력되지 않고, 질의에 대한 정보만이 입력되더라도, 답변이 고려된 각 질의의 토큰 별 중요도가 출력될 수 있다.As the first neural network model 310 is trained so that the query expression vector and the full answer expression vector become similar, when calculating the importance of each token of each query, an expression vector similar to the actual correct answer can be finally generated, A query expression vector and a similarity checker may be trained. When the learning process of the first neural network model 310 is completed, even if no answer is inputted thereafter and only information about the query is inputted, the importance of each token for each query in which the answer is considered may be output.

제1 신경망 모델(310)에서 결정된 질의 토큰 별 중요도는 제2 신경망 모델(330)로 입력될 수 있다. 예를 들어, 제2 신경망 모델(330)은 제1 신경망 모델(310)에서 출력된 질의 토큰 별 중요도(334) 및 사용자 질의에 대응되는 사용자 입력 문장(332)을 획득할 수 있다. 제2 신경망 모델(330)은 사용자 입력 문장(332) 및 질의 토큰 중요도(334)를 답변 생성기(336)에 입력한다. The importance of each query token determined in the first neural network model 310 may be input to the second neural network model 330 . For example, the second neural network model 330 may acquire the importance 334 for each query token output from the first neural network model 310 and the user input sentence 332 corresponding to the user query. The second neural network model 330 inputs the user input sentence 332 and the query token importance 334 to the answer generator 336 .

일 실시 예에 의하면, 답변 생성기(336)는 제1 신경망 모델에 대응될 수 있다. 일 실시 예에 의하면 답변 생성기(336)는 인코더 및 디코더를 포함할 수 있다. 예를 들어, 답변 생성기(336)내 인코더는 질의를 인코딩함으로써 제1 인코딩 출력 값을 결정할 수 있다. 또한, 답변 생성기(336)는 제1 인코딩 출력 값에, 상기 질의의 토큰 별 중요도를, 토큰 별로 스칼라배 함으로써 인코더 출력 변환 값(예컨대 제2 인코딩 출력 값)을 결정할 수 있다. 답변 생성기(336)는 제1 인코딩 출력 값을 디코더의 제1 입력으로, 제2 인코딩 출력 값을 디코더의 제2 입력으로 사용할 수 있다.According to an embodiment, the answer generator 336 may correspond to the first neural network model. According to an embodiment, the answer generator 336 may include an encoder and a decoder. For example, the encoder in answer generator 336 may determine the first encoded output value by encoding the query. Also, the answer generator 336 may determine the encoder output conversion value (eg, the second encoded output value) by scalar-multiplying the first encoded output value by the importance of each token of the query for each token. The answer generator 336 may use the first encoded output value as a first input of the decoder and the second encoded output value as a second input of the decoder.

답변 생성기(336)내 디코더는 제1 인코딩 출력 값 및 제2 인코딩 출력 값을 디코딩함으로써, 질의에 대한 답변 문장(338)을 생성할 수 있다. 일 실시 예에 의하면, 답변 생성기(336)내 디코더는 제1 인코딩 출력 값 및 제2 인코딩 출력 값을 순차로 획득할 수 있다. 그러나 또 다른 실시 예에 의하면, 답변 생성기(336)내 디코더는 제1 인코딩 출력 값 및 제2 인코딩 출력 값을 함께 획득할 수도 있다.A decoder in the answer generator 336 may generate an answer sentence 338 to the query by decoding the first encoded output value and the second encoded output value. According to an embodiment, the decoder in the answer generator 336 may sequentially obtain the first encoded output value and the second encoded output value. However, according to another embodiment, the decoder in the answer generator 336 may acquire the first encoded output value and the second encoded output value together.

도 4는 일 실시 예에 따른 전자 장치의 블록도이다.4 is a block diagram of an electronic device according to an embodiment.

일 실시 예에 의하면, 전자 장치(1000)는 프로세서(1300), 네트워크 인터페이스(1500) 및 메모리(1700)를 포함할 수 있다. 그러나 상술한 구성에 한정되는 것은 아니고, 전자 장치(1000)는 응답 내지 답변을 출력하기 위한 스피커, 디스플레이 등을 더 포함할 수도 있다. 일 실시 예에 의하면, 프로세서(1300)는 메모리(1700)에 저장된 하나 이상의 인스트럭션을 실행함으로써 질의에 대한 답변을 제공하는 과정을 수행한다.According to an embodiment, the electronic device 1000 may include a processor 1300 , a network interface 1500 , and a memory 1700 . However, it is not limited to the above-described configuration, and the electronic device 1000 may further include a speaker, a display, and the like for outputting a response or an answer. According to an embodiment, the processor 1300 performs a process of providing an answer to a query by executing one or more instructions stored in the memory 1700 .

일 실시 예에 의하면, 네트워크 인터페이스(1500)는 전자 장치(1000)가 다른 장치(미도시) 및 서버(미도시)와 통신을 하게 하는 하나 이상의 구성요소를 포함할 수 있다. 다른 장치(미도시)는 전자 장치(1000)와 같이 질의에 대한 응답을 제공하는 장치로써, 제1 신경망 모델을 학습시키기 위한 장치일 수 있다. 네트워크 인터페이스(1500)는 다른 전자 장치(1002)로부터 제1 신경망 모델에 대한 정보, 제1 신경망 모델의 질의 토큰 중요도 결정부에 대한 정보, 질의의 토큰 별 중요도 값을 획득할 수 있다.According to an embodiment, the network interface 1500 may include one or more components that allow the electronic device 1000 to communicate with another device (not shown) and a server (not shown). Another device (not shown) is a device that provides a response to a query, such as the electronic device 1000 , and may be a device for training the first neural network model. The network interface 1500 may obtain information on the first neural network model, information on the query token importance determiner of the first neural network model, and importance values for each query token from the other electronic device 1002 .

메모리(1700)는, 프로세서(1300)의 처리 및 제어를 위한 프로그램을 저장할 수 있고, 전자 장치(1000)로 입력되는 질의, 전자 장치(1000)로부터 출력되는 데이터로써 응답 또는 정답 정보를 저장할 수도 있다. 또한, 메모리(1700)는 상술한 제1 신경망 모델, 제2 신경망 모델, 제1 신경망 모델 내 질의 토큰 중요도 결정부에 대한 정보, 질의 토큰 중요도 값에 대한 정보 등을 더 저장할 수도 있다. 또한, 메모리(1700)는 각 신경망 모델을 학습시키기 위한 데이터 베이스, 데이터 베이스에 저장될 학습 데이터에 대한 정보를 더 저장할 수도 있다.The memory 1700 may store a program for processing and control of the processor 1300 , and may store response or correct answer information as data output from a query inputted to the electronic device 1000 and from the electronic device 1000 . . Also, the memory 1700 may further store the above-described first neural network model, the second neural network model, information on the query token importance determiner in the first neural network model, information on the query token importance value, and the like. In addition, the memory 1700 may further store information about a database for learning each neural network model and training data to be stored in the database.

메모리(1700)는 복수의 신경망 모델 내 레이어들 및 상기 레이어들의 연결 강도에 관한 가중치(WEIGHT) 값들을 저장할 수도 있다. 메모리(1700)에 저장된 가중치 값들은 미리 설정된 주기에 따라 수정 및 갱신될 수 있다. 즉, 메모리(1700)에는 전자 장치(1000)가 다른 전자 장치(1002)로부터 획득된 데이터(예컨대 질의 토큰 별 중요도)에 기초하여 새로 추가한 질의 토큰 중요도 결정부, 갱신된 제2 신경망 모델에 대한 정보, 또는 갱신된 제1 신경망 모델에 대한 정보들이 추가 및 갱신될 수 있다.The memory 1700 may store layers in a plurality of neural network models and weight values related to connection strengths of the layers. Weight values stored in the memory 1700 may be modified and updated according to a preset period. That is, in the memory 1700, the query token importance determining unit newly added based on data obtained by the electronic device 1000 from other electronic devices 1002 (eg, the importance of each query token), and the updated second neural network model are stored in the memory 1700 . Information or information about the updated first neural network model may be added and updated.

메모리(1700)는 플래시 메모리 타입(flash memory type), 하드디스크 타입(hard disk type), 멀티미디어 카드 마이크로 타입(multimedia card micro type), 카드 타입의 메모리(예를 들어 SD 또는 XD 메모리 등), 램(RAM, Random Access Memory) SRAM(Static Random Access Memory), 롬(ROM, Read-Only Memory), EEPROM(Electrically Erasable Programmable Read-Only Memory), PROM(Programmable Read-Only Memory), 자기 메모리, 자기 디스크, 광디스크 중 적어도 하나의 타입의 저장매체를 포함할 수 있다. The memory 1700 may include a flash memory type, a hard disk type, a multimedia card micro type, a card type memory (eg, SD or XD memory), and a RAM. (RAM, Random Access Memory) SRAM (Static Random Access Memory), ROM (Read-Only Memory), EEPROM (Electrically Erasable Programmable Read-Only Memory), PROM (Programmable Read-Only Memory), magnetic memory, magnetic disk , may include at least one type of storage medium among optical disks.

프로세서(1300)는 메모리에 저장된 하나 이상의 인스트럭션을 수행함으로써, 질의를 획득하고, 제1 신경망 모델 또는 제2 신경망 모델 중 적어도 하나를 이용하여 질의에 대한 답변을 결정한다. 예를 들어, 프로세서는 상기 질의의 토큰 별 중요도를 결정하고, 상기 결정된 상기 질의의 토큰 별 중요도에 기초하여, 상기 질의 및 상기 질의에 대한 전체 답변의 유사도를 출력하는 제1 신경망 모델로부터 상기 질의의 토큰 별 중요도를 획득하고, 상기 질의 및 상기 획득된 질의의 토큰 별 중요도가 입력되면 상기 질의에 대한 답변을 출력하는 제2 신경망 모델에 상기 질의 및 상기 획득된 질의의 토큰 별 중요도를 입력함으로써, 상기 질의에 대한 응답을 생성할 수 있다.The processor 1300 obtains a query by executing one or more instructions stored in the memory, and determines an answer to the query using at least one of the first neural network model and the second neural network model. For example, the processor determines the importance of each token of the query, and based on the determined importance of each token of the query, the query from the first neural network model that outputs the similarity of all answers to the query and the query. By obtaining the importance of each token, and inputting the importance of each token of the query and the obtained query to a second neural network model that outputs an answer to the query when the importance of each token of the query and the obtained query is input, You can create responses to queries.

또한, 상기 적어도 하나의 프로세서(1300)는 상기 생성된 응답을 상기 사용자의 질의에 대한 답변으로 제공할 수 있다. 또한, 프로세서(1300)는 도 1 내지 3에 상술한 질의에 대한 답변을 제공하는 방법을 수행하기 위해 네트워크 인터페이스(1500) 및 메모리(1700)의 전반적인 동작을 제어한다.Also, the at least one processor 1300 may provide the generated response as an answer to the user's query. In addition, the processor 1300 controls overall operations of the network interface 1500 and the memory 1700 in order to perform the method of providing answers to the queries described above in FIGS. 1 to 3 .

일 실시 예에 의하면, 프로세서(1300)는 제1 신경망 모델이 소정의 질의 및 상기 질의에 대한 답변을 포함하는 대화쌍들이 저장된 데이터 베이스로부터, 상기 질의를 획득하고, 상기 질의를 인코딩함으로써 상기 질의에 대한 표현 벡터를 생성하도록 제어할 수 있다. 또한, 프로세서(1300)는 제1 신경망 모델이, 상기 질의에 대한 답변을 획득하고, 상기 획득된 답변 전체를 인코딩함으로써 상기 답변 전체에 대한 표현 벡터를 생성하도록 제어할 수 있다.According to an embodiment, the processor 1300 obtains the query from a database in which the first neural network model stores conversation pairs including a predetermined query and an answer to the query, and encodes the query to respond to the query. It can be controlled to generate an expression vector for Also, the processor 1300 may control the first neural network model to generate an expression vector for the entire answer by obtaining an answer to the query and encoding the entire obtained answer.

또한, 프로세서(1300)는 제1 신경망 모델이 상기 질의를 토큰화함으로써 질의에 대한 적어도 하나의 토큰을 생성하고, 상기 생성된 토큰 별 표현 벡터를 생성하도록 하고, 상기 생성된 토큰 별 표현 벡터의 중요도를 결정하며, 상기 결정된 질의 토큰 중요도에 기초하여 상기 토큰 별 표현 벡터를 가중합합으로써 상기 질의에 대한 표현 벡터를 생성하도록, 제1 신경망 모델을 제어할 수 있다.In addition, the processor 1300 causes the first neural network model to generate at least one token for the query by tokenizing the query, to generate the generated expression vector for each token, and the importance of the generated expression vector for each token. and controlling the first neural network model to generate an expression vector for the query by weight summing the expression vectors for each token based on the determined importance of the query token.

또한, 프로세서(1300)는 상기 질의에 대한 표현 벡터 및 상기 답변 전체에 대한 표현 벡터가 서로 유사해지도록 질의 표현 벡터 인코더 및 상기 답변 전체 표현 벡터 인코더를 학습시킬 수 있다. 또한, 프로세서(1300)는 상기 질의에 대한 표현 벡터 및 상기 답변 전체에 대한 표현 벡터가 서로 유사해지도록 상기 질의 표현 벡터 인코더가 학습됨에 따라 상기 질의 표현 벡터 인코더 내 상기 질의 토큰 중요도 결정부가 상기 답변 전체에 대한 내용에 기초하여 상기 질의의 토큰 별 중요도를 결정하도록, 제1 신경망 모델을 학습시킬 수 있다.Also, the processor 1300 may train the query expression vector encoder and the full answer expression vector encoder so that the expression vector for the query and the expression vector for the entire answer are similar to each other. In addition, as the query expression vector encoder is trained so that the expression vector for the query and the expression vector for the entire answer are similar to each other, the processor 1300 determines that the query token importance determining unit in the query expression vector encoder is The first neural network model may be trained to determine the importance of each token of the query based on the contents of .

또한, 프로세서(1300)는 사용자로부터 질의가 입력되면 상기 질의를 인코딩하도록 제2 신경망 모델 내 인코더를 제어하고, 상기 인코더의 출력 값 및 상기 인코더의 출력 값에 상기 질의의 토큰 별 중요도를 반영함으로써 결정되는 인코더 출력 변환 값을 획득하며, 상기 획득된 인코더의 출력 값 및 상기 인코더 출력 변환 값을 디코딩하도록 제2 신경망 모델 내 디코더를 제어할 수 있다.In addition, the processor 1300 controls the encoder in the second neural network model to encode the query when a query is input from the user, and determines by reflecting the importance of each token of the query in the output value of the encoder and the output value of the encoder A decoder in the second neural network model may be controlled to obtain an encoder output transform value that is a given value, and to decode the obtained encoder output value and the encoder output transform value.

일 실시예에 따른 전자 장치가 사용자의 질의에 대한 답변을 제공하는 방법은 다양한 컴퓨터 수단을 통하여 수행될 수 있는 프로그램 명령 형태로 구현되어 컴퓨터 판독 가능 매체에 기록될 수 있다. 상기 컴퓨터 판독 가능 매체는 프로그램 명령, 데이터 파일, 데이터 구조 등을 단독으로 또는 조합하여 포함할 수 있다. 상기 매체에 기록되는 프로그램 명령은 본 발명을 위하여 특별히 설계되고 구성된 것들이거나 컴퓨터 소프트웨어 당업자에게 공지되어 사용 가능한 것일 수도 있다.The method in which the electronic device provides an answer to a user's query according to an embodiment may be implemented in the form of a program command that can be executed through various computer means and recorded in a computer-readable medium. The computer-readable medium may include program instructions, data files, data structures, etc. alone or in combination. The program instructions recorded on the medium may be specially designed and configured for the present invention, or may be known and available to those skilled in the art of computer software.

또한, 전자 장치가 사용자의 질의에 대한 답변을 제공하는 방법을 수행하도록 하는 프로그램이 저장된 기록 매체를 포함하는 컴퓨터 프로그램 장치가 제공될 수 있다. Also, there may be provided a computer program device including a recording medium storing a program for enabling the electronic device to perform a method of providing an answer to a user's query.

컴퓨터 판독 가능 기록 매체의 예에는 하드 디스크, 플로피 디스크 및 자기 테이프와 같은 자기 매체(magnetic media), CD-ROM, DVD와 같은 광기록 매체(optical media), 플롭티컬 디스크(floptical disk)와 같은 자기-광 매체(magneto-optical media), 및 롬(ROM), 램(RAM), 플래시 메모리 등과 같은 프로그램 명령을 저장하고 수행하도록 특별히 구성된 하드웨어 장치가 포함된다. 프로그램 명령의 예에는 컴파일러에 의해 만들어지는 것과 같은 기계어 코드뿐만 아니라 인터프리터 등을 사용해서 컴퓨터에 의해서 실행될 수 있는 고급 언어 코드를 포함한다.Examples of the computer-readable recording medium include magnetic media such as hard disks, floppy disks and magnetic tapes, optical media such as CD-ROMs and DVDs, and magnetic such as floppy disks. - includes magneto-optical media, and hardware devices specially configured to store and execute program instructions, such as ROM, RAM, flash memory, and the like. Examples of program instructions include not only machine language codes such as those generated by a compiler, but also high-level language codes that can be executed by a computer using an interpreter or the like.

일부 실시예는 컴퓨터에 의해 실행되는 프로그램 모듈과 같은 컴퓨터에 의해 실행 가능한 명령어를 포함하는 기록 매체의 형태로도 구현될 수 있다. 컴퓨터 판독 가능 매체는 컴퓨터에 의해 액세스될 수 있는 임의의 가용 매체일 수 있고, 휘발성 및 비휘발성 매체, 분리형 및 비분리형 매체를 모두 포함한다. 또한, 컴퓨터 판독가능 매체는 컴퓨터 저장 매체 및 통신 매체를 모두 포함할 수 있다. 컴퓨터 저장 매체는 컴퓨터 판독가능 명령어, 데이터 구조, 프로그램 모듈 또는 기타 데이터와 같은 정보의 저장을 위한 임의의 방법 또는 기술로 구현된 휘발성 및 비휘발성, 분리형 및 비분리형 매체를 모두 포함한다. 통신 매체는 전형적으로 컴퓨터 판독가능 명령어, 데이터 구조, 프로그램 모듈, 또는 반송파와 같은 변조된 데이터 신호의 기타 데이터, 또는 기타 전송 메커니즘을 포함하며, 임의의 정보 전달 매체를 포함한다. 또한, 일부 실시예는 컴퓨터에 의해 실행되는 컴퓨터 프로그램과 같은 컴퓨터에 의해 실행 가능한 명령어를 포함하는 컴퓨터 프로그램 또는 컴퓨터 프로그램 제품(computer program product)으로도 구현될 수 있다. 이상에서 본 발명의 실시예에 대하여 상세하게 설명하였지만 본 발명의 권리범위는 이에 한정되는 것은 아니고 다음의 청구범위에서 정의하고 있는 본 발명의 기본 개념을 이용한 당업자의 여러 변형 및 개량 형태 또한 본 발명의 권리범위에 속한다.Some embodiments may also be implemented in the form of a recording medium containing instructions executable by a computer, such as program modules executed by a computer. Computer-readable media can be any available media that can be accessed by a computer and includes both volatile and nonvolatile media, removable and non-removable media. In addition, computer-readable media may include both computer storage media and communication media. Computer storage media includes both volatile and nonvolatile, removable and non-removable media implemented in any method or technology for storage of information such as computer readable instructions, data structures, program modules or other data. Communication media typically includes computer readable instructions, data structures, program modules, or other data in a modulated data signal such as a carrier wave, or other transport mechanism, and includes any information delivery media. Also, some embodiments may be implemented as a computer program or computer program product comprising instructions executable by a computer, such as a computer program executed by a computer. Although the embodiments of the present invention have been described in detail above, the scope of the present invention is not limited thereto. belong to the scope of the right.

Claims (17)

전자 장치가 사용자의 질의에 대한 답변을 제공하는 방법에 있어서,
상기 사용자로부터 질의를 획득하는 단계;
상기 사용자로부터 질의가 입력되면, 상기 사용자로부터 획득한 질의의 토큰 별 중요도를 결정하고, 상기 결정된 상기 사용자로부터 획득한 질의의 토큰 별 중요도에 기초하여, 상기 사용자로부터 획득한 질의 및 상기 사용자로부터 획득한 질의에 대한 전체 답변의 유사도를 출력하는 제1 신경망 모델로부터 상기 사용자로부터 획득한 질의의 토큰 별 중요도를 획득하는 단계; 및
상기 사용자로부터 획득한 질의 및 상기 사용자로부터 획득된 질의의 토큰 별 중요도가 입력되면 상기 사용자로부터 획득한 질의에 대한 답변을 출력하는 제2 신경망 모델에 상기 사용자로부터 획득한 질의 및 상기 사용자로부터 획득된 질의의 토큰 별 중요도를 입력함으로써, 상기 사용자로부터 획득한 질의에 대한 응답을 생성하는 단계; 를 포함하고,
상기 제2 신경망 모델은,
상기 사용자로부터 질의가 입력되면 상기 사용자로부터 획득한 질의를 인코딩하는 인코더; 및
상기 인코더의 출력 값 및 상기 인코더의 출력 값에 상기 사용자로부터 획득한 질의의 토큰 별 중요도를 반영함으로써 결정되는 인코더 출력 변환 값을 획득하고, 상기 획득된 인코더의 출력 값 및 상기 인코더 출력 변환 값을 디코딩하는 디코더; 를 포함하는 것을 특징으로 하는, 방법.
A method for an electronic device to provide an answer to a user's query, the method comprising:
obtaining a query from the user;
When a query is input from the user, the importance of each token of the query obtained from the user is determined, and based on the determined importance of each token of the query obtained from the user, the query obtained from the user and obtained from the user obtaining a level of importance for each token of a query obtained from the user from a first neural network model that outputs a degree of similarity of all answers to a query; and
When the query obtained from the user and the importance of each token of the query obtained from the user are input, the query obtained from the user and the query obtained from the user are input to a second neural network model that outputs an answer to the query obtained from the user. generating a response to a query obtained from the user by inputting the level of importance for each token of ; including,
The second neural network model is
an encoder that encodes a query obtained from the user when a query is input from the user; and
Obtain an encoder output transform value determined by reflecting the importance of each token of the query obtained from the user in the output value of the encoder and the output value of the encoder, and decode the obtained output value of the encoder and the encoder output transform value decoder; A method comprising:
제1항에 있어서, 상기 방법은
상기 생성된 응답을 상기 사용자의 질의에 대한 답변으로 제공하는 단계; 를 더 포함하는, 방법.
The method of claim 1, wherein the method
providing the generated response as an answer to the user's query; A method further comprising:
제1항에 있어서, 상기 제1 신경망 모델은
소정의 사용자로부터 획득한 질의 및 상기 사용자로부터 획득한 질의에 대한 답변을 포함하는 대화쌍들이 저장된 데이터 베이스로부터 질의를 획득하고, 상기 데이터 베이스로부터 획득한 질의를 인코딩함으로써 상기 데이터 베이스로부터 획득한 질의에 대한 표현 벡터를 생성하는 질의 표현 벡터 인코더; 및
상기 데이터 베이스로부터 획득한 질의에 대한 답변을 획득하고, 상기 획득된 답변 전체를 인코딩함으로써 상기 답변 전체에 대한 표현 벡터를 생성하는 답변 전체 표현 벡터 인코더; 를 포함하는 것인, 방법.
The method of claim 1, wherein the first neural network model is
In the query obtained from the database by obtaining a query from a database in which conversation pairs including a query obtained from a predetermined user and an answer to the query obtained from the user are stored, and encoding the query obtained from the database a query expression vector encoder that generates an expression vector for and
an answer full expression vector encoder that obtains an answer to the query obtained from the database and generates an expression vector for the entire answer by encoding the entire obtained answer; A method comprising:
제3항에 있어서, 상기 질의 표현 벡터 인코더는
상기 질의를 토큰화함으로써 질의에 대한 적어도 하나의 토큰을 생성하고, 상기 생성된 토큰 별 표현 벡터를 생성하는 질의 토큰 표현 벡터 생성부; 및
상기 생성된 토큰 별 표현 벡터의 중요도를 결정하는 질의 토큰 중요도 결정부; 를 포함하고,
상기 질의 표현 벡터 인코더는 상기 결정된 질의 토큰 중요도에 기초하여 상기 토큰 별 표현 벡터를 가중합함으로써 상기 질의에 대한 표현 벡터를 생성하는 것인, 방법.
4. The method of claim 3, wherein the query expression vector encoder comprises:
a query token expression vector generator generating at least one token for the query by tokenizing the query, and generating an expression vector for each generated token; and
a query token importance determining unit that determines the importance of the generated expression vector for each token; including,
and the query expression vector encoder generates the expression vector for the query by weight summing the token-specific expression vector based on the determined query token importance.
제4항에 있어서,
상기 질의 표현 벡터 인코더 및 상기 답변 전체 표현 벡터 인코더는, 상기 질의에 대한 표현 벡터 및 상기 답변 전체에 대한 표현 벡터가 서로 유사해지도록 미리 학습되고,
상기 질의에 대한 표현 벡터 및 상기 답변 전체에 대한 표현 벡터가 서로 유사해지도록 상기 질의 표현 벡터 인코더가 학습됨에 따라 상기 질의 표현 벡터 인코더 내 상기 질의 토큰 중요도 결정부는 상기 답변 전체에 대한 내용에 기초하여 상기 질의의 토큰 별 중요도를 결정하게 되는 것을 특징으로 하는, 방법.
5. The method of claim 4,
The query expression vector encoder and the full answer expression vector encoder are trained in advance so that the expression vector for the query and the expression vector for the entire answer are similar to each other,
As the query expression vector encoder is trained so that the expression vector for the query and the expression vector for the entire answer are similar to each other, the query token importance determining unit in the query expression vector encoder is based on the contents of the entire answer. A method, characterized in that the importance of each token of the query is determined.
삭제delete 제1항에 있어서, 상기 디코더는
상기 인코더의 출력 값 및 상기 인코더 출력 변환 값을 순차로 또는 함께 획득하는 것을 특징으로 하는, 방법.
The method of claim 1, wherein the decoder
A method, characterized in that the output value of the encoder and the encoder output transform value are acquired sequentially or together.
제1항에 있어서, 상기 제2 신경망 모델은
시퀀스 투 시퀀스 구조의 신경망 모델인 것을 특징으로 하는, 방법.
The method of claim 1, wherein the second neural network model is
A method, characterized in that it is a neural network model of a sequence-to-sequence structure.
사용자의 질의에 대한 답변을 제공하는 전자 장치에 있어서,
네트워크 인터페이스;
하나 이상의 인스트럭션을 저장하는 메모리; 및
상기 하나 이상의 인스트럭션을 실행하는 적어도 하나의 프로세서; 를 포함하고,
상기 적어도 하나의 프로세서는
상기 사용자로부터 질의를 획득하고,
상기 사용자로부터 질의가 입력되면, 상기 사용자로부터 획득한 질의의 토큰 별 중요도를 결정하고, 상기 결정된 상기 사용자로부터 획득한 질의의 토큰 별 중요도에 기초하여, 상기 사용자로부터 획득한 질의 및 상기 사용자로부터 획득한 질의에 대한 전체 답변의 유사도를 출력하는 제1 신경망 모델로부터 상기 사용자로부터 획득한 질의의 토큰 별 중요도를 획득하고,
상기 사용자로부터 획득한 질의 및 상기 사용자로부터 획득된 질의의 토큰 별 중요도가 입력되면 상기 사용자로부터 획득한 질의에 대한 답변을 출력하는 제2 신경망 모델에 상기 사용자로부터 획득한 질의 및 상기 사용자로부터 획득된 질의의 토큰 별 중요도를 입력함으로써, 상기 사용자로부터 획득한 질의에 대한 응답을 생성하고,
상기 제2 신경망 모델은,
상기 사용자로부터 질의가 입력되면 상기 사용자로부터 획득한 질의를 인코딩하는 인코더; 및
상기 인코더의 출력 값 및 상기 인코더의 출력 값에 상기 사용자로부터 획득한 질의의 토큰 별 중요도를 반영함으로써 결정되는 인코더 출력 변환 값을 획득하고, 상기 획득된 인코더의 출력 값 및 상기 인코더 출력 변환 값을 디코딩하는 디코더; 를 포함하는 것을 특징으로 하는, 전자 장치.
An electronic device that provides an answer to a user's query, the electronic device comprising:
network interface;
a memory storing one or more instructions; and
at least one processor executing the one or more instructions; including,
the at least one processor
obtain a query from the user;
When a query is input from the user, the importance of each token of the query obtained from the user is determined, and based on the determined importance of each token of the query obtained from the user, the query obtained from the user and obtained from the user Obtaining the importance of each token of the query obtained from the user from the first neural network model that outputs the similarity of all answers to the query,
When the query obtained from the user and the importance of each token of the query obtained from the user are input, the query obtained from the user and the query obtained from the user are input to a second neural network model that outputs an answer to the query obtained from the user. By entering the level of importance for each token of
The second neural network model is
an encoder that encodes a query obtained from the user when a query is input from the user; and
Obtain an encoder output transform value determined by reflecting the importance of each token of the query obtained from the user in the output value of the encoder and the output value of the encoder, and decode the obtained output value of the encoder and the encoder output transform value decoder; An electronic device comprising a.
제9항에 있어서, 상기 적어도 하나의 프로세서는
상기 생성된 응답을 상기 사용자의 질의에 대한 답변으로 제공하는, 전자 장치.
10. The method of claim 9, wherein the at least one processor is
An electronic device that provides the generated response as an answer to the user's query.
제9항에 있어서, 상기 제1 신경망 모델은
소정의 사용자로부터 획득한 질의 및 상기 사용자로부터 획득한 질의에 대한 답변을 포함하는 대화쌍들이 저장된 데이터 베이스로부터 질의를 획득하고, 상기 데이터 베이스로부터 획득한 질의를 인코딩함으로써 상기 데이터 베이스로부터 획득한 질의에 대한 표현 벡터를 생성하는 질의 표현 벡터 인코더; 및
상기 데이터 베이스로부터 획득한 질의에 대한 답변을 획득하고, 상기 획득된 답변 전체를 인코딩함으로써 상기 답변 전체에 대한 표현 벡터를 생성하는 답변 전체 표현 벡터 인코더; 를 포함하는 것인, 전자 장치.
The method of claim 9, wherein the first neural network model is
In the query obtained from the database by obtaining a query from a database in which conversation pairs including a query obtained from a predetermined user and an answer to the query obtained from the user are stored, and encoding the query obtained from the database a query expression vector encoder that generates an expression vector for and
an answer full expression vector encoder that obtains an answer to the query obtained from the database and generates an expression vector for the entire answer by encoding the entire obtained answer; The electronic device comprising a.
제11항에 있어서, 상기 질의 표현 벡터 인코더는
상기 질의를 토큰화함으로써 질의에 대한 적어도 하나의 토큰을 생성하고, 상기 생성된 토큰 별 표현 벡터를 생성하는 질의 토큰 표현 벡터 생성부; 및
상기 생성된 토큰 별 표현 벡터의 중요도를 결정하는 질의 토큰 중요도 결정부; 를 포함하고,
상기 질의 표현 벡터 인코더는 상기 결정된 질의 토큰 중요도에 기초하여 상기 토큰 별 표현 벡터를 가중합함으로써 상기 질의에 대한 표현 벡터를 생성하는 것인, 전자 장치.
12. The method of claim 11, wherein the query expression vector encoder comprises:
a query token expression vector generator generating at least one token for the query by tokenizing the query, and generating an expression vector for each generated token; and
a query token importance determining unit that determines the importance of the generated expression vector for each token; including,
and the query expression vector encoder generates the expression vector for the query by weight summing the expression vector for each token based on the determined query token importance.
제12항에 있어서,
상기 질의 표현 벡터 인코더 및 상기 답변 전체 표현 벡터 인코더는, 상기 질의에 대한 표현 벡터 및 상기 답변 전체에 대한 표현 벡터가 서로 유사해지도록 미리 학습되고,
상기 질의에 대한 표현 벡터 및 상기 답변 전체에 대한 표현 벡터가 서로 유사해지도록 상기 질의 표현 벡터 인코더가 학습됨에 따라 상기 질의 표현 벡터 인코더 내 상기 질의 토큰 중요도 결정부는 상기 답변 전체에 대한 내용에 기초하여 상기 질의의 토큰 별 중요도를 결정하게 되는 것을 특징으로 하는, 전자 장치.
13. The method of claim 12,
The query expression vector encoder and the full answer expression vector encoder are trained in advance so that the expression vector for the query and the expression vector for the entire answer are similar to each other,
As the query expression vector encoder is trained so that the expression vector for the query and the expression vector for the entire answer are similar to each other, the query token importance determining unit in the query expression vector encoder is based on the contents of the entire answer. An electronic device, characterized in that the importance of each token of the query is determined.
삭제delete 제9항에 있어서, 상기 디코더는,
상기 인코더의 출력 값 및 상기 인코더 출력 변환 값을 순차로 또는 함께 획득하는 것을 특징으로 하는, 전자 장치.
The method of claim 9, wherein the decoder comprises:
The electronic device, characterized in that the output value of the encoder and the encoder output conversion value are acquired sequentially or together.
제9항에 있어서, 상기 제2 신경망 모델은
시퀀스 투 시퀀스 구조의 신경망 모델인 것을 특징으로 하는, 전자 장치.
The method of claim 9, wherein the second neural network model is
An electronic device, characterized in that it is a neural network model of a sequence-to-sequence structure.
사용자로부터 질의를 획득하는 단계;
상기 질의가 입력되면, 상기 질의의 토큰 별 중요도를 결정하고, 상기 결정된 상기 질의의 토큰 별 중요도에 기초하여, 상기 질의 및 상기 질의에 대한 전체 답변의 유사도를 출력하는 제1 신경망 모델로부터 상기 질의의 토큰 별 중요도를 획득하는 단계; 및
상기 질의 및 상기 획득된 질의의 토큰 별 중요도가 입력되면 상기 질의에 대한 답변을 출력하는 제2 신경망 모델에 상기 질의 및 상기 획득된 질의의 토큰 별 중요도를 입력함으로써, 상기 질의에 대한 응답을 생성하는 단계; 를 포함하고,
상기 제2 신경망 모델은,
상기 사용자로부터 질의가 입력되면 상기 사용자로부터 획득한 질의를 인코딩하는 인코더; 및
상기 인코더의 출력 값 및 상기 인코더의 출력 값에 상기 사용자로부터 획득한 질의의 토큰 별 중요도를 반영함으로써 결정되는 인코더 출력 변환 값을 획득하고, 상기 획득된 인코더의 출력 값 및 상기 인코더 출력 변환 값을 디코딩하는 디코더; 를 포함하는 것을 특징으로 하는, 전자 장치가 사용자의 질의에 대한 답변을 제공하는 방법을 수행시키도록 하는 프로그램이 저장된 컴퓨터로 읽을 수 있는 기록 매체.
obtaining a query from a user;
When the query is input, the first neural network model determines the importance of each token of the query, and outputs the similarity of the query and all answers to the query based on the determined importance of each token of the query. acquiring importance for each token; and
When the importance of each token of the query and the obtained query is input, the response to the query is generated by inputting the importance of each token of the query and the obtained query to a second neural network model that outputs an answer to the query step; including,
The second neural network model is
an encoder that encodes a query obtained from the user when a query is input from the user; and
Obtain an encoder output transform value determined by reflecting the importance of each token of the query obtained from the user in the output value of the encoder and the output value of the encoder, and decode the obtained output value of the encoder and the encoder output transform value decoder; A computer-readable recording medium storing a program for causing an electronic device to perform a method of providing an answer to a user's query, comprising:
KR1020200159325A 2020-11-24 2020-11-24 Apparatus for providing query answering based on relation between query and response and method there of KR102464121B1 (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
KR1020200159325A KR102464121B1 (en) 2020-11-24 2020-11-24 Apparatus for providing query answering based on relation between query and response and method there of

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
KR1020200159325A KR102464121B1 (en) 2020-11-24 2020-11-24 Apparatus for providing query answering based on relation between query and response and method there of

Publications (2)

Publication Number Publication Date
KR20220071791A KR20220071791A (en) 2022-05-31
KR102464121B1 true KR102464121B1 (en) 2022-11-04

Family

ID=81780168

Family Applications (1)

Application Number Title Priority Date Filing Date
KR1020200159325A KR102464121B1 (en) 2020-11-24 2020-11-24 Apparatus for providing query answering based on relation between query and response and method there of

Country Status (1)

Country Link
KR (1) KR102464121B1 (en)

Families Citing this family (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
KR102583818B1 (en) * 2022-09-14 2023-10-04 주식회사 글로랑 Method for sampling process of personality test using question and answer network representing group of respondents based on bert
KR102509007B1 (en) * 2022-09-28 2023-03-10 주식회사 액션파워 Method for training speech recognition model based on the importance of tokens in sentences

Citations (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
KR101678787B1 (en) 2015-07-15 2016-12-06 포항공과대학교 산학협력단 Method for automatic question-answering and apparatus therefor
KR101891492B1 (en) 2017-11-03 2018-08-24 주식회사 머니브레인 Method and computer device for providing contextual natural language conversation by modifying plain response, and computer readable recording medium

Family Cites Families (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
KR102297849B1 (en) * 2018-11-28 2021-09-03 한국과학기술원 Question answering system for finding correct sentence and training method thereof
KR102106250B1 (en) 2020-02-25 2020-05-06 주식회사 자이냅스 An apparatus for rule-based user inference reasoning for conversation awareness

Patent Citations (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
KR101678787B1 (en) 2015-07-15 2016-12-06 포항공과대학교 산학협력단 Method for automatic question-answering and apparatus therefor
KR101891492B1 (en) 2017-11-03 2018-08-24 주식회사 머니브레인 Method and computer device for providing contextual natural language conversation by modifying plain response, and computer readable recording medium

Non-Patent Citations (1)

* Cited by examiner, † Cited by third party
Title
이우인, 송광호, 심규석, 질의응답 시스템에서 처음 보는 단어의 역문헌빈도 기반 단어 임베딩 기법, Journal of KIISE, Vol. 43, No. 8, pp. 902-909, 2016. 8. 1부.*

Also Published As

Publication number Publication date
KR20220071791A (en) 2022-05-31

Similar Documents

Publication Publication Date Title
US20210327428A1 (en) Adversarial learning and generation of dialogue responses
CN111309889B (en) Method and device for text processing
CN109460463B (en) Model training method, device, terminal and storage medium based on data processing
US20230385560A1 (en) System and Method for Temporal Attention Behavioral Analysis of Multi-Modal Conversations in a Question and Answer System
US11227581B2 (en) Systems and methods for generating a response based on task-independent conversational responses or task-specific responses
CN111930914B (en) Problem generation method and device, electronic equipment and computer readable storage medium
KR20190125154A (en) An apparatus for machine learning the psychological counseling data and a method thereof
JP7194270B2 (en) Dialogue generation method and device, computer equipment and program
KR102464121B1 (en) Apparatus for providing query answering based on relation between query and response and method there of
CN108470188B (en) Interaction method based on image analysis and electronic equipment
US11995523B2 (en) Systems and methods for determining training parameters for dialog generation
CN116541504B (en) Dialog generation method, device, medium and computing equipment
CN114048301B (en) Satisfaction-based user simulation method and system
CN117494761A (en) Information processing and model training method, device, equipment, medium and program product
CN112163084A (en) Question feedback method, device, medium and electronic equipment
CN117122927A (en) NPC interaction method, device and storage medium
US11393454B1 (en) Goal-oriented dialog generation using dialog template, API, and entity data
CN113761148A (en) Conversation information acquisition method, device, equipment and storage medium
CN117592564A (en) Question-answer interaction method, device, equipment and medium
CN115617972B (en) Robot dialogue method, device, electronic equipment and storage medium
CN116913278A (en) Voice processing method, device, equipment and storage medium
KR20210123545A (en) Method and apparatus for conversation service based on user feedback
TWI754445B (en) Intelligent information processing system and method
CN111310847B (en) Method and device for training element classification model
US20230140480A1 (en) Utterance generation apparatus, utterance generation method, and program

Legal Events

Date Code Title Description
E701 Decision to grant or registration of patent right
GRNT Written decision to grant