PDF-format-paper-oriented biomedical entity identification method

文档序号:1087407 发布日期:2020-10-20 浏览:8次 中文

阅读说明:本技术 一种面向pdf格式论文的生物医学实体识别方法 (PDF-format-paper-oriented biomedical entity identification method ) 是由 杨志豪 韩钦宇 于 2020-06-29 设计创作,主要内容包括:本发明属于命名实体识别技术领域,一种面向PDF格式论文的生物医学实体识别方法,包括以下步骤:(1)接收PDF论文作为输入并确认其格式类型,(2)对输入文本的无效文本信息进行处理,(3)对输入文本内容进行规范化,(4)使用命名实体识别模型识别处理后文本中的医学实体,(5)对识别得到的实体在原文进行高亮处理,(6)整体流程封装并以Web应用形式展示。本发明方法打破了目前医学领域内还没有专门为其相关的论文直接进行实体识别处理并在PDF格式上进行高亮的先例,通过在文本中高亮出医学实体可以让医学研究者们快速的找到本篇论文中自己所关心的医学实体并进行进一步的阅读工作,具有十分有意义的使用价值。(The invention belongs to the technical field of named entity identification, and discloses a PDF-format-paper-oriented biomedical entity identification method, which comprises the following steps: (1) receiving a PDF paper as an input and confirming a format type of the PDF paper, (2) processing invalid text information of an input text, (3) normalizing the content of the input text, (4) identifying a medical entity in the processed text by using a named entity identification model, (5) highlighting the identified entity in the original text, and (6) packaging the whole process and displaying the packaged entity in a Web application form. The method breaks through the precedent that no special entity identification processing is directly carried out on the relevant paper and highlighting is carried out on the PDF format in the current medical field, and medical researchers can quickly find the medical entity concerned in the paper and carry out further reading work by highlighting the medical entity in the text, so that the method has significant use value.)

1. A biomedical entity identification method facing PDF format paper is characterized by comprising the following steps:

step 1, receiving a PDF paper as an input and confirming a format type of the PDF paper, firstly, performing related processing on a non-editable PDF format text to prevent TXT and an XML editable format text as an input, wherein the PDF format text has good encapsulation performance, so that the text information in a photocopy format is allowed to be stored in the PDF format text, and the accuracy of identifying the content in the photocopy file is low due to the limitation of the existing OCR technology, so that a large amount of the content in the photocopy format is stored in the PDF format text; for the confirmation of the format type, a double insurance mode is mainly adopted to screen the text type, and the method specifically comprises the following sub-steps:

(A) because the text is finally packaged into a system and displayed in a webpage form, input text type judgment is set at a webpage input port, so that other types of texts except the PDF format text are screened out;

(B) screening the PDF format text reserved after the screening in the sub-step (A) in the next step, counting the number and the positions of the pictures in the paper by using a PyMuPDF library, and comparing the number and the positions with the complete page positions of the pictures so as to judge whether the paper belongs to a photocopy file obtained by scanning, and screening and discarding;

step 2, processing invalid text information in the input text, wherein due to the non-editability and good encapsulation of the PDF format text, how to process valid text information of each page becomes a difficult problem to be solved urgently; especially, the existence of redundant information of a front cover, a header, a footer, a legend, a chart name and a small amount of special characters in the PDF format text leads to the appearance of character messy codes and redundant invalid text information of a thesis author, a thesis editing and publishing mechanism, a thesis review conference after the PDF format text is directly converted into an editable type text, and the PDF format text containing the redundant invalid text information needs to be firstly cleaned for the convenience of subsequent steps, which specifically comprises the following substeps:

(A) the method is mainly used for identifying and cleaning the header and the tail parts from the whole text, wherein the identification mode mainly adopts the following steps: firstly, converting a PDF format text into a PNG picture format, and then determining the positions of invalid text information parts of a header and a footer in a corresponding picture according to the picture format text, wherein the positions are mainly coordinate position information, so that the invalid text information is cut off on the basis of an original picture by using the coordinate position information; secondly, in order to avoid the error of the recognized picture caused by low accuracy of large-scale character recognition by using a mainstream OCR image recognition technology, the method mainly adopts a mode of recognizing invalid text information parts of headers and footers with small text information amount and then removing the recognized invalid text information from the full text to avoid the error caused by low accuracy as much as possible;

(B) after the invalid text information in the substep (A) of the step 2 is cleaned, the legend, the table, the catalogue and the quoted invalid text information which are not fixed in the position in the PDF format text also need to be thoroughly screened and cleaned; for this purpose, the following method is used for the removal: for the legend information and the chart name of the chart, extracting and cleaning the ineffective text information of the chart title, the legend and the content by combining only a few current extraction PDF format text tables, using Pdflight, Camelot toolkits and a Tessect-OCR tool for identifying the pictures in the PDF format text; extracting a catalogue of a text by combining a PDfminer method for the PDF format text containing the catalogue part and using the catalogue as frame information so as to serve as a frame standard for extracting the content of the effective part of the text; if the processed PDF format text has no directory part, selectively removing the Introduction part and the Reference part, because the parts are invalid text information which is irrelevant to the narration content of the text;

step 3, normalizing the content of the input text, processing the invalid text information of the input text in the step 2, then performing statistical summary to obtain a universal rule which accords with the text, and performing text regularization processing, thereby more effectively ensuring the normalization of the input text of the entity recognition model in the next step; therefore, the effective text is cleaned by mainly adopting a regularization means, and the method mainly comprises the following steps: for the condition that a word in the effective text obtained in the step 2 belongs to two lines, in order to avoid the problem that the entity cannot be identified due to the occurrence of line feed characters, redundant special symbols of the line feed characters are selectively removed according to the characteristics of the text and the common thesis format habit; for symbols of special fonts, reference footnotes and tail notes appearing in effective texts, because the symbols are converted into editable texts and then all appear in the form of escape characters and common character combinations, the escape characters after the common characters are removed are selected or are directly removed together; for the redundant comment part of the chart and the chart name part appearing in the effective text, a long character string with Figure or Table as the beginning needs to be cleaned; setting a minimum threshold value for limiting the character quantity of each line of the text to eliminate the noise information with less formula character quantity in the text; setting a threshold value for limiting the maximum occurrence times of a certain section of character string in the text to eliminate the noise information which repeatedly appears in the text;

step 4, recognizing the medical entities in the processed text by using a named entity recognition model, performing recognition work of various medical entities on the effective text processed in the step 2 and the step 3, and performing sequence labeling on the text mainly by using a BIO label mechanism; because the BIO label can have the problem of error processing of redundant spaces or line breaks, redundant symbols of the line breaks need to be cleaned to obtain editable texts; meanwhile, in order to reduce the cost of entity recognition time of a single text, the text is processed into files in a paper behavior unit and is uniformly placed under a result folder, and the files are sequentially input into a model for marking;

the adopted core entity recognition model is a currently advanced BiLSTM-CRF model based on an attention mechanism, a bidirectional long-short term memory network is used for representing a prediction label for the context of each word by mainly considering the information which can be fully combined with the context, and meanwhile, a CRF model is added to further improve the capability of the model in the aspect of transfer prediction, wherein an I label appears behind a B label but not behind an O label; finally, in order to better handle the problem that the label information of sentence level is inconsistent with the label information of document level, an attention mechanism, lexical characteristics and syntactic characteristics are added to improve the performance of the model; the used machine learning method also combines a plurality of dictionaries made of entries and entities crawled by Wikipedia and medical websites to carry out entity recognition according to rules; limited class of entity identification using the carenlp tool of stanford as a complement to machine learning methods; finally, standardizing the recognized entities, downloading to obtain standardized entries, calculating the editing distance by using word similarity, and mapping some non-standardized entities to the standard entries, so that the problems of single number, capital and small case and abbreviation deformation can be solved; after the standardized entities are processed, some priority problems still need to be considered, and sometimes an entity is composed of a plurality of words, and partial words composing an entity may be another entity; for this purpose, priority is set to the entities already existing in the candidate word set library, or the common medical entities; meanwhile, the recognized entities are divided into eight types according to entity types: drugs, diseases, proteins, DNA, RNA, cells, variations and phenotypes, thereby highlighting different classes of entities to different colors to better achieve the effect of differentiation;

step 5, highlighting the entity obtained by identification in the original text, taking out the entity obtained by relevant identification and corresponding category information according to the eight types of entity results obtained by identification in the step 4 for a certain effective text, and carrying out corresponding highlighting according to different categories; in order to ensure readability and normalization, the original PDF format needs to be kept unchanged, so highlighting the text is equivalent to finding the position where the corresponding entity appears on the original PDF, and a rectangular-shaped area is used for painting the corresponding position, so that the method realizes marking the non-editable PDF format to highlight the corresponding entity; finding the positions of different entities in PDF, firstly using getTextWord function in PyMupdf package, which returns all words using left and right spaces as segmentation, namely specific position information of unit word: the method mainly comprises a unit Word, wherein a horizontal span range formed by a start character coordinate and an end character coordinate and a longitudinal span range formed by upper and lower coordinate information of the unit Word are obtained by calculation by taking the lower left corner of a page where the unit Word appears as an origin, and specific position information of Block, Line and Word where the unit Word appears on the page is also obtained; by using the information as an index, further solving the specific position of each unit word forming the identified entity in the page where the unit word appears, setting the color attribute of an RGB format by using addHighlightAnnot and Setcolor functions in the packet so as to highlight the identified entity with specific color, and making rectangles with different colors in the original PDF according to the found entity position; wherein for a specific entity under different conditions, the position information is mainly obtained by the following sub-steps:

(A) for an entity identified by an entity, if it is composed of a plurality of unit words and all appear in the same row, it needs to process all possible cases by the following substeps:

(a) the most common situation is that an entity consists of a plurality of unit words, namely entities such as MALT lymphomas and muco-associated lymphoid tissue, and the entity can obtain correct position information of the complete entity only by splicing the position information of the plurality of unit words; the position range of the entity selects the first character of the first unit word forming the entity whole as the initial transverse position, and the tail character of the last unit word as the transverse ending position of the entity whole;

(b) for some inclusion relations which occur among the identified entities, namely BCL10gene and BCL 10; in this case, the categories of the entities which are usually involved with each other are different from each other, and in this case, the entity with the longest character matching is selected as the result of determining the final entity;

(c) some entities in an abbreviated form, namely NF-kB, and entities of this type can appear in some texts in a special font form, namely k can be written as a flower case; in order to solve the problem, marks are added to the special characters and the escape characters which are possibly judged due to the influence of the escape characters in the special characters are removed, so that whether an entity is highlighted or not is determined to be successfully carried out according to the matching degree of unit words;

(d) because the entity identification model result does not guarantee one hundred percent accuracy, post-processing is required to be carried out on the basis of the model identification result to guarantee further improvement of the result, and sometimes the right bracket of the first unit word forming the entity cannot be identified, a rule is added and a data structure of a stack is used to guarantee that if a left bracket is arranged in a character string and the right bracket is not corresponding to the left bracket, the left bracket is automatically added to be used as supplement; if the identified entity is not present in the medical dictionary in its entirety but is present in a standard medical dictionary in its constituent part, the priority is changed from the longest matching character to a priority for the known entity;

(B) for the identified entity, if the entity is composed of a plurality of unit words and different parts respectively appear in two rows adjacent to each other, the following sub-steps are needed to process all possible situations:

(a) if the first half unit word set of the entity formed by the recognized entity is at the end of the previous section and the second half unit word set of the entity is at the beginning of the next section, the author adds a connector between the two sections to indicate that the two sections belong to the same entity under normal conditions in order to ensure the normative property of the thesis; therefore, a connector is removed to judge whether the entity belongs to the entity lym-photoma found in entity recognition, but because the entity itself sometimes has the condition of the connector B-Cell, whether the entity belongs to the entity set obtained by the existing recognition after the connector is removed needs to be respectively judged, and then the position of the entity is further determined, namely in this case, the first character of the first unit word in the previous row is taken as the starting position to the tail character of the last unit word in the row, the first character of the first unit word in the next row is taken as the starting position to the tail character of the last unit word in the row, and the two transverse ranges are taken as the total transverse span of the whole entity to be taken as the highlighted transverse range in a rectangular shape;

(b) sometimes, the type of the identified entity is different from the category of the partial entity forming the entity, BCL10gene belongs to the DNA type, BCL10 belongs to the protein type, gene belongs to the DNA type, therefore, if the first half part BCL10 and the second half part gene belong to two rows, in order to ensure that the entities are not divided into two by mistake, a merging judgment means is needed to ensure the maximum matching priority principle;

step 6, packaging the whole flow and displaying the whole flow in a Web application form, after highlighting the medical entity obtained by entity identification under the condition of keeping the original PDF format, packaging the whole flow into Pipeline and storing the Pipeline under a server in order to facilitate the medical researchers to be familiar with and apply, and simultaneously writing a webpage application by taking flash as a rear-end frame and HTML as a front end; the method comprises the steps of uploading a local original PDF file as an input to a back end, directly downloading an output file which is processed and highlighted by the back end from the front end to the local after a series of processing, and mapping a website to a public network by using an frp tool so as to enable a researcher to use the output file.

Technical Field

The invention relates to a PDF format paper-oriented biomedical entity identification method, and belongs to the technical field of named entity identification.

Background

With the rapid development of biomedicine in recent years, the literature related to the field of biomedicine is also growing exponentially. The computer biomedical field is a cross-field subject derived from natural language processing and biomedicine, various problems in the medical field are mainly processed by various technologies of natural language processing, and in order to enable a researcher in the medical field to conveniently distinguish whether a paper contains research progress of a concerned medical entity from a paper in the medical field, the use of the related technologies for identifying and highlighting the entity from a non-editable PDF format paper has significant use value.

Currently, the processing method for converting the PDF into the editable text lacks the processing method in the vertical domain, so that the overall recognition effect is greatly reduced if only the conversion result is used without further processing. Meanwhile, in the vertical fields such as the current medical field, no precedent exists for directly carrying out entity identification processing and highlighting on the PDF format for the relevant papers. Meanwhile, package diversity and non-editability of PDF require professional vertical domain knowledge as support for correctly highlighting the identified entity while maintaining the original PDF format, and make corresponding corrections according to the domain entity characteristics.

Disclosure of Invention

In order to overcome the defects in the prior art, the invention aims to provide a biomedical entity identification method facing a PDF format paper. The method breaks through the precedent that no entity identification processing is specially carried out on relevant papers and highlighting is carried out on PDF format in the medical field at present, can provide convenience for medical researchers, can enable the researchers to quickly find the medical entities concerned in the papers and carry out further reading work by highlighting the medical entities in the text, and has significant use value.

In order to achieve the purpose of the invention and solve the problems in the prior art, the invention adopts the technical scheme that: a biomedical entity identification method facing a PDF format paper comprises the following steps:

step 1, receiving a PDF paper as an input and confirming a format type of the PDF paper, firstly, performing related processing on a non-editable PDF format text to prevent TXT and an XML editable format text as an input, wherein the PDF format text has good encapsulation performance, so that the text information in a photocopy format is allowed to be stored in the PDF format text, and the accuracy of identifying the content in the photocopy file is low due to the limitation of the existing OCR technology, so that a large amount of the content in the photocopy format is stored in the PDF format text; for the confirmation of the format type, a double insurance mode is mainly adopted to screen the text type, and the method specifically comprises the following sub-steps:

(A) because the text is finally packaged into a system and displayed in a webpage form, input text type judgment is set at a webpage input port, so that other types of texts except the PDF format text are screened out;

(B) screening the PDF format text reserved after the screening in the sub-step (A) in the next step, counting the number and the positions of the pictures in the paper by using a PyMuPDF library, and comparing the number and the positions with the complete page positions of the pictures so as to judge whether the paper belongs to a photocopy file obtained by scanning, and screening and discarding;

step 2, processing invalid text information of an input text, wherein due to the non-editability and good encapsulation of a PDF format text, how to process valid text information of each page becomes a difficult problem to be solved urgently; especially, the existence of redundant information of a front cover, a header, a footer, a legend, a chart name and a small amount of special characters in the PDF format text leads to the appearance of character messy codes and redundant invalid text information of a thesis author, a thesis editing and publishing mechanism, a thesis review conference after the PDF format text is directly converted into an editable type text, and the PDF format text containing the redundant invalid text information needs to be firstly cleaned for the convenience of subsequent steps, which specifically comprises the following substeps:

(A) the method is mainly used for identifying and cleaning the header and the tail parts from the whole text, wherein the identification mode mainly adopts the following steps: firstly, converting a PDF format text into a PNG picture format, and then determining the positions of invalid text information parts of a header and a footer in a corresponding picture according to the picture format text, wherein the positions are mainly coordinate position information, so that the invalid text information is cut off on the basis of an original picture by using the coordinate position information; secondly, in order to avoid the error of the recognized picture caused by low accuracy of large-scale character recognition by using a mainstream OCR image recognition technology, the method mainly adopts a mode of recognizing invalid text information parts of headers and footers with small text information amount and then removing the recognized invalid text information from the full text to avoid the error caused by low accuracy as much as possible;

(B) after the invalid text information in the substep (A) of the step 2 is cleaned, the legend, the table, the catalogue and the quoted invalid text information which are not fixed in the position in the PDF format text also need to be thoroughly screened and cleaned; for this purpose, the following method is used for the removal: for the legend information and the chart name of the chart, extracting and cleaning the ineffective text information of the chart title, the legend and the content by combining only a few current extraction PDF format text tables, using Pdflight, Camelot toolkits and a Tessect-OCR tool for identifying the pictures in the PDF format text; extracting a catalogue of a text by combining a PDfminer method for the PDF format text containing the catalogue part and using the catalogue as frame information so as to serve as a frame standard for extracting the content of the effective part of the text; if the processed PDF format text has no directory part, selectively removing the Introduction part and the Reference part, because the parts are invalid text information which is irrelevant to the narration content of the text;

step 3, normalizing the content of the input text, processing the invalid text information of the input text in the step 2, then performing statistical summary to obtain a universal rule which accords with the text, and performing text regularization processing, thereby more effectively ensuring the normalization of the input text of the entity recognition model in the next step; therefore, the effective text is cleaned by mainly adopting a regularization means, and the method mainly comprises the following steps: for the condition that a word in the effective text obtained in the step 2 belongs to two lines, in order to avoid the problem that the entity cannot be identified due to the occurrence of line feed characters, redundant special symbols of the line feed characters are selectively removed according to the characteristics of the text and the common thesis format habit; for symbols of special fonts, reference footnotes and tail notes appearing in effective texts, because the symbols are converted into editable texts and then all appear in the form of escape characters and common character combinations, the escape characters after the common characters are removed are selected or are directly removed together; for the redundant comment part of the chart and the chart name part appearing in the effective text, a long character string with Figure or Table as the beginning needs to be cleaned; setting a minimum threshold value for limiting the character quantity of each line of the text to eliminate the noise information with less formula character quantity in the text; setting a threshold value for limiting the maximum occurrence times of a certain section of character string in the text to eliminate the noise information which repeatedly appears in the text;

step 4, recognizing the medical entities in the processed text by using a named entity recognition model, performing recognition work of various medical entities on the effective text processed in the step 2 and the step 3, and performing sequence labeling on the text mainly by using a BIO label mechanism; because the BIO label can have the problem of error processing of redundant spaces or line breaks, redundant symbols of the line breaks need to be cleaned to obtain editable texts; meanwhile, in order to reduce the cost of entity recognition time of a single text, the text is processed into files in a paper behavior unit and is uniformly placed under a result folder, and the files are sequentially input into a model for marking;

the adopted core entity recognition model is a currently advanced BiLSTM-CRF model based on an attention mechanism, a bidirectional long-short term memory network is used for representing a prediction label for the context of each word by mainly considering the information which can be fully combined with the context, and meanwhile, a CRF model is added to further improve the capability of the model in the aspect of transfer prediction, wherein an I label appears behind a B label but not behind an O label; finally, in order to better handle the problem that the label information of sentence level is inconsistent with the label information of document level, an attention mechanism, lexical characteristics and syntactic characteristics are added to improve the performance of the model; the used machine learning method also combines a plurality of dictionaries made of entries and entities crawled by Wikipedia and medical websites to carry out entity recognition according to rules; limited class of entity identification using the carenlp tool of stanford as a complement to machine learning methods; finally, standardizing the recognized entities, downloading to obtain standardized entries, calculating the editing distance by using word similarity, and mapping some non-standardized entities to the standard entries, so that the problems of single number, capital and small case and abbreviation deformation can be solved; after the standardized entities are processed, some priority problems still need to be considered, and sometimes an entity is composed of a plurality of words, and partial words composing an entity may be another entity; for this purpose, priority is set to the entities already existing in the candidate word set library, or the common medical entities; meanwhile, the recognized entities are divided into eight types according to entity types: drugs, diseases, proteins, DNA, RNA, cells, variations and phenotypes, thereby highlighting different classes of entities to different colors to better achieve the effect of differentiation;

step 5, highlighting the entity obtained by identification in the original text, taking out the entity obtained by relevant identification and corresponding category information according to the eight types of entity results obtained by identification in the step 4 for a certain effective text, and carrying out corresponding highlighting according to different categories; in order to ensure readability and normalization, the original PDF format needs to be kept unchanged, so highlighting the text is equivalent to finding the position where the corresponding entity appears on the original PDF, and a rectangular-shaped area is used for painting the corresponding position, so that the method realizes marking the non-editable PDF format to highlight the corresponding entity; finding the positions of different entities in PDF, firstly using getTextWord function in PyMupdf package, which returns all words using left and right spaces as segmentation, namely specific position information of unit word: the method mainly comprises a unit Word, wherein a horizontal span range formed by a start character coordinate and an end character coordinate and a longitudinal span range formed by upper and lower coordinate information of the unit Word are obtained by calculation by taking the lower left corner of a page where the unit Word appears as an origin, and specific position information of Block, Line and Word where the unit Word appears on the page is also obtained; by using the information as an index, further solving the specific position of each unit word forming the identified entity in the page where the unit word appears, setting the color attribute of an RGB format by using addHighlightAnnot and Setcolor functions in the packet so as to highlight the identified entity with specific color, and making rectangles with different colors in the original PDF according to the found entity position; wherein for a specific entity under different conditions, the position information is mainly obtained by the following sub-steps:

(A) for an entity identified by an entity, if it is composed of a plurality of unit words and all appear in the same row, it needs to process all possible cases by the following substeps:

(a) the most common situation is that an entity consists of a plurality of unit words, namely entities such as MALT lymphomas and muco-associated lymphoid tissue, and the entity can obtain correct position information of the complete entity only by splicing the position information of the plurality of unit words; the position range of the entity selects the first character of the first unit word forming the entity whole as the initial transverse position, and the tail character of the last unit word as the transverse ending position of the entity whole;

(b) for some inclusion relationships that occur between the identified entities, namely BCL10gene and BCL 10; in this case, the categories of the entities which are usually involved with each other are different from each other, and in this case, the entity with the longest character matching is selected as the result of determining the final entity;

(c) some entities in an abbreviated form, namely NF-kB, and entities of this type can appear in some texts in a special font form, namely k can be written as a flower case; in order to solve the problem, marks are added to the special characters and the escape characters which are possibly judged due to the influence of the escape characters in the special characters are removed, so that whether an entity is highlighted or not is determined to be successfully carried out according to the matching degree of unit words;

(d) because the entity identification model result does not guarantee one hundred percent accuracy, post-processing is required to be carried out on the basis of the model identification result to guarantee further improvement of the result, and sometimes the right bracket of the first unit word forming the entity cannot be identified, a rule is added and a data structure of a stack is used to guarantee that if a left bracket is arranged in a character string and the right bracket is not corresponding to the left bracket, the left bracket is automatically added to be used as supplement; if the identified entity is not present in the medical dictionary in its entirety but is present in a standard medical dictionary in its constituent part, the priority is changed from the longest matching character to a priority for the known entity;

(B) for the identified entity, if the entity is composed of a plurality of unit words and different parts respectively appear in two rows adjacent to each other, the following sub-steps are needed to process all possible situations:

(a) if the first half unit word set of the entity formed by the recognized entity is at the end of the previous section and the second half unit word set of the entity is at the beginning of the next section, the author adds a connector between the two sections to indicate that the two sections belong to the same entity under normal conditions in order to ensure the normative property of the thesis; therefore, a connector is removed to judge whether the entity belongs to the entity lym-photoma found in entity recognition, but because the entity itself sometimes has the condition of the connector B-Cell, whether the entity belongs to the entity set obtained by the existing recognition after the connector is removed needs to be respectively judged, and then the position of the entity is further determined, namely in this case, the first character of the first unit word in the previous row is taken as the starting position to the tail character of the last unit word in the row, the first character of the first unit word in the next row is taken as the starting position to the tail character of the last unit word in the row, and the two transverse ranges are taken as the total transverse span of the whole entity to be taken as the highlighted transverse range in a rectangular shape;

(b) sometimes, the type of the identified entity is different from the category of the partial entities forming the entity, the BCL10gene belongs to the DNA type, the BCL10 belongs to the protein type, and the gene belongs to the DNA type, therefore, if the first half part BCL10 and the second half part gene belong to two rows, in order to ensure that the entities are not divided into two entities by mistake, a merging judgment means is needed to ensure the maximum matching priority principle;

step 6, packaging the whole flow and displaying the whole flow in a Web application form, after highlighting the medical entity obtained by entity identification under the condition of keeping the original PDF format, packaging the whole flow into Pipeline and storing the Pipeline under a server in order to facilitate the medical researchers to be familiar with and apply, and simultaneously writing a webpage application by taking flash as a rear-end frame and HTML as a front end; the method comprises the steps of uploading a local original PDF file as an input to a back end, directly downloading an output file which is processed and highlighted by the back end from the front end to the local after a series of processing, and mapping a website to a public network by using an frp tool so as to enable a researcher to use the output file.

The invention has the beneficial effects that: a biomedical entity identification method facing a PDF format paper comprises the following steps: (1) receiving a PDF paper as an input and confirming a format type of the PDF paper, (2) processing invalid text information of an input text, (3) normalizing the content of the input text, (4) identifying a medical entity in the processed text by using a named entity identification model, (5) highlighting the identified entity in the original text, and (6) packaging the whole process and displaying the packaged entity in a Web application form. The invention ensures that a non-editable text form can become an editable and more regular text form through a series of processing and subsequent rules, thereby providing input for subsequent recognition tasks. Meanwhile, the invention utilizes a more advanced entity recognition technology as a core support, takes a BilSTM-CRF model based on an Attention Mechanism as a model for medical entity recognition, combines the advantage that a bidirectional long-short term memory network (BilSTM) model can capture long-distance dependent information and the advantage that a traditional random condition field (CRF) model can enable the sequence of label prediction to be more reasonable, and constructs an Att-BilSTM-CRF model to recognize a biomedical entity by combining the Attention Mechanism (Attention Mechanism). The method has the greatest characteristic that the identified entities are highlighted according to categories on the premise of ensuring that the original PDF format is not changed. The reading convenience and completeness can be guaranteed to the maximum extent by guaranteeing the unchanged format, and the readability of the file can be improved by highlighting the entities of different types into different colors. Meanwhile, various conditions of the highlighted entities are set and processed one by one, and all the identified entities can be correctly reflected in the text to the greatest extent. The invention develops the front-end application to better encapsulate the whole process and ensures that an application program which is more convenient for researchers can process the input text.

Drawings

FIG. 1 is a flow chart of the method steps of the present invention.

FIG. 2 is a schematic structural diagram of a BilSTM-CRF entity recognition model based on an attention mechanism in the invention.

FIG. 3 is a detailed schematic diagram of the entity highlighting process of the present invention.

FIG. 4 is a highlight result presentation of a document of the present invention.

FIG. 5 is a diagram of the result of the invention encapsulated as a Web application.

Detailed Description

The invention is further described below with reference to the accompanying drawings.

As shown in fig. 1, a method for identifying a biomedical entity facing a PDF format paper includes the following steps:

step 1, receiving a PDF paper as an input and confirming a format type of the PDF paper, firstly, performing related processing on a non-editable PDF format text to prevent TXT and an XML editable format text as an input, wherein the PDF format text has good encapsulation performance, so that the text information in a photocopy format is allowed to be stored in the PDF format text, and the accuracy of identifying the content in the photocopy file is low due to the limitation of the existing OCR technology, so that a large amount of the content in the photocopy format is stored in the PDF format text; for the confirmation of the format type, a double insurance mode is mainly adopted to screen the text type, and the method specifically comprises the following sub-steps:

(A) because the text is finally packaged into a system and displayed in a webpage form, input text type judgment is set at a webpage input port, so that other types of texts except the PDF format text are screened out;

(B) screening the PDF format text reserved after the screening in the sub-step (A) in the next step, counting the number and the positions of the pictures in the paper by using a PyMuPDF library, and comparing the number and the positions with the complete page positions of the pictures so as to judge whether the paper belongs to a photocopy file obtained by scanning, and screening and discarding;

step 2, processing invalid text information of an input text, wherein due to the non-editability and good encapsulation of a PDF format text, how to process valid text information of each page becomes a difficult problem to be solved urgently; especially, the existence of redundant information of a front cover, a header, a footer, a legend, a chart name and a small amount of special characters in the PDF format text leads to the appearance of character messy codes and redundant invalid text information of a thesis author, a thesis editing and publishing mechanism, a thesis review conference after the PDF format text is directly converted into an editable type text, and the PDF format text containing the redundant invalid text information needs to be firstly cleaned for the convenience of subsequent steps, which specifically comprises the following substeps:

(A) the method is mainly used for identifying and cleaning the header and the tail parts from the whole text, wherein the identification mode mainly adopts the following steps: firstly, converting a PDF format text into a PNG picture format, and then determining the positions of invalid text information parts of a header and a footer in a corresponding picture according to the picture format text, wherein the positions are mainly coordinate position information, so that the invalid text information is cut off on the basis of an original picture by using the coordinate position information; secondly, in order to avoid the error of the recognized picture caused by low accuracy of large-scale character recognition by using a mainstream OCR image recognition technology, the method mainly adopts a mode of recognizing invalid text information parts of headers and footers with small text information amount and then removing the recognized invalid text information from the full text to avoid the error caused by low accuracy as much as possible;

(B) after the invalid text information in the substep (A) of the step 2 is cleaned, the legend, the table, the catalogue and the quoted invalid text information which are not fixed in the position in the PDF format text also need to be thoroughly screened and cleaned; for this purpose, the following method is used for the removal: for the legend information and the chart name of the chart, extracting and cleaning the ineffective text information of the chart title, the legend and the content by combining only a few current extraction PDF format text tables, using Pdflight, Camelot toolkits and a Tessect-OCR tool for identifying the pictures in the PDF format text; extracting a catalogue of a text by combining a PDfminer method for the PDF format text containing the catalogue part and using the catalogue as frame information so as to serve as a frame standard for extracting the content of the effective part of the text; if the processed PDF format text has no directory part, selectively removing the Introduction part and the Reference part, because the parts are invalid text information which is irrelevant to the narration content of the text;

step 3, normalizing the content of the input text, processing the invalid text information of the input text in the step 2, then performing statistical summary to obtain a universal rule which accords with the text, and performing text regularization processing, thereby more effectively ensuring the normalization of the input text of the entity recognition model in the next step; therefore, the effective text is cleaned by mainly adopting a regularization means, and the method mainly comprises the following steps: for the condition that a word in the effective text obtained in the step 2 belongs to two lines, in order to avoid the problem that the entity cannot be identified due to the occurrence of line feed characters, redundant special symbols of the line feed characters are selectively removed according to the characteristics of the text and the common thesis format habit; for symbols of special fonts, reference footnotes and tail notes appearing in effective texts, because the symbols are converted into editable texts and then all appear in the form of escape characters and common character combinations, the escape characters after the common characters are removed are selected or are directly removed together; for the redundant comment part of the chart and the chart name part appearing in the effective text, a long character string with Figure or Table as the beginning needs to be cleaned; setting a minimum threshold value for limiting the character quantity of each line of the text to eliminate the noise information with less formula character quantity in the text; setting a threshold value for limiting the maximum occurrence times of a certain section of character string in the text to eliminate the noise information which repeatedly appears in the text;

step 4, recognizing the medical entities in the processed text by using a named entity recognition model, performing recognition work of various medical entities on the effective text processed in the step 2 and the step 3, and performing sequence labeling on the text mainly by using a BIO label mechanism; because the BIO label can have the problem of error processing of redundant spaces or line breaks, redundant symbols of the line breaks need to be cleaned to obtain editable texts; meanwhile, in order to reduce the cost of entity recognition time of a single text, the text is processed into files in a paper behavior unit and is uniformly placed under a result folder, and the files are sequentially input into a model for marking;

the core entity recognition model adopted is the currently advanced attention-based BilSTM-CRF model, and the layers of the model are shown as the network shown in FIG. 2, wherein a bidirectional long-short term memory network is used, the context of each word is mainly considered to be capable of sufficiently combining context information to represent a prediction label, and the CRF model is added to further improve the capability of the model in the aspect of transfer prediction, wherein an I label appears behind a B label but not behind an O label; finally, in order to better handle the problem that the label information of sentence level is inconsistent with the label information of document level, an attention mechanism, lexical characteristics and syntactic characteristics are added to improve the performance of the model; the used machine learning method also combines a plurality of dictionaries made of entries and entities crawled by Wikipedia and medical websites to carry out entity recognition according to rules; limited class of entity identification using the carenlp tool of stanford as a complement to machine learning methods; finally, standardizing the recognized entities, downloading to obtain standardized entries, calculating the editing distance by using word similarity, and mapping some non-standardized entities to the standard entries, so that the problems of single number, capital and small case and abbreviation deformation can be solved; after the standardized entities are processed, some priority problems still need to be considered, and sometimes an entity is composed of a plurality of words, and partial words composing an entity may be another entity; for this purpose, priority is set to the entities already existing in the candidate word set library, or the common medical entities; meanwhile, the recognized entities are divided into eight types according to entity types: drugs, diseases, proteins, DNA, RNA, cells, mutations and phenotypes, allowing different classes of entities to be highlighted in different colors for better discrimination, as shown in table 1.

TABLE 1

Step 5, highlighting the entity obtained by identification in the original text, wherein a detailed flow schematic diagram is shown in fig. 3, and for a certain effective text, according to the eight types of entity results obtained by identification in the step 4, the entity obtained by relevant identification and the corresponding category information are taken out, and corresponding highlighting is carried out according to different categories; in order to ensure readability and normalization, the original PDF format needs to be kept unchanged, so highlighting the text is equivalent to finding the position where the corresponding entity appears on the original PDF, and a rectangular-shaped area is used for painting the corresponding position, so that the method realizes marking the non-editable PDF format to highlight the corresponding entity; finding the positions of different entities in PDF, firstly using getTextWord function in PyMupdf package, which returns all words using left and right spaces as segmentation, namely specific position information of unit word: the method mainly comprises a unit Word, wherein a horizontal span range formed by a start character coordinate and an end character coordinate and a longitudinal span range formed by upper and lower coordinate information of the unit Word are obtained by calculation by taking the lower left corner of a page where the unit Word appears as an origin, and specific position information of Block, Line and Word where the unit Word appears on the page is also obtained; by using the information as an index, further solving the specific position of each unit word forming the identified entity in the page where the unit word appears, setting the color attribute of an RGB format by using addHighlightAnnot and Setcolor functions in the packet so as to highlight the identified entity with specific color, and making rectangles with different colors in the original PDF according to the found entity position; wherein for a specific entity under different conditions, the position information is mainly obtained by the following sub-steps:

(A) for an entity identified by an entity, if it is composed of a plurality of unit words and all appear in the same row, it needs to process all possible cases by the following substeps:

(a) the most common situation is that an entity consists of a plurality of unit words, namely entities such as MALT lymphomas and muco-associated lymphoid tissue, and the entity can obtain correct position information of the complete entity only by splicing the position information of the plurality of unit words; the position range of the entity selects the first character of the first unit word forming the entity whole as the initial transverse position, and the tail character of the last unit word as the transverse ending position of the entity whole;

(b) for some inclusion relationships that occur between the identified entities, namely BCL10gene and BCL 10; in this case, the categories of the entities which are usually involved with each other are different from each other, and in this case, the entity with the longest character matching is selected as the result of determining the final entity;

(c) some entities in an abbreviated form, namely NF-kB, and entities of this type can appear in some texts in a special font form, namely k can be written as a flower case; in order to solve the problem, marks are added to the special characters and the escape characters which are possibly judged due to the influence of the escape characters in the special characters are removed, so that whether an entity is highlighted or not is determined to be successfully carried out according to the matching degree of unit words;

(d) because the entity identification model result does not guarantee one hundred percent accuracy, post-processing is required to be carried out on the basis of the model identification result to guarantee further improvement of the result, and sometimes the right bracket of the first unit word forming the entity cannot be identified, a rule is added and a data structure of a stack is used to guarantee that if a left bracket is arranged in a character string and the right bracket is not corresponding to the left bracket, the left bracket is automatically added to be used as supplement; if the identified entity is not present in the medical dictionary in its entirety but is present in a standard medical dictionary in its constituent part, the priority is changed from the longest matching character to a priority for the known entity;

(B) for the identified entity, if the entity is composed of a plurality of unit words and different parts respectively appear in two rows adjacent to each other, the following sub-steps are needed to process all possible situations:

(a) if the first half unit word set of the entity formed by the recognized entity is at the end of the previous section and the second half unit word set of the entity is at the beginning of the next section, the author adds a connector between the two sections to indicate that the two sections belong to the same entity under normal conditions in order to ensure the normative property of the thesis; therefore, a connector is removed to judge whether the entity belongs to the entity lym-photoma found in entity recognition, but because the entity itself sometimes has the condition of the connector B-Cell, whether the entity belongs to the entity set obtained by the existing recognition after the connector is removed needs to be respectively judged, and then the position of the entity is further determined, namely in this case, the first character of the first unit word in the previous row is taken as the starting position to the tail character of the last unit word in the row, the first character of the first unit word in the next row is taken as the starting position to the tail character of the last unit word in the row, and the two transverse ranges are taken as the total transverse span of the whole entity to be taken as the highlighted transverse range in a rectangular shape;

(b) sometimes, the type of the identified entity is different from the category of the partial entities forming the entity, the BCL10gene belongs to the DNA type, the BCL10 belongs to the protein type, and the gene belongs to the DNA type, therefore, if the first half part BCL10 and the second half part gene belong to two rows, in order to ensure that the entities are not divided into two entities by mistake, a merging judgment means is needed to ensure the maximum matching priority principle;

the result file in PDF format obtained after the highlighting process in step 5 is shown in fig. 4 by selecting a page of PDF containing highlighted entities.

Step 6, packaging the whole flow and displaying the whole flow in a Web application form, as shown in FIG. 5, after highlighting the medical entity obtained by entity identification is finished under the condition of keeping the format of the original PDF, in order to facilitate the medical researchers to be familiar with and apply, packaging the whole flow into Pipeline and storing the Pipeline under a server, and simultaneously writing a webpage application by taking flash as a rear-end frame and HTML as a front end; the method comprises the steps of uploading a local original PDF file as an input to a back end, directly downloading an output file which is processed and highlighted by the back end from the front end to the local after a series of processing, and mapping a website to a public network by using an frp tool so as to enable a researcher to use the output file.

17页详细技术资料下载
上一篇:一种医用注射器针头装配设备
下一篇:信息处理方法、装置及电子设备

网友询问留言

已有0条留言

还没有人留言评论。精彩留言会获得点赞!

精彩留言,会给你点赞!