WO2024112169A1 - 개체 유형 및 관계 정보에 대한 프롬프트 및 빈칸 추론을 이용한 대화 관계 추출 방법 및 장치 - Google Patents

개체 유형 및 관계 정보에 대한 프롬프트 및 빈칸 추론을 이용한 대화 관계 추출 방법 및 장치 Download PDF

Info

Publication number
WO2024112169A1
WO2024112169A1 PCT/KR2023/019170 KR2023019170W WO2024112169A1 WO 2024112169 A1 WO2024112169 A1 WO 2024112169A1 KR 2023019170 W KR2023019170 W KR 2023019170W WO 2024112169 A1 WO2024112169 A1 WO 2024112169A1
Authority
WO
WIPO (PCT)
Prior art keywords
prompt
model
relationship extraction
extraction model
input
Prior art date
Application number
PCT/KR2023/019170
Other languages
English (en)
French (fr)
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 고려대학교 산학협력단
Publication of WO2024112169A1 publication Critical patent/WO2024112169A1/ko

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F40/00Handling natural language data
    • G06F40/20Natural language analysis
    • G06F40/205Parsing
    • G06F40/211Syntactic parsing, e.g. based on context-free grammar [CFG] or unification grammars
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F40/00Handling natural language data
    • G06F40/20Natural language analysis
    • G06F40/279Recognition of textual entities
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F40/00Handling natural language data
    • G06F40/30Semantic analysis
    • G06F40/35Discourse or dialogue representation
    • 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

Definitions

  • the present invention relates to a conversation-level relationship extraction method, and more specifically, by applying soft prompt and close-style blank reasoning methods for entity type and relationship information to a pre-trained language model to It relates to a method and device for extracting relationships between entities mentioned in.
  • Dialogue-level relationship extraction covered by the present invention is a different task from sentence, multi-sentence, and document relationship extraction.
  • Conversation-level relationship extraction is the task of extracting all relationships between speakers and entities mentioned in the conversation in a text in which multiple speakers speak freely in colloquial language. Since this task deals with relationships that may arise in everyday conversations rather than with knowledge of common sense inference, the relationship between the speaker and the characters in the conversation must be inferred through context.
  • relationship extraction within general sentences and/or documents not only deals with written language, but also allows relationships to be extracted through common sense reasoning rather than context understanding.
  • a sentence such as “Samsung is a Korean company” the relationship between “Samsung” and “Korea” can be sufficiently inferred through external knowledge and common sense inference without understanding the context.
  • conversation-level relationship extraction tasks require us to infer knowledge beyond our common sense through context.
  • the technology applied in the present invention to extract conversation-level relationships is a technology that generates prompts about entity types and relationship information as virtual tokens and inputs them into the system along with the conversation, as well as a blank reasoning method (Masked Language Modeling, MLM) and dictionary learning.
  • MLM Mask Language Modeling
  • This is a relationship extraction learning methodology using a language model.
  • Prompt technology is a methodology that inputs virtual tokens or actual natural language that are assumed to be helpful for the task into the system along with the task to be solved.
  • Prompt technology is a methodology that allows you to easily instruct a model to perform tasks without requiring a task-specific layer or additional learning model.
  • Prompts for entity type and relationship information applied in the present invention are provided in the form of virtual tokens along with the input conversation, and can act as a kind of hint when the model extracts relationships in the conversation.
  • Encoder-based pre-trained language models typically learn the context on large corpora using the blank inference method (MLM).
  • MLM blank inference method
  • [MASK] tokens are generally used, some of the input tokens are replaced with [MASK] tokens, and the model is pre-trained by restoring the replaced tokens.
  • additional neural network layers are added and fine-tuning is performed on a small task-specific corpus.
  • a methodology that has recently emerged with prompt technology models the task by providing the prompt virtual token, the task token to be solved, and the [MASK] token as input to the model, and then matching the tokens related to the task.
  • This methodology is effective because the blank reasoning method used in pre-training is applied to subtasks almost as is, so the neural network does not need to adapt to new tasks.
  • the present invention proposes a methodology for modeling conversation-level relationship extraction without an additional neural network layer using this blank inference learning methodology.
  • the method of generating an interactive relationship extraction model is performed by a computing device including at least a processor, and generates a conversation, a subject, and an object, each including utterances by a plurality of speakers. It includes receiving examples containing an object, generating an input for each of the examples, and learning a pre-trained language model (PLM) using the input.
  • a computing device including at least a processor, and generates a conversation, a subject, and an object, each including utterances by a plurality of speakers. It includes receiving examples containing an object, generating an input for each of the examples, and learning a pre-trained language model (PLM) using the input.
  • PLM pre-trained language model
  • relationship inference is possible using only the language model without an additional neural network layer.
  • the model can adapt to the relationship extraction task more efficiently.
  • MLM blank inference method
  • the elements considered in the present invention can take into account difficulties in conversation that cannot be considered in general sentences and documents. For example, in order to solve the characteristics of conversations that are long and have low information density, the present invention predicts key clues of relationships called “triggers.”
  • Figure 1 shows (1) a standard tweaking approach and (2) a prompt-based tweaking approach.
  • Figure 2 is a schematic diagram of a relationship extraction model generation method or relationship extraction method according to an embodiment of the present invention.
  • Figure 3 is a flowchart illustrating a method for generating an interactive relationship extraction model according to an embodiment of the present invention.
  • first or second may be used to describe various components, but the components should not be limited by the terms. The above terms are used only for the purpose of distinguishing one component from another component, for example, without departing from the scope of rights according to the concept of the present invention, a first component may be named a second component and similarly a second component The component may also be named a first component.
  • the dialogue-based relation extraction (DialogRE) task aims to predict relationships between argument pairs (which can be named topic pairs) that appear in a conversation.
  • PLMs pre-trained language models
  • GRASP Guiding model with RelAtional Semantics using Prompt.
  • GRASP includes 1) argument-recognition prompt marker strategy and 2) relational cue detection task.
  • GRASP recorded very high F1 and F1c scores on the DialogRE dataset, despite using only PLMs without any additional layers.
  • Relationship extraction (RE) tasks aim to extract semantic relationships from unstructured text such as sentences, documents, or conversations. Because RE can extract structured relationship information, it plays an important role in information extraction and knowledge base construction. However, the use of sentence-level RE is limited because many relational facts are widely distributed across multiple sentences by one or more speakers within a conversation. Accordingly, the DialogRE task, which includes argument pairs and their corresponding relationships, can be understood as creating a model that captures the underlined meanings scattered within the dialogue, as shown in Table 1.
  • Table 1 shows examples of DialogRE data. Arguments are shown in bold, and triggers are underlined. Arguments and triggers are scattered throughout the entire dialog. In other words, the information density is low. Triggers indirectly determine the correct direction of the relationship.
  • prompt-based tweaking treats the subtask as a masked language modeling (MLM) problem by directly generating a textual response to a given template.
  • MLM masked language modeling
  • prompt-based tweaking updates the original input based on a template and predicts label words with the [MASK] token.
  • a set of label words is mapped to a class set by a specific mapping function.
  • the model maps the predicted label words to a set of corresponding task-specific classes.
  • the prompt-based fine-tuning approach does not show sufficient performance compared to the fine-tuning-based approach. In the present invention, this was determined to be due to 1) the high frequency of person-pronouns and 2) the low information density by multiple speakers. Therefore, a prompt-based tweaking approach needs to understand the relationships between arguments.
  • GRASP Guard model with RelAtional Semantics using Prompt
  • APM argument-aware prompt marking
  • RCD relational clue detection
  • the APM strategy guides the model to important arguments scattered within the dialog by carefully considering arguments.
  • the proposed RCD task forces the model to consider important relationship clues.
  • the model is trained to determine whether each token in a conversation belongs to a subject, object, or trigger.
  • Figure 2 is a schematic diagram of a relationship extraction model generation method or relationship extraction method according to an embodiment of the present invention.
  • PLM Pre-trained Language Model
  • MLM Masked Language Modeling
  • Each example X includes a dialogue D, a subject a 1 , and an object a 2 .
  • D is ⁇ s 1 : u 1 , s 2 : u 2 , ... , s N : u N ⁇ .
  • s n is the nth speaker (or speaker) and u n is the corresponding utterance.
  • s n refers to the speaker of the nth utterance u n .
  • D may include information about at least one trigger.
  • T(X) is equal to Equation 1.
  • the present invention constructs the template function T′( ⁇ ) by applying two steps.
  • the two steps include converting D to D' with an argument-aware prompt marker and prompt initialization for [subj] and [obj]. A detailed description of these two steps will be provided later. Additionally, the present invention proposes a relationship clue extraction technique.
  • the present invention proposes an APM strategy that considers both speakers and non-speakers.
  • dialogue is encoded by focusing on speaker information, without focusing on non-speaker arguments.
  • approximately 77.4% of relation triples contain at least one non-speaker argument, suggesting that consideration of non-speaker arguments is essential to improve the model's argument recognition.
  • the argument-recognition prompt marker token [p] is inserted as an entity marker.
  • Argument-aware prompt markers allow the model to obtain information to determine which tokens are elements for relationship prediction.
  • the feature of [p] is initialized by embedding a space token in the model dictionary. According to experiments, blank tokens can detect the start position of arguments. Therefore, the proposed prompt marker allows us to determine which parts of the conversation play an important role in predicting relationships.
  • [S 1 ] and [S 2 ] are special tokens for speakers.
  • [S 1 ] and [S 2 ] are virtual tokens for speaker replacement. also, Is, If satisfies, it is defined as [S m ], otherwise it is defined as a m .
  • APM( ⁇ ) encodes an utterance by inserting a virtual token [p] in front of each argument token. Conversations Built by BERTs Regarding, in the present invention By applying APM(u n ) to each utterance within creates . Therefore, the APM strategy is based on creates . This is expressed as Equation 3.
  • APM( ⁇ ) encodes the text "I am Tom Gordon” as [I, am, [p], Tom, Gordon] by inserting [p] in front of "Tom Gordon”.
  • Input of the pre-trained language model through the operations described above. This can be created.
  • the constructed (or generated) input X' is updated with a template function and initialization is performed.
  • the present invention uses a prior distribution of argument types for initialization.
  • Prompt tokens [subj] and [obj] are used to inject argument-type information.
  • PER means a person
  • ORG means an organization
  • GPE means a place
  • VALUE means numerical information
  • STRING means other types.
  • the distributions ⁇ [subj] and ⁇ [obj] of argument types for AT are calculated by using frequency statistics.
  • the prior distribution is calculated from the learning corpus for the defined type.
  • An exemplary initialization formula is shown in Equation 4.
  • Equation 4 e( ⁇ ) is the embedding from PLM for the input token, is the initialized embedding of the prompt token (in other words, it can refer to the embedding initialization function of the pretrained language model).
  • the embeddings of [subj] and [obj] are calculated using the prior distribution for the entity types of the subject and object and initialized in the embedding layer of the language model.
  • the initial embedding of the token is a weighted average, i.e. It can be calculated as
  • Equation 5 T′( ⁇ ), which converts X′ into X′ prompt .
  • V rel is defined as a set of label words in the dictionary of the model, that is, a set of labeled words, as shown in FIG. 2.
  • metadata for initializing each relationship expression can be used to inject meaning.
  • the present invention creates a virtual token [per:date_of_birth] and maps it to the same unit as the target of the [MASK] token.
  • the embedding of [per:date_of_birth] calculates the average value of the embeddings of “person”, “date”, “of”, and “birth”, Initialize using a function. This operation is performed on all relationships existing in the corpus to generate and initialize the final 36 virtual relationship tokens.
  • RCD predicts whether each input token is a subject ([subject]), an object ([object]), a trigger ([trigger], a relationship clue), or another token ([outside]).
  • V rcd ⁇ [subject],[object],[trigger],[outside] ⁇ and add them to the dictionary of the model.
  • C rcd is constructed as ⁇ [subject],[trigger],[object] ⁇ .
  • “Pheebs” is the subject
  • “LA” is the object argument
  • “lives in” is the trigger.
  • the RCD task uses the MLM head, which is used to predict [MASK] tokens. Except for the [MASK] token, each token is sequentially tagged with V rcd using metadata provided in the dataset. In other words, the RCD task allows the model to identify which non-[MASK] tokens are associated with a particular relational cue type. RCD helps the model gather scattered information from the entire conversation by indicating where to focus within the conversation to predict relationships. In this respect, the model pays considerable attention to semantic clues of relationships, such as triggers. Additionally, the proposed model has low complexity by performing the RCD task without an additional classifier. The loss of the RCD task for each token x ⁇ X′ prompt is given in Equation 6.
  • the position of the trigger is marked using the [p] token, i.e. the argument-aware prompt marker.
  • the model predicts the label words of V rcd for all non-[MASK] tokens. Additionally, [p] is inserted in front of the word predicted as a trigger to learn the model to identify key clues in determining the relationship.
  • M rel Y ⁇ V rel is a mapping function that converts the class set Y to the set of label words V rel (in other words, a function that maps relational tokens corresponding to [MASK] tokens).
  • V rel a mapping function that converts the class set Y to the set of label words V rel (in other words, a function that maps relational tokens corresponding to [MASK] tokens).
  • the learning objective of relationship prediction is to minimize Equation 7.
  • the objective function in Equation 7 promotes the model in MLM to match the virtual relationship token corresponding to the [MASK] token included in the X′ prompt .
  • the GRASP model was developed by using the joint loss expressed in Equations 6 and 7. Multi-task learning can be introduced. Therefore, the final learning goal is to minimize the combination loss in Equation 8.
  • ⁇ 1 and ⁇ 2 are hyperparameters.
  • FIG. 3 is a flowchart illustrating a method for generating a relationship extraction model according to an embodiment of the present invention.
  • the relationship extraction model creation method which may also be named a relationship extraction method or the like, may be performed by a computing device that includes at least a processor and/or memory. Accordingly, at least some of the steps configuring the relationship extraction model generation method may be understood as operations of a processor included in the computing device.
  • Computing devices may include personal computers (PCs), servers, tablet PCs, smartphones, head mounted devices (HMDs), navigation systems, smart glasses, smart watches, etc.
  • each of the examples includes a dialog, a subject, and an object. Additionally, each of the examples may include at least one trigger.
  • input corresponding to each of the examples may be generated (S120).
  • the input can be created using a template function, and since the specific input creation process is the same as the above-described process, the detailed description will be omitted.
  • a pre-trained language model can be learned using the generated input (S130).
  • learning may proceed in the direction of minimizing the final loss (L GRASP ), which is the weighted sum of the first loss (L RCD ) and the second loss (L REL ).
  • the device described above may be implemented as a hardware component, a software component, and/or a set of hardware components and software components.
  • devices and components described in the embodiments may include, for example, a processor, a controller, an Arithmetic Logic Unit (ALU), a Digital Signal Processor, a microcomputer, a Field Programmable Array (FPA), It may be implemented using one or more general-purpose or special-purpose computers, such as a Programmable Logic Unit (PLU), microprocessor, or any other device capable of executing and responding to instructions.
  • the processing device may execute an operating system (OS) and one or more software applications running on the operating system. Additionally, a processing device may access, store, manipulate, process, and generate data in response to the execution of software.
  • OS operating system
  • a processing device may access, store, manipulate, process, and generate data in response to the execution of software.
  • a single processing device may be described as being used; however, those skilled in the art will understand that a processing device may include multiple processing elements and/or multiple types of processing elements. It can be seen that it may include.
  • a processing device may include a plurality of processors or one processor and one controller. Additionally, other processing configurations, such as parallel processors, are also possible.
  • Software may include a computer program, code, instructions, or a combination of one or more of these, and may configure a processing unit to operate as desired, or may be processed independently or collectively. You can command the device.
  • Software and/or data may be used on any type of machine, component, physical device, virtual equipment, computer storage medium or device to be interpreted by or to provide instructions or data to a processing device. , or may be permanently or temporarily embodied in a transmitted signal wave.
  • Software may be distributed over networked computer systems and thus stored or executed in a distributed manner.
  • Software and data may be stored on one or more computer-readable recording media.
  • the method according to the embodiment may be implemented in the form of program instructions that can be executed through various computer means and recorded on a computer-readable medium.
  • the computer-readable medium may include program instructions, data files, data structures, etc., singly or in combination.
  • Program instructions recorded on the medium may be specially designed and configured for the embodiment or may be known and available to those skilled in the art of computer software.
  • Examples of computer-readable recording media include magnetic media such as hard disks, floppy disks, and magnetic tapes, optical media such as CD-ROMs and DVDs, and magnetic media such as floptical disks.
  • program instructions include machine language code, such as that produced by a compiler, as well as high-level language code that can be executed by a computer using an interpreter, etc.
  • the hardware devices described above may be configured to operate as one or more software modules to perform the operations of the embodiments, and vice versa.

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • General Health & Medical Sciences (AREA)
  • Health & Medical Sciences (AREA)
  • Artificial Intelligence (AREA)
  • Computational Linguistics (AREA)
  • General Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • Audiology, Speech & Language Pathology (AREA)
  • Biomedical Technology (AREA)
  • Molecular Biology (AREA)
  • Computing Systems (AREA)
  • Evolutionary Computation (AREA)
  • Data Mining & Analysis (AREA)
  • Mathematical Physics (AREA)
  • Software Systems (AREA)
  • Biophysics (AREA)
  • Life Sciences & Earth Sciences (AREA)
  • Machine Translation (AREA)

Abstract

개체 유형 및 관계 정보에 대한 프롬프트 및 빈칸 추론을 이용한 대화형 관계 추출 모델 생성 방법이 개시된다. 상기 대화형 관계 추출 모델 생성 방법은 적어도 프로세서를 포함하는 컴퓨팅 장치에 의해 수행되고, 각각이 복수의 화자들에 의한 발화들을 포함하는 대화, 서브젝트(subject), 및 오브젝트(object)를 포함하는 예제들을 수신하는 단계, 상기 예제들 각각에 대한 입력을 생성하는 단계, 및 상기 입력을 이용하여 사전학습 언어 모델(Pre-trained Language Model, PLM)을 학습하는 단계를 포함한다.

Description

개체 유형 및 관계 정보에 대한 프롬프트 및 빈칸 추론을 이용한 대화 관계 추출 방법 및 장치
본 발명은 대화 수준 관계 추출 방법에 관한 것이며, 보다 상세하게는 개체 유형 및 관계 정보에 대한 소프트 프롬프트(Soft prompt) 및 클로우즈 스타일(cloze-style) 빈칸 추론 방법을 사전학습 언어 모델에 적용하여 대화 속에서 언급된 개체 사이의 관계를 추출하는 방법 및 장치에 관한 것이다.
본 발명에서 다루는 대화 수준 관계 추출(Dialogue-level Relation Extraction)은 문장, 다중 문장 및 문서 관계 추출과는 다른 작업이다. 대화 수준 관계 추출은 다중 발화자가 구어체로 자유롭게 발화하는 텍스트 속에서 발화자 및 대화 속에서 언급된 개체들 사이의 모든 관계를 추출하는 작업이다. 이 작업은 상식 추론에 대한 지식보다는 일상 대화에서 발생할 수 있는 관계를 다루기 때문에, 발화자와 대화 속 등장인물에 대한 관계를 문맥을 통해서 추론해야 한다.
그에 반해서, 일반적인 문장 및/또는 문서 내에서의 관계 추출은 문어체를 다룰 뿐더러, 문맥 이해보다는 상식 추론을 통해서 관계 추출이 가능하다. 예컨대, "삼성은 대한민국의 기업이다"와 같은 문장에서 "삼성"과 "대한민국"의 관계는 문맥 이해 없이도, 외부 지식 및 상식 추론을 통해서 충분히 추론이 가능하다. 반면에, 대화 수준 관계 추출 작업에서는 우리가 상식으로 알지 못하는 범위의 지식을 문맥을 통해 추론해야 한다.
본 발명에서 대화 수준 관계 추출을 위해 적용한 기술은 개체 유형과 관계 정보에 대한 프롬프트를 가상의 토큰으로 생성하여 대화와 함께 시스템에 입력하는 기술과, 빈칸 추론 방법(Masked Language Modeling, MLM)과 사전학습 언어 모델을 이용한 관계 추출 학습 방법론이다. 프롬프트 기술은 작업에 도움이 된다고 가정하는 가상의 토큰 혹은 실제 자연어를 해결하고자 하는 작업과 함께 시스템에 입력하는 방법론이다. 프롬프트 기술은 작업에 특화되는 계층이나 추가 학습 모델 없이도, 모델에게 쉽게 작업을 지시할 수 있는 방법론이다. 본 발명에서 적용한 개체 유형과 관계 정보에 대한 프롬프트는 입력 대화와 함께 가상의 토큰의 형태로 제공되며, 모델이 대화 속 관계를 추출할 때 일종의 힌트로써 작용할 수 있다.
인코더 기반 사전학습 언어 모델은 일반적으로 빈칸 추론 방법(MLM)을 대규모 말뭉치에 대해 문맥을 학습한다. 자세히는, 빈칸 추론 학습을 위해서, 일반적으로 [MASK] 토큰을 사용하고, 입력 토큰의 일부를 [MASK] 토큰으로 치환한 뒤, 모델이 치환된 토큰을 복원하는 방식으로 사전 학습된다. 일반적으로, 이렇게 사전학습된 모델을 원하는 작업에 맞도록 수정하기 위해서 추가 신경망 계층을 추가하여 소규모 작업 특화 말뭉치에 미세조정 학습(Fine-tuning)을 한다.
하지만, 최근 프롬프트 기술과 함께 떠오르는 방법론은 프롬프트 가상 토큰과 해결하고자 하는 작업 토큰, 그리고 [MASK] 토큰을 모델에 입력으로 제공한 뒤, 작업과 관련된 토큰을 맞추게 하는 방법으로 작업을 모델링한다. 이 방법론은 사전학습에서 사용한 빈칸 추론 방법을 거의 그대로 하위 작업에 응용하기 때문에, 신경망이 새로운 작업에 적응할 필요가 없어 효과적이다. 본 발명은 이 빈칸 추론 학습 방법론을 이용하여 추가적인 신경망 계층 없이도 대화 수준 관계 추출을 모델링하는 방법론을 제안한다.
종래 기술에서는 최근의 기술인 사전학습 언어모델을 활용하긴 하나, 프롬프트를 적용하거나 빈칸 추론 방법론(MLM)을 이용해서 관계 추론을 하는 발명기술은 찾아보기 힘들다. 또한, 일반적인 문장 수준, 다중 문장 및 문서 수준의 관계 추출에 대한 기술은 많으나, 대화 수준의 관계 추출을 다루는 기술은 거의 없다.
본 발명에서는 대화 수준 관계 추출 작업에서 사전학습 언어 모델을 보다 효과적으로 활용할 수 있는 빈칸 추론 방법론(MLM)과, 관계 추론에 힌트를 제공하는 프롬프트 방법론을 적용하여 복잡한 모델링 없이 언어 모델을 활용하는 방법만을 바꾸어 효율적인 대화 관계 추출을 할 수 있다.
본 발명의 일 실시예에 따른 대화형 관계 추출 모델 생성 방법은 적어도 프로세서를 포함하는 컴퓨팅 장치에 의해 수행되고, 각각이 복수의 화자들에 의한 발화들을 포함하는 대화, 서브젝트(subject), 및 오브젝트(object)를 포함하는 예제들을 수신하는 단계, 상기 예제들 각각에 대한 입력을 생성하는 단계, 및 상기 입력을 이용하여 사전학습 언어 모델(Pre-trained Language Model, PLM)을 학습하는 단계를 포함한다.
사전학습 언어 모델에 입력 대화와 개체 유형과 관계 정보에 대한 프롬프트를 함께 제공하고, 빈칸 추론 방식으로 관계 단어를 예측하는 본 발명의 방법론을 통해서 추가적인 신경망 계층 없이 언어 모델만을 이용하여 관계 추론이 가능하다.
개체 유형과 관계 정보에 대한 프롬프트를 정의하기 위하여 사전 분포를 활용하는 방법론은 모델이 관계를 추론하는 데에 도움이 되는 유용한 정보이다.
사전학습 언어 모델이 사전학습을 할 때 사용하는 빈칸 추론 방법(MLM)을 관계 추론할 때 재사용함으로써 모델이 관계 추출 작업에 보다 효율적으로 적응할 수 있다.
본 발명에서 고려한 요소들은 일반적인 문장, 문서에서 고려하지 못하는 대화의 어려움을 고려할 수 있다. 예컨대, 길이가 길어서 정보의 밀도가 낮은 대화의 특성을 해결하기 위하여 본 발명은 "트리거(trigger)"라고 불리는 관계의 핵심 단서를 예측한다.
도 1은 (1) 표준적인 미세조정 접근법과 (2) 프롬프트 기반 미세조정 접근법을 도시한다.
도 2는 본 발명의 일 실시예에 따른 관계 추출 모델 생성 방법 또는 관계 추출 방법의 개략도이다.
도 3은 본 발명의 일 실시예에 따른 대화형 관계 추출 모델 생성 방법을 설명하기 위한 흐름도이다.
본 명세서에 개시되어 있는 본 발명의 개념에 따른 실시예들에 대해서 특정한 구조적 또는 기능적 설명들은 단지 본 발명의 개념에 따른 실시예들을 설명하기 위한 목적으로 예시된 것으로서, 본 발명의 개념에 따른 실시예들은 다양한 형태들로 실시될 수 있으며 본 명세서에 설명된 실시예들에 한정되지 않는다.
본 발명의 개념에 따른 실시예들은 다양한 변경들을 가할 수 있고 여러 가지 형태들을 가질 수 있으므로 실시예들을 도면에 예시하고 본 명세서에서 상세하게 설명하고자 한다. 그러나, 이는 본 발명의 개념에 따른 실시예들을 특정한 개시 형태들에 대해 한정하려는 것이 아니며, 본 발명의 사상 및 기술 범위에 포함되는 모든 변경, 균등물, 또는 대체물을 포함한다.
제1 또는 제2 등의 용어는 다양한 구성 요소들을 설명하는데 사용될 수 있지만, 상기 구성 요소들은 상기 용어들에 의해 한정되어서는 안 된다. 상기 용어들은 하나의 구성 요소를 다른 구성 요소로부터 구별하는 목적으로만, 예컨대 본 발명의 개념에 따른 권리 범위로부터 벗어나지 않은 채, 제1 구성 요소는 제2 구성 요소로 명명될 수 있고 유사하게 제2 구성 요소는 제1 구성 요소로도 명명될 수 있다.
어떤 구성 요소가 다른 구성 요소에 "연결되어" 있다거나 "접속되어" 있다고 언급된 때에는, 그 다른 구성 요소에 직접적으로 연결되어 있거나 또는 접속되어 있을 수도 있지만, 중간에 다른 구성 요소가 존재할 수도 있다고 이해되어야 할 것이다. 반면에, 어떤 구성 요소가 다른 구성 요소에 "직접 연결되어" 있다거나 "직접 접속되어" 있다고 언급된 때에는 중간에 다른 구성 요소가 존재하지 않는 것으로 이해되어야 할 것이다. 구성 요소들 간의 관계를 설명하는 다른 표현들, 즉 "~사이에"와 "바로 ~사이에" 또는 "~에 이웃하는"과 "~에 직접 이웃하는" 등도 마찬가지로 해석되어야 한다.
본 명세서에서 사용한 용어는 단지 특정한 실시예를 설명하기 위해 사용된 것으로서, 본 발명을 한정하려는 의도가 아니다. 단수의 표현은 문맥상 명백하게 다르게 뜻하지 않는 한, 복수의 표현을 포함한다. 본 명세서에서, "포함하다" 또는 "가지다" 등의 용어는 본 명세서에 기재된 특징, 숫자, 단계, 동작, 구성 요소, 부분품 또는 이들을 조합한 것이 존재함을 지정하려는 것이지, 하나 또는 그 이상의 다른 특징들이나 숫자, 단계, 동작, 구성 요소, 부분품 또는 이들을 조합한 것들의 존재 또는 부가 가능성을 미리 배제하지 않는 것으로 이해되어야 한다.
다르게 정의되지 않는 한, 기술적이거나 과학적인 용어를 포함해서 여기서 사용되는 모든 용어들은 본 발명이 속하는 기술 분야에서 통상의 지식을 가진 자에 의해 일반적으로 이해되는 것과 동일한 의미를 가진다. 일반적으로 사용되는 사전에 정의되어 있는 것과 같은 용어들은 관련 기술의 문맥상 가지는 의미와 일치하는 의미를 갖는 것으로 해석되어야 하며, 본 명세서에서 명백하게 정의하지 않는 한, 이상적이거나 과도하게 형식적인 의미로 해석되지 않는다.
이하, 본 명세서에 첨부된 도면들을 참조하여 본 발명의 실시예들을 상세히 설명한다. 그러나, 특허출원의 범위가 이러한 실시예들에 의해 제한되거나 한정되는 것은 아니다. 각 도면에 제시된 동일한 참조 부호는 동일한 부재를 나타낸다.
대화 기반 관계 추출(dialogue-based relation extraction, DialogRE) 태스크는 대화에 등장하는 아규먼트 쌍들(agrument pairs, 주제 쌍들로 명명될 수 있음) 사이의 관계를 예측하는 것을 목표로 한다. 대부분의 이전 연구들은 사전학습 언어 모델들(pre-trained language models, PLMs)에 대한 미세조정을 이용한다. 추가적인 레이어의 도입 없이 PLMs의 내재된 지식을 효율적으로 활용하고 아규먼트들 사이의 관계에 대하여 산개된 의미적 단서를 고려하기 위해서, GRASP(Guiding model with RelAtional Semantics using Prompt)로 불리는 기법을 제안한다. 제안 발명에서, 프롬프트 기반 미세조정 접근법을 채용하고 주어진 대화의 관계에 대한 의미적 단서들을 포착한다. 구체적으로, 1) 아규먼트-인지 프롬프트 마커 전략과 2) 관계 단서 탐지 태스크를 포함한다. 실험에 의하면, GRASP는 어떠한 추가적인 레이어를 포함하지 않는 PLMs만을 이용하였음에도 불구하고, DialogRE 데이터셋에 대하여 매우 높은 F1 및 F1c 스코어를 기록하였다.
관계 추출(relation extraction, RE) 태스크는 문장, 문서, 또는 대화와 같은 구조화되지 않은 텍스트로부터 의미적 관계를 추출하는 것을 목표로 한다. RE는 구조화된 관계 정보를 추출할 수 있기 때문에, 정보 추출(information extraction)과 지식 기반 구축(knowledge base construction)에서 중요한 역할을 한다. 그러나, 문장 수준의 RE(sentence-level RE)는 많은 관계적 사실들(relational facts)이 대화 내에서 한 명 이상의 화자에 의한 다수의 문장들에 넓게 분포되어 있기 때문에, 그 사용이 제한된다. 따라서, 아규먼트 쌍들과 이들에 대응하는 관계들을 포함하는 DialogRE 태스크는, 표 1에 나타난 바와 같이, 대화 내에서 산개된 밑줄친 의미들을 캡쳐하는 모델을 생성하는 것으로 이해될 수 있다.
[표 1]
Figure PCTKR2023019170-appb-img-000001
표 1은 DialogRE 데이터의 예를 나타낸다. 아규먼트들은 굵은 글씨로 나타나 있고, 트리거들(triggers)에는 밑줄이 그어져 있다. 아규먼트들과 트리거들은 전체 대화에 산개되어 있다. 즉, 정보 밀도(information density)가 낮다. 트리거들은 올바른 관계의 방향을 간접적으로 결정한다.
PLMs으로부터의 지식을 효율적으로 이용하기 위해서, 프롬프트 기반 미세조정(prompt-based fine-tuning)을 포함하는 몇몇의 연구가 수행되었다. 이들은 사전학습과 미세조정 사이의 갭을 연결하기 위ㅎ여 PLM을 직접 예측기로 이용하고 클로우즈 태스크(cloze task)를 완료하였다. 도 1에 도시된 바와 같이, 프롬프트 기반 미세조정은, 주어진 템플릿에 대한 텍스트 응답(textual response)을 직접 생성함으로써, 하위 태스크를 MLM(masked language modeling) 문제로 취급한다. 특히, 프롬프트 기반 미세조정은 템플릿에 기초하여 오리지널 입력을 업데이트하고, [MASK] 토큰으로 라벨 워드들(label words)을 예측한다. 도 1의 프롬프트 기반 미세조정 접근법에서, 라벨 워드들의 집합은 특정 맵핑 함수에 의해 클래스 집합(class set)으로 맵핑된다. 결국, 모델은 예측된 라벨 워드들을 대응하는 태스크-명시(task-specific) 클래스 집합으로 맵핑한다.
그러나, 프롬프트 기반 미세조정 접근법은 미세조정 기반 접근법에 비해 충분한 성능을 보이지 않는다. 본 발명에서는, 이를 1) 높은 인칭 대명사(person-pronoun)의 빈도와 2) 다수 화자들에 의한 낮은 정보 정보 밀도에 기인한 것으로 판단하였다. 따라서, 프롬프트 기반 미세조정 접근법은 아규먼트들 사이의 관계를 이해할 필요가 있다.
본 발명에서는, GRASP(Guiding model with RelAtional Semantics using Prompt)로 불리는 DialogRE를 위한 새로운 방법을 제안한다. 프롬프트 기반 미세조정 접근법의 장점을 최대화하기 위하여, APM(argument-aware prompt marking, 아규먼트-인지 프롬프트 마킹) 전략과 RCD(relational clue detection, 관계 단서 탐지) 태스크를 제안한다. APM 전략은, 아규먼트들을 신중하게 고려함으로써 모델을 대화 내에서 산개된 중요한 아규먼트들로 안내한다. APM 전략에 덧붙여, 제안된 RCD 태스크는 모델이 중요한 관계 단서들을 고려하도록 한다. 특히, 모델은 대화 내의 각 토큰이 서브젝트(subject, 주어), 오브젝트(object, 목적어), 또는 트리거(trigger)에 속하는지 결정하도록 학습된다.
도 2는 본 발명의 일 실시예에 따른 관계 추출 모델 생성 방법 또는 관계 추출 방법의 개략도이다.
첫번째로, 프롬프트 템플릿(prompt template)을 갖는 입력이 APM 전략을 이용하여 생성된다. 그런 다음, PLM(Pre-trained Language Model)은 프롬프트 기반 미세 조정(prompt-based fine-tuning)을 위해 생성된 입력을 수신하고, PLM의 맥락화된 표현들을 이용함으로써 모델의 사전(vocabulary)의 확률 분포(probability distributions)를 산출(또는 추정)한다(estimate). RCD 태스크는 모델이 각 토큰의 관계 단서 타입(relational clue type)을 예측하도록 하고, 모델은 MLM(Masked Language Modeling) 태스크에서 최종 관계를 예측하기 위해 [MASK] 표현(representation)을 취한다(takes). 다시 말하면, 제안 모델은 아규먼트 쌍에 대한 관계 단서들과 최종 관계 사이의 상호 통신(mutual communication)을 독력하는 멀티태스크 학습을 통해 학습된다.
Problem Formulation
각 예제(example) X는 대화(dialogue) D, 서브젝트(subject) a1, 및 오브젝트(object) a2를 포함한다. D는 {s1 : u1, s2 : u2, …, sN : uN}로 나타낸다. 여기서 sn은 n번째 화자(speaker, 또는 발화자)이고 un은 이에 대응되는 발화(utterance)이다. 즉, sn은 n번째 발화 un의 화자를 의미한다. 또한, D는 적어도 하나의 트리거에 대한 정보를 포함할 수도 있다. X={D,a1,a2}에 대하여, 대화형 관계 추출(dialogue-based relation extraction, DialogRE)의 목적은 D를 이용하여 아규먼트들(a1과 a2, 관계 추출 대상을 의미함) 사이의 관계 y를 예측하는 것이다. 프롬프트 기반 미세 조정과 관련하여 DialogRE을 기술하기 위하여, 각 예제를 Xprompt=T(X)로 맵핑하는 템플릿 함수(template function) T(·)가 정의된다. [MASK]는 Xprompt로 삽입되고, 관계 y의 라벨 워드들(label words)를 예측하기 위해 이용된다. T(X)는 수학식 1과 같다.
[수학식 1]
T(X) = "[CLS] D [SEP] [subj] a1 [subj]
[MASK] [obj] a2 [obj] [SEP]".
T(·)의 구조에 기초하여, 본 발명에서는 두 가지 단계를 적용함으로써 템플릿 함수 T′(·)를 구축한다. 두 가지 단계는 아규먼트-인지 프롬프트 마커(argument-aware prompt marker)로 D를 D′으로 변환하는 단계와 [subj]와 [obj]에 대한 프롬프트 초기화(prompt initialization) 단계를 포함한다. 이 두 가지 단계에 대한 상세한 설명은 후술한다. 또한, 본 발명에서는 관계 단서 추출 기법을 제안한다.
Argument-aware Prompt Marker
본 발명에서는 화자와 비화자(non-speaker)를 모두 고려하는 APM 전략을 제안한다. 이전의 연구들에서, 대화는, 비화자 아규먼트들에 대한 집중 없이, 화자 정보에 집중함으로써 인코딩된다. 그러나, DialogRE 데이터셋에서, 관계 트리플(relation triples)의 약 77.4%가 적어도 하나의 비화자 아규먼트를 포함하고, 이는 모델의 아규먼트 인지를 향상시키기 위해 비화자 아규먼트들에 대한 고려가 필연적임을 암시한다.
본 발명에서는 아규먼트-인지 프롬프트 마커 토큰 [p]를 엔티티 마커(entity marker)로 삽입한다. 아규먼트-인지 프롬프트 마커는, 모델이 어떤 토큰이 관계 예측을 위한 요소인지를 결정하기 위한 정보를 획득하도록 한다. 본 발명에서는 [p]의 특징(feature)을 모델의 사전에서 공백 토큰(space token)의 임베딩으로 초기화한다. 실험에 따르면, 공백 토큰은 아규먼트들(arguments)의 시작 위치(start position)를 감지할 수 있다. 따라서, 제안하는 프롬프트 마커는, 대화의 어떤 부분이 관계를 예측하는 데 중요한 역할을 수행하는지 결정하도록 한다.
제한하는 아규먼트-인지 프롬프트 마커를 이용하여, BERTs(Dian Yu, Kai Sun, Claire Cardie, and Dong Yu. 2020. Dialogue-based relation extraction. In Proceedings of the 58th Annual Meeting of the Association for Computational Linguistics, pages 4927-4940, Online. Association for Computational Linguistics.)의 토큰 교체 방법을 강화하였다. 예제 X에 대하여, BERTs는
Figure PCTKR2023019170-appb-img-000002
를 구축(또는 생성)한다. 여기서,
Figure PCTKR2023019170-appb-img-000003
이고,
Figure PCTKR2023019170-appb-img-000004
는 수학식 2와 같다.
[수학식 2]
Figure PCTKR2023019170-appb-img-000005
[S1]과 [S2]는 화자들을 위한 스페셜 토큰들(special tokens)이다. [S1]과 [S2]는 화자 치환을 위한 가상의 토큰들이다. 또한,
Figure PCTKR2023019170-appb-img-000006
는,
Figure PCTKR2023019170-appb-img-000007
를 만족하면 [Sm]으로, 그렇지 않으면 am으로 정의된다.
BERTs는 모델이 오퍼피팅되는 것을 방지하고 일반적으로 높은 성능을 보이지만, BERTs는 비화자 아규먼트들을 고려하지 않는다. 고려되지 않은 아규먼트들을 분석하기(explore) 위하여, APM 전략은 DialogRE 태스크에서 아규먼트들의 두 가지 타입 모두를 고려함으로써 BERTs를 확장한다. 본 발명에서는, 가상의 토큰 [p]를 각 아규먼트 토큰의 앞에 삽입함으로써 발화를 인코딩하는 함수 APM(·)을 정의한다. BERTs에 의해 구축된 대화
Figure PCTKR2023019170-appb-img-000008
에 대하여, 본 발명에서는
Figure PCTKR2023019170-appb-img-000009
내의 각 발화에 APM(un)을 적용함으로써
Figure PCTKR2023019170-appb-img-000010
Figure PCTKR2023019170-appb-img-000011
를 생성한다. 따라서, APM 전략은
Figure PCTKR2023019170-appb-img-000012
에 기초하여
Figure PCTKR2023019170-appb-img-000013
를 생성한다. 이를 표현하면 수학식 3과 같다.
[수학식 3]
Figure PCTKR2023019170-appb-img-000014
예컨대, APM(·)은 텍스트 "I am Tom Gordon"을, "Tom Gordon" 앞에 [p]를 삽입하여, [I, am, [p], Tom, Gordon]으로 인코딩한다. 상술한 바와 같은 동작을 통해 사전학습 언어 모델의 입력
Figure PCTKR2023019170-appb-img-000015
이 생성될 수 있다.
Prompt Contruction
본 발명에서는 구축된(또는 생성된) 입력 X′을 템플릿 함수(template function)로 업데이트하고, 초기화를 수행한다. 본 발명에서는 초기화를 위해 아규먼트 타입들의 사전 분포(prior distribution)를 이용한다. 프롬프트 토큰들 [subj]와 [obj]는 아규먼트 타입 정보(argument-type information)를 주입하기 위해 이용된다. 본 발명에서는, 표 1에 도시된 것과 같이 데이터셋 내에서 미리 정의된 타입들을 이용하여, 아규먼트 타입 집합(고려하는 개체의 유형 집합이라 명명될 수도 있음) AT = {"PER," "ORG," "GPE," "VALUE," "STRING"}를 정의한다. 여기서, "PER"은 사람, "ORG"는 조직, "GPE"는 장소, "VALUE"는 수치 정보, "STRING"은 그 외의 유형을 의미한다. 본 발명에서는, 빈도수 통계(frequency statistics)를 이용함으로써, AT에 대한 아규먼트 타입들의 분포 φ[subj] 및 φ[obj]를 계산한다. 즉, 정의된 유형(타입)에 대하여 학습 코퍼스에서 사전 분포를 계산한다. 프롬프트 토큰들 [subj]와 [obj]를 초기화하기 위해, 각 아규먼트 타입 at ∈ AT를 대응하는 사전 분포와 결합한다. 예시적인 초기화 수식은 수학식 4와 같다.
[수학식 4]
Figure PCTKR2023019170-appb-img-000016
수학식 4에서, e(·)는 입력 토큰에 대한 PLM으로부터의 임베딩이고,
Figure PCTKR2023019170-appb-img-000017
는 프롬프트 토큰의 초기화된 임베딩이다(다시 말하면, 사전학습 언어 모델의 임베딩 초기화 함수를 의미할 수 있다). 수학식 4에 따라, 서브젝트와 오브젝트의 개체 유형에 대한 사전 분포를 이용하여 [subj]와 [obj]의 임베딩을 계산하여 언어 모델의 임베딩 계층에 초기화한다. 예시적으로, 서브젝트가 사전 분포 φ[subj] = {"PER":0.5,"ORG":0.5,"GPE":0.0,"VALUE":0.0,"STRING":0.0}를 갖는다고 가정하자. [subj] 토큰의 초기 임베딩은 가중 평균(weighted average), 즉
Figure PCTKR2023019170-appb-img-000018
Figure PCTKR2023019170-appb-img-000019
로 계산될 수 있다.
따라서, X′를 X′prompt로 변환하는 T′(·)를 공식화할 수 있다. X′prompt는 아규먼트-향상된(argument-enhanced) 입력 예이다. 즉, X′prompt = T′(X′)이다. 그런 다음, 프롬프트 기반 미세조정을 위한 최종 입력 구조(최종 토큰 시퀀스)는 수학식 5와 같다.
[수학식 5]
Figure PCTKR2023019170-appb-img-000020
또한, 빈칸 추론 학습을 위한 가상의 관계 토큰을 생성한다. 구체적으로, MLM의 적용에 의한 관계 예측을 위해, Vrel를 도 2에 도시된 바와 같이 모델의 사전 내에서의 라벨 워드들(label words)의 집합, 즉 라벨링된 단어들의 집합으로 정의한다. 구체적으로, 의미를 주입하기 위하여 각 관계 표현의 초기화를 위한 메타데이터를 이용할 수 있다.
예컨대, 모델의 사전에 스페셜 토큰 [per:date_of_birth]를 라벨 워드로 추가하고, 메타데이터 내의 단어의 임베딩을 집속함으로써 이러한 토큰을 초기화할 수 있다. 즉, 클래스 "per:date_of_birth."에 대한 {"person," "date," "of," "birth"}. 다시 말해, "person:date_of_birth"가 정답인 관계의 경우, 본 발명에서는 가상의 토큰 [per:date_of_birth]를 생성하여 [MASK] 토큰의 대상과 같은 단위로 매핑한다. 이 가상의 토큰에 관계적 정보를 부여하기 위하여, [per:date_of_birth]의 임베딩은 "person", "date", "of", "birth"의 임베딩의 평균값을 계산한 뒤,
Figure PCTKR2023019170-appb-img-000021
함수를 이용하여 초기화한다. 이 연산을 코퍼스에 존재하는 모든 관계에 대하여 수행하여, 최종 36개의 가상의 관계 토큰을 생성 및 초기화한다.
Relational Clue Detection(RCD) task
RCD는 각 입력 토큰에 대하여 서브젝트([subject])인지, 오브젝트([object])인지, 트리거([trigger], 관계 단서)인지, 그 외의 토큰([outside])인지를 예측하도록 한다. 즉, 프롬프트 기반 미세조정 접근법을 도입함으로써, 관계 단서(relational clues)에 대한 이해 능력을 향상시키기 위해, RCD 태스크를 제안한다. 라벨 워드들의 집합을 Vrcd = {[subject],[object],[trigger],[outside]}로 정의하고, 모델의 사전에 추가한다. 그러면, X′prompt 내의 각 토큰을 Vrcd로부터의 대응하는 단서 타입 워드에 할당함으로써, RCD를 위한 라벨 워드들의 시퀀스, Crcd를 구축할 수 있다. 예컨대, 토큰 시퀀스가 {"Pheebs","lives in","LA"}로 주어졌을 때, Crcd가 {[subject],[trigger],[object]}와 같이 구축된다. 여기서, "Pheebs"는 서브젝트이고, "LA"는 오브젝트 아규먼트이고, "lives in"는 트리거(trigger)이다.
RCD 태스크는 [MASK] 토큰을 예측하기 위해 사용되는 MLM 헤드(MLM head)를 이용한다. [MASK] 토큰을 제외하고, 각 토큰은 데이터셋 내에 제공되는 메타데이터를 이용하여 순차적으로 Vrcd로 태그된다. 다시 말하면, RCD 태스크는 모델이, 어떤 비-[MASK] 토큰들이 특정 관계 단서 타입과 관련있는지를 식별할 수 있도록 한다. RCD는 관계를 예측하기 위해서 대화 내의 집중해야 하는 곳을 가르킴으로써, 모델이 전체 대화로부터 산개된 정보를 수집하는 것을 지원한다. 이 점에서, 모델은 트리거와 같은 관계의 의미적 단서에 상당한 주의를 기울인다. 또한, 제안 모델은 추가적인 분류기를 구비하지 않고 RCD 태스크를 수행함으로써 낮은 복잡도를 갖는다. 각 토큰 x∈X′prompt에 대한 RCD 태스크의 손실은 수학식 6과 같다.
[수학식 6]
Figure PCTKR2023019170-appb-img-000022
Model Training
최종 관계 예측 전에, RCD 태스크의 결과에 기초하여, 트리거의 위치를 [p] 토큰, 즉 아규먼트-인지 프롬프트 마커(argument-aware prompt marker)를 이용하여 마크한다. 예제 X′prompt에 대해, 모델은 모든 비-[MASK] 토큰들에 대하여 Vrcd의 라벨 워드들을 예측한다. 또한, [p]는, 모델이 관계를 결정하는 데 핵심적인 단서들을 식별하도록 학습하기 위하여, 트리거로 예측된 단어의 앞에 삽입된다.
Multitask Learning
Mrel : Y → Vrel는 클래스 집합 Y를 라벨 워드들의 집합 Vrel으로 변환하는 맵핑 함수이다(다시 말하면, [MASK] 토큰에 대응하는 관계적 토큰을 매핑해주는 함수). 각 입력 X′prompt에 대하여, MLM의 목적은 [MASK]를 모델의 사전 내의 관계 라벨 워드들로 채우는 것이다. 모델이 올바른 라벨 워드를 [MASK]의 위치에 예측하기 때문에, p(y|x) = P([MASK] = Mrel(y)|X′prompt)를 공식화할 수 있다. 관계 예측의 학습 목적은 수학식 7을 최소화하는 것이다. 즉, 수학식 7의 목적 함수는 MLM에서 모델이 X′prompt에 포함된 [MASK] 토큰에 대응하는 가상의 관계 토큰을 맞출 수 있도록 촉진한다.
[수학식 7]
Figure PCTKR2023019170-appb-img-000023
관계 예측을 위한 MLM 태스크와 RCD 태스크 사이의 상호 작용을 통해 관계 단서를 챕쳐하는 모델의 능력을 향상시키기 위하여, 수학식 6과 수학식 7에 표현된 결합 손실(joint loss)를 이용함으로써, GRASP 모델을 학습하는 멀티태스크 학습을 도입할 수 있다. 따라서, 최종 학습 목적은 수학식 8의 결합 손실을 최소화하는 것이다. 여기서 λ1과 λ2는 하이퍼파라미터들이다.
[수학식 8]
Figure PCTKR2023019170-appb-img-000024
도 3은 본 발명의 일 실시예에 따른 관계 추출 모델 생성 방법을 설명하기 위한 흐름도이다. 관계 추출 방법 등으로 명명될 수도 있는 관계 추출 모델 생성 방법은 적어도 프로세서(processor) 및/또는 메모리(memory)를 포함하는 컴퓨팅 장치에 의해 수행될 수 있다. 따라서, 관계 추출 모델 생성 방법을 구성하는 단계들 중 적어도 일부는 컴퓨팅 장치에 포함된 프로세서의 동작으로 이해될 수도 있다. 컴퓨팅 장치는 PC(Personal Computer), 서버(server), 태블릿 PC, 스마트폰, HMD(Head Mounted Device), 내비게이션 시스템, 스마트 안경(smart glasses), 스마트 와치(smart watch) 등을 포함할 수 있다.
우선, 학습 코퍼스를 이루는 예제들이 수신된다(S110). 예제들 각각은 대화, 서브젝트(subject), 및 오브젝트(object)를 포함한다. 또한, 예제들 각각은 적어도 하나의 트리거(trigger)를 포함할 수 있다.
다음으로, 예제들 각각에 대응하는 입력이 생성될 수 있다(S120). 입력은 템플릿 함수를 이용하여 생성될 수 있으며, 구체적인 입력 생성 과정은 상술한 과정과 동일하기 때문에, 그 구체적인 설명은 생략하기로 한다.
마지막으로, 생성된 입력을 이용하여 사전학습 언어 모델(Pre-trained Language Model)을 학습할 수 있다(S130). 여기서, 제1 손실(LRCD)과 제2 손실(LREL)의 가중합인 최종 손실(LGRASP)을 최소화하는 방향으로 학습이 진행될 수 있다.
또한, 학습 코퍼스를 이용하여 사전학습 언어 모델을 학습하기 이전에 [subj]와 [obj] 등의 임베딩을 초기화하는 동작 및/또는 (가상의) 관계 토큰을 생성하고 초기화하는 동작 등이 수행될 수 있다.
이상에서 설명된 장치는 하드웨어 구성 요소, 소프트웨어 구성 요소, 및/또는 하드웨어 구성 요소 및 소프트웨어 구성 요소의 집합으로 구현될 수 있다. 예를 들어, 실시예들에서 설명된 장치 및 구성 요소는, 예를 들어, 프로세서, 콘트롤러, ALU(Arithmetic Logic Unit), 디지털 신호 프로세서(Digital Signal Processor), 마이크로컴퓨터, FPA(Field Programmable array), PLU(Programmable Logic Unit), 마이크로프로세서, 또는 명령(instruction)을 실행하고 응답할 수 있는 다른 어떠한 장치와 같이, 하나 이상의 범용 컴퓨터 또는 특수 목적 컴퓨터를 이용하여 구현될 수 있다. 처리 장치는 운영 체제(Operation System, OS) 및 상기 운영 체제 상에서 수행되는 하나 이상의 소프트웨어 애플리케이션을 수행할 수 있다. 또한, 처리 장치는 소프트웨어의 실행에 응답하여, 데이터를 접근, 저장, 조작, 처리 및 생성할 수도 있다. 이해의 편의를 위하여, 처리 장치는 하나가 사용되는 것으로 설명된 경우도 있지만, 해당 기술 분야에서 통상의 지식을 가진 자는, 처리 장치가 복수 개의 처리 요소(Processing Element) 및/또는 복수 유형의 처리 요소를 포함할 수 있음을 알 수 있다. 예를 들어, 처리 장치는 복수 개의 프로세서 또는 하나의 프로세서 및 하나의 콘트롤러를 포함할 수 있다. 또한, 병렬 프로세서(Parallel Processor)와 같은, 다른 처리 구성(Processing Configuration)도 가능하다.
소프트웨어는 컴퓨터 프로그램(Computer Program), 코드(Code), 명령(Instruction), 또는 이들 중 하나 이상의 조합을 포함할 수 있으며, 원하는 대로 동작하도록 처리 장치를 구성하거나 독립적으로 또는 결합적으로(Collectively) 처리 장치를 명령할 수 있다. 소프트웨어 및/또는 데이터는, 처리 장치에 의하여 해석되거나 처리 장치에 명령 또는 데이터를 제공하기 위하여, 어떤 유형의 기계, 구성 요소(Component), 물리적 장치, 가상 장치(Virtual Equipment), 컴퓨터 저장 매체 또는 장치, 또는 전송되는 신호 파(Signal Wave)에 영구적으로, 또는 일시적으로 구체화(Embody)될 수 있다. 소프트웨어는 네트워크로 연결된 컴퓨터 시스템 상에 분산되어서, 분산된 방법으로 저장되거나 실행될 수도 있다. 소프트웨어 및 데이터는 하나 이상의 컴퓨터 판독 가능 기록 매체에 저장될 수 있다.
실시예에 따른 방법은 다양한 컴퓨터 수단을 통하여 수행될 수 있는 프로그램 명령 형태로 구현되어 컴퓨터 판독 가능 매체에 기록될 수 있다. 상기 컴퓨터 판독 가능 매체는 프로그램 명령, 데이터 파일, 데이터 구조 등을 단독으로 또는 조합하여 포함할 수 있다. 상기 매체에 기록되는 프로그램 명령은 실시예를 위하여 특별히 설계되고 구성된 것들이거나 컴퓨터 소프트웨어 당업자에게 공지되어 사용 가능한 것일 수도 있다. 컴퓨터 판독 가능 기록 매체의 예에는 하드 디스크, 플로피 디스크 및 자기 테이프와 같은 자기 매체(Magnetic Media), CD-ROM, DVD와 같은 광기록 매체(Optical Media), 플롭티컬 디스크(Floptical Disk)와 같은 자기-광 매체(Magneto-optical Media), 롬(ROM), 램(RAM), 플래시 메모리 등과 같은 프로그램 명령을 저장하고 수행하도록 특별히 구성된 하드웨어 장치가 포함된다. 프로그램 명령의 예에는 컴파일러에 의해 만들어지는 것과 같은 기계어 코드뿐만 아니라 인터프리터 등을 사용해서 컴퓨터에 의해서 실행될 수 있는 고급 언어 코드를 포함한다. 상기된 하드웨어 장치는 실시예의 동작을 수행하기 위해 하나 이상의 소프트웨어 모듈로서 작동하도록 구성될 수 있으며, 그 역도 마찬가지이다.
본 발명은 도면에 도시된 실시예를 참고로 설명되었으나 이는 예시적인 것에 불과하며, 본 기술 분야의 통상의 지식을 가진 자라면 이로부터 다양한 변형 및 균등한 타 실시예가 가능하다는 점을 이해할 것이다. 예를 들어, 설명된 기술들이 설명된 방법과 다른 순서로 수행되거나, 및/또는 설명된 시스템, 구조, 장치, 회로 등의 구성 요소들이 설명된 방법과 다른 형태로 결합 또는 조합되거나, 다른 구성 요소 또는 균등물에 의하여 대치되거나 치환되더라도 적절한 결과가 달성될 수 있다. 따라서, 본 발명의 진정한 기술적 보호 범위는 첨부된 등록청구범위의 기술적 사상에 의해 정해져야 할 것이다.

Claims (7)

  1. 적어로 프로세서(processor)를 포함하는 컴퓨팅 장치에 의해 수행되는 대화형 관계 추출 모델 생성 방법에 있어서,
    각각이 복수의 화자들에 의한 발화들을 포함하는 대화, 서브젝트(subject), 및 오브젝트(object)를 포함하는 예제들을 수신하는 단계;
    상기 예제들 각각에 대응하는 입력을 생성하는 단계; 및
    상기 입력을 이용하여 사전학습 언어 모델(Pre-trained Language Model, PLM)을 학습하는 단계를 포함하는 대화형 관계 추출 모델 생성 방법.
  2. 제1항에 있어서,
    상기 예제들 각각은 상기 서브젝트와 상기 오브젝트의 관계에 대한 트리거(trigger)를 포함하는,
    대화형 관계 추출 모델 생성 방법.
  3. 제2항에 있어서,
    상기 입력을 생성하는 단계는,
    상기 대화 내의 상기 서브젝트 및 상기 오브젝트의 앞에 엔티티 마커(entity marker)를 삽입하는 단계를 포함하는,
    대화형 관계 추출 모델 생성 방법.
  4. 제3항에 있어서,
    상기 입력을 생성하는 단계는,
    상기 대화 내의, 상기 서브젝트와 동일한 화자를 화자를 위한 제1 스페셜 토큰으로 치환하는 단계; 및
    상기 대화 내의, 상기 오브젝트와 동일한 화자를 화자를 위한 제2 스페셜 토큰으로 치환하는 단계를 포함하는,
    대화형 관계 추출 모델 생성 방법.
  5. 제4항에 있어서,
    상기 학습하는 단계는, 제1 손실(LRCD)과 제2 손실(LREL)의 가중합인 최종 손실(LGRASP)을 최소하도록 상기 PLM을 학습하고,
    상기 최종 손실은
    Figure PCTKR2023019170-appb-img-000025
    이고,
    상기 λ1과 λ2는 미리 정의된 하이퍼파라미터인,
    대화형 관계 추출 모델 생성 방법.
  6. 제5항에 있어서,
    상기 제1 손실은
    Figure PCTKR2023019170-appb-img-000026
    이고,
    상기 X′prompt는 상기 입력을 나타낸고,
    상기 Crcd는 라벨 워드들의 시퀀스인,
    대화형 관계 추출 모델 생성 방법.
  7. 제6항에 있어서,
    상기 제2 손실은
    Figure PCTKR2023019170-appb-img-000027
    이고,
    상기 Mrel은 클래스 집합(Y)를 라벨 워드들의 집합(Vrel)으로 변환하는 맵핑 함수인,
    대화형 관계 추출 모델 생성 방법.
PCT/KR2023/019170 2022-11-24 2023-11-24 개체 유형 및 관계 정보에 대한 프롬프트 및 빈칸 추론을 이용한 대화 관계 추출 방법 및 장치 WO2024112169A1 (ko)

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
KR1020220158972A KR20240076977A (ko) 2022-11-24 2022-11-24 개체 유형 및 관계 정보에 대한 프롬프트 및 빈칸 추론을 이용한 대화 관계 추출 방법 및 장치
KR10-2022-0158972 2022-11-24

Publications (1)

Publication Number Publication Date
WO2024112169A1 true WO2024112169A1 (ko) 2024-05-30

Family

ID=91196419

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/KR2023/019170 WO2024112169A1 (ko) 2022-11-24 2023-11-24 개체 유형 및 관계 정보에 대한 프롬프트 및 빈칸 추론을 이용한 대화 관계 추출 방법 및 장치

Country Status (2)

Country Link
KR (1) KR20240076977A (ko)
WO (1) WO2024112169A1 (ko)

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20170103753A1 (en) * 2014-03-27 2017-04-13 Microsoft Technology Licensing, Llc Flexible schema for language model customization
KR20200033707A (ko) * 2018-09-20 2020-03-30 삼성전자주식회사 전자 장치, 및 이의 학습 데이터 제공 또는 획득 방법
CN114528383A (zh) * 2021-12-29 2022-05-24 阿里云计算有限公司 基于对比学习的预训练语言模型处理方法和智能问答系统
JP2022547631A (ja) * 2019-09-16 2022-11-14 オラクル・インターナショナル・コーポレイション 自然言語処理のためのストップワードデータ拡張

Family Cites Families (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
KR102186326B1 (ko) 2017-09-28 2020-12-04 한국과학기술원 구조 정보 선행 학습을 통한 딥러닝 관계 추출 시스템 및 이를 이용한 딥러닝 관계 추출 성능 향상 방법
KR102405578B1 (ko) 2020-03-10 2022-06-03 연세대학교 산학협력단 지식 그래프를 이용한 상황 인지형 다중 문장 관계 추출 방법 및 장치
KR102511282B1 (ko) 2020-12-11 2023-03-17 건국대학교 산학협력단 문서 수준 관계 추출 방법 및 장치

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20170103753A1 (en) * 2014-03-27 2017-04-13 Microsoft Technology Licensing, Llc Flexible schema for language model customization
KR20200033707A (ko) * 2018-09-20 2020-03-30 삼성전자주식회사 전자 장치, 및 이의 학습 데이터 제공 또는 획득 방법
JP2022547631A (ja) * 2019-09-16 2022-11-14 オラクル・インターナショナル・コーポレイション 自然言語処理のためのストップワードデータ拡張
CN114528383A (zh) * 2021-12-29 2022-05-24 阿里云计算有限公司 基于对比学习的预训练语言模型处理方法和智能问答系统

Non-Patent Citations (1)

* Cited by examiner, † Cited by third party
Title
SON JUNYOUNG, KIM JINSUNG; LIM JUNGWOO; LIM HEUISEOK: "GRASP: Guiding model with RelAtional Semantics using Prompt for Dialogue Relation Extraction", PROCEEDINGS OF THE 29TH INTERNATIONAL CONFERENCE ON COMPUTATIONAL LINGUISTICS., 1 October 2022 (2022-10-01) - 17 October 2022 (2022-10-17), pages 412 - 423, XP093173134 *

Also Published As

Publication number Publication date
KR20240076977A (ko) 2024-05-31

Similar Documents

Publication Publication Date Title
Kalyan et al. Ammus: A survey of transformer-based pretrained models in natural language processing
Kalyan et al. AMMU: a survey of transformer-based biomedical pretrained language models
Zhang et al. Top-down tree long short-term memory networks
WO2022068627A1 (zh) 一种数据处理方法及相关设备
Zha et al. AlignScore: Evaluating factual consistency with a unified alignment function
WO2021132797A1 (ko) 반지도 학습 기반 단어 단위 감정 임베딩과 장단기 기억 모델을 이용한 대화 내에서 발화의 감정 분류 방법
Orosz et al. HuSpaCy: an industrial-strength Hungarian natural language processing toolkit
Guarasci et al. Assessing BERT’s ability to learn Italian syntax: A study on null-subject and agreement phenomena
CN113553418B (zh) 一种基于多模态学习的视觉对话生成方法及装置
Bahcevan et al. Deep neural network architecture for part-of-speech tagging for turkish language
Jiang et al. Modeling coverage with semantic embedding for image caption generation
Zhang et al. Universal multimodal representation for language understanding
Zhang et al. CJE-TIG: Zero-shot cross-lingual text-to-image generation by Corpora-based Joint Encoding
Chen et al. Unidu: Towards a unified generative dialogue understanding framework
Wu et al. Joint intent detection model for task-oriented human-computer dialogue system using asynchronous training
WO2024112169A1 (ko) 개체 유형 및 관계 정보에 대한 프롬프트 및 빈칸 추론을 이용한 대화 관계 추출 방법 및 장치
US20210240503A1 (en) System and method for interactively guiding users through a procedure
Li et al. Cross-lingual transferring of pre-trained contextualized language models
Ahmadnia et al. Knowledge graphs effectiveness in neural machine translation improvement
Yang et al. Bidirectional relation-guided attention network with semantics and knowledge for relational triple extraction
CN115114939A (zh) 翻译模型的训练方法、语句翻译方法、装置、设备、程序
AP et al. Deep learning based deep level tagger for malayalam
WO2022161613A1 (en) Cross-lingual apparatus and method
Zhang et al. Language-agnostic and language-aware multilingual natural language understanding for large-scale intelligent voice assistant application
WO2023095988A1 (ko) 대화 상대방의 성격정보를 고려하여 신뢰도 증강을 위한 맞춤형 대화 생성 시스템 및 그 방법