KR20220142901A - Method and system for extracting information from semi-structured documents - Google Patents

Method and system for extracting information from semi-structured documents Download PDF

Info

Publication number
KR20220142901A
KR20220142901A KR1020210070404A KR20210070404A KR20220142901A KR 20220142901 A KR20220142901 A KR 20220142901A KR 1020210070404 A KR1020210070404 A KR 1020210070404A KR 20210070404 A KR20210070404 A KR 20210070404A KR 20220142901 A KR20220142901 A KR 20220142901A
Authority
KR
South Korea
Prior art keywords
type
category
words
tokens
token
Prior art date
Application number
KR1020210070404A
Other languages
Korean (ko)
Other versions
KR102649429B1 (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 JP2022062744A priority Critical patent/JP7453731B2/en
Publication of KR20220142901A publication Critical patent/KR20220142901A/en
Application granted granted Critical
Publication of KR102649429B1 publication Critical patent/KR102649429B1/en

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06VIMAGE OR VIDEO RECOGNITION OR UNDERSTANDING
    • G06V30/00Character recognition; Recognising digital ink; Document-oriented image-based pattern recognition
    • G06V30/40Document-oriented image-based pattern recognition
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06VIMAGE OR VIDEO RECOGNITION OR UNDERSTANDING
    • G06V30/00Character recognition; Recognising digital ink; Document-oriented image-based pattern recognition
    • G06V30/10Character recognition

Landscapes

  • Engineering & Computer Science (AREA)
  • Computer Vision & Pattern Recognition (AREA)
  • Physics & Mathematics (AREA)
  • General Physics & Mathematics (AREA)
  • Multimedia (AREA)
  • Theoretical Computer Science (AREA)
  • Artificial Intelligence (AREA)
  • Information Retrieval, Db Structures And Fs Structures Therefor (AREA)

Abstract

The present invention relates to a method and system for extracting information from a document. The present invention may provide a method for extracting information from a semi-structured document. The method comprises the steps of: performing optical character recognition (OCR) on a target document to extract a plurality of words and location information on each of the plurality of words; generating a plurality of tokens corresponding to the plurality of words, respectively; and arranging the plurality of tokens to reflect a data structure between the plurality of words included in the target document. In the step of arranging the plurality of tokens, the plurality of tokens are arranged by using the meaning of the plurality of words and location information for each of the plurality of words. According to the present invention, the time required for generating learning data for machine learning can be greatly shortened.

Description

반정형 문서로부터 정보를 추출하는 방법 및 시스템{METHOD AND SYSTEM FOR EXTRACTING INFORMATION FROM SEMI-STRUCTURED DOCUMENTS}METHOD AND SYSTEM FOR EXTRACTING INFORMATION FROM SEMI-STRUCTURED DOCUMENTS

본 발명은 문서로부터 정보를 추출하는 방법 및 시스템에 관한 것이다.The present invention relates to a method and system for extracting information from a document.

인공지능의 사전적 의미는, 인간의 학습능력과 추론능력, 지각능력, 자연언어의 이해능력 등을 컴퓨터 프로그램으로 실현한 기술이라 할 수 있다. 이러한 인공지능은 머신러닝에 인간의 뇌를 모방한 신경망 네트워크를 더한 딥러닝으로 인하여 비약적인 발전을 이루었다.The dictionary meaning of artificial intelligence is a technology that realizes human learning ability, reasoning ability, perceptual ability, and natural language understanding ability through computer programs. Such artificial intelligence made a leap forward due to deep learning, which added a neural network that mimics the human brain to machine learning.

딥러닝(deep learning)이란, 컴퓨터가 인간처럼 판단하고 학습할 수 있도록 하고, 이를 통해 사물이나 데이터를 군집화하거나 분류하는 기술로서, 최근에는 텍스트 데이터 뿐만 아니라 영상 데이터에 대한 분석까지 가능해져, 매우 다양한 산업분야에 적극적으로 활용되고 있다.Deep learning is a technology that allows a computer to judge and learn like a human, and to cluster or classify objects or data through this. It is actively used in the industrial field.

이러한, 인공지능의 발달로 사무자동화(office automation) 분야에 있어서도 다양한 자동화가 이루어지고 있다. 특히, 사무자동화 분야에서는 종이(paper)에 인쇄된 콘텐츠를 인공지능을 활용한 영상 데이터 분석 기술에 기반하여 데이터화 하는데 많은 노력을 기울이고 있다. 그 일환으로서, 사무자동화 분야에서는 종이 문서를 이미지화 하여, 이미지에 포함된 콘텐츠를 분석하는 이미지 분석 기술(또는 영상 데이터에 대한 분석 기술)을 통하여, 문서에 포함된 콘텐츠를 데이터화하고 있으며, 이 경우 문서에 포함된 콘텐츠의 타입에 맞게 이미지를 분석하는 기술이 필요하다.With the development of artificial intelligence, various automations are being made in the field of office automation. In particular, in the field of office automation, much effort is being made to convert content printed on paper into data based on image data analysis technology using artificial intelligence. As part of that, in the field of office automation, the content included in the document is converted into data through image analysis technology (or analysis technology for image data) that images the paper document and analyzes the content included in the image. It is necessary to have a technique for analyzing images according to the type of content included in the .

예를 들어, 영수증(receipt)을 포함하는 문서를 데이터화 하는 경우, 영수증의 형식, 영수증 내에 포함된 텍스트의 내용 및 영수증에 포함된 텍스트의 위치 등과 같이, 영수증을 둘러싼 다양한 요소들에 대한 정확한 분석이 필요하다.For example, when dataizing a document including a receipt, accurate analysis of various factors surrounding the receipt, such as the format of the receipt, the content of the text included in the receipt, and the location of the text included in the receipt, is required. need.

이에, 이미지에 포함된 정보를 전자 장비에서 처리할 수 있는 형태의 데이터로 가공하기 위한 다양한 기술들이 개발되고 있다. 예를 들어, 대한민국 등록특허 제10-1181209호에서는 OCR 데이터베이스를 구축하는 방법이 개시되어 있다. Accordingly, various technologies for processing information included in an image into data in a form that can be processed by electronic equipment have been developed. For example, Korean Patent Registration No. 10-1181209 discloses a method of constructing an OCR database.

그러나, 현재까지 개발된 방법은 사람이 경험적으로 정한 규칙에 따라 데이터를 분류하는 수준이므로, 대상 문서에 포함된 데이터의 구조 및 텍스트 데이터 간의 관계성까지 정확하게 재현할 수 있는 어플리케이션의 개발이 계속적으로 필요하다.However, since the method developed so far is at the level of classifying data according to rules set empirically by humans, it is necessary to continuously develop an application that can accurately reproduce the structure of data included in the target document and the relationship between text data. do.

본 발명은, 대상 문서에 포함된 복수의 단어 간의 데이터 구조를 반영하여 대상 문서로부터 정보를 추출하는 방법 및 시스템에 관한 것이다.The present invention relates to a method and system for extracting information from a target document by reflecting a data structure between a plurality of words included in the target document.

나아가, 본 발명은 대상 문서에서 데이터를 추출하는 기계학습 모델에 대한 훈련이 용이한 형태의 데이터로 대상 문서로부터 데이터를 추출하는 방법 및 시스템을 제공한다.Furthermore, the present invention provides a method and system for extracting data from a target document as data in a form that is easy to train for a machine learning model for extracting data from a target document.

구체적으로, 본 발명은 대상 문서에서 데이터를 추출하는 기계학습 모델의 정확도를 판단하는데 활용되는 학습 데이터 및 기계학습 모델로부터 출력되는 데이터의 형식을 사람이 가공하기 용이한 형태로 구현함으로써, 기계학습 모델의 정확도를 판단하는데 소요되는 시간 및 비용을 절감할 수 있도록 하는 데이터 추출 방법 및 시스템을 제공한다. Specifically, the present invention provides a machine learning model by implementing the training data used to determine the accuracy of the machine learning model for extracting data from the target document and the data output from the machine learning model in a form that is easy for humans to process. To provide a data extraction method and system that can reduce the time and cost required to determine the accuracy of

나아가, 본 발명은 대상 문서에 포함된 데이터 간의 관계성을 제공할 수 있는 데이터 추출 방법 및 시스템을 제공하기 위한 것이다.Furthermore, the present invention is to provide a data extraction method and system capable of providing a relationship between data included in a target document.

위에서 살펴본 과제를 해결하기 위하여, 본 발명은 대상 문서에 대한 OCR(Optical character recognition)을 수행하여, 복수의 단어 및 상기 복수의 단어 각각에 대한 위치 정보를 추출하는 단계, 상기 복수의 단어 각각에 대응되는 복수의 토큰을 생성하는 단계 및 상기 대상 문서에 포함된 상기 복수의 단어 간의 데이터 구조가 반영되도록, 상기 복수의 토큰을 배열하는 단계를 포함하고, 상기 복수의 토큰을 배열하는 단계에서는, 상기 복수의 단어의 의미 및 상기 복수의 단어 각각에 대한 위치 정보를 이용하여, 상기 복수의 토큰을 배열하는 것을 특징으로 하는 반정형 문서로부터 정보를 추출하는 방법을 제공할 수 있다.In order to solve the above problems, the present invention performs optical character recognition (OCR) on a target document to extract a plurality of words and location information for each of the plurality of words, corresponding to each of the plurality of words generating a plurality of tokens that become It is possible to provide a method of extracting information from a semi-structured document, characterized in that the plurality of tokens are arranged by using the meaning of the word and position information for each of the plurality of words.

또한, 본 발명은 대상 문서에 대한 OCR(Optical character recognition)을 수행하여, 복수의 단어 및 상기 복수의 단어 각각에 대한 위치 정보를 추출하는 OCR부, 상기 복수의 단어 각각에 대응되는 복수의 토큰을 생성하고, 상기 대상 문서에 포함된 상기 복수의 단어 간의 데이터 구조가 반영되도록, 상기 복수의 토큰을 배열하는 제어부를 포함하고, 상기 제어부는, 상기 복수의 단어의 의미 및 상기 복수의 단어 각각에 대한 위치 정보를 이용하여, 상기 복수의 토큰을 배열하는 것을 특징으로 하는 반정형 문서로부터 정보를 추출하는 시스템을 제공할 수 있다.In addition, the present invention performs OCR (Optical Character Recognition) on a target document to obtain a plurality of words and an OCR unit for extracting location information for each of the plurality of words, and a plurality of tokens corresponding to each of the plurality of words. and a control unit for arranging the plurality of tokens so that the data structure between the plurality of words included in the target document is reflected, and the control unit, for the meaning of the plurality of words and each of the plurality of words It is possible to provide a system for extracting information from a semi-structured document, characterized in that the plurality of tokens are arranged by using the location information.

또한, 본 발명은 전자기기에서 하나 이상의 프로세스에 의하여 실행되며, 컴퓨터로 판독될 수 있는 기록매체에 저장 가능한 프로그램으로서, 상기 프로그램은, 대상 문서에 대한 OCR(Optical character recognition)을 수행하여, 복수의 단어 및 상기 복수의 단어 각각에 대한 위치 정보를 추출하는 단계, 상기 복수의 단어 각각에 대응되는 복수의 토큰을 생성하는 단계 및 상기 대상 문서에 포함된 상기 복수의 단어 간의 데이터 구조가 반영되도록, 상기 복수의 토큰을 배열하는 단계를 수행하도록 하는 명령어들을 포함하고, 상기 복수의 토큰을 배열하는 단계에서는, 상기 복수의 단어의 의미 및 상기 복수의 단어 각각에 대한 위치 정보를 이용하여, 상기 복수의 토큰을 배열하는 것을 특징으로 하는 컴퓨터로 판독될 수 있는 기록매체에 저장 가능한 프로그램을 제공할 수 있다.In addition, the present invention is a program that is executed by one or more processes in an electronic device and can be stored in a computer-readable recording medium, wherein the program performs OCR (Optical Character Recognition) on a target document to obtain a plurality of extracting a word and location information for each of the plurality of words; generating a plurality of tokens corresponding to each of the plurality of words; and reflecting a data structure between the plurality of words included in the target document; and instructions for performing the step of arranging a plurality of tokens, wherein, in the step of arranging the plurality of tokens, the plurality of tokens by using the meaning of the plurality of words and location information for each of the plurality of words It is possible to provide a program storable in a computer-readable recording medium, characterized in that the arrangement.

위에서 살펴본 것과 같이, 본 발명은 대상 문서에서 추출된 상기 복수의 단어의 의미 및 상기 복수의 단어 각각에 대한 위치 정보를 이용하여, 생성된 토큰 및 생성된 토큰의 배열을 이용하여, 대상 문서에 포함된 복수의 단어 간의 데이터 구조가 반영된 데이터를 생성할 수 있다. As described above, according to the present invention, by using the meaning of the plurality of words extracted from the target document and location information for each of the plurality of words, the generated token and the array of the generated tokens are used to be included in the target document It is possible to generate data in which a data structure between a plurality of words is reflected.

또한, 본 발명에 따른 정보 추출 모델의 기계학습은 정보 추출 모델로부터 출력된 복수의 토큰의 정확도를 산출함으로써 수행된다. 상기 출력된 토큰들은 단어들 간의 관련성이 완전히 반영된 데이터가 아니므로, 상기 정보 추출 모델의 정확도를 산출하기 위한 학습 데이터 생성이 용이 해진다. In addition, machine learning of the information extraction model according to the present invention is performed by calculating the accuracy of a plurality of tokens output from the information extraction model. Since the output tokens do not fully reflect the relation between words, it is easy to generate training data for calculating the accuracy of the information extraction model.

구체적으로, 학습 데이터 생성 시 기 정해진 룰(토큰 생성 룰)에 따라 일정한 순서로 배열된 토큰을 생성한 후, 정보 추출 모델에서 출력된 토큰들과 비교하는 작업을 통해, 정보 추출 모델의 정확도를 판단하고, 상기 정보 추출 모델의 정확도를 향상시키기 위한 방향으로 정보 추출 모델에 대한 훈련을 진행할 수 있게 된다. 이에 따라, 정보 추출 모델의 기계학습을 위한 학습 데이터를 생성하는데 소요되는 시간이 크게 단축될 수 있다.Specifically, when generating training data, tokens arranged in a predetermined order are generated according to a predetermined rule (token generation rule), and then the accuracy of the information extraction model is determined by comparing it with the tokens output from the information extraction model. And it is possible to proceed with the training of the information extraction model in a direction to improve the accuracy of the information extraction model. Accordingly, the time required to generate training data for machine learning of the information extraction model can be greatly reduced.

도 1은 본 발명에 따른 정보 추출 시스템을 설명하기 위한 개념도이다.
도 2는 본 발명에 따른 정보 추출 방법을 설명하기 위한 순서도이다.
도 3a 및 도 3b는 본 발명에 정보 추출 모델을 설명하기 위한 개념도이다.
도 4는 본 발명에 따른 정보 추출 모델로부터 출력된 데이터를 트리(tree)화 한 모습을 나타내는 개념도이다.
도 5는 본 발명에 따른 정보 추출 모델의 기계학습 방법을 나타내는 개념도이다.
도 6은 본 발명에 따른 정보 추출 모델로부터 출력된 데이터의 정확도를 산출하는 모습을 나타내는 개념도이다.
도 7은 종래 정보 추출을 위한 기계학습 방법을 나타내는 개념도이다.
1 is a conceptual diagram for explaining an information extraction system according to the present invention.
2 is a flowchart illustrating an information extraction method according to the present invention.
3A and 3B are conceptual diagrams for explaining an information extraction model according to the present invention.
4 is a conceptual diagram illustrating a state in which data output from the information extraction model according to the present invention is converted into a tree.
5 is a conceptual diagram illustrating a machine learning method of an information extraction model according to the present invention.
6 is a conceptual diagram illustrating a state of calculating the accuracy of data output from the information extraction model according to the present invention.
7 is a conceptual diagram illustrating a conventional machine learning method for information extraction.

이하, 첨부된 도면을 참조하여 본 명세서에 개시된 실시 예를 상세히 설명하되, 도면 부호에 관계없이 동일하거나 유사한 구성요소에는 동일한 참조 번호를 부여하고 이에 대한 중복되는 설명은 생략하기로 한다. 이하의 설명에서 사용되는 구성요소에 대한 접미사 "모듈" 및 "부"는 명세서 작성의 용이함만이 고려되어 부여되거나 혼용되는 것으로서, 그 자체로 서로 구별되는 의미 또는 역할을 갖는 것은 아니다. 또한, 본 명세서에 개시된 실시 예를 설명함에 있어서 관련된 공지 기술에 대한 구체적인 설명이 본 명세서에 개시된 실시 예의 요지를 흐릴 수 있다고 판단되는 경우 그 상세한 설명을 생략한다. 또한, 첨부된 도면은 본 명세서에 개시된 실시 예를 쉽게 이해할 수 있도록 하기 위한 것일 뿐, 첨부된 도면에 의해 본 명세서에 개시된 기술적 사상이 제한되지 않으며, 본 발명의 사상 및 기술 범위에 포함되는 모든 변경, 균등물 내지 대체물을 포함하는 것으로 이해되어야 한다. Hereinafter, the embodiments disclosed in the present specification will be described in detail with reference to the accompanying drawings, but the same or similar components will be given the same reference numerals regardless of reference numerals, and redundant descriptions thereof will be omitted. The suffixes "module" and "part" for components used in the following description are given or mixed in consideration of only the ease of writing the specification, and do not have distinct meanings or roles by themselves. In addition, in describing the embodiments disclosed in the present specification, if it is determined that detailed descriptions of related known technologies may obscure the gist of the embodiments disclosed in this specification, the detailed description thereof will be omitted. In addition, the accompanying drawings are only for easy understanding of the embodiments disclosed in this specification, and the technical idea disclosed herein is not limited by the accompanying drawings, and all changes included in the spirit and scope of the present invention , should be understood to include equivalents or substitutes.

제1, 제2 등과 같이 서수를 포함하는 용어는 다양한 구성요소들을 설명하는데 사용될 수 있지만, 상기 구성요소들은 상기 용어들에 의해 한정되지는 않는다. 상기 용어들은 하나의 구성요소를 다른 구성요소로부터 구별하는 목적으로만 사용된다.Terms including ordinal numbers such as first, second, etc. may be used to describe various elements, but the elements are not limited by the terms. The above terms are used only for the purpose of distinguishing one component from another.

어떤 구성요소가 다른 구성요소에 "연결되어" 있다거나 "접속되어" 있다고 언급된 때에는, 그 다른 구성요소에 직접적으로 연결되어 있거나 또는 접속되어 있을 수도 있지만, 중간에 다른 구성요소가 존재할 수도 있다고 이해되어야 할 것이다. 반면에, 어떤 구성요소가 다른 구성요소에 "직접 연결되어" 있다거나 "직접 접속되어" 있다고 언급된 때에는, 중간에 다른 구성요소가 존재하지 않는 것으로 이해되어야 할 것이다.When a component is referred to as being “connected” or “connected” to another component, it may be directly connected or connected to the other component, but it is understood that other components may exist in between. it should be On the other hand, when it is said that a certain element is "directly connected" or "directly connected" to another element, it should be understood that the other element does not exist in the middle.

단수의 표현은 문맥상 명백하게 다르게 뜻하지 않는 한, 복수의 표현을 포함한다. The singular expression includes the plural expression unless the context clearly dictates otherwise.

본 출원에서, "포함한다" 또는 "가지다" 등의 용어는 명세서상에 기재된 특징, 숫자, 단계, 동작, 구성요소, 부품 또는 이들을 조합한 것이 존재함을 지정하려는 것이지, 하나 또는 그 이상의 다른 특징들이나 숫자, 단계, 동작, 구성요소, 부품 또는 이들을 조합한 것들의 존재 또는 부가 가능성을 미리 배제하지 않는 것으로 이해되어야 한다.In the present application, terms such as “comprises” or “have” are intended to designate that a feature, number, step, operation, component, part, or combination thereof described in the specification exists, but one or more other features It is to be understood that this does not preclude the possibility of the presence or addition of numbers, steps, operations, components, parts, or combinations thereof.

앞서 살펴본 것과 같이, 인공지능의 발달로 다양한 형태로 사무자동화(office automation)가 이루어지고 있으며, 업무의 효율을 위하여, 종이 문서에 포함된 일정한 형태의 정보를, 종이 문서에 포함된 형식 그대로 디지털화(데이터화) 해야 하는 니즈가 점차적으로 높아지고 있다.As mentioned above, with the development of artificial intelligence, office automation is being done in various forms, and for work efficiency, certain types of information contained in paper documents are digitized in the form contained in paper documents ( The need for data conversion) is gradually increasing.

예를 들어, 도 1에 도시된 영수증(領收證, receipt)과 같은 문서는 매장명, 매장 주소, 주문 상품명, 주문 상품 수량, 주문 금액 등 판매자 및 소비자와 관련된 복수의 범주(Category)를 포함하고 있으며, 데이터의 효율적인 처리를 위해 종이 문서에 포함된 데이터를 동일 범주끼리 연관 지어 전산화할 필요가 있다. For example, a document such as a receipt shown in FIG. 1 includes a plurality of categories related to sellers and consumers, such as store name, store address, order product name, ordered product quantity, and order amount. For efficient data processing, it is necessary to computerize the data included in paper documents by correlating the same categories with each other.

본 명세서에서 “범주”란 정의된 분류 내에서 임의의 수준에 있는 항목을 의미한다. 특정 범주에 속하는 데이터와 다른 범주에 속하는 데이터를 기준은 절대적인 것은 아니며, 범주를 규정하는 임의의 규칙에 따라 달라질 수 있다. 이러한 규칙은 종이 문서와 종이 문서를 디지털화 한 데이터에 다르게 적용될 수 있다.As used herein, “category” means an item at any level within a defined classification. The criteria for data belonging to a specific category and data belonging to other categories are not absolute, and may vary according to any rule defining the category. These rules may be applied differently to paper documents and data obtained by digitizing paper documents.

예를 들어, 종이 문서로 이루어진 특정 영수증은 “매장명”, “매장 주소”, “주문 상품 이름”, “주문 상품 수량”, “주문 상품 금액”이라는 다섯 개의 범주를 포함할 수 있으나, 상기 종이 문서에 포함된 데이터를 디지털화 할 때, “매장”, “주문 상품” 이라는 두 개의 범주로 축소될 수 있다. For example, a particular receipt made of paper documents may contain five categories: “Store Name”, “Store Address”, “Order Item Name”, “Order Item Quantity” and “Order Item Amount”, but When digitizing the data contained in a document, it can be reduced to two categories: “store” and “order product”.

한편, 본 명세서에서는 특정 범주의 속성을 나타내는 단어를 제1타입의 제1타입 단어로 분류한다. 예를 들어, 제1타입 단어는 범주에 속한 데이터의 상위 개념을 정의하는 단어(“매장명: “, “수량: “, “매장 주소”) 등을 포함할 수 있다. Meanwhile, in the present specification, words representing attributes of a specific category are classified as a first type word. For example, the first type word may include a word (“store name: “, “quantity: “, “store address”) defining a higher concept of data belonging to a category.

한편, 본 명세서에서는 특정 범주의 값을 나타내는 단어를 제2타입의 제2타입 단어로 분류한다. 예를 들어, 제2타입 단어는 범주에 속한 데이터(“Happy store”, “105 h-street”, “Carrot”)일 수 있다. 본 명세서에서는 상기 제1타입으로 분류된 제1타입 단어는 “필드명”, 제2타입으로 분류된 제2타입 단어는 “필드값”으로 지칭될 수 있다. Meanwhile, in the present specification, a word representing a value of a specific category is classified as a second type word of a second type. For example, the second type word may be data belonging to a category (“Happy store”, “105 h-street”, “Carrot”). In this specification, the first type word classified as the first type may be referred to as a “field name” and the second type word classified as the second type may be referred to as a “field value”.

한편, 기계에서 처리 가능한 형식의 데이터 관점에서 상기 제1타입 단어는 “속성(key)”으로 지칭될 수 있고, 상기 제2타입 단어는 “값(value)”으로 지칭될 수 있다. Meanwhile, from the viewpoint of machine-processable data, the first type word may be referred to as a “key” and the second type word may be referred to as a “value”.

상술한 용어 정의에 따르면, 영수증과 같은 종이 문서는 동일 범주에 포함된 “속성-값” 쌍의 데이터를 포함할 수 있다. 다만, 이에 한정되지 않고, 종이 영수증과 같은 종이 문서는 특정 범주에 대하여는 필드명 없이 필드값만 포함할 수 있다. 이 경우, 종이 문서에서 상기 필드명은 생략되었을 뿐, 생략된 필드명에 대응되는 필드값은 필드명과 관련된 의미를 포함하고 있다. According to the above definition of the term, a paper document such as a receipt may contain data of “attribute-value” pairs included in the same category. However, the present invention is not limited thereto, and a paper document such as a paper receipt may include only a field value without a field name for a specific category. In this case, the field name is omitted from the paper document, and a field value corresponding to the omitted field name includes a meaning related to the field name.

한편, 종이 문서는 필드값 없이 필드명만 포함할 수 있다. 이 경우, 특정 항목에 할당된 값이 존재하지 않는 것이며, 특정 항목에 할당된 값이 존재하지 않더라도, 종이 문서에 상기 특정 항목이 존재할 수 있다.Meanwhile, a paper document may include only field names without field values. In this case, the value assigned to the specific item does not exist, and even if the value assigned to the specific item does not exist, the specific item may exist in the paper document.

이하, 상술한 용어 정의를 바탕으로 본 발명에 대하여 구체적으로 설명한다. Hereinafter, the present invention will be described in detail based on the above-mentioned definitions of terms.

상술한 종이 문서는 종의 문서에 포함된 동일 범주의 데이터 간의 연관성을 유지하며, 기계가 이해 가능한 데이터로 변환될 수 있다. The above-described paper document maintains the association between data of the same category included in the document of the species, and may be converted into machine-readable data.

일 실시 예에 있어서, 광학식 문자판독장치(Optical Character Reader, OCR)를 이용하여 종이 문서에 포함된 단어를 추출할 수 있다. 영수증과 같이 복수의 범주의 데이터를 포함하는 문서의 경우, 추출된 단어에 대한 파싱(parsing) 과정을 거쳐 무관계 하게 디지털화된 단어를 동일 범주 별로 분류할 수 있다. 이에 따라, 복수의 속성-값 쌍을 포함하는 데이터가 형성될 수 있다.In an embodiment, words included in the paper document may be extracted using an optical character reader (OCR). In the case of a document including a plurality of categories of data, such as a receipt, digitized words can be classified into the same category regardless of the parsing process for the extracted words. Accordingly, data including a plurality of attribute-value pairs may be formed.

기계학습을 통해 OCR을 통해 무관계하게 디지털화된 단어들이 소정 데이터 구조를 가지도록 하고자 하는 연구가 계속되고 있다. 도 7을 참조하면, 종래 정보 추출 모델은 대상 문서(10)에 대한 OCR(711)을 통해 대상 문서(10)로부터 복수의 단어들 및 위치 정보를 추출하고, 이에 기반하여 직렬화 모델(Serializer, 712)을 통해, 추출된 단어들의 일부를 직렬화하고, 태깅 모델(Tagging model, 713)을 통해 직렬화된 텍스트의 범주를 분류하고, Tag2parse 모델(714)을 통해 파싱(parsing)을 수행하였다. Research is continuing to make unrelated digitized words have a predetermined data structure through OCR through machine learning. Referring to FIG. 7 , the conventional information extraction model extracts a plurality of words and location information from the target document 10 through the OCR 711 for the target document 10 , and based on this, a serialization model (Serializer, 712) ), serialized some of the extracted words, classified the serialized text category through a tagging model (713), and performed parsing through the Tag2parse model (714).

이후, 정규화 모델(parse normalizer, 715)를 통해 JSON 형태의 데이터를 생성한다.Thereafter, JSON-type data is generated through a normalization model (parse normalizer, 715).

종래 정보 추출 모델의 훈련은, Tag2parse 모델(714)로부터 출력된 데이터와 원본 데이터 간의 오차를 산출하여, 오차를 최소화하는 방향으로 진행되었다. 이때, 상기 오차 산출을 위해서는 원본 데이터(이하, 학습 데이터)를 생성해야 한다. 원본 데이터는 대상 문서(10)에 포함된 단어들 각각에 대한 주석을 표시(721)하고, 대상 문서(10)에 포함된 텍스트 조각들을 직렬화(722)하고 태깅 모델(723)을 통해 단어들 간의 파싱을 수행함으로써 생성된다. 상술한 과정은 모두 인간의 작업을 통해 진행되므로, 기계 학습을 위한 학습 데이터 생성에는 매우 많은 시간이 소요된다.The training of the conventional information extraction model was carried out in the direction of minimizing the error by calculating the error between the data output from the Tag2parse model 714 and the original data. In this case, in order to calculate the error, original data (hereinafter, referred to as learning data) should be generated. The source data displays 721 annotations for each of the words included in the target document 10 , serializes 722 text fragments included in the target document 10 , and uses a tagging model 723 between words It is created by performing parsing. Since all of the above processes are performed through human work, it takes a very long time to generate learning data for machine learning.

본 발명은 상술한 학습 데이터 생성에 소요되는 시간을 단축시켜, 정보 추출 모델의 기계학습에 소모되는 비용을 최소화할 수 있는 정보 추출 시스템 및 방법을 제공한다.The present invention provides an information extraction system and method capable of reducing the time required for generating the above-described learning data, thereby minimizing the cost of machine learning of an information extraction model.

본 발명은, 대상 문서에 포함된 복수의 단어 간의 데이터 구조를 반영하여 대상 문서로부터 데이터를 추출하는 시스템을 제공한다. The present invention provides a system for extracting data from a target document by reflecting a data structure between a plurality of words included in the target document.

이하에서는, 대상 문서에서 데이터를 추출하는 시스템에 대하여 첨부된 도면과 함께 보다 구체적으로 살펴본다. Hereinafter, a system for extracting data from a target document will be described in more detail with accompanying drawings.

도 1은 본 발명에 따른 정보 추출 시스템을 설명하기 위한 개념도이다.1 is a conceptual diagram for explaining an information extraction system according to the present invention.

본 발명에 따른 정보 추출 시스템(100)은 어플리케이션 또는 소프트웨어의 형태로 구현될 수 있다. 본 발명에 정보 추출 시스템(100)의 소프트웨어적인 구현에 의하면, 본 명세서에서 설명되는 절차 및 기능과 같은 실시 예들은 별도의 소프트웨어 모듈들로 구현될 수 있다. 소프트웨어 모듈들 각각은 본 명세서에서 설명되는 하나 이상의 기능 및 작동을 수행할 수 있다. The information extraction system 100 according to the present invention may be implemented in the form of an application or software. According to the software implementation of the information extraction system 100 according to the present invention, embodiments such as procedures and functions described in this specification may be implemented as separate software modules. Each of the software modules may perform one or more functions and operations described herein.

본 발명에 따른 소프트웨어적인 구현은 도 1에 도시된 정보 추출 시스템(100)에 의하여 구현되며, 이하에서는 정보 추출 시스템(100)의 구성에 대하여 보다 구체적으로 살펴본다.The software implementation according to the present invention is implemented by the information extraction system 100 shown in FIG. 1 , and the configuration of the information extraction system 100 will be described in more detail below.

본 발명에 따른 정보 추출 시스템(100)은 이미지에 대한 OCR을 통해 OCR 데이터를 생성할 수 있다. 본 명세서에서 OCR 데이터는 이미지로부터 추출된 텍스트 및 추출된 텍스트에 대응되는 위치 정보를 포함할 수 있다. 여기서, 상기 위치 정보는 추출된 텍스트의 이미지(또는 종이 문서) 내 위치를 정의한다.The information extraction system 100 according to the present invention may generate OCR data through OCR for an image. In the present specification, OCR data may include text extracted from an image and location information corresponding to the extracted text. Here, the location information defines a location in an image (or paper document) of the extracted text.

여기에서, 이미지는 종이 문서를 스캔한 것에 의하여 획득되는 이미지이거나, 기타 다른 다양한 방법으로 획득된 이미지일 수 있다.Here, the image may be an image obtained by scanning a paper document or an image obtained by other various methods.

한편, 도 1에 도시된 것과 같이, 본 발명에 따른 정보 추출 시스템(100)은 통신부(110), 저장부(120), OCR부(130) 및 제어부(140) 중 적어도 하나를 포함할 수 있다.Meanwhile, as shown in FIG. 1 , the information extraction system 100 according to the present invention may include at least one of a communication unit 110 , a storage unit 120 , an OCR unit 130 , and a control unit 140 . .

통신부(110)는 종이 문서를 스캔한 이미지(10)를 수신하는 수단으로서, 통신부, 스캔부 및 입력부 중 적어도 하나를 포함하여 구성되거나, 기타 이미지(10)를 수신할 수 있는 수단으로 이루어질 수 있다. The communication unit 110 is a means for receiving the scanned image 10 of a paper document, and may include at least one of a communication unit, a scanning unit, and an input unit, or may consist of other means capable of receiving the image 10 . .

정보 추출 시스템(100)은 통신부(110)를 통해 수신한 이미지(10)를 이용하여 데이터를 추출할 수 있다. The information extraction system 100 may extract data using the image 10 received through the communication unit 110 .

다음으로 저장부(120)는, 본 발명에 따른 다양한 정보를 저장하도록 이루어질 수 있다. 저장부(120)의 종류는 매우 다양할 수 있으며, 적어도 일부는, 외부 서버(150, 클라우드 서버 및 데이터베이스(database: DB) 중 적어도 하나)를 의미할 수 있다. 즉, 저장부(120)는 본 발명과 관련된 정보가 저장되는 공간이면 충분하며, 물리적인 공간에 대한 제약은 없는 것으로 이해될 수 있다. Next, the storage unit 120 may be configured to store various information according to the present invention. The types of the storage unit 120 may be very diverse, and at least some of them may mean an external server 150 (at least one of a cloud server and a database (DB)). That is, it can be understood that the storage unit 120 is sufficient as long as a space in which information related to the present invention is stored, and there is no restriction on the physical space.

저장부(120)에는 i) 종이 문서를 스캔한 이미지(10) 및 이와 관련된 데이터, ii) 정보 추출 모델의 기계학습에 활용되는 학습 데이터, iii) 추출된 데이터 중 적어도 하나가 저장될 수 있다. At least one of i) the scanned image 10 of a paper document and data related thereto, ii) learning data used for machine learning of an information extraction model, and iii) extracted data may be stored in the storage unit 120 .

저장부(120)에는 상술한 범주와 관련된 정보가 저장되어 있을 수 있다. 구체적으로, 범주와 관련된 정보는 범주에 대한 개념적인 정보, 범주에 대응되는 범주명을 나타내는 텍스트 및 범주에 대응되는 값을 정의하는 정보가 저장될 수 있다. The storage unit 120 may store information related to the above-described categories. Specifically, as the category-related information, conceptual information about the category, text indicating a category name corresponding to the category, and information defining a value corresponding to the category may be stored.

여기서, 범주명은 필드명, 범주에 대응되는 속성으로도 지칭될 수 있다.Here, the category name may also be referred to as a field name or an attribute corresponding to the category.

한편, 범주에 대응되는 값은 범주에 속하는 적어도 하나의 텍스트를 포함할 수 있다. Meanwhile, a value corresponding to a category may include at least one text belonging to the category.

한편, 상기 범주와 관련된 정보는 본 발명에 따른 정보 추출 모델에 대한 훈련이 이루어짐에 따라 업데이트 될 수 있다. 구체적으로, 정보 추출 모델에 대한 훈련이 진행됨에 따라, 저장부(120)에 정의된 범주의 개수가 증가될 수 있으며, 범주와 관련된 정보는 범주에 대한 개념적인 정보, 범주에 대응되는 범주명을 나타내는 텍스트 및 범주에 대응되는 값을 정의하는 정보 중 적어도 하나가 업데이트 될 수 있다.Meanwhile, the information related to the category may be updated as training for the information extraction model according to the present invention is performed. Specifically, as the training for the information extraction model proceeds, the number of categories defined in the storage unit 120 may increase, and the category-related information includes conceptual information about the category and a category name corresponding to the category. At least one of the indicated text and information defining a value corresponding to a category may be updated.

다음으로, OCR(Optical Character Reader, 130)부는 이미지(10)에 포함된 콘텐츠를 인식하는 수단으로서, 다양한 콘텐츠 인식 알고리즘 중 적어도 하나를 통하여 이미지(10)에 포함된 콘텐츠를 인식할 수 있다. OCR부(130)는 인공지능에 기반한 알고리즘을 이용하여, 콘텐츠를 인식할 수 있다. 여기에서 콘텐츠는 텍스트(문자)를 포함할 수 있다.Next, the OCR (Optical Character Reader, 130) unit may recognize the content included in the image 10 as a means for recognizing the content included in the image 10, and may recognize the content included in the image 10 through at least one of various content recognition algorithms. The OCR unit 130 may recognize the content by using an algorithm based on artificial intelligence. Here, the content may include text (characters).

OCR부는, 이미지에 포함된 텍스트 및 텍스트의 위치 정보를 추출할 수 있다. 여기에서, 텍스트의 위치 정보는 이미지(10) 내에서 텍스트가 어디에 위치하는지에 대한 정보를 포함할 수 있다.The OCR unit may extract text included in the image and location information of the text. Here, the position information of the text may include information on where the text is located in the image 10 .

다음으로 제어부(140)는 본 발명과 관련된 정보 추출 시스템(100)의 전반적인 동작을 제어하도록 이루어질 수 있다. 제어부(140)는 인공지능 알고리즘을 처리 가능한 프로세서(processor, 또는 인공지능 프로세서)를 포함할 수 있다. 제어부(140)는 딥러닝 알고리즘에 기반하여, 이미지(10)로부터 텍스트를 인식하고, 인식된 텍스트에 대한 정보 추출을 수행할 수 있다. Next, the controller 140 may be configured to control the overall operation of the information extraction system 100 related to the present invention. The controller 140 may include a processor (or artificial intelligence processor) capable of processing an artificial intelligence algorithm. The controller 140 may recognize a text from the image 10 based on a deep learning algorithm and extract information on the recognized text.

나아가, 제어부(140)는 정보 추출을 하기 위한 작업 영역을 제공하며, 이러한 작업 영역은 정보 추출을 수행하거나, 정보 추출을 위한 기계 학습을 수행하기 위한 “사용자 환경” 또는 “사용자 인터페이스”라고도 명명될 수 있다.Furthermore, the control unit 140 provides a work area for extracting information, and this work area may also be called "user environment" or "user interface" for performing information extraction or machine learning for information extraction. can

이러한 작업 영역은 전자기기의 디스플레이부 상에 출력(또는 제공)될 수 있다. 나아가, 제어부(140)는 전자기기에 구비된 또는 전자기기와 연동하는 사용자 입력부(예를 들어, 터치 스크린, 마우스 등)를 통해 수신되는 사용자 입력에 근거하여, 정보 추출을 수행하거나, 정보 추출을 위한 기계 학습을 수행을 수행할 수 있다.This work area may be output (or provided) on the display unit of the electronic device. Furthermore, the control unit 140 performs information extraction or extracts information based on a user input received through a user input unit (eg, a touch screen, a mouse, etc.) provided in the electronic device or interworking with the electronic device. It can perform machine learning for

한편, 본 발명에서 작업 영역이 출력되는 전자기기의 종류에는 특별한 제한이 없으며, 본 발명에 따른 어플리케이션이 구동이 가능하기만 하면 된다. 예를 들어, 전자기기는, 스마트폰(smart phone), 휴대폰, 태블릿 PC, 컴퓨터, 노트북, 디지털방송용 단말, PDA(Personal Digital Assistants), PMP(Portable Multimedia Player), 스마트 미러(smart mirror) 및 스마트 TV(smart TV) 중 적어도 하나가 될 수 있다.On the other hand, in the present invention, there is no particular limitation on the type of electronic device to which the work area is output, as long as the application according to the present invention can be driven. For example, the electronic device includes a smart phone, a mobile phone, a tablet PC, a computer, a notebook computer, a digital broadcasting terminal, a personal digital assistant (PDA), a portable multimedia player (PMP), a smart mirror, and a smart device. It may be at least one of TVs (smart TVs).

본 발명에서는, 전자기기 또는 전자기기에 구비되는 디스플레이부, 사용자 입력부에 대하여 별도의 도면 부호를 부여하지 않는다. 그러나, 본 발명에서 설명되는 작업 영역은 전자기기의 디스플레이부에 출력되며, 사용자 입력은 전자기기에 구비되거나, 전자기기와 연동하는 사용자 입력부를 통하여 수신됨은 당업자에게 자명할 것이다.In the present invention, separate reference numerals are not attached to the electronic device or the display unit and the user input unit provided in the electronic device. However, it will be apparent to those skilled in the art that the work area described in the present invention is output to the display unit of the electronic device, and the user input is provided in the electronic device or is received through a user input unit interworking with the electronic device.

이하에서는, 상술한 정보 추출 시스템을 이용하여 정보 추출을 수행하는 방법에 대하여 보다 구체적으로 살펴본다. 특히, 이하에서는, 순서도와 함께, 정보 추출 방법에 대하여 먼저 살펴보도록 한다.Hereinafter, a method of performing information extraction using the above-described information extraction system will be described in more detail. In particular, in the following, along with a flowchart, an information extraction method will be described first.

도 2는 본 발명에 따른 정보 추출 방법을 설명하기 위한 순서도이고, 도 3a 및 도 3b는 본 발명에 정보 추출 모델을 설명하기 위한 개념도이고, 도 4는 본 발명에 따른 정보 추출 모델로부터 출력된 데이터를 트리(tree)화 한 모습을 나타내는 개념도이다. 2 is a flowchart for explaining an information extraction method according to the present invention, FIGS. 3A and 3B are conceptual diagrams for explaining an information extraction model according to the present invention, and FIG. 4 is data output from the information extraction model according to the present invention. It is a conceptual diagram showing the state of becoming a tree.

본 발명에 따른 정보 추출 방법에서는, 대상 문서에 대한 OCR(Optical Character Recognition)을 수행하여, 복수의 단어 및 상기 복수의 단어 각각에 대한 위치 정보를 추출하는 단계가 진행된다(S110). In the information extraction method according to the present invention, a step of extracting a plurality of words and location information for each of the plurality of words by performing OCR (Optical Character Recognition) on a target document is performed (S110).

여기서, 대상 문서란 정보 추출 대상이 되는 종이 문서 또는 종이 문서에 대한 이미지일 수 있다. 앞서, 살펴본 것과 같이, 종이 문서에 대한 이미지(10)는 다양한 루트를 통하여 수신될 수 있다.Here, the target document may be a paper document that is an information extraction target or an image of the paper document. As described above, the image 10 for the paper document may be received through various routes.

OCR 데이터는 이미지에 포함된 텍스트 및 텍스트의 위치 정보를 포함할 수 있다. The OCR data may include text included in an image and location information of the text.

OCR 데이터에 포함된 기 설정된 기준에 따라 상기 OCR 데이터에 포함된 텍스트가 복수의 텍스트 조각(text segment)으로 구분될 수 있다.The text included in the OCR data may be divided into a plurality of text segments according to a preset criterion included in the OCR data.

일 실시 예에 있어서, 텍스트 조각은 어절 단위로 구분되거나, 텍스트의 위치 정보에 기반하여 인접한 복수의 텍스트들이 하나의 텍스트 조각으로 구분될 수 있다. According to an embodiment, a text fragment may be divided into word units, or a plurality of adjacent texts may be divided into one text fragment based on location information of the text.

텍스트 조각을 구분하는 과정에서 복수의 텍스트 조각이 하나로 통합되거나, 하나의 텍스트 조각이 복수개의 텍스트 조각으로 분리될 수 있다. 예를 들어, 도 1의 이미지(10)로부터 추출된 텍스트 “105 h-street”는 두 개의 텍스트 조각(“105” 및 “h-street”)으로 구분된 후, 하나의 텍스트 조각(“105 h-street”)으로 합쳐질 수 있다. 다른 예를 들어, 도 1의 이미지(10)로부터 추출된 “Happy store”는 하나의 텍스트 조각 “Happy store”로 구분된 후, 복수의 텍스트 조각(“Happy” 및 “store”)으로 분리될 수 있다.In the process of classifying the text fragments, a plurality of text fragments may be integrated into one, or one text fragment may be divided into a plurality of text fragments. For example, the text “105 h-street” extracted from the image 10 in FIG. 1 is divided into two text fragments (“105” and “h-street”), and then one text fragment (“105 h-street”). -street”). For another example, the “Happy store” extracted from the image 10 of FIG. 1 may be divided into one text fragment “Happy store” and then divided into a plurality of text fragments (“Happy” and “store”). have.

제어부(140)는 텍스트의 위치 정보에 기반하여 텍스트 조각을 통합하거나, 분리할 수 있다. 제어부(140)가 텍스트 조각을 통합하거나, 분리하는 모델은 기계학습을 통해 생성될 수 있으나, 이에 한정되는 것은 아니다.The controller 140 may integrate or separate text fragments based on the location information of the text. A model in which the controller 140 integrates or separates text fragments may be generated through machine learning, but is not limited thereto.

상술한 과정을 통해, 복수의 단어가 추출될 수 있다. Through the above-described process, a plurality of words may be extracted.

한편, 추출된 복수의 단어별로 위치 정보가 매칭될 수 있다. 여기서, 추출된 단어에 대응되는 위치 정보는 대상 문서 상의 위치 정보일 수 있다. 구체적으로, 상기 위치 정보는 상기 대상 문서의 이미지 상의 일 지점을 기준점으로 하고, 상기 기준점에 대한 2차원 좌표 정보를 포함할 수 있다. Meanwhile, location information may be matched for each of the plurality of extracted words. Here, the location information corresponding to the extracted word may be location information on the target document. Specifically, the location information may include a point on the image of the target document as a reference point, and 2D coordinate information for the reference point.

상술한 바와 같이, 상기 위치 정보는 상대 좌표일 수 있으며, 상기 위치 정보를 이용하여 추출된 복수의 단어간 거리가 산출될 수 있다.As described above, the location information may be relative coordinates, and distances between a plurality of words extracted using the location information may be calculated.

복수의 단어들 각각에 대한 위치 정보는 복수의 단어들 간의 관련성을 판단하는데 활용될 수 있다. 이에 대하여는 후술한다. The location information for each of the plurality of words may be used to determine a relevance between the plurality of words. This will be described later.

다음으로, 상기 복수의 단어 각각에 대응되는 복수의 토큰을 생성하는 단계가 수행된다(S120).Next, a step of generating a plurality of tokens corresponding to each of the plurality of words is performed (S120).

상기 복수의 토큰은 세 가지 타입 중 어느 하나로 생성될 수 있다. 먼저, 복수의 토큰 타입 중 제1 및 제2타입에 대하여 설명한다.The plurality of tokens may be generated in one of three types. First, the first and second types among the plurality of token types will be described.

복수의 토큰은 범주의 속성을 갖는 제1 타입의 제1 타입 토큰 및 상기 범주의 값에 해당하는 데이터 속성을 갖는 제2 타입의 제2 타입 토큰 중 어느 하나의 타입을 가질 수 있다. The plurality of tokens may have one type of a first type token having a category attribute and a second type token having a data attribute corresponding to a value of the category.

상기 제1 및 제2타입에 대응되는 토큰은 대상 문서로부터 추출된 복수의 단어 각각의 의미에 기반하여 생성될 수 있다. The tokens corresponding to the first and second types may be generated based on the meaning of each of the plurality of words extracted from the target document.

일 실시 예에 있어서, 상기 복수의 단어들은, 상기 복수의 단어 각각의 의미 및 상기 대상 문서 상에서의 복수의 단어 각각에 대한 위치 정보에 근거하여, 상기 복수의 단어들을 상기 범주의 속성을 갖는 제1타입에 대응되는 제1 타입 단어 및 상기 데이터의 속성을 갖는 제2타입 단어 중 적어도 하나로 분류된다. In an embodiment, the plurality of words may include the first plurality of words having the category attribute, based on the meaning of each of the plurality of words and location information of each of the plurality of words on the target document. It is classified into at least one of a first type word corresponding to the type and a second type word having an attribute of the data.

상기 분류 과정은 인공지능 모델을 통해 수행될 수 있다. 인공지능 모델은 상기 기 정의된 복수의 범주를 기준으로 상기 복수의 단어들 각각이 어느 범주에 속하는 단어인지 판단하고, 상기 복수의 단어들 각각 “속성”(제1타입)인지 “값”(제2타입)인지 판단한다. The classification process may be performed through an artificial intelligence model. The artificial intelligence model determines which category each of the plurality of words belongs to based on the plurality of predefined categories, and whether each of the plurality of words is an “attribute” (first type) or “value” (the first type). type 2).

복수의 단어들 중 제1타입으로 분류된 제1타입 단어들 각각에 대응되는 제1타입 토큰이 생성되며, 복수의 단어들 중 제2타입으로 분류된 제2타입 단어들 각각에 대응되는 제2타입 토큰이 생성된다. A first type token corresponding to each of the first type words classified as the first type among the plurality of words is generated, and a second type token corresponding to each of the second type words classified as the second type among the plurality of words is generated. A type token is created.

상기 제1타입의 제1타입 토큰은 범주의 속성을 정의하는 토큰으로, 범주명(필드명, 범주의 속성)을 나타내는 텍스트를 포함할 수 있다. 제1타입의 제1타입 토큰에 포함된 텍스트는 기 저장된 범주와 관련된 정보에 포함된 범주명일 수 있다. 여기서, 특정 제1타입 토큰에 포함된 텍스트는 상기 특정 제1타입 토큰 생성에 기반이 된 제1타입 단어와 동일하지 않을 수 있다. The first type of the first type token is a token defining a category attribute, and may include text indicating a category name (field name, category attribute). The text included in the first type token of the first type may be a category name included in pre-stored category-related information. Here, the text included in the specific first type token may not be the same as the first type word based on the generation of the specific first type token.

예를 들어, 도 3을 참조하면, 제1타입으로 분류된 단어 “품명”에 기반하여 생성되는 제1타입 토큰은 “품명”을 포함하지 않고, 텍스트 “name”을 포함한다. For example, referring to FIG. 3 , the first type token generated based on the word “product name” classified as the first type does not include “product name” but includes the text “name”.

상기 제2타입의 제2타입 토큰은 대상 문서로부터 추출된 단어 자체일 수 있다.The second type token of the second type may be a word itself extracted from a target document.

예를 들어, 도 3을 참조하면, 제2타입으로 분류된 단어 “Happy”에 대응되는 제2타입 토큰은 텍스트 “Happy” 자체일 수 있다.For example, referring to FIG. 3 , the second type token corresponding to the word “Happy” classified as the second type may be the text “Happy” itself.

한편, 특정 제1타입 토큰은 제2타입 단어의 의미에 기반하여 생성될 수 있다. 구체적으로, 복수의 단어 중 제2 타입으로 분류된 제2 타입 단어가 속하는 범주 각각에 대한 제1 타입 토큰을 생성이 생성될 수 있다. Meanwhile, the specific first type token may be generated based on the meaning of the second type word. Specifically, a first type token may be generated for each category to which the second type word classified as the second type among the plurality of words belongs.

일 실시 예에 있어서, 상기 복수의 단어 중 특정 범주의 범주 값 해당하는 특정 제2타입 단어가 존재하고, 상기 특정 범주에 해당하는 단어가 존재하지 않는 경우, 상기 특정 범주의 범주 값에 해당하는 상기 특정 제2타입 단어에 근거하여, 상기 특정 범주에 대응되는 특정 제1타입 토큰이 생성될 수 있다. In an embodiment, when a specific second type word corresponding to a category value of a specific category exists among the plurality of words and a word corresponding to the specific category does not exist, the word corresponding to the category value of the specific category Based on the specific second type word, a specific first type token corresponding to the specific category may be generated.

예를 들어, 도 3을 참조하면, 대상 문서(10)에는 “매장명” 범주의 속성에 대응되는 단어가 존재하지 않는다. 본 발명은 대상 문서(10)에서 추출된 제2타입의 단어 “Happy”, “Store”(11)의 의미에 기반하여 기 정의된 복수의 범주 중 “매장명” 범주를 특정하고, “매장명” 범주에 대응되는 제1타입 토큰을 생성할 수 있다.For example, referring to FIG. 3 , a word corresponding to an attribute of a “store name” category does not exist in the target document 10 . The present invention specifies a “store name” category among a plurality of predefined categories based on the meaning of the second type words “Happy” and “Store” 11 extracted from the target document 10 , and “store name” ” You can create a first type token corresponding to the category.

상술한 바와 같이, 본 발명은 대상 문서에 범주의 속성을 지칭하는 단어가 존재하지 않더라도, 제2타입 단어의 실질적인 의미에 기반하여, 대상 문서에 포함된 범주를 특정한다. As described above, the present invention specifies a category included in the target document based on the actual meaning of the second type word even if there is no word indicating the attribute of the category in the target document.

일 실시 예에 있어서, 도 3을 참조하면, 대상 문서(10)에서 복수의 단어들(“Happy”, “store”, “105 h-street”, “주문번호:”, “20210520011”, “품명”, “수량”, “금액”, “Carrot”, “3”, “2997”, “tomato”, “2”, “1000”)이 추출된다. In one embodiment, referring to FIG. 3 , in the target document 10 , a plurality of words (“Happy”, “store”, “105 h-street”, “order number:”, “20210520011”, “product name”) ”, “Quantity”, “Amount”, “Carrot”, “3”, “2997”, “tomato”, “2”, “1000”) are extracted.

한편, 추출된 단어 중 일부(“품명”, “수량”, “금액”, “주문번호:”)는 제1타입의 단어로 분류되며, 나머지 일부(“Happy”, “store”, “105 h-street”, “20210520011”, “Carrot”, “3”, “2997”, “tomato”, “2”, “1000”, “20210520011”)은 제2타입의 단어로 분류될 수 있다.On the other hand, some of the extracted words (“product name”, “quantity”, “amount”, “order number:”) are classified as type 1 words, and the remaining parts (“Happy”, “store”, “105 h) -street”, “20210520011”, “Carrot”, “3”, “2997”, “tomato”, “2”, “1000”, “20210520011”) can be classified as type 2 words.

이후, 추출된 단어들 각각의 의미에 기반하여, 기 정의된 복수의 범주 중 복수의 단어들 각각에 대응되는 일부 범주가 특정된다. 구체적으로, 추출된 단어들의 의미에 기반하여 “store”, “name”(“store” 범주의 하위 범주), “address”, “item”, “list”, “menu”, “name”(“menu” 범주의 하위 범주), “count”, “price” 범주가 특정될 수 있다.Then, based on the meaning of each of the extracted words, some categories corresponding to each of the plurality of words among a plurality of predefined categories are specified. Specifically, based on the meaning of the extracted words, “store”, “name” (a subcategory of “store” category), “address”, “item”, “list”, “menu”, “name” (“menu”) ” category), “count”, and “price” categories can be specified.

이후, “address”, “item”, “list”, “menu”, “name”(“menu” 범주의 하위 범주), “count”, “price” 범주 각각에 대응되는 제1타입의 토큰이 생성되고, 제2타입의 단어로 분류된 단어들에 대응되는 제2타입의 토큰이 생성된다.After that, the first type of token corresponding to each of the categories “address”, “item”, “list”, “menu”, “name” (subcategory of “menu” category), “count” and “price” is created and a token of the second type corresponding to the words classified as the second type of word is generated.

한편, 대상 문서에서 추출하고자 하는 데이터 중 사용자에게 불필요한 범주의 데이터는 데이터 추출 시 삭제하도록 설정될 수 있다. 사용자는 사용자에게 불필요한 데이터의 범주를 사전에 설정하고, 해당 범주의 데이터에 대한 토큰이 생성되지 않도록 설정할 수 있다. 기 설정된 범주에 속하는 단어(“주문번호:”, “20210520011”)는 삭제될 수 있다.Meanwhile, data of a category unnecessary to the user among data to be extracted from the target document may be set to be deleted when data is extracted. The user can set the category of data unnecessary to the user in advance, and can set not to generate a token for the data of that category. Words belonging to a preset category (“order number:”, “20210520011”) may be deleted.

일 실시 예에 있어서, 도 3에 도시된 표를 참조하면, 제1 및 제2타입의 단어로 분류된 복수의 단어들에 기반하여, 복수의 토큰(Output token, 320)이 생성될 수 있다. 복수의 토큰은 시간 흐름(t, 310)에 따라 순차적으로 생성될 수 있다.In an embodiment, referring to the table shown in FIG. 3 , a plurality of output tokens 320 may be generated based on a plurality of words classified into first and second type words. A plurality of tokens may be sequentially generated according to a time flow t 310 .

상기 복수의 토큰은 제3타입의 제3타입 토큰을 포함할 수 있다. 제3타입의 토큰에 대하여는 후술한다. The plurality of tokens may include a third type token of a third type. The third type of token will be described later.

다음으로, 대상 문서에 포함된 상기 복수의 단어 간의 데이터 구조가 반영되도록, 상기 복수의 토큰을 배열하는 단계가 진행된다(S130).Next, the step of arranging the plurality of tokens so that the data structure between the plurality of words included in the target document is reflected (S130).

대상 문서에 포함된 복수의 단어들은 소정 데이터 구조를 가질 수 있다. 데이터 구조란 복수의 단어들의 특성 및 단어들 간의 관계를 논리적 관점에서 나타낸 구조로, 데이터 구조의 종류는 리스트, 배열, 트리, 그래프, 큐 및 스택 중 적어도 하나를 포함할 수 있으나 이에 한정되지 않는다. A plurality of words included in the target document may have a predetermined data structure. A data structure is a structure in which characteristics of a plurality of words and relationships between words are expressed from a logical point of view, and the type of data structure may include at least one of a list, an array, a tree, a graph, a queue, and a stack, but is not limited thereto.

예를 들어, 도 1에서 설명한 대상 문서(10)는 “매장명” 범주, “매장주소” 범주, “주문상품명” 범주, “주문 수량” 범주 및 “주문 금액” 범주를 포함하는 데이터 구조를 가진다. 다만, 대상 문서(10)에 대응되는 데이터 구조는 절대적인 것은 아니며, 대상 문서(10)에 대한 데이터 구조는 데이터 구조를 정의하는 방식에 따라 달라질 수 있다.For example, the target document 10 described in FIG. 1 has a data structure including a “store name” category, “store address” category, “order product name” category, “order quantity” category, and “order amount” category . However, the data structure corresponding to the target document 10 is not absolute, and the data structure of the target document 10 may vary depending on a method of defining the data structure.

본 명세서에서 복수의 토큰을 배열하는 단계는 대상 문서에 포함된 복수의 단어 간의 데이터 구조와 동일한 구조의 데이터를 생성하도록 구현되거나, 대상 문서에 포함된 복수의 단어 간의 데이터 구조가 기 설정된 방식에 따라 변형된 구조의 데이터를 생성하도록 구현될 수 있다. In the present specification, the step of arranging the plurality of tokens is implemented to generate data having the same structure as the data structure between the plurality of words included in the target document, or according to a method in which the data structure between the plurality of words included in the target document is set in advance. It can be implemented to generate data of a modified structure.

예를 들어, 도 1에서 설명한 대상 문서(10)는 “매장명” 범주, “매장주소” 범주, “주문상품명” 범주, “주문 수량” 범주 및 “주문 금액” 범주를 포함하는 데이터 구조를 가지며, 본 발명에 따른 토큰 배열 단계는 “매장명” 범주 및 “매장주소” 범주의 상위 범주인 “매장” 범주, “매장” 범주의 하위 개념인 “매장명” 범주 및 “매장주소” 범주, 서로 연관된 “주문상품명” 범주, “주문 수량” 범주 및 “주문 금액” 범주를 포함하는 데이터 구조를 가지는 데이터가 구현되도록 수행될 수 있다. For example, the target document 10 described in FIG. 1 has a data structure including a “store name” category, a “store address” category, a “order product name” category, an “order quantity” category, and an “order amount” category, , the token arrangement step according to the present invention is a “store” category, which is a parent category of the “store name” category and “store address” category, a “store name” category and “store address” category, which are sub-concepts of the “store” category, with each other Data having a data structure including an associated “order product name” category, “order quantity” category, and “order amount” category may be implemented.

상술한 바와 같이, 본 발명은 대상 문서(10)에 포함된 범주의 상위 개념의 범주를 새롭게 정의하거나, 서로 다른 범주의 데이터가 서로 연관되도록 할 수 있다. As described above, according to the present invention, a category of a higher concept of a category included in the target document 10 may be newly defined, or data of different categories may be associated with each other.

복수의 토큰을 배열하는 단계에서는 상기 복수의 단어의 의미 및 상기 복수의 단어 각각에 대한 위치 정보를 이용하여, 상기 복수의 토큰이 순차적으로 배열된다. In the step of arranging the plurality of tokens, the plurality of tokens are sequentially arranged using the meaning of the plurality of words and location information for each of the plurality of words.

상기 복수의 토큰을 배열하는 단계는 반드시 복수의 토큰이 모두 생성된 후 진행될 필요는 없다. 본 발명은 상기 복수의 토큰 중 일부가 생성된 상태에서, 생성된 토큰을 배열한 후, 추가적으로 토큰을 생성하는 방식으로도 수행될 수 있다. The arranging of the plurality of tokens does not necessarily proceed after all of the plurality of tokens are generated. The present invention may also be performed in a manner in which some of the plurality of tokens are generated, the generated tokens are arranged, and then tokens are additionally generated.

일 실시 예에 있어서, 본 발명은 하나의 토큰이 생성될 때마다, 생성된 토큰을 배열하는 방식으로 수행될 수 있다.In one embodiment, the present invention may be performed by arranging the generated tokens whenever one token is generated.

이하, 복수의 토큰을 배열하는 방법에 대하여 구체적으로 설명한다.Hereinafter, a method of arranging a plurality of tokens will be described in detail.

제2 타입으로 분류된 특정 제2 타입 단어가 속하는 제1범주에 대응되는 제1타입 토큰과 상기 특정 제2타입 단어에 대응되는 제2타입 토큰은 순차적으로 배열될 수 있다. The first type token corresponding to the first category to which the specific second type word classified as the second type belongs and the second type token corresponding to the specific second type word may be sequentially arranged.

일 실시 예에 있어서, 동일한 범주인 제1범주에 대응되는 제1타입 토큰과 제2타입 토큰은 순차적으로 배열될 수 있다. 본 명세서에서는 설명의 편의를 위하여, 제1타입 토큰이 제2타입 토큰보다 선행하여 배열되는 실시 예를 설명하지만, 이에 한정되지 않고, 제2타입 토큰이 제1타입 토큰 보다 선행하여 배열될 수 있다. In an embodiment, the first type token and the second type token corresponding to the first category, which is the same category, may be sequentially arranged. In the present specification, for convenience of explanation, an embodiment in which the first type token is arranged before the second type token is described, but the embodiment is not limited thereto, and the second type token may be arranged before the first type token .

다른 일 실시 예에 있어서, 하나의 토큰이 생성될 때마다, 생성된 토큰을 배열하는 방식으로 토큰 배열이 진행되는 경우, 먼저 배열되는 토큰이 나중에 배열되는 토큰보다 먼저 생성될 수 있다.In another embodiment, whenever one token is generated, when token arrangement is performed in a manner of arranging the generated tokens, a token to be arranged first may be generated before a token to be arranged later.

한편, 상기 제1범주에 속하는 특정 제2타입 단어는 복수 개일 수 있다. 이 경우, 복수개의 상기 특정 제2 타입 단어 각각에 대응되는 복수개의 제2 타입 토큰이 순차적으로 배열된다. Meanwhile, there may be a plurality of specific second type words belonging to the first category. In this case, a plurality of second type tokens corresponding to each of the plurality of specific second type words are sequentially arranged.

이때, 순차적으로 배열된 상기 복수개의 제2 타입 토큰의 배열 순서는, 복수개의 상기 특정 제2 타입 단어 각각의 의미 및 상기 대상 문서 상의 위치 정보에 근거하여, 결정될 수 있다.In this case, the arrangement order of the plurality of sequentially arranged second type tokens may be determined based on the meaning of each of the plurality of specific second type words and location information on the target document.

예를 들어, 도 3을 참조하면, 생성된 토큰들(320) 중 제2타입의 토큰인 “Happy” 토큰과 “store” 토큰은 “[name]” 토큰에 이어 순차적으로 배열되며, 상기 두 개의 제2타입의 토큰 각각의 단어에 기반하여 “Happy” 토큰이 선행하여 배열되며, “store” 토큰이 “Happy” 토큰 다음에 배열된다.For example, referring to FIG. 3 , among the generated tokens 320 , a “Happy” token and a “store” token, which are tokens of the second type, are sequentially arranged following the “[name]” token, and the two Based on each word of the token of the second type, a “Happy” token is arranged first, and a “store” token is arranged after the “Happy” token.

상술한 바와 같이, 본 발명은 대상 문서로부터 추출된 단어의 크기를 최소화함으로써, 대상 문서의 형태가 변형되거나 일부분이 소실됨에 따라 텍스트 간의 상대적 위치가 불규칙하게 되는 경우에도, 단어들의 의미에 기반하여 높은 정확도로 정보를 추출할 수 있도록 한다.As described above, the present invention minimizes the size of a word extracted from a target document, so that even when the relative position between texts becomes irregular as the shape of the target document is changed or a part is lost, it It allows information to be extracted with accuracy.

한편, 서로 다른 범주에 속하는 제1타입의 토큰은 순차적으로 배열된다. 구체적으로, 상기 제1범주에 대응되는 제1타입 토큰과, 상기 제1 범주와 다른 제2 범주에 대응되는 제1 타입 토큰이 순차적으로 배열된다. Meanwhile, tokens of the first type belonging to different categories are sequentially arranged. Specifically, a first type token corresponding to the first category and a first type token corresponding to a second category different from the first category are sequentially arranged.

이때, 상기 제1범주에 대응되는 제1타입 토큰과 상기 제2 범주에 대응되는 제2 타입 토큰 사이에는 상기 제1 범주 및 상기 제2 범주 각각에 대응되는 토큰들을 구분하기 위한 제3 타입의 제3 타입 토큰이 배열될 수 있다. At this time, between the first type token corresponding to the first category and the second type token corresponding to the second category, a third type of tokens corresponding to each of the first category and the second category are distinguished. Three type tokens can be arranged.

일 실시 예에 있어서, 제1 범주에 속하는 토큰이 제1타입 토큰만 존재(대상 문서에로부터 속성에 대응되는 단어만 추출되고, 값에 대응되는 단어는 추출되지 않은 경우)하는 경우, 제3타입 토큰은 제1타입 토큰에 연속하여 배열된다.According to an embodiment, when the token belonging to the first category has only the first type token (when only the word corresponding to the attribute is extracted from the target document and the word corresponding to the value is not extracted), the third type token The tokens are arranged consecutively to the first type token.

다른 일 실시 예에 있어서, 제1범주에 속하는 토큰이 제1타입 토큰과 하나의 제2타입 토큰인 경우, 제1 범주에 대응되는 제1 타입 토큰이 가장 첫 번째로 배열되고, 제1타입 토큰에 연속하여 제2타입 토큰이 배열될 수 있다. 제3타입 토큰은 제2타입 토큰에 연속하여 배열된다. In another embodiment, when the tokens belonging to the first category are the first type token and one second type token, the first type token corresponding to the first category is arranged first, and the first type token The second type token may be arranged in succession to . The third type token is arranged consecutively to the second type token.

다른 일 실시 예에 있어서, 제1범주에 속하는 토큰이 제1타입 토큰과 복수의 제2타입 토큰인 경우, 상기 제1 범주에 대응되는 제1 타입 토큰이 가장 첫번째로 배열되고, 상기 제1 범주에 대응되는 제1 타입 토큰과 연속하여 상기 특정 제2 타입 단어에 대응되는 복수의 제2 타입 토큰을 순차적으로 배열되며, 상기 특정 제2 타입 단어에 대응되는 제2 타입 토큰 중 마지막으로 배열된 특정 제2 타입 토큰에 연속하여 상기 제3 타입 토큰 배열될 수 있다.In another embodiment, when the tokens belonging to the first category are a first type token and a plurality of second type tokens, a first type token corresponding to the first category is arranged first, and the first category A plurality of second type tokens corresponding to the specific second type word are sequentially arranged consecutively with the first type token corresponding to The third type token may be arranged in succession to the second type token.

상술한 바와 같이, 상기 제3타입의 토큰은 특정 범주에 속하는 적어도 하나의 토큰 중 가장 마지막 순서로 배열될 수 있다.As described above, the third type of tokens may be arranged in the last order among at least one token belonging to a specific category.

대상 문서(10)로부터, 추출된 복수의 단어들 각각의 의미에 기반하여, 기 정의된 복수의 범주 중 복수의 단어들 각각에 대응되는 범주가 특정될 수 있다. 기 정의된 복수의 범주 중 상기 특정된 범주가 정의하는 개념보다 상위 개념의 범주가 존재하는 경우, 상기 상위 개념의 범주가 복수의 단어들 각각에 대응되는 범주로 특정될 수 있다.A category corresponding to each of the plurality of words among a plurality of predefined categories may be specified based on the meaning of each of the plurality of words extracted from the target document 10 . When a category of a higher concept than a concept defined by the specified category exists among a plurality of predefined categories, the category of the higher concept may be specified as a category corresponding to each of the plurality of words.

상술한 상위 개념의 범주는 특정 카테고리의 상위 카테고리로 이해될 수 있다. 본 명세서에서, 특정 범주에 대한 상위 개념의 범주를 상위 범주라 지칭하고, 상기 상위 범주의 하위 개념의 범주를 하위 범주라 지칭한다. 상기 표현은 상대적인 표현이므로, 특정 범주를 기준으로 활용될 수 있다.The category of the above-described upper-level concept may be understood as a higher-level category of a specific category. In the present specification, a category of a higher-level concept for a specific category is referred to as a super-category, and a category of a sub-concept of the upper-level category is referred to as a sub-category. Since the above expression is a relative expression, it may be utilized based on a specific category.

예를 들어, 상기 제1범주의 상위 개념에 대응되는 범주가 존재하는 경우, 상기 상위 개념에 대응되는 범주는 제3범주로 특정될 수 있다. 이 경우, 상기 제1범주는 상기 제3범주의 하위 범주라 지칭될 수 있고, 상기 제3범주는 상기 제1범주의 상위 범주라 지칭될 수 있다.For example, when a category corresponding to a higher-level concept of the first category exists, the category corresponding to the upper-level concept may be specified as a third category. In this case, the first category may be referred to as a sub-category of the third category, and the third category may be referred to as a super-category of the first category.

상기 상위 개념의 범주보다 상위 개념의 범주가 기 정의된 경우, 상기 상위 개념의 범주보다 상위 개념의 범주도 복수의 단어들 각각에 대응되는 범주로 특정될 수 있다. When a category of a concept higher than the category of the upper concept is predefined, a category of a concept higher than the category of the upper concept may also be specified as a category corresponding to each of the plurality of words.

특정 범주의 상위 범주가 특정되는 경우, 상위 범주에 대응되는 제1타입의 제1타입 토큰이 생성될 수 있다. 예를 들어, 상기 특정된 제3범주에 대응되는 상기 제1타입의 제1타입 토큰이 생성된다. 상기 제3범주에 대응되는 제1타입 토큰, 상기 제1범주에 대응되는 제1타입 토큰 및 상기 제1범주에 대응되는 제2타입 토큰은 순차적으로 배열될 수 있다. When a higher category of a specific category is specified, a first type token of a first type corresponding to the upper category may be generated. For example, the first type token of the first type corresponding to the specified third category is generated. A first type token corresponding to the third category, a first type token corresponding to the first category, and a second type token corresponding to the first category may be sequentially arranged.

한편, 특정 범주의 하위 범주는 복수 개 특정될 수 있다. 예를 들어, 상기 제1 및 제2범주가 상기 제3범주의 하위 범주일 수 있다. 이 경우, 제1 내지 제3범주에 대응되는 제1타입의 제1타입 토큰이 생성된다. 상기 제3범주에 대응되는 제1타입 토큰, 상기 제1범주에 대응되는 제1타입 토큰, 상기 제1범주에 대응되는 제2타입 토큰, 제3타입 토큰, 상기 제2범주에 대응되는 제1타입 토큰 및 상기 제2범주에 대응되는 제2타입 토큰은 순차적으로 배열될 수 있다. Meanwhile, a plurality of subcategories of a specific category may be specified. For example, the first and second categories may be sub-categories of the third category. In this case, a first type token of the first type corresponding to the first to third categories is generated. A first type token corresponding to the third category, a first type token corresponding to the first category, a second type token corresponding to the first category, a third type token, a first corresponding to the second category The type token and the second type token corresponding to the second category may be sequentially arranged.

상술한 바와 같이, 두 개의 하위 범주 각각에 대응되는 제1타입 토큰 사이에는 제3타입 토큰이 배열된다.As described above, a third type token is arranged between the first type tokens corresponding to each of the two subcategories.

도 3을 참조하여, 실제 영수증을 기반으로 생성된 토큰을 배열하는 방법에 대하여 보다 구체적으로 설명한다. With reference to FIG. 3 , a method of arranging tokens generated based on an actual receipt will be described in more detail.

도 3에서는 토큰이 생성된 순서와 토큰의 배열 순서가 동일한 것으로 설명하지만, 토큰의 생성 순서와 토큰의 배열 순서가 반드시 일치할 필요는 없다. Although it is described that the token generation order and the token arrangement order are the same in FIG. 3 , the token generation order and the token arrangement order do not necessarily coincide with each other.

대상 문서(10)로부터, 추출된 단어들 각각의 의미에 기반하여, “[store]”, “[name]”(“[store]” 토큰에 대응하는 범주의 하위 범주에 대응), “[address]” (“[store]” 토큰에 대응하는 범주의 하위 범주에 대응), “[item]”, “[list]” (“[item]” 토큰에 대응하는 범주의 하위 범주에 대응), “[menu]” (“[list]” 토큰에 대응하는 범주의 하위 범주에 대응), “[name]” (“[menu]” 토큰에 대응하는 범주의 하위 범주에 대응), “[count]” (“[menu]” 토큰에 대응하는 범주의 하위 범주에 대응) 및 “[price]” (“[menu]” 토큰에 대응하는 범주의 하위 범주에 대응) 토큰이 생성된다. Based on the meaning of each of the words extracted from the target document 10, “[store]”, “[name]” (corresponding to a sub-category of the category corresponding to the “[store]” token), “[address ]” (corresponding to the subcategory of the category corresponding to the token “[store]”), “[item]”, “[list]” (corresponding to the subcategory of the category corresponding to the token “[item]”), “ [menu]” (corresponding to the subcategories of the category corresponding to the token “[list]”), “[name]” (corresponding to the subcategories of the category corresponding to the token “[menu]”), “[count]” Tokens are created (corresponding to the subcategories of the category corresponding to the “[menu]” token) and “[price]” (corresponding to the subcategories of the category corresponding to the “[menu]” token).

또한, 제2타입으로 분류된 단어들(“Happy”, “store”, “105 h-street”, “20210520011”, “Carrot”, “3”, “2997”, “tomato”, “2”, “1000”)에 대응되는 제2타입의 토큰이 생성된다.Also, words classified as type 2 (“Happy”, “store”, “105 h-street”, “20210520011”, “Carrot”, “3”, “2997”, “tomato”, “2”, A second type of token corresponding to “1000”) is generated.

복수의 범주 중 가장 상위 개념에 대응되는 두 개의 범주 “store”, “item” 범주 중 어느 하나에 대응되는 [store] 토큰이 가장 첫 번째 토큰으로 배열된다. 이후, “store” 범주의 하위 범주에 대응되는 “name” 범주에 대응되는 [name] 토큰이 [store] 토큰에 연속적으로 배열되며, “name” 범주에 속한 제2타입 단어에 대응되는 “Happy”, “store” 토큰이 [name] 토큰에 이어 연속적으로 배치된다. A [store] token corresponding to any one of the two categories “store” and “item” corresponding to the highest concept among multiple categories is arranged as the first token. Thereafter, [name] tokens corresponding to the “name” category corresponding to the subcategories of the “store” category are sequentially arranged in the [store] tokens, and “Happy” corresponding to the second type word belonging to the “name” category , “store” tokens are placed consecutively after [name] tokens.

“name” 범주에 속한 토큰(321a)이 모두 배열된 후, “name” 범주에 대응되는 토큰 중 가장 마지막 토큰(“store” 토큰”)에 연속적으로 제3타입 토큰([reduce], 321b)이 배열된다. 이후, “store” 범주의 하위 범주에 대응되는 “address” 범주에 대응되는 [address] 토큰이 [reduce] 토큰에 연속적으로 배열된다.After all the tokens (321a) belonging to the “name” category are arranged, the third type tokens ([reduce], 321b) are successively added to the last token (“store” token) among the tokens corresponding to the “name” category. are arranged Thereafter, [address] tokens corresponding to the “address” category corresponding to the subcategories of the “store” category are sequentially arranged in the [reduce] tokens.

도시되지 않았지만, 이후 배열 방법에 대하여 추가적으로 설명한다. “address” 범주에 속한 제2타입 단어에 대응되는 “105 h-street” 토큰이 [address] 토큰에 이어 연속적으로 배치된다. “address” 범주에 속한 토큰이 모두 배열된 후, “address” 범주에 대응되는 토큰 중 가장 마지막 토큰(“105 h-street” 토큰)에 연속적으로 제3타입 토큰이 배열된다. Although not shown, an arrangement method will be further described later. The “105 h-street” token corresponding to the second type word belonging to the “address” category is placed consecutively after the [address] token. After all tokens belonging to the “address” category are arranged, the third type tokens are sequentially arranged in the last token (“105 h-street” token) among the tokens corresponding to the “address” category.

한편, “store” 범주에 대응되는 모든 토큰이 배열되었는 바, 제3타입 토큰이 추가적으로 한 번 더 배열된다. 즉, “address” 범주에 대응되는 토큰 중 가장 마지막 토큰(“105 h-street” 토큰)에 연속적으로 두 개의 제3타입 토큰이 배열된다.Meanwhile, since all tokens corresponding to the “store” category have been arranged, the third type token is additionally arranged once more. That is, two third-type tokens are sequentially arranged in the last token (“105 h-street” token) among the tokens corresponding to the “address” category.

연속적으로 배열된 두 개의 제3타입 토큰에 이어 “item” 범주에 대응되는 [item] 토큰이 배열된다. [item] 토큰에 이어, “item” 범주의 하위 범주인 “list” 범주에 대응되는 [list] 토큰, “list” 범주의 하위 범주인 “menu” 범주에 대응되는 [menu] 토큰, “menu” 범주의 하위 범주인 “name” 범주에 대응되는 [name] 토큰이 연속적으로 배열된다. [name] 토큰에 이어 “name” 범주 속한 값에 대응되는 “carrot” 토큰이 연속적으로 배열되며, “carrot” 토큰에 이어 [reduce] 토큰이 배열된다. Following the two consecutively arranged third type tokens, [item] tokens corresponding to the category “item” are arranged. Following the [item] token, the [list] token corresponding to the “list” category, which is a subcategory of the “item” category, the [menu] token corresponding to the “menu” category, which is a subcategory of the “list” category, and “menu” [name] tokens corresponding to the category “name”, which is a subcategory of the category, are arranged consecutively. Following the [name] token, “carrot” tokens corresponding to values belonging to the “name” category are sequentially arranged, and after the “carrot” token, the [reduce] token is arranged.

이후, “menu” 범주의 하위 범주인 “count” 범주에 대응되는 [count] 토큰이 연속적으로 배열된다. [count] 토큰에 이어 “count” 범주 속한 값에 대응되는 “3” 토큰이 연속적으로 배열되며, “3” 토큰에 이어 [reduce] 토큰이 배열된다.Thereafter, [count] tokens corresponding to the “count” category, which is a subcategory of the “menu” category, are sequentially arranged. Following the [count] token, “3” tokens corresponding to values belonging to the “count” category are sequentially arranged, and after the “3” token, the [reduce] token is arranged.

이후, “menu” 범주의 하위 범주인 “price” 범주에 대응되는 [price] 토큰이 연속적으로 배열된다. [price] 토큰에 이어 “price” 범주 속한 값에 대응되는 “2997” 토큰이 연속적으로 배열되며, “2997” 토큰이 배열된다.Thereafter, [price] tokens corresponding to the “price” category, which is a subcategory of the “menu” category, are sequentially arranged. Following the [price] token, “2997” tokens corresponding to values belonging to the “price” category are sequentially arranged, and “2997” tokens are arranged.

“price” 범주, “menu” 범주, “list” 범주에 대응되는 모든 토큰이 배열되었는 바, “2997” 토큰에 이어, 연속적으로 세 개의 제3타입 토큰이 배열된다.All tokens corresponding to the “price” category, “menu” category, and “list” category have been arranged. Following the “2997” token, three third-type tokens are sequentially arranged.

이후, 연속적으로 배열된 세 개의 제3타입 토큰에 이어, “item” 범주의 하위 범주인 “list” 범주에 대응되는 [list] 토큰, “list” 범주의 하위 범주인 “menu” 범주에 대응되는 [menu] 토큰, “menu” 범주의 하위 범주인 “name” 범주에 대응되는 [name] 토큰이 연속적으로 배열된다. [name] 토큰에 이어 “name” 범주 속한 값에 대응되는 “tomato” 토큰이 연속적으로 배열되며, “tomato” 토큰에 이어 [reduce] 토큰이 배열된다. After that, following three consecutively arranged third type tokens, a [list] token corresponding to the “list” category, which is a subcategory of the “item” category, and a “menu” category that is a subcategory of the “list” category. [menu] tokens, [name] tokens corresponding to category “name”, which is a subcategory of category “menu”, are arranged consecutively. Following the [name] token, “tomato” tokens corresponding to values belonging to the “name” category are sequentially arranged, followed by the “tomato” token and then the [reduce] token.

이후, “menu” 범주의 하위 범주인 “tomato” 범주에 대응되는 [count] 토큰이 연속적으로 배열된다. [count] 토큰에 이어 “count” 범주 속한 값에 대응되는 “2” 토큰이 연속적으로 배열되며, “2” 토큰에 이어 [reduce] 토큰이 배열된다.Thereafter, [count] tokens corresponding to the “tomato” category, which is a subcategory of the “menu” category, are sequentially arranged. Following the [count] token, “2” tokens corresponding to values belonging to the “count” category are sequentially arranged, and after the “2” token, the [reduce] token is arranged.

이후, “menu” 범주의 하위 범주인 “price” 범주에 대응되는 [price] 토큰이 연속적으로 배열된다. [price] 토큰에 이어 “price” 범주 속한 값에 대응되는 “1000” 토큰이 연속적으로 배열되며, “1000” 토큰이 배열된다. 상기 “1000” 토큰을 마지막으로 토큰 배열이 종료된다.Thereafter, [price] tokens corresponding to the “price” category, which is a subcategory of the “menu” category, are sequentially arranged. Following the [price] token, “1000” tokens corresponding to values belonging to the “price” category are sequentially arranged, and “1000” tokens are arranged. Finally, the token array is terminated with the “1000” token.

한편, 상기 생성된 토큰들 및 상기 토큰들이 배열된 순서에 기반하여 상기 대상 문서에 포함된 상기 복수의 단어 간의 데이터 구조가 반영된 데이터가 생성될 수 있다.Meanwhile, data in which a data structure between the plurality of words included in the target document is reflected may be generated based on the generated tokens and the order in which the tokens are arranged.

상기 대상 문서에 포함된 상기 복수의 단어 간의 데이터 구조가 반영된 데이터는 토큰이 배열된 순서대로 토큰에 대응되는 액션을 수행함으로써 생성된다. The data in which the data structure between the plurality of words included in the target document is reflected is generated by performing actions corresponding to the tokens in the order in which the tokens are arranged.

일 실시 예에 있어서, 상기 대상 문서에 포함된 상기 복수의 단어 간의 데이터 구조가 반영된 데이터는 트리(tree) 형태로 생성될 수 있다. In an embodiment, data in which a data structure between the plurality of words included in the target document is reflected may be generated in the form of a tree.

트리 데이터는 복수의 노드 및 복수의 계층을 포함하며, 각각의 노드에는 복수의 범주 중 어느 하나가 대응되며, 대응되는 범주의 속성 및 값 중 적어도 하나가 매칭된다. The tree data includes a plurality of nodes and a plurality of hierarchies, and each node corresponds to any one of a plurality of categories, and at least one of attributes and values of the corresponding category is matched.

트리 데이터 생성 시 최상위 노드(S)를 기준 노드로 설정한 후, 토큰이 배열된 순서대로, 토큰에 대응되는 액션을 수행하며 노드를 생성하거나, 노드에 대응되는 데이터를 매칭시킨다.After setting the top node (S) as a reference node when generating tree data, in the order in which the tokens are arranged, actions corresponding to the tokens are performed to create a node or match data corresponding to the node.

제1타입의 토큰에 대한 액션은, 기준 노드의 하위 노드를 생성하고, 생성된 하위 노드를 기준 노드로 변경하는 것이며, 제2타입의 토큰에 대한 액션은 기준 노드에 해당 제2타입 토큰에 대응되는 단어를 값으로 매칭시키는 것이다. 제3타입의 토큰에 대한 액션은 기준 노드보다 한 단계 상위 노드를 기준 노드로 변경하는 것이다.The action for the first type of token is to create a lower node of the reference node and change the generated lower node to the reference node, and the action for the second type of token corresponds to the second type token in the reference node Matching words with values. The action for the third type of token is to change a node one level higher than the reference node to a reference node.

상술한 기준에 따라, 순서대로 배열된 토큰으로부터 트리 데이터가 생성될 수 있다.According to the above-mentioned criteria, tree data may be generated from tokens arranged in order.

도 3 및 4를 참조하여, 트리 데이터를 생성하는 일 실시 예에 대하여 설명한다. 대상 문서(10)로부터 토큰을 생성하고 배열하는 방법에 대한 설명은 앞서 설명한 내용으로 갈음한다.An embodiment of generating tree data will be described with reference to FIGS. 3 and 4 . A description of a method of generating and arranging tokens from the target document 10 is replaced with the above description.

도 3을 참조하면, 토큰이 배열 순서(310)대로 토큰에 대응되는 액션(330)을 수행한다. 도 3에 도시된 표의 토큰 생성 시간 열(311)에 포함된 숫자들은 토큰을 처리하는 순서가 될 수 있으며, 토큰 처리 순서 대로 액션 열(331)에 포함된 액션이 수행된다. 이에 따라, 파싱(340)이 수행되며, 파싱 열(341)에 포함된 데이터들이 순차적으로 생성된다.Referring to FIG. 3 , the actions 330 corresponding to the tokens are performed according to the token arrangement order 310 . Numbers included in the token generation time column 311 of the table shown in FIG. 3 may be the order of processing tokens, and the actions included in the action column 331 are performed in the order of token processing. Accordingly, the parsing 340 is performed, and data included in the parsing column 341 are sequentially generated.

가장 먼저 트리의 최상위 노드(S)를 기준 노드로 설정하고, 기준 노드에서 [store] 토큰에 대응되는 액션(NT(store))이 수행된다. 이에 따라, 기준 노드(S)의 하위 노드인 [store] 노드(410)가 생성되며, 기준 노드가 [store] 노드(410)로 변경된다.First, the top node (S) of the tree is set as the reference node, and the action (NT(store)) corresponding to the [store] token is performed in the reference node. Accordingly, a [store] node 410 that is a lower node of the reference node S is generated, and the reference node is changed to a [store] node 410 .

다음으로, [name] 토큰에 대응되는 액션(NT(name))이 수행되며, [store] 노드(410)의 하위 노드인 [name] 노드(420)가 생성되며, 기준 노드가 [name] 노드(420)로 변경된다.Next, the action (NT(name)) corresponding to the [name] token is performed, and the [name] node 420, which is a child node of the [store] node 410, is created, and the reference node is the [name] node. (420).

다음으로, [name] 노드(420)에 “Happy” 토큰에 대응되는 단어 “Happy”를 매칭시키는 액션(GEN(Happy))이 수행된다. 이어서, [name] 노드(420)에 “store” 토큰에 대응되는 단어 “store”를 매칭시키는 액션(GEN(store))이 수행된다. [name] 노드(420)에 매칭된 단어는 단어가 매칭된 순서대로 직렬화(serialization)된다. 이에 따라, [name] 노드(420)에는 “Happy store”(421)가 매칭된다.Next, an action (GEN(Happy)) of matching the word “Happy” corresponding to the “Happy” token to the [name] node 420 is performed. Next, an action (GEN(store)) of matching the word “store” corresponding to the “store” token to the [name] node 420 is performed. Words matching the [name] node 420 are serialized in the order in which the words are matched. Accordingly, “Happy store” 421 is matched to the [name] node 420 .

도 3에 도시된 표의 331a 영역에 포함된 모든 액션이 수행됨에 따라, 도 4의 410, 420 노드가 생성되며, 420노드에 대응되는 텍스트가 매칭된다. As all actions included in area 331a of the table shown in FIG. 3 are performed, nodes 410 and 420 of FIG. 4 are generated, and text corresponding to the node 420 is matched.

다음으로, 도 3에 도시된 표의 331b 영역에 포함된 [reduce] 토큰에 대응되는 액션이 수행된다. 이에 따라, 기준 노드가 [name] 노드에서 [name] 노드의 상위 노드인 [store] 노드로 변경된다. Next, an action corresponding to the [reduce] token included in area 331b of the table shown in FIG. 3 is performed. Accordingly, the reference node is changed from the [name] node to the [store] node, which is the parent node of the [name] node.

다음으로, [address] 토큰에 대응되는 액션(NT(address))이 수행되며, [store] 노드(410)의 하위 노드인 [address] 노드가 생성되며, 기준 노드가 [address] 노드로 변경된다.Next, an action (NT(address)) corresponding to the [address] token is performed, an [address] node, which is a lower node of the [store] node 410, is created, and the reference node is changed to an [address] node. .

다음으로, [address] 노드에 “105 h-street” 토큰에 대응되는 단어 “105 h-street”를 매칭시키는 액션(GEN(105 h-street))이 수행된다. 이에 따라, [address] 노드에는 “105 h-street”가 매칭된다.Next, an action (GEN(105 h-street)) of matching the word “105 h-street” corresponding to the “105 h-street” token to the [address] node is performed. Accordingly, “105 h-street” is matched to the [address] node.

다음으로, 연속으로 배치된 두 개의 [reduce] 토큰에 대응되는 액션이 수행되며, 기준 노드가 최상위 노드(S)로 변경된다.Next, the action corresponding to the two [reduce] tokens placed in a row is performed, and the reference node is changed to the highest node (S).

다음으로, [item] 토큰, [list] 토큰, [menu] 토큰, [name] 토큰에 대응되는 액션이 순차적으로 수행되며, [item] 노드(430), [list] 노드(440), [menu] 노드(450), [name] 노드(460)가 순차적으로 생성된다. 이어서, “carrot” 토큰에 대응되는 액션이 수행됨에 따라, [name] 노드(460)에 단어 “carrot”(461)이 매칭된다.Next, actions corresponding to [item] token, [list] token, [menu] token, and [name] token are sequentially performed, [item] node 430, [list] node 440, [menu] ] node 450 and [name] node 460 are sequentially created. Subsequently, as the action corresponding to the “carrot” token is performed, the word “carrot” 461 is matched to the [name] node 460 .

상술한 룰에 따라, 생성된 토큰에 대한 액션을 반복하는 경우, 도 4에 도시된 트리 데이터가 생성될 수 있다. According to the above-described rule, when the action on the generated token is repeated, the tree data shown in FIG. 4 may be generated.

도 4에 도시된 트리는 대상 문서(10)에 포함된 단어들 각각에 대한 키-값 쌍이 완전히 매칭된 데이터이며, 각각의 데이터들의 범주가 완전히 정의되어 있다. The tree shown in FIG. 4 is data in which key-value pairs for each word included in the target document 10 are completely matched, and categories of each data are completely defined.

상술한 바와 같이, 본 발명은 대상 문서에서 추출된 상기 복수의 단어의 의미 및 상기 복수의 단어 각각에 대한 위치 정보를 이용하여, 생성된 토큰 및 생성된 토큰의 배열을 이용하여, 대상 문서에 포함된 복수의 단어 간의 데이터 구조가 반영된 데이터를 생성할 수 있다. As described above, according to the present invention, by using the meaning of the plurality of words extracted from the target document and location information for each of the plurality of words, the generated token and the array of the generated tokens are used to be included in the target document It is possible to generate data in which a data structure between a plurality of words is reflected.

한편, 본 발명은 정보 추출 모델에 대한 기계 학습 수행 시 상술한 트리 데이터를 기준으로 정보 추출 모델에 대한 정확도를 판단한다.On the other hand, the present invention determines the accuracy of the information extraction model based on the above-described tree data when performing machine learning on the information extraction model.

도 5는 본 발명에 따른 정보 추출 모델의 기계학습 방법을 나타내는 개념도이고, 도 6은 본 발명에 따른 정보 추출 모델로부터 출력된 데이터의 정확도를 산출하는 모습을 나타내는 개념도이다.5 is a conceptual diagram illustrating a machine learning method of an information extraction model according to the present invention, and FIG. 6 is a conceptual diagram illustrating a state of calculating the accuracy of data output from the information extraction model according to the present invention.

도 5를 참조하면, 대상 문서(10)에 대한 OCR(511)을 수행하여, 복수의 단어 및 상기 복수의 단어 각각에 대한 위치 정보(512)를 추정한 후, 복수의 단어 및 위치 정보를 본 발명에 따른 정보 추출 모델(513)에 입력한다. 이에 따라, 순차적으로 배열된 토큰이 순차적으로 배열된다. Referring to FIG. 5 , after performing OCR 511 on the target document 10 to estimate a plurality of words and location information 512 for each of the plurality of words, the plurality of words and location information are viewed. It is input to the information extraction model 513 according to the invention. Accordingly, the sequentially arranged tokens are sequentially arranged.

한편, 대상 문서(10)에 대응되는 데이터는 학습 데이터로 가공된다. 학습 데이터를 위한 가공은 parse annotator(521)에 의해 수행되는데, parse annotator(521)는 기 저장된 데이터를 복수의 토큰이 순차적으로 배열된 복수의 토큰 형태로 출력한다. 즉, parse annotator(521)는 본 발명에 따른 기계 학습 모델의 출력 데이터와 동일한 형식의 데이터를 출력한다. 이를 통해, 기계학습을 위한 원본 데이터(학습 데이터)가 생성된다. Meanwhile, data corresponding to the target document 10 is processed as learning data. Processing for the learning data is performed by the parse annotator 521, which outputs pre-stored data in the form of a plurality of tokens in which a plurality of tokens are sequentially arranged. That is, the parse annotator 521 outputs data in the same format as the output data of the machine learning model according to the present invention. Through this, original data (learning data) for machine learning is generated.

본 발명에 따른 정보 추출 모델로부터 출력된 복수의 토큰들을 기반으로 생성된 트리 데이터와 원본 데이터 간의 오차를 산출하고, 오차를 최소화하는 방향으로 훈련이 진행될 수 있다.Training may be performed in a direction to calculate an error between the tree data and original data generated based on a plurality of tokens output from the information extraction model according to the present invention, and to minimize the error.

일 실시 예에 있어서, 도 6을 참조하면, 정보 추출 모델의 오차는, 정보 추출 모델로부터 생성된 트리 데이터에 포함된 노드와 및 원본 데이터를 구성하는 노드 간의 비교를 통해 산출될 수 있다. 구체적으로, 정보 추출 모델로부터 출력된 트리 데이터(도 6의 최상단 트리)를 원본 데이터의 트리(도 6의 최하단 트리)와 동일하게 변화시키면서 정보 추출 모델의 오차가 산출될 수 있다. In an embodiment, referring to FIG. 6 , the error of the information extraction model may be calculated through comparison between a node included in tree data generated from the information extraction model and a node constituting the original data. Specifically, the error of the information extraction model may be calculated while changing the tree data output from the information extraction model (the uppermost tree of FIG. 6 ) to be the same as the tree of the original data (the lowermost tree of FIG. 6 ).

구체적으로, 정보 추출 모델로부터 출력된 트리 데이터(도 6의 최상단 트리)의 각 노드들(610, 620, 630)과 노드에 매칭된 값(621, 631)이 원본 데이터의 트리와 일치하는 지 판단하고, 일치하지 않는 노드(630) 및 일치하지 않는 값(631)을 원본 데이터와 동일하게 수정하여, 일치하지 않는 노드(630)가 원본 데이터와 일치하는 노드(630’)로 수정되도록 하고, 일치하지 않는 값(631)이 원본 데이터와 일치하는 값(631’)으로 수정되도록 한다. 이러한 과정에서 정보 추출 모델로부터 출력된 트리 데이터의 스코어가 산출된다. 스코어 산출 방식은 기 공지된 방식을 활용하므로 구체적인 설명은 생략한다.Specifically, it is determined whether each of the nodes 610 , 620 , 630 of the tree data output from the information extraction model (the topmost tree in FIG. 6 ) and the values 621 and 631 matched to the nodes match the tree of the original data. and correct the inconsistent node 630 and the inconsistent value 631 to be the same as the original data, so that the inconsistent node 630 is corrected to the node 630' that matches the original data, and match A value 631 that does not exist is corrected to a value 631' that matches the original data. In this process, the score of the tree data output from the information extraction model is calculated. Since the score calculation method utilizes a known method, a detailed description thereof will be omitted.

상술한 바와 같이, 본 발명에 따른 정보 추출 모델의 기계학습은 정보 추출 모델로부터 출력되며, 순차적으로 배열된 토큰의 정확도를 산출함으로써 수행된다. 상기 출력된 토큰들은 “키-값” 쌍이 완전히 매칭된 데이터가 아니므로, 상기 정보 추출 모델의 정확도를 산출하기 위한 학습 데이터 생성이 용이 해진다. As described above, machine learning of the information extraction model according to the present invention is output from the information extraction model, and is performed by calculating the accuracy of sequentially arranged tokens. Since the output tokens are not data in which the “key-value” pair is completely matched, it is easy to generate training data for calculating the accuracy of the information extraction model.

구체적으로, 학습 데이터 생성 시 기 정해진 룰(토큰 생성 룰)에 따라 일정한 순서로 배열된 토큰을 생성한 후, 정보 추출 모델에서 출력된 토큰들과 비교하는 작업을 통해, 정보 추출 모델의 정확도를 판단하고, 상기 정보 추출 모델의 정확도를 향상시키기 위한 방향으로 기계학습을 진행할 수 있게 된다. 이에 따라, 정보 추출 모델의 기계학습을 위한 학습 데이터를 생성하는데 소요되는 시간이 크게 단축될 수 있다.Specifically, when generating training data, tokens arranged in a predetermined order are generated according to a predetermined rule (token generation rule), and then the accuracy of the information extraction model is determined by comparing it with the tokens output from the information extraction model. and machine learning can be performed in a direction to improve the accuracy of the information extraction model. Accordingly, the time required to generate training data for machine learning of the information extraction model can be greatly reduced.

한편, 위에서 살펴본 본 발명은, 컴퓨터에서 하나 이상의 프로세스에 의하여 실행되며, 이러한 컴퓨터로 판독될 수 있는 매체(또는 기록 매체)에 저장 가능한 프로그램으로서 구현될 수 있다.Meanwhile, the present invention described above may be implemented as a program storable in a computer-readable medium (or recording medium), which is executed by one or more processes in a computer.

나아가, 위에서 살펴본 본 발명은, 프로그램이 기록된 매체에 컴퓨터가 읽을 수 있는 코드 또는 명령어로서 구현하는 것이 가능하다. 즉, 본 발명은 프로그램의 형태로 제공될 수 있다. Furthermore, the present invention as seen above can be implemented as computer-readable codes or instructions on a medium in which a program is recorded. That is, the present invention may be provided in the form of a program.

한편, 컴퓨터가 읽을 수 있는 매체는, 컴퓨터 시스템에 의하여 읽혀질 수 있는 데이터가 저장되는 모든 종류의 기록장치를 포함한다. 컴퓨터가 읽을 수 있는 매체의 예로는, HDD(Hard Disk Drive), SSD(Solid State Disk), SDD(Silicon Disk Drive), ROM, RAM, CD-ROM, 자기 테이프, 플로피 디스크, 광 데이터 저장 장치 등이 있다. Meanwhile, the computer-readable medium includes all types of recording devices in which data readable by a computer system is stored. Examples of computer-readable media include Hard Disk Drive (HDD), Solid State Disk (SSD), Silicon Disk Drive (SDD), ROM, RAM, CD-ROM, magnetic tape, floppy disk, optical data storage device, etc. There is this.

나아가, 컴퓨터가 읽을 수 있는 매체는, 저장소를 포함하며 전자기기가 통신을 통하여 접근할 수 있는 서버 또는 클라우드 저장소일 수 있다. 이 경우, 컴퓨터는 유선 또는 무선 통신을 통하여, 서버 또는 클라우드 저장소로부터 본 발명에 따른 프로그램을 다운로드 받을 수 있다.Furthermore, the computer-readable medium may be a server or a cloud storage that includes a storage and that an electronic device can access through communication. In this case, the computer may download the program according to the present invention from a server or cloud storage through wired or wireless communication.

나아가, 본 발명에서는 위에서 설명한 컴퓨터는 프로세서, 즉 CPU(Central Processing Unit, 중앙처리장치)가 탑재된 전자기기로서, 그 종류에 대하여 특별한 한정을 두지 않는다.Furthermore, in the present invention, the computer described above is an electronic device equipped with a processor, that is, a CPU (Central Processing Unit, Central Processing Unit), and there is no particular limitation on the type thereof.

한편, 상기의 상세한 설명은 모든 면에서 제한적으로 해석되어서는 아니되고 예시적인 것으로 고려되어야 한다. 본 발명의 범위는 첨부된 청구항의 합리적 해석에 의해 결정되어야 하고, 본 발명의 등가적 범위 내에서의 모든 변경은 본 발명의 범위에 포함된다.On the other hand, the above detailed description should not be construed as limiting in all respects, but should be considered as exemplary. The scope of the present invention should be determined by a reasonable interpretation of the appended claims, and all modifications within the equivalent scope of the present invention are included in the scope of the present invention.

Claims (16)

대상 문서에 대한 OCR(Optical character recognition)을 수행하여, 복수의 단어 및 상기 복수의 단어 각각에 대한 위치 정보를 추출하는 단계;
상기 복수의 단어 각각에 대응되는 복수의 토큰을 생성하는 단계; 및
상기 대상 문서에 포함된 상기 복수의 단어 간의 데이터 구조가 반영되도록, 상기 복수의 토큰을 배열하는 단계를 포함하고,
상기 복수의 토큰을 배열하는 단계에서는,
상기 복수의 단어의 의미 및 상기 복수의 단어 각각에 대한 위치 정보를 이용하여, 상기 복수의 토큰을 배열하는 것을 특징으로 하는 반정형 문서로부터 정보를 추출하는 방법.
performing optical character recognition (OCR) on a target document to extract a plurality of words and location information for each of the plurality of words;
generating a plurality of tokens corresponding to each of the plurality of words; and
arranging the plurality of tokens so that a data structure between the plurality of words included in the target document is reflected;
In the step of arranging the plurality of tokens,
A method of extracting information from a semi-structured document, characterized in that the plurality of tokens are arranged by using the meaning of the plurality of words and location information for each of the plurality of words.
제1항에 있어서,
상기 복수의 토큰은, 범주의 속성을 갖는 제1 타입의 제1 타입 토큰 및 상기 범주의 값에 해당하는 데이터 속성을 갖는 제2 타입의 제2 타입 토큰 중 어느 하나의 타입을 갖는 것을 특징으로 하는 반정형 문서로부터 정보를 추출하는 방법.
According to claim 1,
The plurality of tokens, characterized in that it has any one type of a first type token having a category attribute and a second type token having a data attribute corresponding to the value of the category. A method of extracting information from semi-structured documents.
제2항에 있어서,
상기 복수의 단어 각각에 대응되는 복수의 토큰을 생성하는 단계는,
상기 복수의 단어 각각의 의미에 기반하여, 상기 범주 속성을 갖는 제1 타입 토큰 및 상기 데이터 속성을 갖는 제2 타입 토큰 중 적어도 하나를 생성하는 단계를 포함하는 것을 특징으로 하는 반정형 문서로부터 정보를 추출하는 방법.
3. The method of claim 2,
The step of generating a plurality of tokens corresponding to each of the plurality of words includes:
based on the meaning of each of the plurality of words, generating at least one of a first type token having the category attribute and a second type token having the data attribute How to extract.
제2항에 있어서,
상기 복수의 단어 각각의 의미 및 상기 대상 문서 상에서의 복수의 단어 각각에 대한 위치 정보에 근거하여, 상기 복수의 단어들을 상기 범주의 속성을 갖는 제1타입에 대응되는 제1 타입 단어 및 상기 데이터의 속성을 갖는 제2타입 단어 중 적어도 하나로 분류하는 단계를 더 포함하는 것을 특징으로 하는 반정형 문서로부터 정보를 추출하는 방법.
3. The method of claim 2,
Based on the meaning of each of the plurality of words and location information of each of the plurality of words on the target document, the plurality of words are classified into a first type word corresponding to a first type having the category attribute and the data. The method of extracting information from a semi-structured document, characterized in that it further comprises the step of classifying into at least one of the second type words having an attribute.
제4항에 있어서,
상기 복수의 단어 각각에 대응되는 복수의 토큰을 생성하는 단계는,
상기 복수의 단어들 중 상기 제1 타입으로 분류된 상기 제1 타입 단어에 각각 대응되도록 적어도 하나의 제1 타입 토큰을 생성하고,
상기 제2 타입으로 분류된 상기 제2 타입 단어에 각각 대응되도록 적어도 하나의 제2 타입 토큰을 생성하는 것을 특징으로 하는 반정형 문서로부터 정보를 추출하는 방법.
5. The method of claim 4,
The step of generating a plurality of tokens corresponding to each of the plurality of words includes:
generating at least one first type token to respectively correspond to the first type word classified into the first type among the plurality of words;
and generating at least one second type token to correspond to each of the second type words classified into the second type.
제5항에 있어서,
상기 복수의 단어 각각에 대응되는 복수의 토큰을 생성하는 단계는,
상기 제2 타입으로 분류된 제2 타입 단어가 속하는 범주 각각에 대한 제1 타입 토큰을 생성하는 것을 특징으로 하는 반정형 문서로부터 정보를 추출하는 방법.
6. The method of claim 5,
The step of generating a plurality of tokens corresponding to each of the plurality of words includes:
and generating a first type token for each category to which the second type word classified into the second type belongs.
제6항에 있어서,
상기 복수의 단어 각각에 대응되는 복수의 토큰을 생성하는 단계는, 상기 복수의 단어에 특정 범주의 범주 값 해당하는 특정 제2타입 단어가 존재하고, 상기 특정 범주에 해당하는 단어가 존재하지 않는 경우,
상기 특정 범의 범주 값에 해당하는 상기 특정 제2타입 단어에 근거하여, 상기 특정 범주에 대응되는 특정 제1타입 토큰을 생성하는 단계를 더 포함하는 것을 특징으로 하는 반정형 문서로부터 정보를 추출하는 방법.
7. The method of claim 6,
The generating of the plurality of tokens corresponding to each of the plurality of words may include: when a specific second type word corresponding to a category value of a specific category exists in the plurality of words, and a word corresponding to the specific category does not exist ,
The method of extracting information from a semi-structured document, characterized in that it further comprises the step of generating a specific first type token corresponding to the specific category based on the specific second type word corresponding to the category value of the specific category .
제6항에 있어서,
상기 복수의 토큰을 배열하는 단계에서는,
상기 제2 타입으로 분류된 특정 제2 타입 단어가 속하는 제1범주에 대응되는 제1타입 토큰과 상기 특정 제2타입 단어에 대응되는 제2타입 토큰을 순차적으로 배열하는 것을 특징으로 하는 반정형 문서로부터 정보를 추출하는 방법.
7. The method of claim 6,
In the step of arranging the plurality of tokens,
A semi-structured document characterized in that a first type token corresponding to a first category to which the specific second type word classified into the second type belongs and a second type token corresponding to the specific second type word are sequentially arranged How to extract information from
제8항에 있어서,
상기 복수의 토큰을 배열하는 단계에서는,
상기 특정 제2타입 단어가 복수개인 경우,
복수개의 상기 특정 제2 타입 단어 각각에 대응되는 복수개의 제2 타입 토큰을 순차적으로 배열하고,
순차적으로 배열된 상기 복수개의 제2 타입 토큰의 배열 순서는, 복수개의 상기 특정 제2 타입 단어 각각의 의미 및 상기 대상 문서 상의 위치 정보에 근거하여, 결정되는 것을 특징으로 하는 반정형 문서로부터 정보를 추출하는 방법.
9. The method of claim 8,
In the step of arranging the plurality of tokens,
When the specific second type word is plural,
sequentially arranging a plurality of second type tokens corresponding to each of the plurality of specific second type words,
An arrangement order of the plurality of sequentially arranged second type tokens is determined based on the meaning of each of the plurality of specific second type words and location information on the target document. How to extract.
제8항에 있어서,
상기 복수의 토큰을 배열하는 단계에서는,
상기 제1범주에 대응되는 제1타입 토큰과, 상기 제1 범주와 다른 제2 범주에 대응되는 제1 타입 토큰을 순차적으로 배열하고,
상기 제1범주에 대응되는 제1타입 토큰과 상기 제2 범주에 대응되는 제2 타입 토큰 사이에는 상기 제1 범주 및 상기 제2 범주 각각에 대응되는 토큰들을 구분하기 위한 제3 타입의 제3 타입 토큰이 배열되는 것을 특징으로 하는 반정형 문서로부터 정보를 추출하는 방법.
9. The method of claim 8,
In the step of arranging the plurality of tokens,
sequentially arranging a first type token corresponding to the first category and a first type token corresponding to a second category different from the first category,
Between the first type token corresponding to the first category and the second type token corresponding to the second category, a third type of third type for distinguishing tokens corresponding to each of the first category and the second category A method of extracting information from a semi-structured document, characterized in that tokens are arranged.
제10항에 있어서,
상기 복수의 토큰을 배열하는 단계에서는,
상기 제1 범주에 대응되는 제1 타입 토큰 및 상기 특정 제2타입 단어에 대응되는 제2타입 토큰 중, 상기 제1 범주에 대응되는 제1 타입 토큰을 가장 첫번째 로 배열하고,
상기 제1 범주에 대응되는 제1 타입 토큰과 연속하여 상기 특정 제2 타입 단어에 대응되는 제2 타입 토큰을 순차적으로 배열하며,
상기 특정 제2 타입 단어에 대응되는 제2 타입 토큰 중 마지막으로 배열된 특정 제2 타입 토큰에 연속하여 상기 제3 타입 토큰을 배열하는 것을 특징으로 하는 반정형 문서로부터 정보를 추출하는 방법.
11. The method of claim 10,
In the step of arranging the plurality of tokens,
Among the first type token corresponding to the first category and the second type token corresponding to the specific second type word, the first type token corresponding to the first category is arranged first;
sequentially arranging a second type token corresponding to the specific second type word in succession with the first type token corresponding to the first category,
The method of extracting information from a semi-structured document, characterized in that the third type token is arranged in succession to the last arranged specific second type token among the second type tokens corresponding to the specific second type word.
제11항에 있어서,
상기 복수의 토큰을 이용하여, 상기 대상 문서와 대응되는 구조를 갖는 데이터를 생성하는 단계를 더 포함하고,
상기 데이터를 생성하는 단계에서는,
상기 복수의 토큰 중 상기 제3 타입 토큰이 검출되면, 상기 제3 타입 토큰이 검출되기 직전에 검출된 특정 토큰과 상기 제3 타입 토큰에 연속하는 특정 토큰을 서로 다른 범주에 각각 대응되는 토큰으로서 인식하는 것을 특징으로 하는 반정형 문서로부터 정보를 추출하는 방법.
12. The method of claim 11,
The method further comprising generating data having a structure corresponding to the target document by using the plurality of tokens,
In the step of generating the data,
When the third type token is detected among the plurality of tokens, a specific token detected immediately before the third type token is detected and a specific token consecutive to the third type token are recognized as tokens corresponding to different categories, respectively. A method of extracting information from a semi-structured document, characterized in that
제8항에 있어서,
상기 복수의 단어 각각에 대응되는 복수의 토큰을 생성하는 단계는,
상기 제1범주의 상위 개념에 대응되는 범주가 존재하는 경우, 상기 상위 개념에 대응되는 범주를 제3범주로 특정하고, 상기 특정된 제3범주에 대응되는 상기 제1타입의 제1타입 토큰을 생성하는 것을 특징으로 하는 반정형 문서로부터 정보를 추출하는 방법.
9. The method of claim 8,
The step of generating a plurality of tokens corresponding to each of the plurality of words includes:
When a category corresponding to a higher-level concept of the first category exists, a category corresponding to the upper-level concept is specified as a third category, and a first type token of the first type corresponding to the specified third category is obtained. A method of extracting information from a semi-structured document, characterized in that it is generated.
제13항에 있어서,
상기 제3범주에 대응되는 제1타입 토큰, 상기 제1범주에 대응되는 제1타입 토큰 및 상기 제1범주에 대응되는 제2타입 토큰은 순차적으로 배열되는 것을 특징으로 하는 반정형 문서로부터 정보를 추출하는 방법.
14. The method of claim 13,
Information from a semi-structured document, characterized in that the first type token corresponding to the third category, the first type token corresponding to the first category, and the second type token corresponding to the first category are sequentially arranged How to extract.
대상 문서에 대한 OCR(Optical character recognition)을 수행하여, 복수의 단어 및 상기 복수의 단어 각각에 대한 위치 정보를 추출하는 OCR부,
상기 복수의 단어 각각에 대응되는 복수의 토큰을 생성하고,
상기 대상 문서에 포함된 상기 복수의 단어 간의 데이터 구조가 반영되도록, 상기 복수의 토큰을 배열하는 제어부를 포함하고,
상기 제어부는,
상기 복수의 단어의 의미 및 상기 복수의 단어 각각에 대한 위치 정보를 이용하여, 상기 복수의 토큰을 배열하는 것을 특징으로 하는 반정형 문서로부터 정보를 추출하는 시스템.
An OCR unit for performing OCR (Optical Character Recognition) on the target document to extract a plurality of words and location information for each of the plurality of words;
generating a plurality of tokens corresponding to each of the plurality of words;
a control unit arranging the plurality of tokens so that the data structure between the plurality of words included in the target document is reflected;
The control unit is
A system for extracting information from a semi-structured document, characterized in that the plurality of tokens are arranged by using the meanings of the plurality of words and position information for each of the plurality of words.
전자기기에서 하나 이상의 프로세스에 의하여 실행되며, 컴퓨터로 판독될 수 있는 기록매체에 저장 가능한 프로그램으로서,
상기 프로그램은,
대상 문서에 대한 OCR(Optical character recognition)을 수행하여, 복수의 단어 및 상기 복수의 단어 각각에 대한 위치 정보를 추출하는 단계;
상기 복수의 단어 각각에 대응되는 복수의 토큰을 생성하는 단계; 및
상기 대상 문서에 포함된 상기 복수의 단어 간의 데이터 구조가 반영되도록, 상기 복수의 토큰을 배열하는 단계를 수행하도록 하는 명령어들을 포함하고,
상기 복수의 토큰을 배열하는 단계에서는,
상기 복수의 단어의 의미 및 상기 복수의 단어 각각에 대한 위치 정보를 이용하여, 상기 복수의 토큰을 배열하는 것을 특징으로 하는 컴퓨터로 판독될 수 있는 기록매체에 저장 가능한 프로그램.
A program that is executed by one or more processes in an electronic device and can be stored in a computer-readable recording medium,
The program is
performing optical character recognition (OCR) on a target document to extract a plurality of words and location information for each of the plurality of words;
generating a plurality of tokens corresponding to each of the plurality of words; and
including instructions for performing the step of arranging the plurality of tokens so that the data structure between the plurality of words included in the target document is reflected,
In the step of arranging the plurality of tokens,
A program storable in a computer-readable recording medium, characterized in that the plurality of tokens are arranged by using the meaning of the plurality of words and location information for each of the plurality of words.
KR1020210070404A 2021-04-15 2021-05-31 Method and system for extracting information from semi-structured documents KR102649429B1 (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP2022062744A JP7453731B2 (en) 2021-04-15 2022-04-05 Method and system for extracting information from semi-structured documents

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
KR20210049464 2021-04-15
KR1020210049464 2021-04-15

Publications (2)

Publication Number Publication Date
KR20220142901A true KR20220142901A (en) 2022-10-24
KR102649429B1 KR102649429B1 (en) 2024-03-20

Family

ID=83805852

Family Applications (1)

Application Number Title Priority Date Filing Date
KR1020210070404A KR102649429B1 (en) 2021-04-15 2021-05-31 Method and system for extracting information from semi-structured documents

Country Status (1)

Country Link
KR (1) KR102649429B1 (en)

Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
KR20200063750A (en) * 2018-11-28 2020-06-05 삼성생명보험주식회사 A computing device for extracting item from a document image
KR102149050B1 (en) * 2020-04-24 2020-08-28 주식회사 애자일소다 System and method for analyzing document using artificial intelligence based on ocr
KR20210011606A (en) * 2019-07-23 2021-02-02 한국과학기술원 Method and Apparatus for Analyzing Tables in Document

Patent Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
KR20200063750A (en) * 2018-11-28 2020-06-05 삼성생명보험주식회사 A computing device for extracting item from a document image
KR20210011606A (en) * 2019-07-23 2021-02-02 한국과학기술원 Method and Apparatus for Analyzing Tables in Document
KR102149050B1 (en) * 2020-04-24 2020-08-28 주식회사 애자일소다 System and method for analyzing document using artificial intelligence based on ocr

Also Published As

Publication number Publication date
KR102649429B1 (en) 2024-03-20

Similar Documents

Publication Publication Date Title
US10614266B2 (en) Recognition and population of form fields in an electronic document
JP6629942B2 (en) Hierarchical automatic document classification and metadata identification using machine learning and fuzzy matching
AU2020279921B2 (en) Representative document hierarchy generation
US20240095247A1 (en) Computerized information extraction from tables
US9384389B1 (en) Detecting errors in recognized text
US20090018990A1 (en) Retrieving Electronic Documents by Converting Them to Synthetic Text
US20150199567A1 (en) Document classification assisting apparatus, method and program
KR102699224B1 (en) Method and system for recognizing tables
JP7493937B2 (en) Method, program and system for identifying a sequence of headings in a document
US20240296691A1 (en) Image reading systems, methods and storage medium for performing geometric extraction
WO2014068770A1 (en) Data extraction method, data extraction device, and program thereof
JP2016027493A (en) Document classification support device, document classification support method, and document classification support program
CN113627173A (en) Manufacturer name identification method and device, electronic equipment and readable medium
US20210182549A1 (en) Natural Language Processing (NLP) Pipeline for Automated Attribute Extraction
KR102684423B1 (en) Method and system for data searching
KR102697516B1 (en) Character recognition method and system robust to errors of character recognition that recognize information included in tables
KR20220142901A (en) Method and system for extracting information from semi-structured documents
JP7453731B2 (en) Method and system for extracting information from semi-structured documents
KR20220143538A (en) Method and system for extracting information from semi-structured documents
US11983228B1 (en) Apparatus and a method for the generation of electronic media
US20240127577A1 (en) Generating templates using structure-based matching
US20240330583A1 (en) Apparatus and method for generating an article
US20230267274A1 (en) Mapping entities in unstructured text documents via entity correction and entity resolution
CN115759020A (en) Form information extraction method, form template configuration method and electronic equipment
CN116090432A (en) Document matching method and electronic device

Legal Events

Date Code Title Description
E902 Notification of reason for refusal
E701 Decision to grant or registration of patent right