Document classification learning apparatus, document classification apparatus, and program

The FiD-based document classification system addresses the issue of uniform sentence treatment by prioritizing important sentences, resulting in improved classification accuracy through iterative learning and cross-attention scoring.

JP2024123574AInactive Publication Date: 2024-09-12NIPPON HOSO KYOKAI
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
JP2023031111
Authority / Receiving Office
JP · JP
Patent Type
Applications
Current Assignee / Owner
Filing Date
2023-03-01
Publication Date
2024-09-12
Estimated Expiration
Not applicable · inactive patent

AI Technical Summary

Technical Problem

Existing document classification methods, such as SLC, fail to accurately classify documents due to uniform treatment of sentences with varying importance, leading to insufficient estimation accuracy.

Method used

A document classification system using FiD (Fusion-in-Decoder) that learns to prioritize sentences with high importance by dividing documents into summary and full text sentences, using retrievers and readers to estimate labels based on cross-attention scores and inner products, with iterative learning to refine the model.

Benefits of technology

Improves document classification accuracy by focusing on important sentences, enhancing the model's ability to correctly classify documents.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure 2024123574000001
    Figure 2024123574000001
Patent Text Reader

Abstract

To learn a plurality of sentences constituting a document in consideration of importance, thereby improving the accuracy of document classification.SOLUTION: A division unit 10 of a document classification learning apparatus 1 divides a summary portion A of training data K into sentences c in units of sentence. A passage configuration unit 11 configures a passage p including a preset question q and a sentence c. A division unit 12 divides all sentences F of the training data k into sentences f in units of sentence, and stores a DB composed of the sentences f in a storage unit 13. A learning unit 14 trains a reader 17 using the passage p and a label L of the training data K. A retriever 16 estimates the passage p using the question q and the DB. The trained reader 17 calculates ca score to train the retriever 16. The trained retriever 16 estimates the passage p to re-train the reader 17. The training and estimation processes of the retriever 16 and the re-training process of the reader 17 are repeated by a preset number of repetitions.SELECTED DRAWING: Figure 3
Need to check novelty before this filing date? Find Prior Art

Description

[Technical field]

[0001] The present invention relates to a document classification technique for natural language processing, and more particularly to a document classification learning device, a document classification device, and a program that can be used to build a document classification system. [Background technology]

[0002] Advances in hardware technology have made it possible to obtain large amounts of text data, increasing the demand for document classification. The amount of text data handled is increasing year by year, and there is a demand for assistance with analysis using natural language processing.

[0003] Such document classification is an important technique in natural language processing, and many methods have been proposed (see, for example, Non-Patent Document 1). In recent natural language processing, a general-purpose trained language model such as BERT (see, for example, Non-Patent Document 2), which is a model based on Transformer (see, for example, Non-Patent Document 7), one of the deep learning methods, is used.

[0004] This language model is often fine-tuned according to the field of application or the purpose of classification, generation, etc., and is used, for example, in machine translation, automatic summarization, and the like.

[0005] However, the number of tokens that can be input during fine tuning (the smallest unit when inputting to a language model, roughly equivalent to the number of words) depends on the size of the input when constructing a general-purpose language model, and is limited to 512 tokens. Tokens exceeding 512 cannot be input, and there was a problem in that they were not reflected in learning.

[0006] To solve this problem, SLC (Sentence-Level Classifier) ​​has been proposed (see, for example, Non-Patent Document 3). This SLC is also a method described in Patent Application No. 2022-042647, which was made by the same applicant of this patent application and was unpublished at the time of filing this patent application.

[0007] Fig. 14 is a diagram for explaining an overview of the conventional technology (SLC). During learning, SLC divides training data into sentence units, constructs new data according to a predetermined rule, and fine-tunes a general-purpose language model using the shortened sentences and correct labels. During estimation, SLC divides a document to be estimated into sentence units, constructs new data according to a predetermined rule, obtains estimated labels for sentence units, which are classification results, from a trained language model using the shortened sentences, and integrates the labels for sentence units to obtain an estimated label for the document.

[0008] Meanwhile, question answering (QA) tasks are known as one of the important techniques in natural language processing. A QA task is a task for finding an answer from a set of questions and documents for finding the answer. In particular, an open-domain QA task, which is one of the QA tasks, is a task in which only the question and the answer are given as learning data, and at the time of estimation, the basis for the answer is found by referring to an external knowledge database such as Wikipedia (registered trademark).

[0009] To solve this open-domain QA task, the ORQA (Open-Retrieval Question Answering) model has been proposed (see, for example, Non-Patent Document 4). In addition, based on this ORQA model, FiD (Fusion-in-Decoder) has been proposed with an improved reader part (see, for example, Non-Patent Document 5).

[0010] The ORQA model consists of a retriever, which searches an external knowledge database for an appropriate (related) set of sentences to obtain an answer, and a reader, which finds the answer by extracting tokens contained in sentences that are important for obtaining the answer from the combination of the set of sentences searched by the retriever and the question.

[0011] Furthermore, a method has been proposed to train the retriever using the leader's knowledge (see, for example, Non-Patent Document 6). This method can improve the accuracy of the QA task. [Prior art documents] [Non-patent literature]

[0012] [Non-Patent Document 1] Shervin Minaee, Nal Kalchbrenner, Erik Cambria, Narjes Nikzad, Meysam Chenaghlu, and Jianfeng Gao. ,“Deep learning-based text classification: A comprehensive review.”, ACM Comput. Surv., Vol. 54, No.3, pp. 62:1-62:40, 2021. [Non-Patent Document 2] Jacob Devlin, Ming-Wei Chang, Kenton Lee, and Kristina Toutanova. ,“BERT: Pre-training of deep bidirectional transformers for language understanding.”, In Proceedings of the 2019 Conference of the North American Chapter of the Association for Computational Linguistics: Human Language Technologies, Volume 1 (Long and Short Papers), pp. 4171-4186, Minneapolis, Minnesota, June 2019. Association for Computational Linguistics. [Non-Patent Document 3] Azumi Okuda, Taro Miyazaki, Hideya Mino, Jun Goto, “A study on paper classification methods using sentence-level classifiers”, 2021 Institute of Image Information and Television Engineers Winter Conference, 2021 [Non-Patent Document 4] Kenton Lee, Ming-Wei Chang, and Kristina Toutanova. ,“Latent retrieval for weakly supervised open domain question answering.”, In Proceedings of the 57th Annual Meeting of the Association for Computational Linguistics, pp. 6086-6096, Florence, Italy, July 2019. Association for Computational Linguistics. [Non-Patent Document 5] Gautier Izacard and Edouard Grave. ,“Leveraging passage retrieval with generative models for open domain question answering.”, In Proceedings of the 16th Conference of the European Chapter of the Association for Computational Linguistics, pp. 874-880, 2021. [Non-Patent Document 6] Gautier Izacard and Edouard Grave. ,“Distilling knowledge from reader to retriever for question answering.”, In The International Conference on Learning Representations, 2021. [Non-Patent Document 7] A. Vaswani, N. Shazeer, N. Parmar, J. Uszkoreit, L. Jones, AN Gomez, L. Kaiser, and I. Polosukhin, “Attention Is All You Need”, NIPS 2017 pp.5998-6008 (2017) Summary of the Invention [Problem to be solved by the invention]

[0013] In the SLC described in the aforementioned Non-Patent Document 3, during learning, a document of training data is divided into sentence units to construct multiple short sentences, and learning is performed using the multiple short sentences and correct labels. During estimation using a trained model, the SLC divides the document into sentence units to obtain estimated labels for each sentence, and obtains the estimated label of the document by averaging the estimated labels for each sentence for all sentences or by taking a majority vote.

[0014] However, this SLC has a problem in that the estimation accuracy of document classification is not sufficient. This is because the training data documents used during learning contain not only sentences with high importance related to label estimation, but also sentences with low importance that are not related to label estimation, and learning is performed by treating all of these sentences uniformly. Also, during estimation, the labels of each sentence are integrated for all sentences.

[0015] Here, during learning, it is expected that highly accurate document classification can be realized by focusing on only sentences with high importance related to the labels included in the documents of the training data and learning using those sentences. For this reason, it has been desired to perform learning that takes into account the importance of each sentence (learning that takes into account which sentences are important for label estimation).

[0016] Therefore, the present invention has been made to solve the above-mentioned problems, and its object is to provide a document classification learning device, a document classification device, and a program that are capable of realizing learning that takes into account the importance of the multiple sentences that make up a document, and improving the accuracy of document classification. [Means for solving the problem]

[0017] In order to solve the above problem, the document classification learning device of claim 1 is a document classification learning device that learns a model for classifying documents by using sentences included in the documents and labels assigned to the documents, the document classification learning device including: a first division unit that inputs a summary of the document, the entire text of the document, and the labels as training data, and divides the summary into sentence units to generate a plurality of sentences; a first passage construction unit that constructs a plurality of passages, each of which is a passage consisting of a set consisting of a question consisting of a predetermined sentence and each of the plurality of sentences generated by the first division unit; and a first passage construction unit that inputs the entire text, divides the entire text into sentence units to generate a plurality of sentences, and stores a DB consisting of the plurality of sentences. The present invention is characterized in that it is equipped with a second division unit that stores a predetermined number of teacher data in a memory unit, a learning unit that learns a fusion-in-decoder (FiD) consisting of a retriever that uses a predetermined number of teacher data, the plurality of passages corresponding to the teacher data constructed by the first passage construction unit, the DB corresponding to the teacher data stored in the memory unit, the label and the question, to estimate a plurality of passages as output data, with the question and the DB as input data and a pair of the question and context as a passage, and a reader that uses the plurality of passages as input data and estimates a label as output data.

[0018] The document classification learning device of claim 2 is the document classification learning device of claim 1, wherein the learning unit further comprises: a reader learning means for learning the reader using the plurality of passages corresponding to the teacher data constructed by the first passage construction unit and the labels for each of the predetermined number of teacher data; a retriever learning means for estimating a plurality of passages by the retriever using the question and the DB corresponding to the teacher data for each of the predetermined number of teacher data, calculating a cross-attention (CA) score for each of the plurality of passages estimated by the reader learned by the reader learning means, and learning the retriever based on the CA score and an inner product of the question and the context that constitutes each of the plurality of passages; and The system is characterized in that it is equipped with a leader re-learning means for estimating a plurality of passages using the DB corresponding to the question and the teaching data by the retriever learned by the retriever learning means, and re-learning the leader using the estimated plurality of passages and the label, and a repetitive learning means for repeatedly performing a retriever learning process in which, for each of the predetermined number of teaching data, the leader re-learned by the leader re-learning means calculates the CA score by the leader re-learned by the retriever learning means, and learns the retriever based on the CA score and the inner product, and a re-learning process in which, for each of the predetermined number of teaching data, the leader re-learning means estimates the plurality of passages by the retriever learned by the retriever learning process, and re-learns the leader, a predetermined number of times.

[0019] Furthermore, the document classification device of claim 3 is a document classification device that classifies a document to be classified into one of a plurality of labels by the reader that constitutes the FiD learned by the document classification learning device of claim 1 or 2, and is characterized in that it comprises: a third division unit that inputs a summary portion of the document to be classified and generates a plurality of sentences by dividing the summary portion into sentence units; a second passage construction unit that constructs a plurality of passages, each of which is a set consisting of a question consisting of a predetermined sentence and each of the plurality of sentences generated by the third division unit; and an estimation unit that estimates the label by the reader using the plurality of passages constructed by the second passage construction unit.

[0020] Furthermore, the program of claim 4 is characterized in that the program causes a computer constituting a learning device for document classification that learns a model for classifying a document using sentences contained in the document and labels assigned to the document to function as a first division unit that inputs a summary portion of the document, the entire text of the document, and the labels as training data, and generates a plurality of sentences by dividing the summary portion into sentence units, a first passage construction unit that constructs a plurality of passages by treating a set consisting of a question consisting of a predetermined sentence and each of the plurality of sentences generated by the first division unit as a passage, and a second division unit that inputs the entire text, divides the entire text into sentence units to generate a plurality of sentences, and stores a DB consisting of the plurality of sentences in a memory unit.

[0021] The program of claim 5 is characterized in that the computer constituting a document classification device that classifies a document to be classified into one of a plurality of labels by the reader constituting the FiD learned by the document classification learning device of claim 1 or 2 functions as a third division unit that inputs a summary portion of the document to be classified and generates a plurality of sentences by dividing the summary portion into sentence units, a second passage construction unit that constructs a plurality of passages by using a set of a question consisting of a predetermined sentence and each of the plurality of sentences generated by the third division unit as a passage, and an estimation unit that estimates the label using the plurality of passages constructed by the second passage construction unit by the reader. Effect of the Invention

[0022] As described above, according to the present invention, it is possible to realize learning that takes into account the importance of multiple sentences that make up a document, thereby improving the accuracy of document classification. [Brief description of the drawings]

[0023] [Figure 1] FIG. 1 is a diagram for explaining an overview of the present invention. [Diagram 2] FIG. 13 is a diagram for explaining details of FiD. [Diagram 3] 1 is a block diagram showing an example of the configuration of a document classification learning device according to an embodiment of the present invention. [Figure 4] 13 is a flowchart showing an example of processing by the document classification learning device. [Diagram 5] 13 is a flowchart showing an example of a leader learning process (step S401). [Figure 6] FIG. 13 is a block diagram illustrating an example of a leader learning process (step S401). [Figure 7] 13 is a flowchart showing an example of a retriever learning process (step S402). [Figure 8] FIG. 13 is a block diagram illustrating an example of a retriever learning process (step S402). [Figure 9]13 is a flowchart showing an example of a retriever estimation process and a leader re-learning process (steps S403 and S404). [Figure 10] FIG. 13 is a block diagram illustrating an example of a retriever estimation process and a leader re-learning process (steps S403 and S404). [Figure 11] 1 is a block diagram showing an example of the configuration of a document classification device according to an embodiment of the present invention. [Figure 12] 13 is a flowchart illustrating an example of processing by the document classification device. [Figure 13] FIG. 13 is a diagram illustrating the results of an experiment. [Figure 14] FIG. 1 is a diagram for explaining an overview of the conventional technology (SLC). DETAILED DESCRIPTION OF THE PREFERRED EMBODIMENTS

[0024] The following describes in detail the embodiments of the present invention with reference to the drawings. The present invention applies FiD, which is used in the ORQA task, which is one of the QA tasks, to document classification, and is characterized in that it trains FiD taking into account the importance of sentences that make up a document, and classifies documents to be classified into labels using the trained FiD.

[0025] This FiD integrates sentences segmented from a document using a neural network (NN), extracts sentences with high importance from multiple sentences, and learns to estimate labels taking into account the importance of the sentences.

[0026] Here, the importance of a sentence refers to the degree to which a label that represents the genre of the entire document is expressed for each of the multiple sentences that make up a document. A sentence with high importance indicates that it is a sentence that contributes to estimating the correct label of the document to a high degree, and a sentence with low importance indicates that it contributes to estimating the correct label of the document to a low degree. For example, sentences such as standard phrases and URLs are sentences with low importance because they do not contribute to estimating the label of the document by themselves.

[0027] This makes it possible to realize learning that takes into account the importance of the multiple sentences that make up a document, thereby improving the accuracy of document classification.

[0028] Summary of the Invention First, an overview of the present invention will be described. Fig. 1 is a diagram for explaining the overview of the present invention, and Fig. 2 is a diagram for explaining the details of FiD. In the present invention, FiD, which is composed of a retriever and a reader, is applied to document classification.

[0029] As shown in Fig. 1, a document classification learning device 1 according to an embodiment of the present invention uses training data to learn retrievers and readers that constitute FiD. The training data is data for each document, such as a paper, and is composed of an abstract, which is a short piece of text contained in the document, a full text, which is a long piece of text, and a label (correct label) that represents the genre of the document.

[0030] The summary part of the training data is divided into sentences, and the multiple sentences that make up the summary part are used for learning. In addition, the entire sentence of the training data is also divided into sentences, and the multiple sentences that make up the entire sentence are built as a DB (external knowledge), and the DB is used for learning.

[0031] A document classification device 2 according to an embodiment of the present invention estimates a label of a document to be classified using only the leaders that constitute the FiD learned by the document classification learning device 1. The summary part of the document to be classified is divided into sentence units, and the label of the document is estimated from the leaders using multiple sentences that constitute the summary part.

[0032] As shown in Figures 1 and 2, the retriever is an NN that inputs a question and a DB, extracts contexts, which are multiple sentences with high importance related to the label, using the inner product results between the question and each data in the DB, and outputs n passages (passage1, 2,..., n). A passage is composed of a question and a context. In other words, the retriever constructs n passages by performing a neighborhood search of multiple contexts related to the question from the DB, and outputs the n passages.

[0033] The question is information that is useful for assigning a label, and an example of such a fixed sentence is "What genre best describes this abstract?". As mentioned above, the DB is constructed from multiple sentences obtained by dividing the full text F of a single document into sentence units. The retriever and reader basically learn for each training data, and the DB used is updated every time the training data is changed. In other words, the DB, which is the external knowledge searched for by the retriever, is constructed not from all documents, but from multiple sentences obtained by dividing the full text F of a single document.

[0034] In this way, by using a pre-defined question and database, the retriever considers the operation of searching the database for sentences related to the question as extracting multiple sentences with high importance related to the label from the entire document.

[0035] The leader is a NN that inputs multiple passages output by the retriever and outputs a label, which is the answer. In other words, the leader's operation of inferring a label from multiple passages is considered to be the operation of inferring a label from multiple sentences by the conventional SLC shown in Figure 14.

[0036] The reader's input includes a sentence, which is the context, as well as a question, which is useful information for inferring a label, which is an answer separate from the context, that is, a passage consisting of a question and a context.

[0037] Each of the multiple passages is input to the reader's encoder to obtain a sequence of embeddings, which are then input to the concat to be concatenated and input to the decoder as a single sequence, which then outputs the answer, a label.

[0038] In addition, in the process of inputting each of the multiple passages into the encoding and outputting the labels from the decoder, the reader calculates the score for each token in the passage for the question as a cross-attention score (hereinafter referred to as the "CA score").

[0039] This CA score is output from the reader to the retriever during the learning of the retriever. The CA score indicates the degree of association between the input and output tokens in the transformer's attention mechanism. The retriever learns under the assumption that tokens in a passage with a high CA score have a high contribution to the answer (high contribution of correct label estimation), and tokens in a passage with a low CA score have a low contribution to the answer (low contribution of correct label estimation).

[0040] When learning FiD, the passages used by the leader are updated by the retriever, and the ca score calculated by the leader during the output process is used for learning the retriever. The leader and the retriever are mutually related, and by repeatedly learning the leader and the retriever, the accuracy of each model can be improved.

[0041] [Learning device for document classification 1] Next, a description will be given of the document classification learning device 1 according to an embodiment of the present invention. Fig. 3 is a block diagram showing an example of the configuration of the document classification learning device 1 according to an embodiment of the present invention.

[0042] This document classification learning device 1 includes division units 10 and 12, a passage construction unit 11, memory units 13 and 15, and a learning unit 14. The learning unit 14 includes a leader learning means 30, a retriever learning means 31, a leader re-learning means 32, and a repetitive learning means 33.

[0043] The document classification learning device 1 uses a predetermined number of training data K (K-1, K-2, ...) to learn an FiD consisting of a retriever 16 and a reader 17 stored in a memory unit 15. As described above, the training data K is data for each document such as a paper, and is composed of an outline portion A of the document (outline portion A included in the document), the full text F of the document, and a label L of the document (correct label assigned to the document).

[0044] The division unit 10 receives an outline A of a document and divides the outline A into sentences to generate a plurality of sentences c. The division unit 10 then outputs the plurality of sentences c to the passage construction unit 11.

[0045] The passage construction unit 11 inputs a plurality of sentences c from the division unit 10, and also inputs a question q of a preset fixed sentence.

[0046] Instead of a fixed sentence, the summary part A of the document may be used as the question q. In this case, the question q is changed for each of a predetermined number of pieces of teacher data K so that the summary part A of the teacher data K is used for each piece of the teacher data K.

[0047] The passage construction unit 11 constructs a plurality of passages p, each of which is a pair of a question q and a sentence c, for each of the plurality of sentences c, and outputs the plurality of passages p to the learning unit 14.

[0048] The division unit 12 inputs the entire text F of a document and divides the entire text F into sentence units to generate multiple sentences f. Then, the division unit 12 stores a DB consisting of the multiple sentences f in the storage unit 13. As a result, the storage unit 13 stores a DB consisting of the multiple sentences f obtained by dividing the entire text F of the document by the training data K.

[0049] The learning unit 14 inputs from the passage construction unit 11 a plurality of passages p each composed of a plurality of sentences c and a question q of the summary part A included in the teacher data K. The learning unit 14 also reads from the storage unit 13 a DB composed of a plurality of sentences f constituting a full sentence F included in the teacher data K. Furthermore, the learning unit 14 inputs a label (correct answer label) L included in the teacher data K, and also inputs a question q of a preset fixed sentence.

[0050] The learning unit 14 learns the FiD composed of the retriever 16 and the leader 17 stored in the memory unit 15 by the leader learning means 30 , the retriever learning means 31 , the leader re-learning means 32 and the iterative learning means 33 .

[0051] Fig. 4 is a flowchart showing an example of processing by the document classification learning device 1 shown in Fig. 3. First, the document classification learning device 1 performs a leader learning process for learning a leader 17 using a plurality of passages p and labels L for each of a predetermined number of training data K (step S401). This leader learning process is performed by the division unit 10, the passage composition unit 11, and the leader learning means 30 of the learning unit 14 shown in Fig. 3. The leader learning process will be described in detail later.

[0052] The document classification learning device 1 uses the question q and the DB stored in the memory unit 13 to estimate multiple passages p with the retriever 16 for each of a predetermined number of teacher data K, calculates a ca score with the reader 17 learned in step S401, and performs a retriever learning process for learning the retriever 16 (step S402). This retriever learning process is performed by the division unit 12, the memory unit 13, and the retriever learning means 31 of the learning unit 14, which are shown in Fig. 3. The retriever learning process will be described in detail later.

[0053] The document classification learning device 1 performs a retriever estimation process (step S403) to estimate a plurality of passages p by the retriever 16 learned in step S402 for each of the predetermined number of teacher data K. Then, the document classification learning device 1 performs a leader re-learning process (step S404) to re-learn the leader 17 learned in step S401 using the plurality of passages p estimated in step S403 and the labels L for each of the predetermined number of teacher data K.

[0054] The retriever estimation process and the leader re-learning process are performed by the memory unit 13 and the leader re-learning means 32 of the learning unit 14 shown in Fig. 3. In this case, the memory unit 13 stores an individual DB for each teacher data K. The retriever estimation process and the leader re-learning process will be described in detail later.

[0055] The document classification learning device 1 determines whether or not the repetitive processing (the processing of steps S402 to S404) has been completed a preset number of times (step S405).

[0056] If the document classification learning device 1 determines in step S405 that the repetitive processing is not complete (step S405: N), it proceeds to step S402, and performs retriever learning processing in step S402, retriever estimation processing in step S403, and leader re-learning processing in step S404.

[0057] In this case, in the retriever learning process in step S402, the ca score is calculated by the leader 17 re-learned in step S404. In the leader re-learning process in step S404, the leader 17 is re-learned in step S404 immediately before the repeat process.

[0058] On the other hand, if it is determined in step S405 that the repetitive process is completed (step S405: Y), the document classification learning device 1 ends the process. This repetitive process is performed by the memory unit 13, and the retriever learning means 31, the leader re-learning means 32, and the repetitive learning means 33 of the learning unit 14. In this case, it is assumed that the memory unit 13 stores an individual DB for each piece of teacher data K. The repetitive process will be described in detail later.

[0059] As a result, the learned FiD is stored in the memory unit 15, and the learned leader 17 that constitutes the learned FiD is used for document classification processing by the document classification device 2.

[0060] (Leader learning process: step S401) Fig. 5 is a flow chart showing an example of the leader learning process (step S401), and Fig. 6 is a block diagram explaining an example of the leader learning process (step S401). As described above, this leader learning process is performed by the division unit 10, the passage construction unit 11, and the leader learning means 30 of the learning unit 14 shown in Fig. 3.

[0061] The document classification learning device 1 receives as input the summary part A and the label L of the teacher data K, as well as a question q (Step S501).

[0062] The division unit 10 receives the summary part A, divides the summary part A into sentence units, and generates sentences c1, c2, . . . (Step S502). Then, the division unit 10 outputs the sentences c1, c2, . . . to the passage construction unit 11.

[0063] The passage construction unit 11 inputs the question q and the sentences c1, c2, ... from the division unit 10, and constructs passages p1(q, c1), p2(q, c2), ... consisting of the question q and the sentences c1, c2, ... (step S503). Then, the passage construction unit 11 outputs the passages p1(q, c1), p2(q, c2), ... to the reader learning means 30.

[0064] The leader learning means 30 inputs the label L and also inputs the passages p1(q,c1), p2(q,c2),... from the passage construction unit 11. Then, the leader learning means 30 learns the leader 17 using the passages p1(q,c1), p2(q,c2),... and the label L (step S504).

[0065] Specifically, the reader 17 receives passages p1(q,c1), p2(q,c2),... as input data, performs model calculations by the reader 17, and outputs labels to the update unit 18-1 as output data. The update unit 18-1 receives the label L and the label from the reader 17, and updates the parameters of the reader 17 so that the label matches the correct label, which is the label L, thereby learning the reader 17.

[0066] The document classification learning device 1 determines whether or not processing of all of a predetermined number of teacher data K has been completed (step S505). If the document classification learning device 1 determines in step S505 that processing of all of the teacher data K has not been completed (step S505: N), it proceeds to step S501 and performs the processes of steps S501 to S504 by inputting the summary part A and label L of the next teacher data K. It is assumed that the question q is a fixed sentence common to all of the teacher data K.

[0067] When the document classification learning device 1 determines in step S505 that the processing of all the teacher data K has been completed (step S505: Y), the document classification learning device 1 ends the leader learning process. This completes the learning of the leader 17 using a predetermined number of teacher data K.

[0068] (Retriever learning process: step S402) Fig. 7 is a flow chart showing an example of the retriever learning process (step S402), and Fig. 8 is a block diagram explaining the example of the retriever learning process (step S402). As described above, the retriever learning process is performed by the division unit 12, the storage unit 13, and the retriever learning means 31 of the learning unit 14 shown in Fig. 3.

[0069] The document classification learning device 1 receives as input the full text F of the teacher data K and a question q (Step S701).

[0070] The division unit 12 inputs the entire text F, divides the entire text F into sentence units, and generates sentences f1, f2, ... (step S702). Then, the division unit 12 stores a DB consisting of the sentences f1, f2, ... in the storage unit 13 (step S703).

[0071] The retriever learning means 31 inputs the question q and the DB stored in the storage unit 13, and infers a plurality of passages p using the question q and the DB by the retriever 16 (step S704).

[0072] The retriever learning means 31 uses the multiple passages p estimated by the retriever 16 by the trained reader 17 trained in step S401 of Figure 4 (step S504 of Figure 5), to calculate, for each passage p, the ca score for each token contained in the passage p for the question q (step S705).

[0073] The retriever learning means 31 learns the retriever 16 using the multiple passages p estimated by the retriever 16 and the multiple ca scores calculated by the leader 17 (step S706).

[0074] Specifically, the retriever 16 receives the question q and the DB as input data, performs calculations of the model by the retriever 16, and outputs a plurality of passages p as output data to the reader 17 and the update unit 18-2.

[0075] The reader 17 inputs multiple passages p from the retriever 16 as input data, and in the process of calculating the model by the reader 17, calculates a ca score for each token contained in each of the multiple passages p for the question q, and outputs the multiple ca scores to the update unit 18-2.

[0076] The update unit 18-2 inputs a plurality of passages p from the retriever 16 and inputs a plurality of CA scores from the reader 17. Then, for each of the plurality of passages p, the update unit 18-2 calculates an inner product between a question q constituting the passage p and a context. The update unit 18-2 learns the retriever 16 by updating the parameters of the retriever 16 so that the CA score corresponding to the passage p and its inner product are associated with each other (so that the CA score and the inner product are normalized and the distance between the normalized CA score and the inner product is minimized).

[0077] The document classification learning device 1 determines whether or not processing of all of the predetermined number of teacher data K has been completed (step S707). If the document classification learning device 1 determines in step S707 that processing of all of the teacher data K has not been completed (step S707: N), it proceeds to step S701 and performs the processes of steps S701 to S706 by inputting the full text F of the next teacher data K. Note that the question q is a fixed sentence common to all of the teacher data K.

[0078] When it is determined in step S707 that the processing of all the training data K has been completed (step S707: Y), the document classification learning device 1 ends the retriever learning process. This completes the learning of the retriever 16 using a predetermined number of training data K.

[0079] (Retriever estimation process and leader re-learning process: steps S403, S404) Fig. 9 is a flow chart showing an example of the retriever estimation process and the leader re-learning process (steps S403, S404), and Fig. 10 is a block diagram explaining an example of the retriever estimation process and the leader re-learning process (steps S403, S404). The retriever estimation process and the leader re-learning process are performed by the memory unit 13 and the leader re-learning means 32 of the learning unit 14 shown in Fig. 3.

[0080] The document classification learning device 1 inputs the label L of the teacher data K and the question q (step S901). Then, when a predetermined number of DBs (a predetermined number of DBs corresponding to full texts F of the predetermined number of teacher data K) are stored in storage unit 13 in step S703 of Fig. 7, for example, the document classification learning device 1 sets, among these DBs, the DB corresponding to the teacher data K in step S901 as the DB to be used in the subsequent step S903 (step S902).

[0081] In step S902, the division unit 12 of the document classification learning device 1 may store in the storage unit 13 the DB generated by dividing the full text F of the training data K in steps S701 to S703 of FIG.

[0082] The leader re-learning means 32 inputs the question q and the DB set in step S902 (the DB stored in the memory unit 13), and the learned retriever 16 learned in step S402 of Figure 4 (step S706 of Figure 7) estimates passages p1, p2, ... using the question q and the DB (step S903).

[0083] Specifically, the retriever 16 receives the question q and the DB as input data, and performs passage retrieval to extract multiple contexts related to the question q and effective for label estimation by performing approximate neighborhood search in the DB for the question q using faiss [9]. The retriever 16 then constructs a passage p consisting of the question q and the context, and outputs multiple passages p1, p2, ... to the reader 17 as output data.

[0084] For details about approximate neighborhood search, please refer to the following document. ARISEanalyticsInc., “Recommendation#3Approximate Neighborhood Search with GPU...”, [online], [Retrieved February 15, 2023], Internet<URL:https: / / www.ariseanalytics.com / activities / report / 20210304 / >

[0085] The leader re-learning means 32 inputs the label L and re-learns the learned leader 17 learned in step S401 of FIG. 4 (step S504 of FIG. 5) using the passages p1, p2, ... and label L estimated by the retriever 16 (step S904).

[0086] Specifically, the reader 17 receives the passages p1, p2,... estimated by the retriever 16 as input data, performs model calculations by the reader 17, and outputs the labels as output data to the update unit 18-3. The update unit 18-3 receives the label from the reader 17, and updates the parameters of the reader 17 so that the label matches the correct label, which is the label L, thereby re-learning the reader 17.

[0087] The document classification learning device 1 determines whether or not processing of all of a predetermined number of pieces of teacher data K has been completed (step S905). If the document classification learning device 1 determines in step S905 that processing of all of the teacher data K has not been completed (step S905: N), it proceeds to step S901 and performs the processes of steps S901 to S904 by inputting the label L of the next teacher data K. Note that the question q is a fixed sentence common to all of the teacher data K.

[0088] When it is determined in step S905 that the processing of all the teacher data K has been completed (step S905: Y), the document classification learning device 1 ends the retriever estimation process and the leader re-learning process. This completes the re-learning of the leader 17 using a predetermined number of teacher data K.

[0089] (Repetitive learning process: steps S402 to S404) The repeated processing of steps S402 to S404 shown in FIG. 4 is performed by the division unit 12, the storage unit 13, and the retriever learning means 31, the leader re-learning means 32, and the repeated learning means 33 of the learning unit 14 shown in FIG.

[0090] The repetitive learning means 33 judges whether the repetitive process is completed a preset number of times. If the repetitive learning means 33 judges that the repetitive process is not completed, the repetitive learning means 33 causes the division unit 12, the storage unit 13, and the retriever learning means 31 to perform the retriever learning process of step S402, and causes the storage unit 13 and the leader re-learning means 32 to perform the retriever estimation process and the leader re-learning process of steps S403 and S404.

[0091] On the other hand, when it is determined that the repetitive process has been completed a preset number of times, the repetitive learning means 33 ends the repetitive process.

[0092] In this case, during the retriever learning process in step S402, in steps S701 to S703 of Figure 7, if a predetermined number of DBs (a predetermined number of DBs corresponding to the full text F of the teacher data K) are stored in the memory unit 13, as in step S902 of Figure 9, the retriever learning means 31 sets among these DBs the DB corresponding to the teacher data K to be processed as the DB to be used for this learning.

[0093] 9. In addition, in step S705 of FIG. 7, the retriever learning means 31 calculates the ca score using the passage p estimated by the retriever 16 by the trained leader 17 that has already been re-trained in step S904 of FIG.

[0094] Also, during the leader re-learning process in step S404, the leader re-learning means 32 re-learns the learned leader 17 that was already re-learned in the previous step S904 using the passages p1, p2, ... and label L in step S904 of Figure 9.

[0095] As a result, the learned FiD is stored in the storage unit 15. The learned reader 17 constituting the learned FiD is used for document classification processing by the document classification device 2, which will be described later.

[0096] For general learning methods for FiD, please refer to the following literature. “CVML Expert Guide”, [online], [searched February 14, 2023], Internet <URL:https: / / cvml-expertguide.net / terms / dl / seq2seq-translation / transformer / multi-head-attention / #3_Transformer>

[0097] As described above, according to the document classification learning device 1 of the embodiment of the present invention, the division unit 10 generates a plurality of sentences c by dividing the summary part A of the training data K into sentence units, and the passage construction unit 11 constructs a plurality of passages p for each of the plurality of sentences c by treating a pair of a predetermined fixed sentence question q and the sentence c as a passage.

[0098] The division unit 12 divides the entire sentence F of the training data K into sentence units to generate a plurality of sentences f, and stores a DB consisting of the plurality of sentences f in the storage unit 13.

[0099] The learning unit 14 learns a leader 17 that constructs an FiD for each of a predetermined number of teacher data K, using a plurality of passages p constructed by the passage construction unit 11 and the label L of the teacher data K.

[0100] Next, the learning unit 14 estimates multiple passages p for each of a predetermined number of teacher data K using the retriever 16 with the question q and the DB of the teacher data K, calculates a ca score using the passage p with the learned reader 17, and learns the retriever 16 that constructs the FiD so that the ca score is associated with the inner product of the question q and the context that constitutes the passage p.

[0101] Next, the learning unit 14 estimates multiple passages p for each of a predetermined number of teacher data K using the question q and the DB of the teacher data K with the trained retriever 16, and re-learns the reader 17 using the multiple passages p and the labels L of the teacher data K.

[0102] Next, the learning unit 14 repeats the above-mentioned learning process by the retriever 16, the estimation process by the retriever 16, and the re-learning process by the reader 17 for a preset number of times. Here, the learning of FiD is performed for each document that is the teacher data K, and the DB used during learning is not a DB reflecting all of a predetermined number of teacher data K, but a DB corresponding to one teacher data K, and is changed every time the teacher data K is changed.

[0103] As a result, the retriever 16 and the reader 17 that constitute the FiD are trained, and a trained FiD is obtained. Then, the document classification device 2 uses the trained reader 17 that constitutes the trained FiD to classify the documents to be classified.

[0104] As described above, the division units 10 and 12 divide the summary part A and the full text F into sentence units, and FiD is trained using the passage p and DB based on the sentence. This makes it unnecessary to input long sentences that exceed the limitations of the language model to FiD, which is effective when the summary part A and the full text F are long.

[0105] In addition, in the learning process of the retriever 16 by the learning unit 14, the retriever 16 is trained using the ca score, which is the contribution of the token in the passage p to the question q to the correct label estimation. Therefore, the retriever 16 is trained taking into consideration important parts in a sentence that contribute highly to the correct label estimation, that is, tokens with high importance in the sentence. The reader 17 is then retrained using the retriever 16 trained in this way. As a result, documents can be classified with higher accuracy when using the document classification device 2 compared to when using the conventional SLC shown in FIG. 14.

[0106] In addition, in the re-learning process of the reader 17 by the learning unit 14, the retriever 16 selects multiple sentences (multiple contexts) with high importance (relevant when estimating a correct label) from a DB consisting of multiple sentences f into which the full sentence F of the teacher data K is divided, and estimates multiple passages p. Then, the learning unit 14 re-learns the reader 17 using the multiple passages p estimated in this way. Therefore, it is possible to obtain a reader 17 that can estimate a label taking into account the importance of the sentence. As a result, documents can be classified with higher accuracy when using the document classification device 2 compared to when using the conventional SLC shown in FIG. 14.

[0107] Therefore, it is possible to realize learning that takes into account the importance of the multiple sentences that make up a document, thereby improving the accuracy of document classification.

[0108] [Document Classification Device 2] Next, a description will be given of the document classification device 2 according to an embodiment of the present invention. Fig. 11 is a block diagram showing an example of the configuration of the document classification device 2 according to an embodiment of the present invention, and Fig. 12 is a flowchart showing an example of the processing of the document classification device 2.

[0109] This document classification device 2 includes a division unit 20, a passage construction unit 21, an estimation unit 22, and a memory unit 23. The memory unit 23 stores a trained leader 17 that constitutes a trained FiD trained by the document classification learning device 1 shown in FIG.

[0110] The document classification device 2 classifies a document to be classified into one of a plurality of labels using the trained reader 17 stored in the storage unit 23.

[0111] The division unit 20 receives an outline A' of a document to be classified (step S1201) and divides the outline A' into sentences to generate multiple sentences c' (step S1202). The division unit 20 then outputs the multiple sentences c' to the passage construction unit 21.

[0112] The passage construction unit 21 inputs a plurality of sentences c' from the division unit 20, and also inputs a question q, which is a preset fixed sentence. The question q is a fixed sentence used when learning FiD by the document classification learning device 1 shown in FIG. 3.

[0113] The passage construction unit 21 constructs a plurality of passages p' by combining a question q and a sentence c' for each of the plurality of sentences c' (step S1203). As a result, when the plurality of sentences c' are sentences c1', c2', ..., passages p1'(q, c1'), p2'(q, c2'), ... are constructed. The passage construction unit 21 outputs the plurality of passages p' to the estimation unit 22.

[0114] The estimation unit 22 inputs multiple passages p' from the passage construction unit 21, estimates labels using the multiple passages p' using the learned reader 17 stored in the memory unit 23 (step S1204), and outputs the estimated labels (step S1205).

[0115] As described above, according to the document classification device 2 of an embodiment of the present invention, the division unit 20 generates multiple sentences c' by dividing the summary part A' of the document to be classified into sentence units, and the passage construction unit 21 constructs multiple passages p' for each of the multiple sentences c' by setting a pair of a predetermined fixed sentence question q and sentence c' as passage p'.

[0116] Estimation unit 22 estimates labels using multiple passages p' by trained reader 17 trained by document classification learning device 1, and outputs the estimated labels.

[0117] As a result, the division unit 20 divides the summary part A' into sentence units, and the passage construction unit 21 constructs a passage p' based on the sentence. This is effective when the summary part A' has a long sentence, since it is not necessary to input a long sentence that exceeds the limit of the language model to the trained reader 17.

[0118] In addition, since the trained leader 17 trained by the document classification learning device 1 is a model capable of estimating labels taking into account the importance of sentences and tokens, the document classification device 2 can classify documents with higher accuracy than when the conventional SLC shown in Figure 14 is used.

[0119] Therefore, it is possible to realize learning that takes into account the importance of the multiple sentences that make up a document, thereby improving the accuracy of document classification.

[0120] [Experimental Results] Next, we will explain the experimental results for the document classification learning device 1 and document classification device 2 according to the embodiment of the present invention. Fig. 13 is a diagram explaining the experimental results. This experiment classifies novel coronavirus papers on CORD-19 into labels of 25 research fields, and the Micro-F1 and Macro-F1 shown in Fig. 13 were obtained from this experiment.

[0121] For more information on the CORD-19 novel coronavirus paper, please see below. LLWang et al.: “CORD-19:The Covid-19 Open Research Dataset”,arXiv:2004.10706(2020)

[0122] 13, the abstract in the embodiment of the present invention corresponds to the leader learning process in step S401 in FIG. 4, and the number of repetitions is set to 0. The retriever result in the embodiment of the present invention corresponds to the repetitive process in steps S402 to S404 in FIG. 4, and the number of repetitions corresponds to the number of repetitive processes in step S405 in FIG. 4.

[0123] FIG. 13 shows that the embodiment of the present invention generally outperforms the conventional SLC in both Micro-F1 and Macro-F1, and in particular, the accuracy is generally improved up to about 4 iterations (α).

[0124] Although the present invention has been described above with reference to the embodiments, the present invention is not limited to the above-described embodiments and can be modified in various ways without departing from the technical concept thereof.

[0125] A normal computer can be used as the hardware configuration of the document classification learning device 1 and document classification device 2 according to the embodiments of the present invention. The document classification learning device 1 and document classification device 2 are configured by a computer equipped with a CPU, a volatile storage medium such as RAM, a non-volatile storage medium such as ROM, an interface, etc.

[0126] Each function of the division units 10, 12, passage construction unit 11, memory units 13, 15, and learning unit 14 (reader learning means 30, retriever learning means 31, leader re-learning means 32, and repeated learning means 33) provided in the document classification learning device 1 is realized by having a CPU execute a program that describes these functions.

[0127] In addition, each function of the division unit 20, the passage construction unit 21, the estimation unit 22, and the storage unit 23 provided in the document classification device 2 is also realized by causing the CPU to execute a program describing these functions.

[0128] These programs are stored in the storage medium and are read and executed by the CPU. These programs can also be distributed by storing them in a storage medium such as a magnetic disk (floppy disk, hard disk, etc.), an optical disk (CD-ROM, DVD, etc.), or a semiconductor memory, and can also be transmitted and received via a network. [Explanation of symbols]

[0129] 1 Learning device for document classification 2. Document Classification Device 10,12,20 division part 11,21 Passage composition 13,15,23 Storage section 14 Learning Department 16 Retriever 17 Leader 18 Update section 22 Estimation part 30 Leadership Learning Tools 31 Retriever Learning Tools 32 Leader Relearning Methods 33 Repetitive learning methods K Teacher data A,A' Abstract F Full text L label (correct label) c,c',f sentence (context) q Question p,p' passage

Claims

1. 1. A document classification learning device that learns a model for classifying documents using sentences contained in the documents and labels assigned to the documents, comprising: The outline of the document, the entire text of the document, and the label are used as training data. a first division unit that receives the summary portion and divides the summary portion into sentence units to generate a plurality of sentences; a first passage construction unit that constructs a plurality of passages by using a set of a question consisting of a predetermined sentence and each of the plurality of sentences generated by the first division unit as a passage; a second division unit that receives the entire text, divides the entire text into sentence units, thereby generating a plurality of sentences, and stores a DB consisting of the plurality of sentences in a storage unit; a learning unit that learns a fusion-in-decoder (FiD) consisting of a retriever that uses the plurality of passages corresponding to the teacher data constructed by the first passage construction unit, the DB corresponding to the teacher data stored in the storage unit, the label, and the question, with the question and the DB as input data, and estimates a plurality of passages, with a pair of the question and a context as a passage, as output data, and a reader that uses the plurality of passages as input data and estimates a label as output data; A document classification learning device comprising:

2. 2. The document classification learning device according to claim 1, The learning unit is A leader learning means for learning the leader by using the plurality of passages corresponding to the teacher data constructed by the first passage construction unit and the label for each of the predetermined number of teacher data; For each of the predetermined number of teacher data, the retriever estimates a plurality of passages using the DB corresponding to the question and the teacher data; Calculate a ca (cross-attention) score for each of the plurality of passages estimated by the leader learned by the leader learning means; A retriever learning means for learning the retriever based on the ca score and an inner product of the question and the context constituting each of the plurality of passages; For each of the predetermined number of teacher data, a plurality of passages are estimated by the retriever learned by the retriever learning means using the DB corresponding to the question and the teacher data; a leader re-learning means for re-learning the leader using the estimated passages and the labels; a repetitive learning means for repeatedly performing a retriever learning process in which, for each of the predetermined number of teacher data, the retriever learning means calculates the ca score using the leader re-learned by the leader re-learning means, and learns the retriever based on the ca score and the inner product; and a re-learning process in which, for each of the predetermined number of teacher data, the leader re-learning means estimates the multiple passages using the retriever learned by the retriever learning process, and re-learns the leader, a preset number of times; A document classification learning device comprising:

3. A document classification device that classifies a document to be classified into one of a plurality of labels by the reader that constitutes the FiD learned by the document classification learning device according to claim 1 or 2, a third division unit that receives an outline of the document to be classified and divides the outline into sentences to generate a plurality of sentences; a second passage construction unit that constructs a plurality of passages by using a set of a question consisting of a predetermined sentence and each of the plurality of sentences generated by the third division unit as a passage; an estimation unit that estimates the label by the reader using the plurality of passages constructed by the second passage construction unit; A document classification device comprising:

4. A computer constituting a learning device for document classification that learns a model for classifying a document using sentences contained in the document and labels assigned to the document, The outline of the document, the entire text of the document, and the label are used as training data. a first division unit that receives the summary portion and divides the summary portion into sentence units to generate a plurality of sentences; a first passage construction unit that constructs a plurality of passages by using a set of a question consisting of a predetermined sentence and each of the plurality of sentences generated by the first division unit as a passage; and A program for functioning as a second division unit that inputs the entire text, divides the entire text into sentence units to generate a plurality of sentences, and stores a DB consisting of the plurality of sentences in a memory unit.

5. A computer constituting a document classification device that classifies a document to be classified into one of a plurality of labels by the reader constituting the FiD trained by the document classification learning device according to claim 1 or 2, a third division unit that receives an outline of the document to be classified and divides the outline into sentences to generate a plurality of sentences; a second passage construction unit that constructs a plurality of passages by using a set of a question consisting of a predetermined sentence and each of the plurality of sentences generated by the third division unit as a passage; and A program for causing the reader to function as an estimation unit that estimates the label using the multiple passages constructed by the second passage construction unit.