KR102559687B1 - Method and apparatus for correcting grammatical error, and training method of deep learing model therefor - Google Patents

Method and apparatus for correcting grammatical error, and training method of deep learing model therefor Download PDF

Info

Publication number
KR102559687B1
KR102559687B1 KR1020200146251A KR20200146251A KR102559687B1 KR 102559687 B1 KR102559687 B1 KR 102559687B1 KR 1020200146251 A KR1020200146251 A KR 1020200146251A KR 20200146251 A KR20200146251 A KR 20200146251A KR 102559687 B1 KR102559687 B1 KR 102559687B1
Authority
KR
South Korea
Prior art keywords
word
sentence
spelling
error
changing
Prior art date
Application number
KR1020200146251A
Other languages
Korean (ko)
Other versions
KR20220060350A (en
Inventor
김성환
민진홍
정성준
Original Assignee
건국대학교 산학협력단
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by 건국대학교 산학협력단 filed Critical 건국대학교 산학협력단
Priority to KR1020200146251A priority Critical patent/KR102559687B1/en
Publication of KR20220060350A publication Critical patent/KR20220060350A/en
Application granted granted Critical
Publication of KR102559687B1 publication Critical patent/KR102559687B1/en

Links

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F40/00Handling natural language data
    • G06F40/20Natural language analysis
    • G06F40/232Orthographic correction, e.g. spell checking or vowelisation
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F40/00Handling natural language data
    • G06F40/20Natural language analysis
    • G06F40/268Morphological analysis
    • 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

Abstract

딥러닝 모델을 이용한 맞춤법 교정 방법, 장치 및 이를 위한 딥러닝 모델의 학습 방법이 개시된다. 일 실시예에 따른 맞춤법 교정 방법은, 문장을 수신하는 단계와, 상기 문장을 딥러닝 모델에 입력하여 상기 문장의 맞춤법을 교정하는 단계를 포함하고, 상기 딥러닝 모델은, 정상 문장 및 상기 정상 문장의 어절 및 형태소 중 적어도 하나를 변경하여 생성된 오류 문장에 기초하여 학습된 딥러닝 모델이다.A spelling correction method and apparatus using a deep learning model, and a method for learning a deep learning model therefor are disclosed. A spelling correction method according to an embodiment includes receiving a sentence and correcting the spelling of the sentence by inputting the sentence to a deep learning model, wherein the deep learning model is a deep learning model learned based on a normal sentence and an erroneous sentence generated by changing at least one of a word and a morpheme of the normal sentence.

Description

딥러닝 모델을 이용한 맞춤법 교정 방법, 장치 및 이를 위한 딥러닝 모델의 학습 방법{METHOD AND APPARATUS FOR CORRECTING GRAMMATICAL ERROR, AND TRAINING METHOD OF DEEP LEARING MODEL THEREFOR}Spelling correction method using deep learning model, apparatus and learning method of deep learning model for the same

본 개시는 딥러닝 모델을 이용한 맞춤법 교정 방법, 장치 및 이를 위한 딥러닝 모델의 학습 방법에 관한 것이다.The present disclosure relates to a spelling correction method using a deep learning model, an apparatus, and a deep learning model learning method therefor.

급성장하는 빅 데이터 시대 이후, 텍스트 데이터에 대한 접근이 용이하며 다양한 영역에 널리 적용되고 있다. 이러한 상황에서 정리되지 않은 방대한 양 데이터를 처리하기 위해서는 적절한 언어 처리 방법이 요구된다. 텍스트 데이터 오류를 처리하기 위한 맞춤법 오류 수정(Grammatical Error Correction(GEC)) 모델을 개발하기 위해 다양한 노력이 적용되고 있다. 다만 한국어에 대한 맞춤법 오류 수정 모델은 상대적으로 미개척 상태로 남아 있다.Since the era of rapidly growing big data, access to text data is easy and it is widely applied in various fields. In this situation, an appropriate language processing method is required to process the vast amount of unorganized data. Various efforts are being applied to develop a Grammatical Error Correction (GEC) model for handling text data errors. However, spelling error correction models for Korean remain relatively unexplored.

관련 선행기술로, 한국공개특허공보 제10-2006-0043682호(발명의 명칭: 개선된 맞춤법 검사를 위한 시스템 및 방법)가 있다.As related prior art, there is Korean Patent Publication No. 10-2006-0043682 (Title of Invention: System and Method for Improved Spelling Check).

본 발명은 맞춤법 교정 모델을 학습시키기 위한 데이터 셋을 용이하게 생성하고, 생성한 데이터 셋을 바탕으로 높은 성능의 맞춤법 교정 모델을 학습하는 기술을 제공할 수 있다.The present invention can provide a technique for easily generating a data set for learning a spelling correction model and learning a high-performance spelling correction model based on the generated data set.

다만, 기술적 과제는 상술한 기술적 과제들로 한정되는 것은 아니며, 또 다른 기술적 과제들이 존재할 수 있다.However, the technical challenges are not limited to the above-described technical challenges, and other technical challenges may exist.

일 실시예에 따른 맞춤법 교정 방법은, 문장을 수신하는 단계와, 상기 문장을 딥러닝 모델에 입력하여 상기 문장의 맞춤법을 교정하는 단계를 포함하고, 상기 딥러닝 모델은, 정상 문장 및 상기 정상 문장의 어절 및 형태소 중 적어도 하나를 변경하여 생성된 오류 문장에 기초하여 학습된 딥러닝 모델이다.A spelling correction method according to an embodiment includes receiving a sentence and correcting the spelling of the sentence by inputting the sentence to a deep learning model, wherein the deep learning model is a deep learning model learned based on a normal sentence and an erroneous sentence generated by changing at least one of a word and a morpheme of the normal sentence.

상기 오류 문장은, 상기 어절이 서술어인 경우, 상기 어절의 어간 및 어미를 이용해 만들 수 있는 용언의 활용형에 기초하여 상기 어절을 변경하여 생성될 수 있다.When the word is a predicate, the erroneous sentence may be generated by changing the word based on the conjugation of a verb that can be made using the stem and ending of the word.

상기 오류 문장은, 상기 어절이 서술어가 아닌 경우, 상기 어절을 맞춤법 오류 목록에 포함된 상기 어절에 대한 오류로 변경하여 생성될 수 있다.When the word is not a predicate, the erroneous sentence may be generated by changing the word into an error for the word included in the spelling error list.

상기 오류 문장은, 상기 형태소를 맞춤법 오류 목록에 포함된 상기 형태소에 대한 오류로 변경하여 생성될 수 있다.The erroneous sentence may be generated by changing the morpheme to an error for the morpheme included in the spelling error list.

일 실시예에 따른 맞춤법 교정 장치는, 인스트럭션들을 포함하는 메모리와, 상기 인스트럭션들을 실행하기 위한 프로세서를 포함하고, 상기 프로세서에 의해 상기 인스트럭션들이 실행될 때, 상기 프로세서는, 문장을 수신하고, 상기 문장을 딥러닝 모델에 입력하여 상기 문장의 맞춤법을 교정하고, 상기 딥러닝 모델은, 정상 문장 및 상기 정상 문장의 어절 및 형태소 중 적어도 하나를 변경하여 생성된 오류 문장에 기초하여 학습된 딥러닝 모델이다.An apparatus for correcting spelling according to an embodiment includes a memory including instructions and a processor for executing the instructions. When the instructions are executed by the processor, the processor receives a sentence, inputs the sentence to a deep learning model, corrects the spelling of the sentence, and the deep learning model is a deep learning model learned based on a normal sentence and an erroneous sentence generated by changing at least one of a word and a morpheme of the normal sentence.

상기 오류 문장은, 상기 어절이 서술어인 경우, 상기 어절의 어간 및 어미를 이용해 만들 수 있는 용언의 활용형에 기초하여 상기 어절을 변경하여 생성될 수 있다.When the word is a predicate, the erroneous sentence may be generated by changing the word based on the conjugation of a verb that can be made using the stem and ending of the word.

상기 오류 문장은, 상기 어절이 서술어가 아닌 경우, 상기 어절을 맞춤법 오류 목록에 포함된 상기 어절에 대한 오류로 변경하여 생성될 수 있다.When the word is not a predicate, the erroneous sentence may be generated by changing the word into an error for the word included in the spelling error list.

상기 오류 문장은, 상기 형태소를 맞춤법 오류 목록에 포함된 상기 형태소에 대한 오류로 변경하여 생성될 수 있다.The erroneous sentence may be generated by changing the morpheme to an error for the morpheme included in the spelling error list.

일 실시예에 따른 맞춤법 교정을 위한 딥러닝 모델의 학습 방법은, 입력 문장의 어절 및 형태소 중 적어도 하나에 기초하여 맞춤법 오류를 포함하는 오류 문장을 생성하는 단계와, 상기 오류 문장을 상기 딥러닝 모델에 입력하는 단계와, 상기 딥러닝 모델의 출력 및 상기 입력 문장에 기초하여 상기 딥러닝 모델을 학습하는 단계를 포함할 수 있다.A method of learning a deep learning model for spelling correction according to an embodiment may include generating an erroneous sentence including a spelling error based on at least one of a word and a morpheme of an input sentence, inputting the erroneous sentence to the deep learning model, and learning the deep learning model based on an output of the deep learning model and the input sentence.

상기 생성하는 단계는, 상기 어절이 서술어인지 판단하는 단계와, 상기 어절이 서술어인 경우, 상기 어절을 다른 활용형으로 변경하는 단계와, 상기 어절이 서술어가 아닌 경우, 상기 어절을 맞춤법 오류 목록에 포함된 오류로 변경하는 단계를 포함할 수 있다.The generating step may include determining whether the word is a predicate, changing the word into another conjugation if the word is a predicate, and changing the word to an error included in a spelling error list if the word is not a predicate.

상기 변형하는 단계는, 상기 어절의 어간 및 어미를 추출하는 단계와, 상기 어간 및 상기 어미를 이용해 만들 수 있는 활용형들을 추출하는 단계와, 균등 분포에 기초하여 상기 활용형들 중 하나를 선택하여 상기 어절을 변경하는 단계를 포함할 수 있다.The transforming may include extracting the stem and ending of the word, extracting conjugations that can be made using the stem and ending, and changing the word by selecting one of the conjugation forms based on a uniform distribution.

상기 생성하는 단계는, 상기 형태소를 맞춤법 오류 목록에 포함된 상기 형태소에 대한 오류로 변경하는 단계를 포함할 수 있다.The generating may include changing the morpheme into an error for the morpheme included in a spelling error list.

상기 생성하는 단계는, 상기 입력 문장의 형태소 중 오류 발생 빈도가 가장 높은 형태소를 변경하는 단계를 포함할 수 있다.The generating may include changing a morpheme having the highest error occurrence frequency among morphemes of the input sentence.

상기 학습 방법은, 상기 입력 문장을 단어로 분리하는 전처리 단계를 더 포함할 수 있다.The learning method may further include a preprocessing step of dividing the input sentence into words.

도 1은 일 실시예에 따른 맞춤법 교정 장치를 도시한다.
도 2는 맞춤법 교정 모델의 학습 방법을 도시한다.
도 3은 맞춤법 교정 모델의 네트워크 구조를 도시한다.
1 illustrates a spelling correction device according to an embodiment.
2 shows a learning method of a spelling correction model.
Figure 3 shows the network structure of the spelling correction model.

실시예들에 대한 특정한 구조적 또는 기능적 설명들은 단지 예시를 위한 목적으로 개시된 것으로서, 다양한 형태로 변경되어 구현될 수 있다. 따라서, 실제 구현되는 형태는 개시된 특정 실시예로만 한정되는 것이 아니며, 본 명세서의 범위는 실시예들로 설명한 기술적 사상에 포함되는 변경, 균등물, 또는 대체물을 포함한다.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 features, numbers, steps, operations, components, parts, or combinations thereof exist, but it should be understood that the presence or addition of one or more other features or numbers, 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 are not interpreted in an ideal or excessively formal sense unless explicitly defined herein.

이하, 실시예들을 첨부된 도면들을 참조하여 상세하게 설명한다. 첨부 도면을 참조하여 설명함에 있어, 도면 부호에 관계없이 동일한 구성 요소는 동일한 참조 부호를 부여하고, 이에 대한 중복되는 설명은 생략하기로 한다.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은 일 실시예에 따른 맞춤법 교정 장치를 도시한다.1 illustrates a spelling correction device according to an embodiment.

맞춤법 교정 장치(100)는 맞춤법 오류를 교정할 수 있다. 맞춤법 교정 장치(100)는 딥러닝 모델을 이용하여 한글 문장의 맞춤법 오류를 교정할 수 있다.The spelling correction device 100 may correct spelling errors. The spelling correction device 100 may correct spelling errors in Korean sentences using a deep learning model.

맞춤법 교정을 위한 딥러닝 모델은 디노이징 오토인코더(denoising autoencoder) 방식으로 학습될 수 있다. 예를 들어, 맞춤법 교정 모델은 오류가 추가된 입력 데이터에 기초하여 입력 데이터를 출력하도록 학습될 수 있다.A deep learning model for spelling correction may be trained using a denoising autoencoder method. For example, a spelling correction model can be trained to output input data based on input data with errors added.

맞춤법 교정 장치(100)는 프로세서(130) 및 메모리(150)를 포함할 수 있다. 맞춤법 교정 장치(100)의 동작은 프로세서(130) 및 메모리(150)를 통해 수행될 수 있다.The spelling correction device 100 may include a processor 130 and a memory 150 . The operation of the spelling correction device 100 may be performed by the processor 130 and the memory 150 .

메모리(150)는 프로세서(130)에 의해 실행가능한 인스트럭션들(또는 프로그램)을 저장할 수 있다. 예를 들어, 인스트럭션들은 프로세서(130)의 동작 및/또는 프로세서(130)의 각 구성의 동작을 실행하기 위한 인스트럭션들을 포함할 수 있다.Memory 150 may store instructions (or programs) executable by processor 130 . For example, the instructions may include instructions for executing an operation of the processor 130 and/or an operation of each component of the processor 130 .

메모리(150)는 휘발성 메모리 장치 또는 불휘발성 메모리 장치로 구현될 수 있다. 휘발성 메모리 장치는 DRAM(dynamic random access memory), SRAM(static random access memory), T-RAM(thyristor RAM), Z-RAM(zero capacitor RAM), 또는 TTRAM(Twin Transistor RAM)으로 구현될 수 있다. 불휘발성 메모리 장치는 EEPROM(Electrically Erasable Programmable Read-Only Memory), 플래시(flash) 메모리, MRAM(Magnetic RAM), 스핀전달토크 MRAM(Spin-Transfer Torque(STT)-MRAM), Conductive Bridging RAM(CBRAM), FeRAM(Ferroelectric RAM), PRAM(Phase change RAM), 저항 메모리(Resistive RAM(RRAM)), 나노 튜브 RRAM(Nanotube RRAM), 폴리머 RAM(Polymer RAM(PoRAM)), 나노 부유 게이트 메모리(Nano Floating Gate Memory(NFGM)), 홀로그래픽 메모리(holographic memory), 분자 전자 메모리 소자(Molecular Eelectronic Memory Device), 또는 절연 저항 변화 메모리(Insulator Resistance Change Memory)로 구현될 수 있다.The memory 150 may be implemented as a volatile memory device or a nonvolatile memory device. The volatile memory device may be implemented as dynamic random access memory (DRAM), static random access memory (SRAM), thyristor RAM (T-RAM), zero capacitor RAM (Z-RAM), or twin transistor RAM (TTRAM). Non-volatile memory devices include EEPROM (Electrically Erasable Programmable Read-Only Memory), Flash memory, MRAM (Magnetic RAM), Spin-Transfer Torque (STT)-MRAM (Spin-Transfer Torque (STT)-MRAM), Conductive Bridging RAM (CBRAM), FeRAM (Ferroelectric RAM), PRAM (Phase change RAM), Resistive RAM (RRAM), Nanotube RRAM (Nanotube RRAM), polymer It can be implemented as polymer RAM (PoRAM), nano floating gate memory (NFGM), holographic memory, molecular electronic memory device, or insulator resistance change memory.

메모리(150)는 뉴럴 네트워크에 포함된 연산이 수행될 행렬을 저장할 수 있다. 메모리(150)는 프로세서(130)가 처리하여 생성된 연산 결과를 저장할 수 있다.The memory 150 may store a matrix on which an operation included in the neural network is to be performed. The memory 150 may store an operation result generated by processing by the processor 130 .

프로세서(130)는 메모리(150)에 저장된 데이터를 처리할 수 있다. 프로세서(130)는 메모리(150)에 저장된 컴퓨터로 읽을 수 있는 코드(예를 들어, 소프트웨어) 및 프로세서(130)에 의해 유발된 인스트럭션(instruction)들을 실행할 수 있다.The processor 130 may process data stored in the memory 150 . The processor 130 may execute computer readable code (eg, software) stored in the memory 150 and instructions triggered by the processor 130 .

프로세서(130)는 목적하는 동작들(desired operations)을 실행시키기 위한 물리적인 구조를 갖는 회로를 가지는 하드웨어로 구현된 데이터 처리 장치일 수 있다. 예를 들어, 목적하는 동작들은 프로그램에 포함된 코드(code) 또는 인스트럭션들(instructions)을 포함할 수 있다. 예를 들어, 하드웨어로 구현된 데이터 처리 장치는 중앙 처리 장치(central processing unit), 그래픽 처리 장치(graphics processing unit), 신경망 처리 장치(neural processing unit), 멀티-코어 프로세서(multi-core processor), 멀티프로세서(multiprocessor), ASIC(Application-Specific Integrated Circuit), FPGA(Field Programmable Gate Array)를 포함할 수 있다.The processor 130 may be a hardware-implemented data processing device having a circuit having a physical structure for executing desired operations. For example, desired operations may include codes or instructions included in a program. For example, a data processing unit implemented as hardware may include a central processing unit, a graphics processing unit, a neural network processing unit, a multi-core processor, a multiprocessor, an application-specific integrated circuit (ASIC), and a field programmable gate array (FPGA).

도 2는 맞춤법 교정 모델의 학습 방법을 도시하고, 도 3은 맞춤법 교정 모델의 네트워크 구조를 도시한다.2 shows a learning method of a spelling correction model, and FIG. 3 shows a network structure of a spelling correction model.

맞춤법 교정 모델(300)은 한글 문장들을 이용하여 학습될 수 있다. 예를 들어, 한글 문장들은 온라인으로 제공되는 백과사전(예를 들어, 위키피디아, 네이버 백과사전)에서 획득될 수 있다. 또한, 국립 국어원에서 제공하는 말뭉치(corpus)가 학습 데이터 세트로 이용될 수 있다. 이때, 한글 문장들은 맞춤법 오류를 포함하지 않는 정상 문장들일 수 있다.The spelling correction model 300 may be trained using Korean sentences. For example, Korean sentences may be acquired from online encyclopedias (eg, Wikipedia, Naver Encyclopedia). In addition, a corpus provided by the National Institute of the Korean Language can be used as a learning data set. In this case, the Korean sentences may be normal sentences that do not include spelling errors.

맞춤법 교정 모델(300)은 디노이징 오토인코더(denoising autoencoder) 방식으로 학습될 수 있다.The spelling correction model 300 may be learned using a denoising autoencoder method.

맞춤법 교정 모델(300)의 학습 방법(200)은 전처리 단계(pre-processing; 210), 사전 학습 단계(pre-training; 220), 학습 단계(training; 230) 및 후처리 단계(post-processing; 240)을 포함할 수 있다.The learning method 200 of the spelling correction model 300 may include a pre-processing step 210, a pre-training step 220, a training step 230, and a post-processing step 240.

전처리 단계(210)는 입력 문장을 서브워드(subword)로 분리하는 단계일 수 있다. 예를 들어, 전처리 단계(210)에서 맞춤법 교정 모델(300)에 학습 데이터로 입력되는 입력 문장은 센텐스피스(sentencepiece) 소스를 통해 단어들로 분리될 수 있다.The preprocessing step 210 may be a step of dividing an input sentence into subwords. For example, an input sentence input as training data to the spelling correction model 300 in the preprocessing step 210 may be separated into words through a sentencepiece source.

사전 학습 단계(220)는 입력 문장에 오류를 추가하는 단계일 수 있다. 사전 학습 단계(220)에서 입력 문장의 어절 및 형태소 중 적어도 하나에 기초하여 맞춤법 오류를 포함하는 오류 문장이 생성될 수 있다.The pre-learning step 220 may be a step of adding errors to the input sentence. In the pre-learning step 220, an erroneous sentence including a spelling error may be generated based on at least one of a word and a morpheme of the input sentence.

오류 문장은 어절을 기반으로 생성될 수 있다. 입력 문장에 포함된 어절은 서술어인지 판단될 수 있다. 예를 들어, 어절이 서술어인지 여부는 soylemma 사전 또는 한국어 NLP를 위한 파이썬(python) 사전에 기초하여 판단될 수 있다.An error sentence may be generated based on a word. It may be determined whether a word included in the input sentence is a predicate. For example, whether a word is a predicate may be determined based on a soylemma dictionary or a python dictionary for Korean NLP.

어절이 서술어인 경우, 어절을 다른 활용형으로 변경하여 오류 문장이 생성될 수 있다. 서술어인 어절은 어간과 어미로 분리될 수 있고, 어간 및 어미에 기초하여 만들 수 있는 용언의 활용형이 추출될 수 있다. 변경되는 활용형은 균등 분포에 기초하여 추출된 활용형 중에서 선택될 수 있다.If the word is a predicate, an error sentence can be created by changing the word to another conjugation. Words that are predicate words can be separated into stems and endings, and conjugations of verbs that can be made based on the stems and endings can be extracted. The changed utilization type may be selected from utilization types extracted based on uniform distribution.

어절이 서술어가 아닌 경우, 어절은 맞춤법 오류 목록에 포함된 오류로 변경될 수 있다. 예를 들어, 맞춤법 오류 목록은 자주 틀리는 맞춤법 오류를 포함하는 목록 등을 포함할 수 있다.If the word is not a predicate, the word may be changed to an error included in the spelling error list. For example, the misspelling error list may include a list including frequent misspelling errors, and the like.

오류 문장은 형태소를 기반으로 생성될 수 있다. 오류 문장은 입력 문장에 포함되는 형태소를 변경하여 생성될 수 있다. 오류 문장은 입력 문장의 올바른 형태소를 오류로 대체하는 노이즈 함수에 기초하여 생성될 수 있다.Error sentences may be generated based on morphemes. An error sentence may be generated by changing a morpheme included in an input sentence. An erroneous sentence may be generated based on a noise function that replaces correct morphemes of an input sentence with erroneous ones.

노이즈 함수는 올바른 형태소 및 대응되는 오류를 포함하는 맞춤법 오류 목록에 기초하여 형태소를 변경할 수 있다. 노이즈 함수는 입력 문장에 포함된 형태소 중 일부를 무작위로 선택하여 맞춤법 오류 목록에 포함된 오류로 대체할 수 있다. 예를 들어, 노이즈 함수는 국립국어원에서 제공하는 한국어 학습자 말뭉치에 기초하여 오류 문장을 생성할 수 있다. 한국어 학습자 말뭉치는 올바른 형태소와 형태소에 대응되는 오류를 포함하는 말뭉치들을 포함할 수 있다.The noise function can change morphemes based on a misspelling list that includes correct morphemes and corresponding errors. The noise function can randomly select some of the morphemes included in the input sentence and replace them with errors included in the spelling error list. For example, the noise function may generate an error sentence based on the Korean learner corpus provided by the National Institute of the Korean Language. The Korean learner's corpus may include correct morphemes and corpora with errors corresponding to the morphemes.

학습 단계(230)는 입력 문장 및 오류 문장 쌍에 기초하여 맞춤법 교정 모델(300)을 학습하는 단계일 수 있다. 맞춤법 교정 모델(300)의 학습 방법은 수학식 1과 같이 표현될 수 있다.The learning step 230 may be a step of learning the spelling correction model 300 based on the pair of input sentences and erroneous sentences. The learning method of the spelling correction model 300 can be expressed as Equation 1.

x 및 x+noise는 각각 입력 문장 및 오류 문장이고, Enc(*) 및 Dec(*)는 맞춤법 교정 모델(300)의 인코더 및 디코더의 함수이고, Loss(*)는 손실함수를 의미한다.x and x+noise are input sentences and error sentences, respectively, Enc(*) and Dec(*) are encoder and decoder functions of the spelling correction model 300, and Loss(*) is a loss function.

맞춤법 교정 모델(300)은 트랜스포머 모델(Transformer model)일 수 있다. 맞춤법 교정 모델(300)은 여덟 개의 어텐션 헤드(attention heads)와 사전 어텐션 레이어 정규화(pre-attention layer normalization)를 포함하는 512 내지 2048 단위의 여섯 개의 블록 모델을 포함할 수 있다.The spelling correction model 300 may be a Transformer model. The spelling correction model 300 may include six block models of 512 to 2048 units including eight attention heads and pre-attention layer normalization.

후처리 단계(240)는 맞춤법 교정 모델(300)이 교정에 실패한 경우에 실패한 부분을 다시 변경해주는 단계일 수 있다. 예를 들어, 후처리 단계에서, 맞춤법 교정 모델(300)에서 출력된 알 수 없는 단어는 "unk"로 표시되고, 해당 부분은 다른 단어로 다시 변경될 수 있다.The post-processing step 240 may be a step of changing the failed portion again when the spelling correction model 300 fails in correction. For example, in the post-processing step, an unknown word output from the spelling correction model 300 is displayed as “unk”, and the corresponding part may be changed to another word again.

이상에서 설명된 실시예들은 하드웨어 구성요소, 소프트웨어 구성요소, 및/또는 하드웨어 구성요소 및 소프트웨어 구성요소의 조합으로 구현될 수 있다. 예를 들어, 실시예들에서 설명된 장치, 방법 및 구성요소는, 예를 들어, 프로세서, 콘트롤러, 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 be implemented using a general purpose computer or special purpose computer, such as, for example, a processor, controller, arithmetic logic unit (ALU), digital signal processor, microcomputer, field programmable gate array (FPGA), 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 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 recognize that the processing device may include a plurality of processing elements and/or multiple types of processing elements. 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 these, and may configure a processing device to operate as desired, or may independently or collectively direct a processing device. Software and/or data may be permanently or temporarily embodied in any tangible machine, component, physical device, virtual equipment, computer storage medium or device, or transmitted signal wave, to be interpreted by, or to provide instructions or data to, a processing device. 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. 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, magneto-optical media such as floptical disks, and hardware devices specially configured to store and execute program instructions such as ROM, RAM, and flash memory. 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, even if the described techniques are performed in an order different from the described method, and/or components of the described system, structure, device, circuit, etc. are combined or combined in a different form from the described method, or replaced or substituted by other components or 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 (14)

맞춤법 교정 장치가 수행하는 맞춤법 교정 방법에 있어서,
상기 맞춤법 교정 장치가 한국어 문장을 수신하는 단계; 및
상기 맞춤법 교정 장치가 상기 문장을 딥러닝 모델에 입력하여 상기 문장의 맞춤법을 교정하는 단계
를 포함하고,
상기 딥러닝 모델은,
정상 문장 및 상기 정상 문장의 어절 및 형태소 중 적어도 하나를 변경하여 생성된 오류 문장에 기초하여 학습된, 디노이징 오토인코더 기반 딥러닝 모델이고,
상기 오류 문장은,
상기 어절이 서술어인 경우, 상기 어절의 어간 및 어미를 이용해 만들 수 있는 용언의 활용형에 기초하여 상기 어절을 변경하여 생성된 것인,
맞춤법 교정 방법.
In the spelling correction method performed by the spelling correction device,
receiving a Korean sentence by the spelling correction device; and
Correcting the spelling of the sentence by inputting the sentence to a deep learning model by the spelling correction device
including,
The deep learning model,
A denoising autoencoder-based deep learning model learned based on a normal sentence and an erroneous sentence generated by changing at least one of the word and morpheme of the normal sentence,
The error statement is
If the word is a predicate word, it is generated by changing the word based on the conjugation of a verb that can be made using the stem and ending of the word,
How to correct spelling.
삭제delete 제1항에 있어서,
상기 오류 문장은,
상기 어절이 서술어가 아닌 경우, 상기 어절을 맞춤법 오류 목록에 포함된 상기 어절에 대한 오류로 변경하여 생성된, 맞춤법 교정 방법.
According to claim 1,
The error statement is
If the word is not a predicate, the spelling correction method generated by changing the word to an error for the word included in the spelling error list.
제1항에 있어서,
상기 오류 문장은,
상기 형태소를 맞춤법 오류 목록에 포함된 상기 형태소에 대한 오류로 변경하여 생성된, 맞춤법 교정 방법.
According to claim 1,
The error statement is
A spelling correction method generated by changing the morpheme to an error for the morpheme included in a spelling error list.
인스트럭션들을 포함하는 메모리; 및
상기 인스트럭션들을 실행하기 위한 프로세서
를 포함하고,
상기 프로세서에 의해 상기 인스트럭션들이 실행될 때, 상기 프로세서는,
한국어 문장을 수신하고, 상기 문장을 딥러닝 모델에 입력하여 상기 문장의 맞춤법을 교정하고,
상기 딥러닝 모델은,
정상 문장 및 상기 정상 문장의 어절 및 형태소 중 적어도 하나를 변경하여 생성된 오류 문장에 기초하여 학습된, 디노이징 오토인코더 기반 딥러닝 모델이고,
상기 오류 문장은,
상기 어절이 서술어인 경우, 상기 어절의 어간 및 어미를 이용해 만들 수 있는 용언의 활용형에 기초하여 상기 어절을 변경하여 생성된 것인,
맞춤법 교정 장치.
memory containing instructions; and
A processor for executing the above instructions
including,
When the instructions are executed by the processor, the processor:
Receive a Korean sentence, input the sentence to a deep learning model to correct the spelling of the sentence,
The deep learning model,
A denoising autoencoder-based deep learning model learned based on a normal sentence and an erroneous sentence generated by changing at least one of the word and morpheme of the normal sentence,
The error statement is
If the word is a predicate word, it is generated by changing the word based on the conjugation of a verb that can be made using the stem and ending of the word,
Spell corrector.
삭제delete 제5항에 있어서,
상기 오류 문장은,
상기 어절이 서술어가 아닌 경우, 상기 어절을 맞춤법 오류 목록에 포함된 상기 어절에 대한 오류로 변경하여 생성된, 맞춤법 교정 장치.
According to claim 5,
The error statement is
If the word is not a predicate, the spelling correction device generated by changing the word to an error for the word included in the spelling error list.
제5항에 있어서,
상기 오류 문장은,
상기 형태소를 맞춤법 오류 목록에 포함된 상기 형태소에 대한 오류로 변경하여 생성된, 맞춤법 교정 장치.
According to claim 5,
The error statement is
A spelling correction device generated by changing the morpheme to an error for the morpheme included in a spelling error list.
맞춤법 교정 장치가 수행하는, 한국어 맞춤법 교정을 위한 딥러닝 모델의 학습 방법에 있어서,
상기 맞춤법 교정 장치가 입력 문장의 어절 및 형태소 중 적어도 하나에 기초하여 맞춤법 오류를 포함하는 오류 문장을 생성하는 단계;
상기 맞춤법 교정 장치가 상기 오류 문장을 상기 딥러닝 모델에 입력하는 단계; 및
상기 맞춤법 교정 장치가 상기 딥러닝 모델의 출력 및 상기 입력 문장에 기초하여, 디노이징 오토인코더에 기반한 상기 딥러닝 모델을 학습하는 단계
를 포함하고,
상기 생성하는 단계는,
상기 어절이 서술어인 경우에 상기 어절의 어간 및 어미를 추출하는 단계;
상기 어간 및 상기 어미를 이용해 만들 수 있는 활용형들을 추출하는 단계; 및
균등 분포에 기초하여 상기 활용형들 중 하나를 선택하여 상기 어절을 변경하는 단계
를 포함하는, 학습 방법.
In the learning method of a deep learning model for Korean spelling correction performed by a spelling correction device,
generating, by the spell correction device, an erroneous sentence including a spelling error based on at least one of a word and a morpheme of the input sentence;
inputting the erroneous sentence into the deep learning model by the spelling correction device; and
Learning, by the spell correction device, the deep learning model based on a denoising autoencoder based on the output of the deep learning model and the input sentence;
including,
The generating step is
extracting the stem and ending of the word when the word is a predicate;
extracting conjugations that can be made using the stem and the ending; and
Changing the word by selecting one of the conjugations based on uniform distribution
Including, learning method.
제9항에 있어서,
상기 생성하는 단계는,
상기 어절이 서술어가 아닌 경우, 상기 어절을 맞춤법 오류 목록에 포함된 오류로 변경하는 단계
를 포함하는, 학습 방법.
According to claim 9,
The generating step is
If the word is not a predicate, changing the word to an error included in a spelling error list.
Including, learning method.
삭제delete 제9항에 있어서,
상기 생성하는 단계는,
상기 형태소를 맞춤법 오류 목록에 포함된 상기 형태소에 대한 오류로 변경하는 단계
를 포함하는, 학습 방법.
According to claim 9,
The generating step is
Changing the morpheme to an error about the morpheme included in the spelling error list
Including, learning method.
제12항에 있어서,
상기 형태소에 대한 오류로 변경하는 단계는,
상기 입력 문장의 형태소 중 오류 발생 빈도가 가장 높은 형태소를 변경하는 단계
를 포함하는, 학습 방법.
According to claim 12,
The step of changing the morpheme to an error,
Changing a morpheme with the highest error occurrence frequency among morphemes of the input sentence
Including, learning method.
제9항에 있어서,
상기 맞춤법 교정 장치가 상기 입력 문장을 단어로 분리하는 전처리 단계
를 더 포함하는, 학습 방법.
According to claim 9,
A pre-processing step of dividing the input sentence into words by the spelling correction device.
Further comprising, learning method.
KR1020200146251A 2020-11-04 2020-11-04 Method and apparatus for correcting grammatical error, and training method of deep learing model therefor KR102559687B1 (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
KR1020200146251A KR102559687B1 (en) 2020-11-04 2020-11-04 Method and apparatus for correcting grammatical error, and training method of deep learing model therefor

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
KR1020200146251A KR102559687B1 (en) 2020-11-04 2020-11-04 Method and apparatus for correcting grammatical error, and training method of deep learing model therefor

Publications (2)

Publication Number Publication Date
KR20220060350A KR20220060350A (en) 2022-05-11
KR102559687B1 true KR102559687B1 (en) 2023-07-26

Family

ID=81607138

Family Applications (1)

Application Number Title Priority Date Filing Date
KR1020200146251A KR102559687B1 (en) 2020-11-04 2020-11-04 Method and apparatus for correcting grammatical error, and training method of deep learing model therefor

Country Status (1)

Country Link
KR (1) KR102559687B1 (en)

Family Cites Families (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
KR102348845B1 (en) * 2018-05-23 2022-01-11 부산대학교 산학협력단 A method and system for context sensitive spelling error correction using realtime candidate generation

Non-Patent Citations (5)

* Cited by examiner, † Cited by third party
Title
Lee et al. "Korean grammatical error correction based on transformer with copying mechanisms and grammatical noise implantation methods." Sensors 21.8 (2021): 2658.
Xie et al. "Noising and denoising natural language: Diverse backtranslation for grammar correction." Proceedings of NAACL-HLT 2018: Human Language Technologies, Volume 1 (Long Papers). 2018.*
김태형 et al. "디노이징 메커니즘을 통한 한국어 대화 모델 정규화." 정보과학회논문지 45.6 (2018): 572-581.
김태형 et al. "한국어 대화 모델 학습을 위한 디노이징 응답 생성." 한국어정보학회 학술대회 (2017): 29-34.*
박찬준 et al. "Denoising Transformer기반 한국어 맞춤법 교정기." 한국어정보학회 학술대회 (2019): 368-372.*

Also Published As

Publication number Publication date
KR20220060350A (en) 2022-05-11

Similar Documents

Publication Publication Date Title
KR102184278B1 (en) Method and system for transfer learning into any target dataset and model structure based on meta-learning
KR102589638B1 (en) Apparatus and method for generating a sentence
US9922025B2 (en) Generating distributed word embeddings using structured information
KR102342066B1 (en) Method and apparatus for machine translation using neural network and method for learning the appartus
Nguyen et al. Relation extraction: Perspective from convolutional neural networks
US11334467B2 (en) Representing source code in vector space to detect errors
KR102458244B1 (en) Machine translation method and apparatus
JP7276498B2 (en) Information processing device, information processing method and program
JP7070653B2 (en) Learning devices, speech recognition ranking estimators, their methods, and programs
Matteson et al. Rich character-level information for Korean morphological analysis and part-of-speech tagging
KR20210044056A (en) Natural language processing method and appratus using repetetion token embedding
WO2021010203A1 (en) Inference device, inference method, and inference program
KR20200025779A (en) Method and apparatus for mapping sentences
CN111062206B (en) Sub-word unit splitting method, sub-word unit splitting device and computer readable storage medium
KR102559687B1 (en) Method and apparatus for correcting grammatical error, and training method of deep learing model therefor
KR102594770B1 (en) Matching continuous values in data processing devices
WO2016056503A1 (en) Partial character string position detection device, partial character string position detection method, and program
US11341340B2 (en) Neural machine translation adaptation
US9594829B2 (en) Identifying possible contexts for a source of unstructured data
KR20220049693A (en) Translation method using proper nouns coding based on neural network and the system thereof
WO2021113467A1 (en) Generating followup questions for interpretable recursive multi-hop question answering
US11048878B2 (en) Determining answers to a question that includes multiple foci
US20230269104A1 (en) Method of managing data history and device performing the same
KR102593448B1 (en) Device and method for parallel corpus filtering based on semantic similarity
KR102425922B1 (en) Method of translating ancient korean using machine translation

Legal Events

Date Code Title Description
E902 Notification of reason for refusal
AMND Amendment
AMND Amendment
X701 Decision to grant (after re-examination)