KR102511282B1 - Method and apparatus for document-level relation extraction - Google Patents
Method and apparatus for document-level relation extraction Download PDFInfo
- Publication number
- KR102511282B1 KR102511282B1 KR1020200173638A KR20200173638A KR102511282B1 KR 102511282 B1 KR102511282 B1 KR 102511282B1 KR 1020200173638 A KR1020200173638 A KR 1020200173638A KR 20200173638 A KR20200173638 A KR 20200173638A KR 102511282 B1 KR102511282 B1 KR 102511282B1
- Authority
- KR
- South Korea
- Prior art keywords
- entity
- encoding
- sentences
- document
- vectors
- Prior art date
Links
Images
Classifications
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F40/00—Handling natural language data
- G06F40/20—Natural language analysis
- G06F40/205—Parsing
- G06F40/211—Syntactic parsing, e.g. based on context-free grammar [CFG] or unification grammars
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F40/00—Handling natural language data
- G06F40/10—Text processing
- G06F40/12—Use of codes for handling textual entities
- G06F40/126—Character encoding
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F40/00—Handling natural language data
- G06F40/20—Natural language analysis
- G06F40/279—Recognition of textual entities
- G06F40/289—Phrasal analysis, e.g. finite state techniques or chunking
Landscapes
- Engineering & Computer Science (AREA)
- Theoretical Computer Science (AREA)
- Health & Medical Sciences (AREA)
- Artificial Intelligence (AREA)
- Audiology, Speech & Language Pathology (AREA)
- Computational Linguistics (AREA)
- General Health & Medical Sciences (AREA)
- Physics & Mathematics (AREA)
- General Engineering & Computer Science (AREA)
- General Physics & Mathematics (AREA)
- Machine Translation (AREA)
Abstract
문서 수준 관계 추출 방법 및 장치가 개시된다. 일 실시예에 따른 문서 수준 관계 추출 방법은 문서를 전처리하여 상기 문서로부터 복수의 문장들을 선별하는 동작; 상기 복수의 문장들에 인코딩을 수행하는 동작; 상기 복수의 문장들에 수행된 인코딩 결과에 기초하여 개체 쌍 인코딩을 수행하는 동작; 상기 복수의 문장들에 수행된 인코딩 결과에 기초하여 관계-문맥 코-어텐션을 수행하는 동작; 및 상기 개체 쌍 인코딩 결과 및 상기 관계-문맥 코-어텐션 결과에 기초하여 상기 복수의 문장들에 존재하는 개체 쌍의 관계를 판별하는 동작을 포함한다.A document level relationship extraction method and apparatus are disclosed. A document-level relationship extraction method according to an embodiment includes pre-processing a document to select a plurality of sentences from the document; encoding the plurality of sentences; performing entity pair encoding based on encoding results performed on the plurality of sentences; performing relational-context co-attention based on an encoding result performed on the plurality of sentences; and determining a relationship between entity pairs present in the plurality of sentences based on the entity pair encoding result and the relationship-context co-attention result.
Description
아래 개시는 문서 수준 관계 추출 방법 및 장치에 관한 것이다.The disclosure below relates to document-level relationship extraction methods and apparatus.
관계 추출은 주어진 문장이나 문서에 존재하는 개체(entity)들 간의 의미적 관계를 찾아내는 작업으로, 개체들 중 서로 연관성을 갖는 개체를 찾아내고 그 관계명을 분별하는 작업을 말하는 것이다.Relationship extraction is a task of finding a semantic relationship between entities existing in a given sentence or document.
최근에, 문서 수준 관계 추출 말뭉치인 DocRED(Document-level Relation Extraction Dataset)가 공개되면서 문서 수준 관계 추출(document-level relation extraction)에 대한 연구가 활발히 진행되고 있다. Recently, with the release of DocRED (Document-level Relation Extraction Dataset), a document-level relation extraction corpus, research on document-level relation extraction is being actively conducted.
표 1은 대표적인 문장 수준 관계 추출 말뭉치인 TACRED(TAC Relation Extraction Dataset)와 문서 수준 관계 추출 말뭉치 DocRED(Document-level Relation Extraction Dataset)를 비교한 것이다.Table 1 compares TACRED (TAC Relation Extraction Dataset), a representative sentence-level relation extraction corpus, and DocRED (Document-level Relation Extraction Dataset), a document-level relation extraction corpus.
[표 1][Table 1]
표 1에서 보이는 바와 같이 문서 수준의 관계 추출은 문장 수준 관계 추출보다 더 많은 부분을 고려해야 한다. 문서에는 문장보다 월등히 많은 수의 개체들이 존재하며 이에 따른 복잡한 형태의 관계들이 존재한다. 또한 문서 수준 관계 추출은 한 문장 내에서 표현된 관계뿐만 아니라 여러 문장에 걸쳐 표현된 관계나 멀리 떨어진 문장 간에 표현된 관계에 대한 추출 방법이 필요하다.As shown in Table 1, document-level relationship extraction requires more consideration than sentence-level relationship extraction. There are far more entities in a document than sentences, and complex relationships exist accordingly. In addition, document-level relationship extraction requires an extraction method not only for relationships expressed within one sentence, but also for relationships expressed across several sentences or between sentences that are far apart.
또한, 사전 학습된 마스크 언어 모델(masked language model(MLM))이 자연어 처리 분야 전체에 영향력을 보이면서 관계 추출에서도 MLM을 사용하는 연구가 진행되고 있다. 그러나, 문서 수준의 관계 추출은 문서의 단위가 길기 때문에 셀프 어텐션(self-attention)을 기반으로 하는 MLM을 사용하면 모델의 계산량이 증가하는 문제가 있다.In addition, as a pre-learned masked language model (MLM) is influential in the entire field of natural language processing, research on using MLM in relation extraction is being conducted. However, since document-level relationship extraction has a long document unit, the use of self-attention-based MLM increases the computational complexity of the model.
실시예들은 관계 추출에 필요한 문장을 선별하는 전처리 기술을 제공할 수 있다.Embodiments may provide a preprocessing technique for selecting sentences necessary for relation extraction.
또한, 실시예들은 문서의 길이에 상관없이 관계 추출에 필요한 어휘 정보를 자동으로 습득할 수 있는 관계-문맥 코-어텐션(Relation-Context Co-attention) 기술을 제공할 수 있다.In addition, embodiments may provide a Relation-Context Co-attention technology capable of automatically acquiring vocabulary information required for relation extraction regardless of the length of a document.
다만, 기술적 과제는 상술한 기술적 과제들로 한정되는 것은 아니며, 또 다른 기술적 과제들이 존재할 수 있다.However, the technical challenges are not limited to the above-described technical challenges, and other technical challenges may exist.
일 실시예에 따른 문서 수준 관계 추출 방법은 문서를 전처리하여 상기 문서로부터 복수의 문장들을 선별하는 동작; 상기 복수의 문장들에 인코딩을 수행하는 동작; 상기 복수의 문장들에 수행된 인코딩 결과에 기초하여 개체 쌍 인코딩을 수행하는 동작; 상기 복수의 문장들에 수행된 인코딩 결과에 기초하여 관계-문맥 코-어텐션을 수행하는 동작; 및 상기 개체 쌍 인코딩 결과 및 상기 관계-문맥 코-어텐션 결과에 기초하여 상기 복수의 문장들에 존재하는 개체 쌍의 관계를 판별하는 동작을 포함한다.A document-level relationship extraction method according to an embodiment includes pre-processing a document to select a plurality of sentences from the document; encoding the plurality of sentences; performing entity pair encoding based on encoding results performed on the plurality of sentences; performing relational-context co-attention based on an encoding result performed on the plurality of sentences; and determining a relationship between entity pairs present in the plurality of sentences based on the entity pair encoding result and the relationship-context co-attention result.
상기 복수의 문장들을 선별하는 동작은 상기 문서에서 관계 추출에 필요한 개체가 존재하는 복수의 문장들을 선별하는 동작을 포함할 수 있다.The operation of selecting the plurality of sentences may include an operation of selecting a plurality of sentences in which an entity necessary for extracting a relationship exists in the document.
상기 개체가 존재하는 복수의 문장들을 선별하는 동작은 상기 문서에서 개체가 존재하는 문장을 검출하여 각 개체마다의 문장 집합을 생성하는 동작; 및 각 객체마다 문장 집합을 비교하여 포함 관계에 해당하는 문장 집합이 존재하면 두 문장 집합 중 더 큰 문장 집합에 다른 하나의 문장 집합을 합하는 동작을 포함할 수 있다.The operation of selecting a plurality of sentences in which the entity exists may include: detecting sentences in which the entity exists in the document and generating a sentence set for each entity; and comparing sentence sets for each object and, if a sentence set corresponding to the inclusion relationship exists, adding one sentence set to a larger sentence set of the two sentence sets.
상기 인코딩을 수행하는 동작은 상기 복수의 문장들에 인코딩을 수행하여 상기 복수의 문장들에 존재하는 복수의 개체들 각각의 개체 인코딩 벡터를 생성하는 동작을 포함할 수 있다.The operation of performing the encoding may include an operation of performing encoding on the plurality of sentences to generate an entity encoding vector of each of a plurality of entities present in the plurality of sentences.
상기 개체 인코딩 벡터를 생성하는 동작은 상기 복수의 문장들에 포함된 전체 단어의 단어 인코딩 벡터들을 생성하는 동작; 상기 단어 인코딩 벡터들에 기초하여 상기 전체 단어 중에서 개체 언급에 해당하는 단어를 이용하여 해당 개체에 대한 언급 인코딩 벡터를 생성하는 동작; 및 상기 해당 개체의 언급 인코딩 벡터 및 상기 해당 개체의 언급 횟수에 기초하여 상기 해당 개체의 개체 인코딩 벡터를 생성하는 동작을 포함할 수 있다.The generating of the entity encoding vectors may include generating word encoding vectors of all words included in the plurality of sentences; generating a reference encoding vector for a corresponding entity by using a word corresponding to the entity reference among the entire words based on the word encoding vectors; and generating an entity encoding vector of the corresponding entity based on the reference encoding vector of the corresponding entity and the number of mentions of the corresponding entity.
상기 개체 쌍 인코딩을 수행하는 동작은 복수의 개체들 각각의 개체 인코딩 벡터를 이용하여 상기 복수의 개체들에 대해 객체 쌍 인코딩을 수행함으로써 복수의 개체들의 모든 개체 쌍 조합에 대한 개체 쌍 인코딩 벡터들을 생성하는 동작을 포함할 수 있다.The operation of performing entity pair encoding generates entity pair encoding vectors for all entity pair combinations of a plurality of entities by performing object pair encoding on the plurality of entities using entity encoding vectors of each of the plurality of entities. action may be included.
상기 개체 쌍 인코딩 벡터를 생성하는 동작은 아래 수학식을 이용하여 상기 개체 쌍 인코딩 벡터를 생성하는 동작을 포함할 수 있다.The operation of generating the entity pair encoding vector may include an operation of generating the entity pair encoding vector using Equation below.
[수학식][mathematical expression]
는 주체 후보 개체에 해당하는 개체 인코딩 벡터이고, 는 객체 후보 개체에 해당하는 개체 인코딩 벡터이고, 는 두 개체 인코딩 벡터의 차의 절대 값을 의미하고, 은 두 개체 인코딩 벡터의 곱을 의미하고, [ ]는 안에 주어진 벡터들을 모두 연결한다는 것일 수 있다. is an entity encoding vector corresponding to a subject candidate entity, is an entity encoding vector corresponding to an object candidate entity, means the absolute value of the difference between the two object encoding vectors, may mean the product of two object encoding vectors, and [ ] may mean connecting all vectors given in it.
상기 관계-문맥 코-어텐션을 수행하는 동작은 상기 단어 인코딩 벡터들 및 관계 라벨 임베딩 벡터들 간의 어텐션을 수행하여 관계-문맥 코-어텐션 벡터들을 생성하는 동작을 포함할 수 있다.The operation of performing the relation-context co-attention may include generating relation-context co-attention vectors by performing attention between the word encoding vectors and relation label embedding vectors.
상기 어텐션은 바이리니어 어텐션(Bilinear attention)을 기반으로 수행되는 것일 수 있다.The attention may be performed based on bilinear attention.
상기 관계를 판별하는 동작은 상기 개체 쌍 인코딩 벡터들 및 관계-문맥 코-어텐션 벡터들 간의 어텐션을 수행하여 개체 쌍의 관계를 추출하는 동작을 포함할 수 있다.The operation of determining the relationship may include extracting the relationship of the entity pair by performing attention between the entity pair encoding vectors and the relationship-context co-attention vectors.
일 실시예에 따른 문서 수준 관계 추출을 수행하는 장치는 하나 이상의 인스트럭션을 저장하는 메모리; 및 상기 인스트럭션을 실행시키기 위한 프로세서를 포함하고, 상기 인스트럭션이 실행될 때, 상기 프로세서는 문서를 전처리하여 상기 문서로부터 복수의 문장들을 선별하는 동작; 상기 복수의 문장들에 인코딩을 수행하는 동작; 상기 복수의 문장들에 수행된 인코딩 결과에 기초하여 개체 쌍 인코딩을 수행하는 동작; 상기 복수의 문장들에 수행된 인코딩 결과에 기초하여 관계-문맥 코-어텐션을 수행하는 동작; 및 상기 개체 쌍 인코딩 결과 및 상기 관계-문맥 코-어텐션 결과에 기초하여 상기 복수의 문장들에 존재하는 개체 쌍의 관계를 판별하는 동작을 수행할 수 있다.An apparatus for performing document-level relationship extraction according to an embodiment includes a memory storing one or more instructions; and a processor for executing the instruction, wherein when the instruction is executed, the processor pre-processes the document to select a plurality of sentences from the document; encoding the plurality of sentences; performing entity pair encoding based on encoding results performed on the plurality of sentences; performing relational-context co-attention based on an encoding result performed on the plurality of sentences; and determining a relationship between entity pairs present in the plurality of sentences based on the entity pair encoding result and the relationship-context co-attention result.
상기 복수의 문장들을 선별하는 동작은 상기 문서에서 관계 추출에 필요한 개체가 존재하는 복수의 문장들을 선별하는 동작을 포함할 수 있다.The operation of selecting the plurality of sentences may include an operation of selecting a plurality of sentences in which an entity necessary for extracting a relationship exists in the document.
상기 개체가 존재하는 복수의 문장들을 선별하는 동작은 상기 문서에서 개체가 존재하는 문장을 검출하여 각 개체마다의 문장 집합을 생성하는 동작; 및 각 객체마다 문장 집합을 비교하여 포함 관계에 해당하는 문장 집합이 존재하면 두 문장 집합 중 더 큰 문장 집합에 다른 하나의 문장 집합을 합하는 동작을 포함할 수 있다.The operation of selecting a plurality of sentences in which the entity exists may include: detecting sentences in which the entity exists in the document and generating a sentence set for each entity; and comparing sentence sets for each object and, if a sentence set corresponding to the inclusion relationship exists, adding one sentence set to a larger sentence set of the two sentence sets.
상기 인코딩을 수행하는 동작은 상기 복수의 문장들에 인코딩을 수행하여 상기 복수의 문장들에 존재하는 복수의 개체들 각각의 개체 인코딩 벡터를 생성하는 동작을 포함할 수 있다.The operation of performing the encoding may include an operation of performing encoding on the plurality of sentences to generate an entity encoding vector of each of a plurality of entities present in the plurality of sentences.
상기 개체 인코딩 벡터를 생성하는 동작은 상기 복수의 문장들에 포함된 전체 단어의 단어 인코딩 벡터들을 생성하는 동작; 상기 단어 인코딩 벡터들에 기초하여 상기 전체 단어 중에서 개체 언급에 해당하는 단어를 이용하여 해당 개체에 대한 언급 인코딩 벡터를 생성하는 동작; 및 상기 해당 개체의 언급 인코딩 벡터 및 상기 해당 개체의 언급 횟수에 기초하여 상기 해당 개체의 개체 인코딩 벡터를 생성하는 동작을 포함할 수 있다.The generating of the entity encoding vectors may include generating word encoding vectors of all words included in the plurality of sentences; generating a reference encoding vector for a corresponding entity by using a word corresponding to the entity reference among the entire words based on the word encoding vectors; and generating an entity encoding vector of the corresponding entity based on the reference encoding vector of the corresponding entity and the number of mentions of the corresponding entity.
상기 개체 쌍 인코딩을 수행하는 동작은 복수의 개체들 각각의 개체 인코딩 벡터를 이용하여 상기 복수의 개체들에 대해 객체 쌍 인코딩을 수행함으로써 복수의 개체들의 모든 개체 쌍 조합에 대한 개체 쌍 인코딩 벡터들을 생성하는 동작을 포함할 수 있다.The operation of performing entity pair encoding generates entity pair encoding vectors for all entity pair combinations of a plurality of entities by performing object pair encoding on the plurality of entities using entity encoding vectors of each of the plurality of entities. action may be included.
상기 개체 쌍 인코딩 벡터를 생성하는 동작은 아래 수학식을 이용하여 상기 개체 쌍 인코딩 벡터를 생성하는 동작을 포함할 수 있다.The operation of generating the entity pair encoding vector may include an operation of generating the entity pair encoding vector using Equation below.
[수학식][mathematical expression]
는 주체 후보 개체에 해당하는 개체 인코딩 벡터이고, 는 객체 후보 개체에 해당하는 개체 인코딩 벡터이고, 는 두 개체 인코딩 벡터의 차의 절대 값을 의미하고, 은 두 개체 인코딩 벡터의 곱을 의미하고, [ ]는 안에 주어진 벡터들을 모두 연결한다는 것일 수 있다. is an entity encoding vector corresponding to a subject candidate entity, is an entity encoding vector corresponding to an object candidate entity, means the absolute value of the difference between the two object encoding vectors, may mean the product of two object encoding vectors, and [ ] may mean connecting all vectors given in it.
상기 관계-문맥 코-어텐션을 수행하는 동작은 상기 단어 인코딩 벡터들 및 관계 라벨 임베딩 벡터들 간의 어텐션을 수행하여 관계-문맥 코-어텐션 벡터들을 생성하는 동작을 포함할 수 있다.The operation of performing the relation-context co-attention may include generating relation-context co-attention vectors by performing attention between the word encoding vectors and relation label embedding vectors.
상기 관계를 판별하는 동작은 상기 개체 쌍 인코딩 벡터들 및 관계-문맥 코-어텐션 벡터들 간의 어텐션을 수행하여 개체 쌍의 관계를 추출하는 동작을 포함할 수 있다.The operation of determining the relationship may include extracting the relationship of the entity pair by performing attention between the entity pair encoding vectors and the relationship-context co-attention vectors.
도 1은 일 실시예에 따른 문서 수준 관계 추출 동작을 수행하는 전자 장치의 일 예를 나타낸다.
도 2는 전처리 알고리즘의 일 예를 나타낸다.
도 3은 일 실시예에 따른 문서 수준 관계 추출 모델의 일 예를 개략적으로 나타낸다.
도 4는 일 실시예에 따른 문서 수준 관계 추출 동작을 수행하는 전차 장치의 다른 예를 나타낸다.1 illustrates an example of an electronic device performing a document-level relationship extraction operation according to an embodiment.
2 shows an example of a preprocessing algorithm.
3 schematically illustrates an example of a document-level relationship extraction model according to an embodiment.
4 shows another example of an electric car device performing a document-level relationship extraction operation according to an embodiment.
실시예들에 대한 특정한 구조적 또는 기능적 설명들은 단지 예시를 위한 목적으로 개시된 것으로서, 다양한 형태로 변경되어 구현될 수 있다. 따라서, 실제 구현되는 형태는 개시된 특정 실시예로만 한정되는 것이 아니며, 본 명세서의 범위는 실시예들로 설명한 기술적 사상에 포함되는 변경, 균등물, 또는 대체물을 포함한다.Specific structural or functional descriptions of the embodiments are disclosed for illustrative purposes only, and may be changed and implemented in various forms. Therefore, the form actually implemented is not limited only to the specific embodiments disclosed, and the scope of the present specification includes changes, equivalents, or substitutes included in the technical idea described in the embodiments.
제1 또는 제2 등의 용어를 다양한 구성요소들을 설명하는데 사용될 수 있지만, 이런 용어들은 하나의 구성요소를 다른 구성요소로부터 구별하는 목적으로만 해석되어야 한다. 예를 들어, 제1 구성요소는 제2 구성요소로 명명될 수 있고, 유사하게 제2 구성요소는 제1 구성요소로도 명명될 수 있다.Although terms such as first or second may be used to describe various components, such terms should only be construed for the purpose of distinguishing one component from another. For example, a first element may be termed a second element, and similarly, a second element may be termed a first element.
어떤 구성요소가 다른 구성요소에 "연결되어" 있다고 언급된 때에는, 그 다른 구성요소에 직접적으로 연결되어 있거나 또는 접속되어 있을 수도 있지만, 중간에 다른 구성요소가 존재할 수도 있다고 이해되어야 할 것이다.It should be understood that when an element is referred to as being “connected” to another element, it may be directly connected or connected to the other element, but other elements may exist in the middle.
단수의 표현은 문맥상 명백하게 다르게 뜻하지 않는 한, 복수의 표현을 포함한다. 본 명세서에서, "포함하다" 또는 "가지다" 등의 용어는 설명된 특징, 숫자, 단계, 동작, 구성요소, 부분품 또는 이들을 조합한 것이 존재함으로 지정하려는 것이지, 하나 또는 그 이상의 다른 특징들이나 숫자, 단계, 동작, 구성요소, 부분품 또는 이들을 조합한 것들의 존재 또는 부가 가능성을 미리 배제하지 않는 것으로 이해되어야 한다.Singular expressions include plural expressions unless the context clearly dictates otherwise. In this specification, terms such as "comprise" or "have" are intended to designate that the described feature, number, step, operation, component, part, or combination thereof exists, but one or more other features or numbers, It should be understood that the presence or addition of steps, operations, components, parts, or combinations thereof is not precluded.
다르게 정의되지 않는 한, 기술적이거나 과학적인 용어를 포함해서 여기서 사용되는 모든 용어들은 해당 기술 분야에서 통상의 지식을 가진 자에 의해 일반적으로 이해되는 것과 동일한 의미를 가진다. 일반적으로 사용되는 사전에 정의되어 있는 것과 같은 용어들은 관련 기술의 문맥상 가지는 의미와 일치하는 의미를 갖는 것으로 해석되어야 하며, 본 명세서에서 명백하게 정의하지 않는 한, 이상적이거나 과도하게 형식적인 의미로 해석되지 않는다.Unless defined otherwise, all terms used herein, including technical or scientific terms, have the same meaning as commonly understood by one of ordinary skill in the art. Terms such as those defined in commonly used dictionaries should be interpreted as having a meaning consistent with the meaning in the context of the related art, and unless explicitly defined in this specification, it should not be interpreted in an ideal or excessively formal meaning. don't
이하, 실시예들을 첨부된 도면들을 참조하여 상세하게 설명한다. 첨부 도면을 참조하여 설명함에 있어, 도면 부호에 관계없이 동일한 구성 요소는 동일한 참조 부호를 부여하고, 이에 대한 중복되는 설명은 생략하기로 한다.Hereinafter, embodiments will be described in detail with reference to the accompanying drawings. In the description with reference to the accompanying drawings, the same reference numerals are given to the same components regardless of reference numerals, and overlapping descriptions thereof will be omitted.
도 1은 일 실시예에 따른 문서 수준 관계 추출 동작을 수행하는 전자 장치의 일 예를 나타내고, 도 2는 전처리 알고리즘의 일 예를 나타낸다.1 shows an example of an electronic device that performs a document-level relationship extraction operation according to an embodiment, and FIG. 2 shows an example of a preprocessing algorithm.
도 1 및 도 2를 참조하면, 일 실시예에 따른, 전자 장치(10)는 문장 및/또는 문서에 존재하는 개체(entity)들 간의 관계를 추출하는 동작을 수행할 수 있다. 관계 추출은 관계를 맺는 개체들을 추출하고 추출된 개체들에 알맞은 관계명(예: 관계 트리플 형태)을 부착하는 동작을 수 있다.Referring to FIGS. 1 and 2 , according to an embodiment, the
전자 장치(10)는 전처리기(100) 및 문서 수준 관계 추출 모델(200)을 포함할 수 있다. 전자 장치(10)는 문서 수준 관계 추출 모델(200)을 이용하여 문서 수준 관계 추출 동작을 수행함으로써 문장 및/또는 문서에 존재하는 개체들 간의 관계를 추출할 수 있다. 관계는 관계 트리플 형태(예: subject-relation-object)로 정보가 추출될 수 있다. 개체는 고유한 의미를 갖는 단어(예: 인명, 지명, 기관명 등)를 의미하고, 개체 중에서 관계의 주체가 subject가 되고, 관계의 객체가 object가 될 수 있다. 개체는 관계의 주체에 해당하는 개체로 및/또는 관계의 객체에 해당하는 개체로 존재하며, 다른 개체와 관계를 맺지 않는 개체로도 존재할 수 있다.The
전처리기(100)는 복수의 문장들을 포함하는 문서를 수신하고, 문서에서 개체를 중심으로 문장을 추출하는 전처리 동작을 수행할 수 있다. 문서 전체의 시퀀스(Sequence) 길이가 길기 때문에, 대부분의 MLM(Masked Language Model)에서 사용하는 셀프-어텐션(Self-Attention)의 계산량이 폭발적으로 증가할 수 있다. 관계 추출을 할 때 꼭 필요한 문장을 제외한 나머지 문장은 모델(예: 문서 수준 관계 추출 모델(200))에 잡음(Noise)으로 작용할 수 있는 가능성이 있다. 전처리기(100)가 관계 추출에 필요한 문장만을 선별함으로써, 데이터의 복잡성과 모델(예: 문서 수준 관계 추출 모델(200))의 계산량을 줄일 수 있다.The
전처리기(100)는 문서에서 관계 추출에 필요한 개체가 존재하는 복수의 문장들을 선별할 수 있다. 전처리기(100)는 딥러닝(Deep-learning) 모델로 구현할 필요 없이 도 2의 전처리 알고리즘(예: 도 2의 의사 코드)으로 문서에서 관계 추출에 필요한 문장들을 간단하게 선별할 수 있다. 우선, 전처리기(100)는 문서에서 개체(entity)가 존재하는 문장을 검출하여(예: 찾아 내어) 각 개체마다의 문장 집합을 생성할 수 있다(예: 도 2의 ①). 다음으로, 전처리기(100)는 각 개체마다 문장 집합을 비교하여 포함 관계에 해당하는 문장 집합이 존재하면 두 문장 집합 중 더 큰 문장 집합에 다른 하나의 문장 집합을 합할 수 있다(예: 도 2의 ②). 전처리기(100)는 상술한 동작(예: 도 2의 ①, ②)을 진행하여 기존 문서보다 짧고 관계 추출에 필요한 문장을 충분히 포함하고 있는 새로운 문장 집합을 생성할 수 있다. 전처리기(100)는 문서에서 선별한 문장들을 문서 수준 관계 추출 모델(200)로 출력할 수 있다.The
문서 수준 관계 추출 모델(200)은 선별한 문장들을 이용하여 인코딩(예: 문서 또는 문장 인코딩, 개체 쌍 인코딩, 관계-문맥 코-어텐션, 및 어텐션(예: 멀티-헤드 어텐션)을 수행하여 선별한 문장들 내의 각 개체 쌍의 관계를 판별할 수 있다. 문서 수준 관계 추출 모델(200)에 대해서는 도 3을 참조하여 상세히 설명하도록 한다.The document-level
도 3은 일 실시예에 따른 문서 수준 관계 추출 모델의 일 예를 개략적으로 나타낸다.3 schematically illustrates an example of a document-level relationship extraction model according to an embodiment.
문서 수준 관계 추출 모델(200)은 MLM 계층(210), 개체 쌍 인코딩 계층(inter-pair encoding; 230), 코-어텐션 계층(co-attention; 250), 및 멀티-헤드 LAN 계층(multi-head LAN; 270)을 포함할 수 있다.The document level
MLM 계층(210)은 전처리기(100)에 의해서 선별된 복수의 문장들을 단어 단위(예: 도 3의 w1(첫번째 단어), w2(두번째 단어), w3(세번째 단어), w4(네번째 단어), wn(n번째 단어))로 수신할 수 있다. 복수의 문장들 각각은 단어들로 구성되며, 문장 경계(예: 도 3의 <S>)에 의해서 구분될 수 있다. 문장 경계(<S>)는 문장 경계(<S>) 다음에 나타나는 단어들이 다음 문장이라는 것을 MLM 계층(210)에 알려주는 역할을 하는 것일 수 있다. 예를 들어, 단어들(w1, w2, w3)은 첫번째 문장을 구성하며, 다음 단어(w4)는 두번째 문장을 구성하는 것이다.The
MLM 계층(210)은 선별된 복수의 문장들에 대해서 인코딩(예: 문장 인코딩 또는 문서 인코딩)을 수행할 수 있다. MLM 계층(210)은 ELECTRA(Efficiently Learning an Encoder that Classifies Token Replacements Accurately)로 구현될 수 있다. ELECTRA는 사전 학습 시 Masking된 단어를 판별하는 방법으로 자가 지도 학습(Self-supervised Learning)을 진행한 MLM일 수 있다.The
MLM 계층(210)은 선별된 복수의 문장들에 인코딩을 수행하여 선별된 복수의 문장들에 존재하는 복수의 개체들 각각의 개체 인코딩 벡터를 생성(예: 계산)할 수 있다. 우선, MLM 계층(210)은 복수의 문장들에 포함된 전체 단어의 단어 인코딩 벡터들을 생성(예: 계산)할 수 있다. MLM 계층(210)은 단어 인코딩 벡터들에 기초하여 전체 단어 중에서 개체 언급에 해당하는 단어를 이용하여 해당 개체에 대한 언급 인코딩 벡터를 생성(예: 계산)할 수 있다. MLM 계층(210)은 해당 개체의 언급 인코딩 벡터 및 해당 개체의 언급 횟수에 기초하여 해당 개체의 개체 인코딩 벡터를 생성(예: 계산)할 수 있다.The
개체의 인코딩 벡터는 각 개체 언급(Mention)에 해당하는 단어들의 인코딩 벡터들의 평균값일 수 있다. MLM 계층(210)은 수학식 1과 같이 개체의 인코딩 과정을 수행할 수 있다.An encoding vector of an entity may be an average value of encoding vectors of words corresponding to each entity mention. The
수학식 1에서 은 개체 인코딩 벡터를 의미하고, 은 해당 개체에 대해 언급 인코딩 벡터를 의미할 수 있다. 은 개체의 언급 회수를 의미하고, 는 언급에 해당하는 단어의 수를 의미할 수 있다. 는 문서(예: 선별된 복수의 문장들)에서 j번째 단어의 인코딩 벡터를 의미할 수 있다 in
MLM 계층(210)은 선별된 복수의 문장들에 인코딩 결과인 복수의 개체들 각각의 개체 인코딩 벡터를 개체 쌍 인코딩 계층(230)으로 출력할 수 있다. MLM 계층(210)은 선별된 복수의 문장들에 인코딩 결과인 전체 단어의 단어 인코딩 벡터들을 코-어텐션 계층(250)으로 출력할 수 있다. 선별된 복수의 문장들에 인코딩 결과는 복수의 개체들 각각의 개체 인코딩 벡터 및 전체 단어의 단어 인코딩 벡터들을 포함할 수 있다.The
개체 쌍 인코딩 계층(230)은 선별된 복수의 문장들에 인코딩 결과에 기초하여 개체 쌍 인코딩을 수행할 수 있다. 개체 쌍 인코딩 계층(230)은 복수의 개체들에 대해 개체 쌍 인코딩을 수행하여 복수의 개체들의 모든 개체 쌍 조합에 대한 개체 쌍 인코딩 벡터를 생성(예: 계산)할 수 있다. 개체 쌍 인코딩 계층(230)은 수학식 2를 이용하여 개체 쌍 인코딩을 수행할 수 있다.The entity pair encoding layer 230 may perform entity pair encoding on the selected plurality of sentences based on an encoding result. The entity pair encoding layer 230 may generate (eg, calculate) entity pair encoding vectors for all entity pair combinations of the plurality of entities by performing entity pair encoding on the plurality of entities. The entity pair encoding layer 230 may perform entity pair encoding using
수학식 2에서 는 Subject 후보 개체에 해당하는 개체 인코딩 벡터이고, 는 Object 후보 개체에 해당하는 개체 인코딩 벡터일 수 있다. 는 두 개체 인코딩 벡터의 차의 절대 값을 의미하고, 은 두 개체 인코딩 벡터의 곱을 의미할 수 있다. [ ]는 안에 주어진 벡터들을 모두 연결한다는 의미일 수 있다. 수식은 두 문장 사이의 연관 정보를 구하는데 효과를 증명한 Infer-Sent 모델의 수식을 참고했다. 모든 개체의 객체 쌍 인코딩 벡터 는 위 과정을 통해 계산될 수 있다. 개체 쌍 인코딩 계층(230)은 개체 쌍 인코딩 벡터(들)을 멀티-헤드 LAN 계층(270)으로 출력할 수 있다.in
코-어텐션 계층(250)은 선별된 복수의 문장들에 인코딩 결과에 기초하여 관계-문맥 코-어텐션(Relation-Context Co-attention)을 수행할 수 있다. 코-어텐션 계층(250)은 각 관계 라벨(Label)을 설명하는 어휘 정보를 활용하기 위한 관계-문맥 코-어텐션 방법(Relation-Context Co-attention)을 수행할 수 있다. 코-어텐션 계층(250)은 관계-문맥 코-어텐션(Relation-Context Co-attention) 계층이라 할 수 있다. 코-어텐션 계층(250)은 MLM 계층(210)로부터 전체 단어의 단어 인코딩 벡터(들)과 관계 라벨 임베딩 벡터(들) 간의 어텐션(Attention)을 수행하여 관계-문맥 코-어텐션(Relation-Context Co-attention) 벡터(들)를 생성할 수 있다. 코-어텐션 계층(250)은 전체 단어의 단어 인코딩 벡터(들)과 관계 라벨 임베딩 벡터 간의 어텐션을 통해 각 단어가 어떤 관계와 연관이 있는지 계산할 수 있다. 코-어텐션 계층(250)은 문맥에서 각 관계 라벨을 설명하는 부분을 자동적으로 강조하는 역할을 수행하는 것일 수 있다.The
관계 임베딩 벡터는 임의 초기화하며 모델 학습이 진행되며 그 값이 미세 조정(Fine tune)될 수 있다. 어텐션은 바이리니어 어텐션(Bilinear attention)을 기반으로 수행되며 수학식 3과 같을 수 있다.The relational embedding vector is randomly initialized, model learning proceeds, and its value can be fine tuned. Attention is performed based on bilinear attention and may be as shown in Equation 3.
수학식 3에서, 는 번째 관계 라벨의 임베딩 벡터를 의마하고, 는 전체 단어의 단어 인코딩 벡터들을 의미하며, 는 바이리니어 어텐션(Bilinear attention)의 가중치 행렬일 수 있다. 는 두 벡터 간의 연관도 점수이며, 에 를 취해 연관도 확률 분포인 가 획득(예: 계산)될 수 있다. 이후 는 단어 인코딩 벡터 와의 행렬 곱을 통해 에 관련된 단어의 의미가 강조된 벡터(예: 관계-문맥 상호-어텐션 벡터) 계산에 사용될 수 있다. 코-어텐션 계층(250)은 문서의 길이에 상관없이 문서에서 관계를 설명하는 부분의 정보를 습득하는데 도움을 줄 수 있다. 코-어텐션 계층(250)은 관계-문맥 상호-어텐션 벡터(들)를 멀티-헤드 LAN 계층(270)으로 출력할 수 있다.In Equation 3, Is It means the embedding vector of the th relation label, denotes the word encoding vectors of the entire word, May be a weight matrix of bilinear attention. is the association score between the two vectors, to Take , which is the probability distribution of the degree of association Can be obtained (eg calculated). after is the word encoding vector through matrix multiplication with A vector in which the meaning of words related to is emphasized (e.g., a relationship-context cross-attention vector) can be used in calculations. The
멀티-헤드 LAN 계층(270)은 개체 쌍 인코딩 결과 및 관계-문맥 코-어텐션 결과에 기초하여 각 객체 쌍의 관계를 판별할 수 있다. 멀티-헤드 LAN 계층(270)은 개체 쌍 인코딩 벡터(들)와 관계-문맥 코-어텐션 벡터(들) 간의 어텐션(Attention)을 수행하여 각 개체 쌍이 갖는 관계를 추출할 수 있다. 멀티-헤드 LAN 계층(270)은 멀티-헤드 어텐션(Multi-head Attention)의 수식을 기반으로 하며 수식은 수학식 4와 같을 수 있다. 멀티-헤드 LAN 계층(270)은 각 개체 쌍의 관계 점수(예: 최종 관계 예측 점수 )를 출력할 수 있다.The
수학식 4에서, , 는 개체 쌍 인코딩 벡터들과 상호-어텐션(Co-attention) 벡터들에 FNN(Feed-forward Neural Network)를 적용해 추상화한 값일 수 있다. 은 사용할 헤드(head)의 개수를 의미하며, 는 헤드(head)의 인덱스(index)를 의미할 수 있다. 개체 쌍의 관계 점수는 두 벡터의 내적을 기반으로 계산되며 최종 관계 예측 점수 는 각 헤드(head)의 점수를 평균 낸 값일 수 있다. 모델(예: 멀티-헤드 LAN 계층(270))의 학습을 위한 손실 함수는 다중 분류(Multi Labeling)를 위해 바이너리 교차-엔트로피(Binary Cross-Entropy)가 사용되며 관계 예측 점수 와 실제 정답 사이의 손실 값이 계산될 수 있다.In Equation 4, , may be a value abstracted by applying a feed-forward neural network (FNN) to entity pair encoding vectors and co-attention vectors. means the number of heads to be used, may mean the index of the head. The relationship score of a pair of entities is calculated based on the dot product of the two vectors, and the final relationship prediction score May be a value obtained by averaging the scores of each head. The loss function for training of the model (e.g., multi-head LAN layer 270) uses Binary Cross-Entropy for Multi Labeling, and the relationship prediction score. A loss value between ? and the actual correct answer can be calculated.
도 4는 일 실시예에 따른 문서 수준 관계 추출 동작을 수행하는 전차 장치의 다른 예를 나타낸다.4 shows another example of an electric car device performing a document-level relationship extraction operation according to an embodiment.
전자 장치(400)는 도 1의 전자 장치(10)와 실질적으로 동일할 수 있다. 전자 장치(400)는 도 1 내지 도 3을 참조하여 설명한 문서 수준 관계 추출 동작을 수행할 수 있다. 전자 장치(400)는 메모리(410) 및 프로세서(430)를 포함할 수 있다. 도 1의 전처리기(100) 및 문서 수준 관계 추출 모델(200)은 메모리(410)에 저장되어 있다 프로세서(430)에 로딩되어 프로세서(430)에 의해서 실행될 수도 있으며, 프로세서(430)에 임베디드될 수도 있다.The
메모리(410)는 프로세서(430)에 의해 실행가능한 인스트럭션들(또는 프로그램)을 저장할 수 있다. 예를 들어, 인스트럭션들은 프로세서(430)의 동작 및/또는 프로세서(430)의 각 구성의 동작을 실행하기 위한 인스트럭션들을 포함할 수 있다.
프로세서(430)는 메모리(410)에 저장된 데이터를 처리할 수 있다. 프로세서(430)는 메모리(410)에 저장된 컴퓨터로 읽을 수 있는 코드(예를 들어, 소프트웨어) 및 프로세서(430)에 의해 유발된 인스트럭션(instruction)들을 실행할 수 있다.The
프로세서(430)는 목적하는 동작들(desired operations)을 실행시키기 위한 물리적인 구조를 갖는 회로를 가지는 하드웨어로 구현된 데이터 처리 장치일 수 있다. 예를 들어, 목적하는 동작들은 프로그램에 포함된 코드(code) 또는 인스트럭션들(instructions)을 포함할 수 있다.The
예를 들어, 하드웨어로 구현된 데이터 처리 장치는 마이크로프로세서(microprocessor), 중앙 처리 장치(central processing unit), 프로세서 코어(processor core), 멀티-코어 프로세서(multi-core processor), 멀티프로세서(multiprocessor), ASIC(Application-Specific Integrated Circuit), FPGA(Field Programmable Gate Array)를 포함할 수 있다.For example, a data processing unit implemented in hardware includes a microprocessor, a central processing unit, a processor core, a multi-core processor, and a multiprocessor. , Application-Specific Integrated Circuit (ASIC), and Field Programmable Gate Array (FPGA).
프로세서(430)에 의해 수행되는 동작은 도 1 내지 도 3을 참조하여 설명한 전처리기(100) 및 문서 수준 관계 추출 모델(200)을 이용하는 문서 수준 관계 추출 동작과 실질적으로 동일하다. 이에, 상세한 설명은 생략하도록 한다.An operation performed by the
이상에서 설명된 실시예들은 하드웨어 구성요소, 소프트웨어 구성요소, 및/또는 하드웨어 구성요소 및 소프트웨어 구성요소의 조합으로 구현될 수 있다. 예를 들어, 실시예들에서 설명된 장치, 방법 및 구성요소는, 예를 들어, 프로세서, 콘트롤러, ALU(arithmetic logic unit), 디지털 신호 프로세서(digital signal processor), 마이크로컴퓨터, FPGA(field programmable gate array), PLU(programmable logic unit), 마이크로프로세서, 또는 명령(instruction)을 실행하고 응답할 수 있는 다른 어떠한 장치와 같이, 범용 컴퓨터 또는 특수 목적 컴퓨터를 이용하여 구현될 수 있다. 처리 장치는 운영 체제(OS) 및 상기 운영 체제 상에서 수행되는 소프트웨어 애플리케이션을 수행할 수 있다. 또한, 처리 장치는 소프트웨어의 실행에 응답하여, 데이터를 접근, 저장, 조작, 처리 및 생성할 수도 있다. 이해의 편의를 위하여, 처리 장치는 하나가 사용되는 것으로 설명된 경우도 있지만, 해당 기술분야에서 통상의 지식을 가진 자는, 처리 장치가 복수 개의 처리 요소(processing element) 및/또는 복수 유형의 처리 요소를 포함할 수 있음을 알 수 있다. 예를 들어, 처리 장치는 복수 개의 프로세서 또는 하나의 프로세서 및 하나의 컨트롤러를 포함할 수 있다. 또한, 병렬 프로세서(parallel processor)와 같은, 다른 처리 구성(processing configuration)도 가능하다.The embodiments described above may be implemented as hardware components, software components, and/or a combination of hardware components and software components. For example, the devices, methods 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 gate (FPGA). array), programmable logic units (PLUs), microprocessors, or any other device capable of executing and responding to instructions. The processing device may execute an operating system (OS) and software applications running on the operating system. A processing device may also access, store, manipulate, process, and generate data in response to execution of software. For convenience of understanding, there are cases in which one processing device is used, but those skilled in the art will understand that the processing device includes a plurality of processing elements and/or a plurality of types of processing elements. It can be seen that it can include. For example, a processing device may include a plurality of processors or a processor and a controller. Other processing configurations are also possible, such as parallel processors.
소프트웨어는 컴퓨터 프로그램(computer program), 코드(code), 명령(instruction), 또는 이들 중 하나 이상의 조합을 포함할 수 있으며, 원하는 대로 동작하도록 처리 장치를 구성하거나 독립적으로 또는 결합적으로(collectively) 처리 장치를 명령할 수 있다. 소프트웨어 및/또는 데이터는, 처리 장치에 의하여 해석되거나 처리 장치에 명령 또는 데이터를 제공하기 위하여, 어떤 유형의 기계, 구성요소(component), 물리적 장치, 가상 장치(virtual equipment), 컴퓨터 저장 매체 또는 장치, 또는 전송되는 신호 파(signal wave)에 영구적으로, 또는 일시적으로 구체화(embody)될 수 있다. 소프트웨어는 네트워크로 연결된 컴퓨터 시스템 상에 분산되어서, 분산된 방법으로 저장되거나 실행될 수도 있다. 소프트웨어 및 데이터는 컴퓨터 판독 가능 기록 매체에 저장될 수 있다.Software may include a computer program, code, instructions, or a combination of one or more of the foregoing, which configures a processing device to operate as desired or processes independently or collectively. You can command the device. Software and/or data may be any tangible machine, component, physical device, virtual equipment, computer storage medium or device, intended to be interpreted by or provide instructions or data to a processing device. , or may be permanently or temporarily embodied in a transmitted signal wave. Software may be distributed on networked computer systems and stored or executed in a distributed manner. Software and data may be stored on computer readable media.
실시예에 따른 방법은 다양한 컴퓨터 수단을 통하여 수행될 수 있는 프로그램 명령 형태로 구현되어 컴퓨터 판독 가능 매체에 기록될 수 있다. 컴퓨터 판독 가능 매체는 프로그램 명령, 데이터 파일, 데이터 구조 등을 단독으로 또는 조합하여 포함할 수 있으며 매체에 기록되는 프로그램 명령은 실시예를 위하여 특별히 설계되고 구성된 것들이거나 컴퓨터 소프트웨어 당업자에게 공지되어 사용 가능한 것일 수도 있다. 컴퓨터 판독 가능 기록 매체의 예에는 하드 디스크, 플로피 디스크 및 자기 테이프와 같은 자기 매체(magnetic media), CD-ROM, DVD와 같은 광기록 매체(optical media), 플롭티컬 디스크(floptical disk)와 같은 자기-광 매체(magneto-optical media), 및 롬(ROM), 램(RAM), 플래시 메모리 등과 같은 프로그램 명령을 저장하고 수행하도록 특별히 구성된 하드웨어 장치가 포함된다. 프로그램 명령의 예에는 컴파일러에 의해 만들어지는 것과 같은 기계어 코드뿐만 아니라 인터프리터 등을 사용해서 컴퓨터에 의해서 실행될 수 있는 고급 언어 코드를 포함한다. 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. alone or in combination, and the program instructions recorded on the medium may be specially designed and configured for the embodiment or may be known and usable to those skilled in the art of computer software. may be 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. - includes hardware devices specially configured to store and execute program instructions, such as magneto-optical media, and ROM, RAM, flash memory, and the like. Examples of program instructions include high-level language codes that can be executed by a computer using an interpreter, as well as machine language codes such as those produced by a compiler.
위에서 설명한 하드웨어 장치는 실시예의 동작을 수행하기 위해 하나 또는 복수의 소프트웨어 모듈로서 작동하도록 구성될 수 있으며, 그 역도 마찬가지이다.The hardware device described above may be configured to operate as one or a plurality of software modules to perform the operations of the embodiments, and vice versa.
이상과 같이 실시예들이 비록 한정된 도면에 의해 설명되었으나, 해당 기술분야에서 통상의 지식을 가진 자라면 이를 기초로 다양한 기술적 수정 및 변형을 적용할 수 있다. 예를 들어, 설명된 기술들이 설명된 방법과 다른 순서로 수행되거나, 및/또는 설명된 시스템, 구조, 장치, 회로 등의 구성요소들이 설명된 방법과 다른 형태로 결합 또는 조합되거나, 다른 구성요소 또는 균등물에 의하여 대치되거나 치환되더라도 적절한 결과가 달성될 수 있다.As described above, although the embodiments have been described with limited drawings, those skilled in the art can apply various technical modifications and variations based on this. For example, the described techniques may be performed in an order different from the method described, and/or components of the described system, structure, device, circuit, etc. may be combined or combined in a different form than the method described, or other components may be used. Or even if it is replaced or substituted by equivalents, appropriate results can be achieved.
그러므로, 다른 구현들, 다른 실시예들 및 특허청구범위와 균등한 것들도 후술하는 특허청구범위의 범위에 속한다.Therefore, other implementations, other embodiments, and equivalents of the claims are within the scope of the following claims.
Claims (20)
문서 수준 관계 추출 장치가 문서를 전처리하여 상기 문서로부터 복수의 문장들을 선별하는 동작;
문서 수준 관계 추출 장치가 상기 복수의 문장들에 인코딩을 수행하는 동작;
문서 수준 관계 추출 장치가 상기 복수의 문장들에 수행된 인코딩 결과에 기초하여 개체 쌍 인코딩을 수행하는 동작;
문서 수준 관계 추출 장치가 상기 복수의 문장들에 수행된 인코딩 결과에 기초하여 관계-문맥 코-어텐션을 수행하는 동작; 및
문서 수준 관계 추출 장치가 상기 개체 쌍 인코딩 결과 및 상기 관계-문맥 코-어텐션 결과에 기초하여 상기 복수의 문장들에 존재하는 개체 쌍의 관계를 판별하는 동작
을 포함하고,
상기 복수의 문장들에 인코딩을 수행하는 동작은,
상기 복수의 문장들에 포함된 전체 단어의 단어 인코딩 벡터들을 생성하는 동작;
상기 단어 인코딩 벡터들에 기초하여 상기 전체 단어 중에서 개체 언급에 해당하는 단어를 이용하여 해당 개체에 대한 언급 인코딩 벡터를 생성하는 동작; 및
상기 해당 개체의 언급 인코딩 벡터 및 상기 해당 개체의 언급 횟수에 기초하여 상기 해당 개체의 개체 인코딩 벡터를 생성하는 동작
을 포함하고,
상기 관계-문맥 코-어텐션을 수행하는 동작은,
상기 단어 인코딩 벡터들 및 관계 라벨 임베딩 벡터들 간의 어텐션을 수행하여 관계-문맥 코-어텐션 벡터들을 생성하는 동작
을 포함하는, 방법.
In the document-level relationship extraction method performed by the document-level relationship extraction device,
selecting a plurality of sentences from the document by pre-processing the document by the document-level relation extraction device;
performing encoding on the plurality of sentences by a document-level relation extraction device;
performing entity pair encoding based on encoding results performed on the plurality of sentences by a document level relationship extracting device;
performing relation-context co-attention based on an encoding result performed on the plurality of sentences by a document-level relation extraction apparatus; and
An operation of determining, by a document-level relationship extraction device, a relationship between entity pairs present in the plurality of sentences based on the entity pair encoding result and the relationship-context co-attention result
including,
The operation of encoding the plurality of sentences,
generating word encoding vectors of all words included in the plurality of sentences;
generating a reference encoding vector for a corresponding entity by using a word corresponding to the entity reference among the entire words based on the word encoding vectors; and
An operation of generating an object encoding vector of the corresponding entity based on the reference encoding vector of the corresponding entity and the number of mentions of the corresponding entity
including,
The operation of performing the relation-context co-attention,
An operation of generating relation-context co-attention vectors by performing attention between the word encoding vectors and relation label embedding vectors.
Including, how.
상기 복수의 문장들을 선별하는 동작은,
상기 문서에서 관계 추출에 필요한 개체가 존재하는 복수의 문장들을 선별하는 동작
을 포함하는, 방법.
According to claim 1,
The operation of selecting the plurality of sentences,
An operation of selecting a plurality of sentences in which an entity necessary for extracting a relationship exists in the document
Including, how.
상기 개체가 존재하는 복수의 문장들을 선별하는 동작은,
상기 문서에서 개체가 존재하는 문장을 검출하여 각 개체마다의 문장 집합을 생성하는 동작; 및
각 객체마다 문장 집합을 비교하여 포함 관계에 해당하는 문장 집합이 존재하면 두 문장 집합 중 더 큰 문장 집합에 다른 하나의 문장 집합을 합하는 동작
을 포함하는, 방법.
According to claim 2,
The operation of selecting a plurality of sentences in which the entity exists,
detecting sentences in which the entity exists in the document and generating a sentence set for each entity; and
An operation of comparing sentence sets for each object and, if a sentence set corresponding to the inclusion relationship exists, adding one sentence set to the larger sentence set of the two sentence sets.
Including, how.
상기 개체 쌍 인코딩을 수행하는 동작은,
복수의 개체들 각각의 개체 인코딩 벡터를 이용하여 상기 복수의 개체들에 대해 객체 쌍 인코딩을 수행함으로써 복수의 개체들의 모든 개체 쌍 조합에 대한 개체 쌍 인코딩 벡터들을 생성하는 동작
을 포함하는, 방법.
According to claim 1,
The operation of performing the entity pair encoding,
An operation of generating entity pair encoding vectors for all entity pair combinations of a plurality of entities by performing object pair encoding on the plurality of entities using entity encoding vectors of each of the plurality of entities.
Including, how.
상기 개체 쌍 인코딩 벡터를 생성하는 동작은,
아래 수학식을 이용하여 상기 개체 쌍 인코딩 벡터를 생성하는 동작
을 포함하는, 방법.
[수학식]
는 주체 후보 개체에 해당하는 개체 인코딩 벡터이고, 는 객체 후보 개체에 해당하는 개체 인코딩 벡터이고, 는 두 개체 인코딩 벡터의 차의 절대 값을 의미하고, 은 두 개체 인코딩 벡터의 곱을 의미하고, [ ]는 안에 주어진 벡터들을 모두 연결한다는 것인.
According to claim 6,
The operation of generating the entity pair encoding vector,
An operation of generating the entity pair encoding vector using the equation below
Including, how.
[mathematical expression]
is an entity encoding vector corresponding to a subject candidate entity, is an entity encoding vector corresponding to an object candidate entity, means the absolute value of the difference between the two object encoding vectors, means the product of two object encoding vectors, and [ ] connects all the vectors given inside.
상기 어텐션은 바이리니어 어텐션(Bilinear attention)을 기반으로 수행되는 것인, 방법.
According to claim 1,
The method, wherein the attention is performed based on bilinear attention.
상기 관계를 판별하는 동작은,
상기 개체 쌍 인코딩 벡터들 및 관계-문맥 코-어텐션 벡터들 간의 어텐션을 수행하여 개체 쌍의 관계를 추출하는 동작
을 포함하는, 방법.
According to claim 7,
The operation of determining the relationship,
Extracting the relationship of the entity pair by performing attention between the entity pair encoding vectors and the relationship-context co-attention vectors
Including, how.
A computer program stored in a computer readable recording medium in order to execute the method of any one of claims 1 to 3, 6, 7, 9 and 10 in combination with hardware.
하나 이상의 인스트럭션을 저장하는 메모리; 및
상기 인스트럭션을 실행시키기 위한 프로세서
를 포함하고,
상기 인스트럭션이 실행될 때, 상기 프로세서는,
문서를 전처리하여 상기 문서로부터 복수의 문장들을 선별하는 동작;
상기 복수의 문장들에 인코딩을 수행하는 동작;
상기 복수의 문장들에 수행된 인코딩 결과에 기초하여 개체 쌍 인코딩을 수행하는 동작;
상기 복수의 문장들에 수행된 인코딩 결과에 기초하여 관계-문맥 코-어텐션을 수행하는 동작; 및
상기 개체 쌍 인코딩 결과 및 상기 관계-문맥 코-어텐션 결과에 기초하여 상기 복수의 문장들에 존재하는 개체 쌍의 관계를 판별하는 동작
을 수행하고,
상기 복수의 문장들에 인코딩을 수행하는 동작은,
상기 복수의 문장들에 포함된 전체 단어의 단어 인코딩 벡터들을 생성하는 동작;
상기 단어 인코딩 벡터들에 기초하여 상기 전체 단어 중에서 개체 언급에 해당하는 단어를 이용하여 해당 개체에 대한 언급 인코딩 벡터를 생성하는 동작; 및
상기 해당 개체의 언급 인코딩 벡터 및 상기 해당 개체의 언급 횟수에 기초하여 상기 해당 개체의 개체 인코딩 벡터를 생성하는 동작
을 포함하고,
상기 관계-문맥 코-어텐션을 수행하는 동작은,
상기 단어 인코딩 벡터들 및 관계 라벨 임베딩 벡터들 간의 어텐션을 수행하여 관계-문맥 코-어텐션 벡터들을 생성하는 동작
을 포함하는, 장치.
An apparatus for performing document-level relationship extraction,
a memory that stores one or more instructions; and
A processor to execute the instruction
including,
When the instruction is executed, the processor:
pre-processing the document to select a plurality of sentences from the document;
encoding the plurality of sentences;
performing entity pair encoding based on encoding results performed on the plurality of sentences;
performing relational-context co-attention based on an encoding result performed on the plurality of sentences; and
Determining a relationship between entity pairs present in the plurality of sentences based on the entity pair encoding result and the relationship-context co-attention result
do,
The operation of encoding the plurality of sentences,
generating word encoding vectors of all words included in the plurality of sentences;
generating a reference encoding vector for a corresponding entity by using a word corresponding to the entity reference among the entire words based on the word encoding vectors; and
An operation of generating an object encoding vector of the corresponding entity based on the reference encoding vector of the corresponding entity and the number of mentions of the corresponding entity
including,
The operation of performing the relation-context co-attention,
An operation of generating relation-context co-attention vectors by performing attention between the word encoding vectors and relation label embedding vectors.
Including, device.
상기 복수의 문장들을 선별하는 동작은,
상기 문서에서 관계 추출에 필요한 개체가 존재하는 복수의 문장들을 선별하는 동작
을 포함하는, 장치.
According to claim 12,
The operation of selecting the plurality of sentences,
An operation of selecting a plurality of sentences in which an entity necessary for extracting a relationship exists in the document
Including, device.
상기 개체가 존재하는 복수의 문장들을 선별하는 동작은,
상기 문서에서 개체가 존재하는 문장을 검출하여 각 개체마다의 문장 집합을 생성하는 동작; 및
각 객체마다 문장 집합을 비교하여 포함 관계에 해당하는 문장 집합이 존재하면 두 문장 집합 중 더 큰 문장 집합에 다른 하나의 문장 집합을 합하는 동작
을 포함하는, 장치.
According to claim 13,
The operation of selecting a plurality of sentences in which the entity exists,
detecting sentences in which the entity exists in the document and generating a sentence set for each entity; and
An operation of comparing sentence sets for each object and, if a sentence set corresponding to the inclusion relationship exists, adding one sentence set to the larger sentence set of the two sentence sets.
Including, device.
상기 개체 쌍 인코딩을 수행하는 동작은,
복수의 개체들 각각의 개체 인코딩 벡터를 이용하여 상기 복수의 개체들에 대해 객체 쌍 인코딩을 수행함으로써 복수의 개체들의 모든 개체 쌍 조합에 대한 개체 쌍 인코딩 벡터들을 생성하는 동작
을 포함하는, 장치.
According to claim 12,
The operation of performing the entity pair encoding,
An operation of generating entity pair encoding vectors for all entity pair combinations of a plurality of entities by performing object pair encoding on the plurality of entities using entity encoding vectors of each of the plurality of entities.
Including, device.
상기 개체 쌍 인코딩 벡터를 생성하는 동작은,
아래 수학식을 이용하여 상기 개체 쌍 인코딩 벡터를 생성하는 동작
을 포함하는, 장치.
[수학식]
는 주체 후보 개체에 해당하는 개체 인코딩 벡터이고, 는 객체 후보 개체에 해당하는 개체 인코딩 벡터이고, 는 두 개체 인코딩 벡터의 차의 절대 값을 의미하고, 은 두 개체 인코딩 벡터의 곱을 의미하고, [ ]는 안에 주어진 벡터들을 모두 연결한다는 것인.
According to claim 12,
The operation of generating the entity pair encoding vector,
An operation of generating the entity pair encoding vector using the equation below
Including, device.
[mathematical expression]
is an entity encoding vector corresponding to a subject candidate entity, is an entity encoding vector corresponding to an object candidate entity, means the absolute value of the difference between the two object encoding vectors, means the product of two object encoding vectors, and [ ] connects all the vectors given inside.
상기 관계를 판별하는 동작은,
상기 개체 쌍 인코딩 벡터들 및 관계-문맥 코-어텐션 벡터들 간의 어텐션을 수행하여 개체 쌍의 관계를 추출하는 동작
을 포함하는, 장치.
According to claim 12,
The operation of determining the relationship,
Extracting the relationship of the entity pair by performing attention between the entity pair encoding vectors and the relationship-context co-attention vectors
Including, device.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
KR1020200173638A KR102511282B1 (en) | 2020-12-11 | 2020-12-11 | Method and apparatus for document-level relation extraction |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
KR1020200173638A KR102511282B1 (en) | 2020-12-11 | 2020-12-11 | Method and apparatus for document-level relation extraction |
Publications (2)
Publication Number | Publication Date |
---|---|
KR20220083414A KR20220083414A (en) | 2022-06-20 |
KR102511282B1 true KR102511282B1 (en) | 2023-03-17 |
Family
ID=82249955
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
KR1020200173638A KR102511282B1 (en) | 2020-12-11 | 2020-12-11 | Method and apparatus for document-level relation extraction |
Country Status (1)
Country | Link |
---|---|
KR (1) | KR102511282B1 (en) |
Families Citing this family (1)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
KR102621869B1 (en) | 2023-04-24 | 2024-01-05 | 고려대학교 산학협력단 | Device and method for constructing dataset in korean document-level relation extraction |
Citations (1)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
JP2020140674A (en) * | 2019-03-01 | 2020-09-03 | 富士ゼロックス株式会社 | Answer selection device and program |
Family Cites Families (3)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
KR102342066B1 (en) * | 2017-06-21 | 2021-12-22 | 삼성전자주식회사 | Method and apparatus for machine translation using neural network and method for learning the appartus |
KR20190004525A (en) * | 2017-07-04 | 2019-01-14 | 주식회사 마인즈랩 | System and method for learning sentences |
KR102182619B1 (en) * | 2019-01-09 | 2020-11-24 | 주식회사 솔트룩스 | Knowledge extraction system using frame based on ontology |
-
2020
- 2020-12-11 KR KR1020200173638A patent/KR102511282B1/en active IP Right Grant
Patent Citations (1)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
JP2020140674A (en) * | 2019-03-01 | 2020-09-03 | 富士ゼロックス株式会社 | Answer selection device and program |
Non-Patent Citations (2)
Title |
---|
Alexis Conneau 외 4명, "Supervised Learning of Universal Sentence Representations from Natural Language Inference Data", arXiv:1705.02364 [cs.CL] , 2018.07., pp.1-12. 1부.* |
Kuekyeng Kim외 2명, "GREG: A Global Level Relation Extraction with Knowledge Graph Embedding", Applied Sciences, Vol.10(1181), 2020.02., pp.1-12. 1부.* |
Also Published As
Publication number | Publication date |
---|---|
KR20220083414A (en) | 2022-06-20 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
US11604956B2 (en) | Sequence-to-sequence prediction using a neural network model | |
Zhang et al. | End-to-end neural relation extraction with global optimization | |
KR102342066B1 (en) | Method and apparatus for machine translation using neural network and method for learning the appartus | |
Xu et al. | Convolutional neural network based triangular crf for joint intent detection and slot filling | |
US11693854B2 (en) | Question responding apparatus, question responding method and program | |
CN109558570B (en) | Sentence generation method and equipment | |
CN110895928A (en) | Speech recognition method and apparatus | |
KR20180094664A (en) | Method for information extraction from text data and apparatus therefor | |
US20180246856A1 (en) | Analysis method and analysis device | |
KR102511282B1 (en) | Method and apparatus for document-level relation extraction | |
Reza et al. | A customized residual neural network and bi-directional gated recurrent unit-based automatic speech recognition model | |
KR102564692B1 (en) | System and method for processing natural language using correspondence learning | |
US20140324411A1 (en) | Translation validation | |
Arakelyan et al. | Towards JointUD: Part-of-speech tagging and lemmatization using recurrent neural networks | |
KR102192342B1 (en) | Method and device for multimodal character identification on multiparty dialogues | |
Dumitrescu et al. | Racai’s natural language processing pipeline for universal dependencies | |
KR101706827B1 (en) | Apparatus and method for extracting social relation between entity | |
KR101983477B1 (en) | Method and System for zero subject resolution in Korean using a paragraph-based pivotal entity identification | |
KR102557380B1 (en) | Apparatus and metohd for generating named entity recognition model based on knowledge enbedding model | |
KR102501869B1 (en) | Document-level sentiment classification method and apparatus based on importance of sentences | |
CN113066510B (en) | Vowel weak reading detection method and device | |
KR102191133B1 (en) | Method and Apparatus for Relation Extraction based on Reinforcement Learning using Sequential Information in a Paragraph | |
KR102445497B1 (en) | Apparatus for generating lexical pattern and training sentence and operating method thereof | |
US20180033425A1 (en) | Evaluation device and evaluation method | |
KR102352481B1 (en) | Sentence analysis device using morpheme analyzer built on machine learning and operating method thereof |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
E701 | Decision to grant or registration of patent right | ||
GRNT | Written decision to grant |