CN116257622B - Label rendering method and device, storage medium and electronic equipment - Google Patents

Label rendering method and device, storage medium and electronic equipment Download PDF

Info

Publication number
CN116257622B
CN116257622B CN202310551004.8A CN202310551004A CN116257622B CN 116257622 B CN116257622 B CN 116257622B CN 202310551004 A CN202310551004 A CN 202310551004A CN 116257622 B CN116257622 B CN 116257622B
Authority
CN
China
Prior art keywords
label
text
tag
adjacent
marking
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Active
Application number
CN202310551004.8A
Other languages
Chinese (zh)
Other versions
CN116257622A (en
Inventor
邓光源
李劲松
相文超
周天舒
田雨
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Zhejiang Lab
Original Assignee
Zhejiang Lab
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Zhejiang Lab filed Critical Zhejiang Lab
Priority to CN202310551004.8A priority Critical patent/CN116257622B/en
Publication of CN116257622A publication Critical patent/CN116257622A/en
Application granted granted Critical
Publication of CN116257622B publication Critical patent/CN116257622B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/30Information retrieval; Database structures therefor; File system structures therefor of unstructured textual data
    • G06F16/34Browsing; Visualisation therefor
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F40/00Handling natural language data
    • G06F40/10Text processing
    • G06F40/166Editing, e.g. inserting or deleting
    • G06F40/169Annotation, e.g. comment data or footnotes
    • GPHYSICS
    • G16INFORMATION AND COMMUNICATION TECHNOLOGY [ICT] SPECIALLY ADAPTED FOR SPECIFIC APPLICATION FIELDS
    • G16HHEALTHCARE INFORMATICS, i.e. INFORMATION AND COMMUNICATION TECHNOLOGY [ICT] SPECIALLY ADAPTED FOR THE HANDLING OR PROCESSING OF MEDICAL OR HEALTHCARE DATA
    • G16H10/00ICT specially adapted for the handling or processing of patient-related medical or healthcare data
    • G16H10/60ICT specially adapted for the handling or processing of patient-related medical or healthcare data for patient-specific data, e.g. for electronic patient records
    • YGENERAL TAGGING OF NEW TECHNOLOGICAL DEVELOPMENTS; GENERAL TAGGING OF CROSS-SECTIONAL TECHNOLOGIES SPANNING OVER SEVERAL SECTIONS OF THE IPC; TECHNICAL SUBJECTS COVERED BY FORMER USPC CROSS-REFERENCE ART COLLECTIONS [XRACs] AND DIGESTS
    • Y02TECHNOLOGIES OR APPLICATIONS FOR MITIGATION OR ADAPTATION AGAINST CLIMATE CHANGE
    • Y02DCLIMATE CHANGE MITIGATION TECHNOLOGIES IN INFORMATION AND COMMUNICATION TECHNOLOGIES [ICT], I.E. INFORMATION AND COMMUNICATION TECHNOLOGIES AIMING AT THE REDUCTION OF THEIR OWN ENERGY USE
    • Y02D10/00Energy efficient computing, e.g. low power processors, power management or thermal management

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Health & Medical Sciences (AREA)
  • General Health & Medical Sciences (AREA)
  • Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Artificial Intelligence (AREA)
  • Databases & Information Systems (AREA)
  • Audiology, Speech & Language Pathology (AREA)
  • Computational Linguistics (AREA)
  • Data Mining & Analysis (AREA)
  • Epidemiology (AREA)
  • Medical Informatics (AREA)
  • Primary Health Care (AREA)
  • Public Health (AREA)
  • Medical Treatment And Welfare Office Work (AREA)

Abstract

The embodiment of the specification firstly determines a label set obtained by labeling a medical text, and judges whether the two labels are overlapped or not according to label information of any two adjacent labels in the label set or relative position relation displayed in a page by a label text box of any two adjacent labels. And obtaining a final rendering level according to the initial rendering level of the tag and the judging result. Finally, each label is rendered in the page area between the medical text lines according to the final rendering level of each label and the original line spacing of the medical text. In the method, the rendering level is a value which is a multiple of the original line spacing of the medical text when the index label is rendered in the medical text, so that when the labels are relatively close, the labels are rendered in the medical text based on different rendering levels, and the problem of overlapping of the labels can be solved.

Description

Label rendering method and device, storage medium and electronic equipment
Technical Field
The present disclosure relates to the field of front-end rendering, and in particular, to a tag rendering method, a device, a storage medium, and an electronic apparatus.
Background
With the rapid development of artificial intelligence, medical texts such as outpatient records, admission records, pathology reports, image inspection reports and the like of patients can be analyzed and processed through a machine learning model, and detailed medical features are extracted, so that doctors can better perform clinical supervision and diagnosis. Among other things, the medical features may include: symptom characteristics, examination characteristics, specification characteristics, etc.
At present, a medical entity contained in a medical text can be identified through a machine learning model, and medical features are extracted, but the medical features are not visualized in the form of labels on the original medical text, so that the work of a doctor cannot be accurately and intuitively assisted.
Based on this, how to visually render the existing labels of the medical text is a problem to be solved.
Disclosure of Invention
The embodiment of the specification provides a label rendering method, a device, a storage medium and electronic equipment, so as to partially solve the problems existing in the prior art.
The embodiment of the specification adopts the following technical scheme:
The label rendering method provided by the specification comprises the following steps:
acquiring a medical text, and determining a label set obtained by labeling the medical text and label information of each label in the label set; wherein, for each tag, tag information of the tag includes: the method comprises the steps of marking a marking starting position of a marking text of the tag in the medical text, marking an ending position of the marking text of the tag in the medical text and an initial rendering level of the tag; the rendering level is a multiple value of the original line spacing of the medical text, wherein the vertical distance from the labeling text when the index label is rendered in the medical text;
according to the labeling initial position of the labeling text of each label in the label set in the medical text, ascending order is carried out on the labels in the label set to obtain an ordered label set;
determining, for each tag in the ordered tag set, a tag that is located before and adjacent to the tag from the ordered tag set, as an adjacent tag of the tag, and judging whether the tag and the adjacent tag overlap according to a marking start position of a marking text of the tag in the medical text and a marking end position of a marking text of the adjacent tag in the medical text, or according to a relative positional relationship between a tag text box of the tag and a tag text box of the adjacent tag when the tag text box of the tag and the tag text box of the adjacent tag are displayed in a page containing the medical text, so as to obtain a judgment result of the tag;
Determining a final rendering level of the label according to the judging result of the label and the initial rendering level of the label;
each tag in the ordered set of tags is rendered in a page area between the medical text lines based on a final rendering level of each tag in the ordered set of tags and an original line spacing of the medical text to reveal each tag in the medical text.
Optionally, according to the labeling initial position of the labeling text of each label in the label set in the medical text, the ascending order of the labels in the label set is specifically included:
judging whether the number of the labels in the label set is larger than a preset number or not;
if the number of the labels in the label set is larger than the preset number, according to a quick ordering mode, according to the marking initial position of the marking text of each label in the label set in the medical text, ascending order is carried out on the labels in the label set;
if the number of the labels in the label set is not greater than the preset number, according to an insertion ordering mode, according to the marking starting position of the marking text of each label in the label set in the medical text, ascending order is carried out on the labels in the label set.
Optionally, according to a labeling start position of a labeling text of the label in the medical text and a labeling end position of a labeling text of the adjacent label in the medical text, or according to a positional relationship between a label text box of the label and a label text box of the adjacent label when the label text box of the label and the label text box of the adjacent label are displayed in a page containing the medical text, judging whether the label and the adjacent label overlap, and obtaining a judging result of the label specifically includes:
judging whether the label and the adjacent label are overlapped or not according to the marking starting position of the marking text of the label in the medical text and the marking ending position of the marking text of the adjacent label in the medical text;
if the marking initial position of the marking text of the label in the medical text is before the marking end position of the marking text of the adjacent label in the medical text, determining that the label is overlapped with the adjacent label, and taking the label as a judging result of the label;
if the marking starting position of the marking text of the label in the medical text is behind the marking ending position of the marking text of the adjacent label in the medical text, determining that the label and the adjacent label are not overlapped, and taking the label and the adjacent label as a judging result of the label.
Optionally, according to a labeling start position of a labeling text of the label in the medical text and a labeling end position of a labeling text of the adjacent label in the medical text, or according to a relative position relationship between a label text box of the label and a label text box of the adjacent label when the label text box of the label is displayed in a page containing the medical text, judging whether the label and the adjacent label overlap, and obtaining a judging result of the label specifically includes:
determining a label text box of the label according to a pre-generated abstract syntax tree containing label information of the label; determining a label text box of the adjacent label according to a pre-generated abstract syntax tree containing label information of the adjacent label;
and judging whether the label and the adjacent label are overlapped according to the relative position relation between the label text box of the label and the label text box of the adjacent label when the label is displayed in the page containing the medical text, so as to obtain a judging result of the label.
Optionally, according to the relative positional relationship between the tag text box of the tag and the tag text box of the adjacent tag when the tag text box of the tag is displayed in a page containing the medical text, judging whether the tag and the adjacent tag overlap, to obtain a judging result of the tag, specifically including:
Determining each projection axis of the label text box for the label according to the edge vector of the label text box of the label;
for each projection axis, projecting each side of the tab text box of the tab onto the projection axis according to the position of the tab text box of the tab when being displayed in a page containing the medical text, so as to obtain each projection side as each first projection side on the projection axis; projecting each side of the label text box of the adjacent label onto the projection shaft according to the position of the label text box of the adjacent label when the label text box is displayed in the page containing the medical text, so as to obtain each projection side as each second projection side on the projection shaft;
judging whether each first projection edge and each second projection edge on the projection axis are overlapped or not to obtain a judgment result aiming at the projection axis;
if it is determined that at least one first projection edge and at least one second projection edge on each projection axis are not overlapped according to the judgment result of each projection axis, determining that the label is not overlapped with the adjacent label, and taking the label as the judgment result of the label;
and if the first projection edges and the second projection edges on each projection axis are overlapped according to the judgment result of each projection axis, determining that the label is overlapped with the adjacent label, and taking the label as the judgment result of the label.
Optionally, determining the tag text box of the tag according to a pre-generated abstract syntax tree containing tag information of the tag, and determining the tag text box of the adjacent tag according to a pre-generated abstract syntax tree containing tag information of the adjacent tag, which specifically includes:
performing text detection on the medical text, and determining various categories contained in the medical text and text segments under each category in the medical text;
determining each label obtained by labeling the text segment under the category as a label subset under the category, and determining label information of each label in the label subset under the category;
generating an abstract syntax tree aiming at the label set under the category as an abstract syntax tree corresponding to the category according to the category name, the medical text and the label information of each label in the label subset under the category;
screening abstract syntax trees containing label information of the labels from abstract syntax trees corresponding to various orders, rendering the abstract syntax trees containing the label information of the labels, and determining label text boxes of the labels; and screening abstract syntax trees containing label information of the adjacent labels from abstract syntax trees corresponding to various orders, rendering the abstract syntax trees containing the label information of the adjacent labels, and determining label text boxes of the adjacent labels.
Optionally, determining a final rendering level of the tag according to the determination result of the tag and the initial rendering level of the tag specifically includes:
if the label is determined to be overlapped with the adjacent label according to the judgment result of the label, the initial rendering level of the label is adjusted to obtain an adjusted rendering level of the label, and the adjusted rendering level is used as the final rendering level of the label; wherein the initial rendering level of the tag is one;
and if the label is determined to be not overlapped with the adjacent label according to the judgment result of the label, determining the initial rendering level of the label as the final rendering level of the label.
Optionally, adjusting the initial rendering level of the tag to obtain an adjusted rendering level of the tag, which specifically includes:
and adding one to the initial rendering level of the label to obtain an adjusted rendering level of the label.
Optionally, based on the final rendering level of each tag in the ordered set of tags and the original line spacing of the medical text, rendering each tag in the ordered set of tags in a page area between lines of the medical text, specifically including:
determining the product of the final rendering level of each label and the original line spacing of the medical text for each label in the ordered label set to obtain the line spacing between the label and the labeling text of the label;
Determining the rendering starting position of the label in a page containing the medical text according to the marking starting position of the marking text of the label in the medical text;
and rendering the label in a page area corresponding to the rendering start position between the medical text lines according to the line spacing.
The label rendering device provided in the present specification includes:
the first determining module is used for acquiring a medical text and determining a label set obtained by labeling the medical text and label information of each label in the label set; wherein, for each tag, tag information of the tag includes: the method comprises the steps of marking a marking starting position of a marking text of the tag in the medical text, marking an ending position of the marking text of the tag in the medical text and an initial rendering level of the tag; the rendering level is a multiple value of the original line spacing of the medical text, wherein the vertical distance from the labeling text when the index label is rendered in the medical text;
the sorting module is used for sorting the labels in the label set in an ascending order according to the labeling initial position of the labeling text of each label in the label set in the medical text to obtain a sorted label set;
The judging module is used for determining a label which is positioned in front of the label and is adjacent to the label from the label set after sorting according to each label in the label set after sorting, and judging whether the label and the adjacent label are overlapped according to the marking starting position of the marking text of the label in the medical text and the marking ending position of the marking text of the adjacent label in the medical text or according to the relative position relation between the label text box of the label and the label text box of the adjacent label when the label text box of the label is displayed in a page containing the medical text, so as to obtain a judging result of the label;
the second determining module is used for determining the final rendering level of the label according to the judging result of the label and the initial rendering level of the label;
and the rendering module is used for rendering each label in the ordered label set in a page area between the medical text rows based on the final rendering level of each label in the ordered label set and the original row spacing of the medical text so as to display each label in the medical text.
Optionally, the sorting module is specifically configured to determine whether the number of tags in the tag set is greater than a preset number; if the number of the labels in the label set is larger than the preset number, according to a quick ordering mode, according to the marking initial position of the marking text of each label in the label set in the medical text, ascending order is carried out on the labels in the label set; if the number of the labels in the label set is not greater than the preset number, according to an insertion ordering mode, according to the marking starting position of the marking text of each label in the label set in the medical text, ascending order is carried out on the labels in the label set.
Optionally, the judging module is specifically configured to judge whether the label and the adjacent label overlap according to a labeling start position of the labeling text of the label in the medical text and a labeling end position of the labeling text of the adjacent label in the medical text; if the marking initial position of the marking text of the label in the medical text is before the marking end position of the marking text of the adjacent label in the medical text, determining that the label is overlapped with the adjacent label, and taking the label as a judging result of the label; if the marking starting position of the marking text of the label in the medical text is behind the marking ending position of the marking text of the adjacent label in the medical text, determining that the label and the adjacent label are not overlapped, and taking the label and the adjacent label as a judging result of the label.
Optionally, the judging module is specifically configured to determine a tag text box of the tag according to a pre-generated abstract syntax tree including tag information of the tag; determining a label text box of the adjacent label according to a pre-generated abstract syntax tree containing label information of the adjacent label; and judging whether the label and the adjacent label are overlapped according to the relative position relation between the label text box of the label and the label text box of the adjacent label when the label is displayed in the page containing the medical text, so as to obtain a judging result of the label.
Optionally, the judging module is specifically configured to determine each projection axis of the tag text box for the tag according to the edge vector of the tag text box of the tag; for each projection axis, projecting each side of the tab text box of the tab onto the projection axis according to the position of the tab text box of the tab when being displayed in a page containing the medical text, so as to obtain each projection side as each first projection side on the projection axis; projecting each side of the label text box of the adjacent label onto the projection shaft according to the position of the label text box of the adjacent label when the label text box is displayed in the page containing the medical text, so as to obtain each projection side as each second projection side on the projection shaft; judging whether each first projection edge and each second projection edge on the projection axis are overlapped or not to obtain a judgment result aiming at the projection axis; if it is determined that at least one first projection edge and at least one second projection edge on each projection axis are not overlapped according to the judgment result of each projection axis, determining that the label is not overlapped with the adjacent label, and taking the label as the judgment result of the label; and if the first projection edges and the second projection edges on each projection axis are overlapped according to the judgment result of each projection axis, determining that the label is overlapped with the adjacent label, and taking the label as the judgment result of the label.
A computer readable storage medium is provided in the present specification, the storage medium storing a computer program, which when executed by a processor, implements the label rendering method described above.
The electronic device provided by the specification comprises a memory, a processor and a computer program stored on the memory and capable of running on the processor, wherein the processor realizes the label rendering method when executing the program.
The above-mentioned at least one technical scheme that this description embodiment adopted can reach following beneficial effect:
in the embodiment of the specification, a label set obtained by labeling a medical text is determined first, and whether two labels are overlapped or not is judged according to label information of any two adjacent labels in the label set or the relative position relationship displayed in a page by a label text box of any two adjacent labels. And obtaining a final rendering level according to the initial rendering level of the tag and the judging result. Finally, each label is rendered in the page area between the medical text lines according to the final rendering level of each label and the original line spacing of the medical text. In the method, the labels when the medical text is marked can be rendered into the medical text, and meanwhile, the rendering level is that the vertical distance from the marked text is a multiple value of the original line spacing of the medical text when the labels are rendered in the medical text, so that when the labels are relatively close, the problem that the labels are overlapped can be solved by rendering the labels based on different rendering levels.
Drawings
The accompanying drawings, which are included to provide a further understanding of the specification, illustrate and explain the exemplary embodiments of the present specification and their description, are not intended to limit the specification unduly. In the drawings:
fig. 1 is a schematic flow chart of a label rendering method according to an embodiment of the present disclosure;
fig. 2 is a schematic diagram of a labeling result after labeling a medical text according to an embodiment of the present disclosure;
fig. 3 is a schematic diagram of determining whether any two adjacent labels overlap according to the embodiment of the present disclosure;
FIG. 4 is a schematic page view of rendering multiple labels in medical text provided by embodiments of the present disclosure;
fig. 5 is a schematic structural diagram of a label rendering apparatus according to an embodiment of the present disclosure;
fig. 6 is a schematic structural diagram of an electronic device according to an embodiment of the present disclosure.
Detailed Description
In the present specification, when the text labeling is performed on the medical text, due to the large number of feature elements and the complex structure in the medical text, certain keywords in one sentence of text may belong to the category of feature a, and may be also generalized into feature B. Such as a sentence of text in a course record: the abdomen is flat and soft, scars with the length of about 20cm are visible, the scars are not covered up, the abdomen is free from tenderness and rebound pain, and the scars with the length of 20cm are simultaneously subject to the characteristic categories of symptoms, examination, specification and the like. Therefore, when a label is given to the text, a "symptom" label, a "check" label, and a "specification" label can be given at the same time. Therefore, when the front end is rendered, according to the method of rendering the labels right above the original text, a plurality of label collision, interleaving, even overlapping and the like can occur.
The labeling process of the medical text may be a process of labeling a part of characters from the medical text and assigning labels to the labeled part of characters. The marked part of the text can be given one label or a plurality of different labels.
In this specification, a primary category, a secondary category, and a tertiary category may be defined first. Each medical text is contained under the first class, and the names of the medical texts conform to the concept names in OMOP standard terms, such as: admission records, pathology reports, etc. The secondary category is a classification under medical text, which may include: complaints, current medical history, etc. The third category is a classification under the second category, the third category is a summarizing word summarizing a piece of text, and the third category may include: symptom information, examination information, etc. For each tertiary category, the tertiary category corresponds to specific characteristic information that is presented from the medical text. In addition, the first class category, the second class category, the third class category and the specific characteristic information have mapping relations between each other.
For example, if the primary category is an admission record, the secondary category may be a complaint, a current medical history, a past history, etc. Taking the second category as an example of a complaint, the third category may be symptom information. The correspondence for symptom information is: feature information of latitude such as symptoms, body parts, azimuth words, frequency, causes and the like.
In this specification, in labeling the medical text, the name of the tertiary category may be used as the label name of the label.
Next, a method of rendering a label will be described mainly in the case where a label is present in a medical text.
For the purposes of making the objects, technical solutions and advantages of the present specification more apparent, the technical solutions of the present specification will be clearly and completely described below with reference to specific embodiments of the present specification and corresponding drawings. It will be apparent that the described embodiments are only some, but not all, of the embodiments of the present specification. All other embodiments, which can be made by one of ordinary skill in the art without undue burden from the present disclosure, are intended to be within the scope of the present disclosure.
The following describes in detail the technical solutions provided by the embodiments of the present specification with reference to the accompanying drawings.
Fig. 1 is a flowchart of a tag rendering method according to an embodiment of the present disclosure, where the tag rendering method may be applicable to a browser, and includes:
s100: acquiring a medical text, and determining a label set obtained by labeling the medical text and label information of each label in the label set; wherein, for each tag, tag information of the tag includes: the method comprises the steps of marking a marking starting position of a marking text of the tag in the medical text, marking an ending position of the marking text of the tag in the medical text and an initial rendering level of the tag; the rendering level is a value that is a multiple of the original line spacing of the medical text of the vertical distance from the annotation text when the index is rendered in the medical text.
In the present specification embodiment, the medical text may include: medical texts such as outpatient records, admission records, pathology reports, and influence examination reports. The label set obtained by labeling the medical text may refer to a label set obtained by labeling the whole medical text, wherein the label set may be composed of label subsets under various eyes in the medical text. For each category in the medical text, the subset of labels under the category is the set of labels obtained by labeling the text segments under the category. Taking medical text as an admission record as an example, categories in the medical text may include: complaints, current medical history, past history, family history, physical examination, and the like. It should be noted that the category herein is actually a secondary category defined in the specification.
In the embodiment of the present disclosure, a medical text to be labeled may be obtained first, and then, the obtained medical text is labeled by a text labeling model trained in advance, so as to obtain a label set and label information of each label in the label set. The text annotation model may refer to a generic information extraction (Universal Information Extraction, UIE) model, among others. The labeling of the medical text may be a process of labeling a part of the text or the keyword from the medical text and assigning a label to the labeled part of the text or the keyword. The marked part of the text or the keyword can be given one label or a plurality of different labels. In addition, for each tag, a part of text or keyword marked by the tag may be used as the marked text of the tag.
For each tag, the tag information of the tag may include: the method comprises the steps of marking a marking starting position of a marking text of the label in a medical text, marking an ending position of the marking text of the label in the medical text, an initial rendering level of the label and a marking sign of the label. The marking start position and the marking end position can be represented by index values for characters in the medical text, and the index values are used for representing the characters in the medical text. The rendering level may be a value that is a multiple of an original line spacing of the medical text when the label is rendered in the medical text, the initial rendering level of the label being used to determine the line spacing between the label and the label text of the label. The tag name of the tag may refer to a general term used to describe the tagged text of the tag. For any tag, the initial rendering level of the tag is one.
Taking medical text as an admission record as an example, tag names such as: symptom information, video information, specification information, inspection information, and the like. It should be noted that the label is actually the name of the three-level category defined in the present specification.
For the label information, the embodiment of the present disclosure provides a schematic diagram of labeling results after labeling the medical text, as shown in fig. 2. It should be noted that, in order to facilitate visual understanding of the labeling result of the medical text, the label is displayed on the page rendered with the label, but in step S100, the label is not actually rendered on the page.
In fig. 2, the medical text is exemplified by an admission record, the text of which is composed of text segments under a plurality of categories. The categories may be: complaints, personal history, family history, physical examination. There is a piece of text under each category. In the text segment under each category, some keywords may be labeled as labeled text, and labels may be assigned to the labeled text. Such as: under the category of the main complaints, marking chest distress and palpitation as a marked text by using a rectangular frame, marking the position of the word of chest at the marking starting position of the marked text, marking the position of the word of palpitation at the marking ending position of the marked text, and giving a symptom information label for the chest distress and palpitation; under the category of personal history, marking 'drinking habit 40 years' as a marking text, marking the marking initial position of the marking text as the position of the character of 'drinking', marking the ending position of the marking text as the position of the character of 'year', and giving a 'drinking information' label for 'drinking habit 40 years'; in the category of physical examination, the label "two lung breath sounds are thick" is a label text, and the label for "two lung breath sounds are thick" examination information "and" symptom information ". The two labels are in an overlapping state. It should be noted that, in fig. 2, two labels in an overlapped state do not use the label rendering method in the present solution to avoid label overlapping.
In addition, for the UIE model, it can be expressed as: the framework can uniformly model different information extraction (Information Extraction, IE) tasks, adaptively generate target structures, and collaboratively learn the general capabilities of IEs from different knowledge sources. The UIE design can generate results corresponding to a plurality of schema entity types at a time, and meanwhile, the separate extraction of nested entities in the medical field is realized. Aiming at the characteristics of multiple types, large quantity, variable expression and the like of medical terms, the problem of term generalization is solved to a certain extent due to the less sample learning effect brought by the sampling learning mechanism of UIE. The framework idea is to design a structure extraction language (structural extraction language, SEL) that encodes different IE structures into a unified representation so that the various IE tasks can be modeled universally in the same text-to-structure generation framework. IE structure generation can be broken down into two atomic operations: positioning and associating. The localization is used to indicate the localization of target information blocks from sentences, such as entities and trigger words in an event. The association is used to represent information blocks that are connected differently according to the desired association (e.g., a relationship between pairs of entities or a role between an event and its parameters).
Different IE structures may be represented as a combination of atomic structure generation operations.
For example, medical texts are: "(bottom of bladder) adenocarcinoma, combined with history and morphology, rectal cancer metastasis origin. Entity identification: "((site: bladder bottom) (site: rectum) (disease: adenocarcinoma) (disease: rectal cancer)") event extraction: "((trigger word: metastasis (metastasis source: rectal cancer) (metastasis site: bladder bottom))".
In order to adaptively generate target structures for different IE tasks, UIE uses a hint mechanism of a structure pattern director (structural schema instructor, SSI) to control the content to be found, the content to be associated, and the content to be generated, for example, SSI "[ spot ] location [ spot ] disease [ asso ] disease occurrence location [ text ]" represents a record of extracting from sentences the relationship pattern of "what disease occurs at what location".
When the UIE model is used, the UIE takes a given structure pattern director SSI and text as inputs, generates a structure extraction language SEL containing extraction information from the text based on the structure pattern director during generation, and then converts the generated structure extraction language into the extracted information (i.e., markup text).
When the text labeling model is trained, the sample medical text and the mode guide symbol corresponding to the sample medical text can be obtained. And inputting the sample medical text and the mode guide corresponding to the sample medical text into a text labeling model so as to label or extract the labeling text from the sample medical text based on the mode guide corresponding to the sample medical text through the text labeling model, wherein the labeling text is used as a text to be optimized. And training the text labeling model by taking the difference between the text to be optimized and the real text labeled by the sample medical text as an optimization target. The text labeling model is a UIE model.
S102: and according to the labeling initial position of the labeling text of each label in the label set in the medical text, carrying out ascending order sorting on the labels in the label set to obtain a sorted label set.
In the embodiment of the present disclosure, after determining the tag set corresponding to the medical text and the tag information of each tag in the tag set, it is necessary to determine whether the tags that are relatively close to each other in the page overlap, if so, it is necessary to adjust the rendering level of the tag, and if not, it is not necessary to adjust the rendering level of the tag. Therefore, the labels in the label set need to be ordered according to the sequence of the labels in the page. Note that, the label overlapping described in this specification is not only a meaning that the index labels are completely overlapped, but also a meaning that the index labels are crossed, staggered, collided, or overlapped.
When the browser renders the labels, the label text box is aligned with the label starting position of the label text of the labels by default, so that the label starting position contained in the label information of each label can be referred to when the labels are ordered.
Specifically, according to the labeling initial position of the labeling text of each label in the label set in the medical text, each label in the label set can be sequenced in an ascending order to obtain a sequenced label set, and the sequenced label set is used as the sequenced label set. That is, the label with the front label at the start position is arranged in front, and the label with the rear label at the start position is arranged in rear.
The number of the labels in the label set determines a sorting mode for sorting the labels, and when the number of the labels in the label set is relatively large, in order to improve the execution performance of the browser, the labels can be sorted in a quick sorting mode; when the number of tags in the tag set is small, the tag ordering may be performed in an insert ordering manner.
Further, it is determined whether the number of tags in the tag set is greater than a preset number. Wherein the preset number may be 23. If the number of the labels in the label set is larger than the preset number, according to a quick ordering mode, according to the marking starting position of the marking text of each label in the label set in the medical text, ascending order ordering is carried out on the labels in the label set. If the number of the labels in the label set is not greater than the preset number, according to the insertion ordering mode, according to the marking starting position of the marking text of each label in the label set in the medical text, ascending order is carried out on the labels in the label set.
S104: and determining the label which is positioned before and adjacent to each label in the ordered label set from the ordered label set as the adjacent label of the label, and judging whether the label is overlapped with the adjacent label according to the marking starting position of the marking text of the label in the medical text and the marking ending position of the marking text of the adjacent label in the medical text or according to the relative position relation between a label text box of the label and a label text box of the adjacent label when the label text box of the label is displayed in a page containing the medical text, so as to obtain the judging result of the label.
In the embodiment of the present disclosure, after the ordered tag set is obtained, two methods may be adopted to determine whether any two adjacent tags overlap, where the first method is: judging whether the labels are overlapped according to whether the labeling texts of the labels are overlapped, wherein the second method is as follows: and judging whether the labels are overlapped according to whether the label text boxes of the labels are overlapped.
Specifically, for each tag in the sorted tag set, a tag that is located before and adjacent to the tag is determined from the sorted tag set as an adjacent tag to the tag. And then judging whether the label is overlapped with the adjacent label according to the label starting position of the label text of the label in the medical text and the label ending position of the label text of the adjacent label in the medical text or according to the relative position relation between the label text box of the label and the label text box of the adjacent label when the label text box of the label is displayed in a page containing the medical text, and obtaining a judging result of the label.
For the first method:
and judging whether the label and the adjacent label are overlapped or not according to the marking starting position of the marking text of the label in the medical text and the marking ending position of the marking text of the adjacent label in the medical text.
Specifically, according to the marking starting position of the marking text of the label in the medical text and the marking ending position of the marking text of the adjacent label in the medical text, whether the marking starting position of the marking text of the label in the medical text is before the marking ending position of the marking text of the adjacent label in the medical text is judged. If the labeling initial position of the labeling text of the label in the medical text is before the labeling end position of the labeling text of the adjacent label in the medical text, the labeling text of the label is overlapped with the labeling text of the adjacent label, and the label is determined to be overlapped with the adjacent label to be used as a judging result of the label; if the labeling start position of the labeling text of the label in the medical text is at the labeling end position of the labeling text of the adjacent label in the medical text, the labeling text of the label is not overlapped with the labeling text of the adjacent label, and the label is determined to be not overlapped with the adjacent label as a judging result of the label.
For the second method:
and judging whether the label and the adjacent label are overlapped according to the relative position relation between the label text box of the label and the label text box of the adjacent label when the label is displayed in the page containing the medical text.
Specifically, according to a pre-generated abstract syntax tree containing label information of the label, a label text box of the label is determined. Meanwhile, according to a pre-generated abstract syntax tree containing label information of adjacent labels, a label text box of the adjacent labels is determined. And then, judging whether the label is overlapped with the adjacent label according to the relative position relation between the label text box of the label and the label text box of the adjacent label when the label is displayed in the page containing the medical text, and obtaining a judging result of the label.
When the tag and the adjacent tag belong to the same category, the abstract syntax tree containing the tag information of the tag is the same abstract syntax tree as the abstract syntax tree containing the tag information of the adjacent tag. When the tag and the adjacent tag do not belong to the same category, the abstract syntax tree containing the tag information of the tag is a different abstract syntax tree from the abstract syntax tree containing the tag information of the adjacent tag.
Because, in the method for generating the abstract syntax tree, one abstract syntax tree is generated for the tag subset under each category in the medical text, the document object model (Document Object Model, DOM) for each category is conveniently generated based on the abstract syntax tree under each category in the following.
When the abstract grammar tree under each category is generated, text detection can be carried out on the medical text, and various categories contained in the medical text and text segments under each category in the medical text are determined. Then, for each category, determining each label obtained by labeling the text segment under the category as a label subset under the category, and determining label information of each label in the label subset under the category. And finally, generating an abstract syntax tree aiming at the label set under the category as an abstract syntax tree corresponding to the category according to the category name, the medical text and the label information of each label in the label subset under the category. The abstract syntax tree corresponding to the category is tag information of each tag in the category name, the medical text and the tag subset under the category, and the tag information may include: the method comprises the steps of marking a starting position of a marking text of a label in a medical text, marking an ending position of the marking text of the label in the medical text, rendering level of the label and a label name.
When determining the tag text box of the tag, the abstract syntax tree containing the tag information of the tag, which is generated in advance, can be rendered to generate the DOM containing the tag object. And determining the label text box of the label and the first page position of the label text box of the label when the label text box of the label is displayed in the page containing the medical text according to the generated DOM containing the label object. Similarly, when determining the tag text box of the adjacent tag, the abstract syntax tree containing the tag information of the tag, which is generated in advance, can be rendered to generate the DOM containing the adjacent tag object. And determining the label text boxes of the adjacent labels and the second page position of the label text boxes of the adjacent labels when the label text boxes of the adjacent labels are displayed in the page containing the medical text according to the generated DOM containing the adjacent label objects.
In the DOM, one tag corresponds to one node object, i.e., one tag corresponds to one rectangular text box. An application programming interface (Application Programming Interface, API) that invokes the DOM may be predefined for the DOM. If the position information of the label text box corresponding to the origin of coordinates is required to be acquired, the getbase ClientRact function in the API can be used; if the coordinate information of each vertex of the label text box on the X axis and the Y axis is required to be acquired, the offsetLeft function and the offsetTop function in the API can be used. The X-axis coordinates of the tag text box can be obtained by an offsetLeft function, and the Y-axis coordinates of the tag text box can be obtained by an offsetTop function.
When determining the first page position of the tag text box of the tag when the tag text box is displayed in the page containing the medical text, the upper left corner of the page containing the medical text can be used as the origin of coordinates, the horizontal right direction of the page is used as the positive direction of the X axis, and the vertical downward direction of the page is used as the positive direction of the Y axis, so as to construct a coordinate system. And then, determining the position coordinates of each vertex in the label text box of the label when the label text box of the label is displayed in the page containing the medical text by calling the DOM containing the label object, and taking the position coordinates as the first page position of the label text box of the label.
And simultaneously, determining the position coordinates of each vertex in the label text box of the adjacent label when the label is displayed in the page containing the medical text by calling DOM containing the adjacent label object, and taking the position coordinates as the second page position of the label text box of the adjacent label.
When judging whether the label and the adjacent label are overlapped according to the relative position relation between the label text box of the label and the label text box of the adjacent label when being displayed in the page containing the medical text, judging whether the label text box of the label is overlapped with the label text box of the adjacent label according to the relative position relation between the first page position when the label text box of the label is displayed in the page containing the medical text and the second page position when the label text box of the adjacent label is displayed in the page containing the medical text. And if the label text box of the label is overlapped with the label text box of the adjacent label, determining that the label is overlapped with the adjacent label.
When judging whether the label text box of the label and the label text boxes of the adjacent labels are overlapped, judging whether the projected edges of the label text boxes of the label and the projected edges of the label text boxes of the adjacent labels on the same projection axis are overlapped or not by projecting the edges of the label text boxes.
Specifically, each projection axis of the tag text box for the tag is determined according to the edge vector of the tag text box of the tag. The projection axis may be a unit normal vector indicating the label text box edge. And for each projection axis, projecting each side of the tab text box of the tab onto the projection axis based on the first page position when the tab text box of the tab is displayed in the page containing the medical text, so as to obtain each projection side as each first projection side on the projection axis. And simultaneously, based on the second page position of the label text box of the adjacent label when the label text box of the adjacent label is displayed in the page containing the medical text, projecting each side of the label text box of the adjacent label onto the projection axis to obtain each projection side as each second projection side on the projection axis. Then, whether each first projection side and each second projection side on the projection axis are overlapped is judged, and a judgment result aiming at the projection axis is obtained.
If it is determined that at least one of the projection axes has the first projection edge and the second projection edge that do not overlap according to the determination result for each projection axis, determining that the tab text box of the tab and the tab text box of the adjacent tab do not overlap, that is, determining that the tab and the adjacent tab do not overlap, as the determination result of the tab. If it is determined that each first projection side and each second projection side on each projection axis overlap according to the determination result for each projection axis, the tag text box of the tag overlaps with the tag text box of the adjacent tag, that is, the tag overlaps with the adjacent tag, as the determination result of the tag.
Wherein, according to the edge vector of the label text box of the label, the method for determining each projection axis of the label text box of the label can comprise: after a coordinate system is built on a page containing medical texts, two sides which are adjacent to each other in a label text box of the label are determined, one side of the two sides is taken as a first side, and the other side is taken as a second side. And then, according to the first page position of the label text box of the label, determining the position coordinates of the two vertexes of the first side in the label text box of the label, and according to the position coordinates of the two vertexes of the first side, determining the side vector of the first side. And simultaneously, determining the position coordinates of two vertexes of a second side in the label text box of the label according to the first page position of the label text box of the label, and determining the side vector of the second side according to the position coordinates of the two vertexes of the second side. And then, determining a unit normal vector of the first side as a first projection axis according to the side vector of the first side. And meanwhile, determining a unit normal vector of the second side as a second projection axis according to the side vector of the second side. And determining each projection axis of the label text box for the label according to the first projection axis and the second projection axis.
And when each projection axis is used as each first projection edge on the projection axis, the position coordinates of each vertex in the tag text box of the tag are determined according to the first page position of the tag text box of the tag when the tag text box of the tag is displayed in the page containing the medical text. And then, determining the edge vector of each edge in the label text box of the label according to the position coordinates of each vertex in the label text box of the label. And then, based on the edge vector of each edge in the label text box of the label, projecting each edge in the label text box of the label onto the projection axis to obtain each projection edge as each first projection edge on the projection axis.
In addition, the projection method of the label text box for the adjacent label is the same as the projection method of the label text box of the label, and will not be repeated.
When judging whether each first projection side and each second projection side on the projection axis overlap or not to obtain a judgment result for the projection axis, judging whether the first projection side overlaps any one of the second projection sides or not for each first projection side on the projection axis, and if the first projection side overlaps any one of the second projection sides, determining that each first projection side and each second projection side on the projection axis overlap. If all the first projection edges are not overlapped with any one of the second projection edges, determining that the first projection edges and the second projection edges on the projection axis are not overlapped.
Next, the above method for determining whether the label and the adjacent label overlap is illustrated, and the embodiment of the present disclosure provides a schematic diagram for determining whether any two adjacent labels overlap, as shown in fig. 3.
In fig. 3, O is the origin of coordinates, i.e., the upper left corner of the page containing the medical text, the horizontal right is the positive X-axis direction, and the vertical down is the positive Y-axis direction. The label text box of the label 1 is rectangular ABCD, and the label text box of the label 2 is rectangular
Figure SMS_10
Tag 1 is the adjacent tag to tag 2. Side vector->
Figure SMS_9
The unit normal vector of (i.e., the edge vector of the first side) is +>
Figure SMS_17
As projection axis, edge vector +.>
Figure SMS_4
The unit normal vector of (i.e., the edge vector of the second side) is +.>
Figure SMS_13
As the projection axis. For projection axis +.>
Figure SMS_3
Edges AD and BC in tag 1 are in projection axis +.>
Figure SMS_12
The second projection edge is ApDp; label 2 middle edge
Figure SMS_2
And->
Figure SMS_14
In the projection axis->
Figure SMS_5
The first projection side on is also ApDp, i.e. in the projection axis +.>
Figure SMS_11
And the first projection side and the second projection side are overlapped. For projection axis +.>
Figure SMS_6
Edges AB and CD in tag 1 are in projection axis +.>
Figure SMS_15
The second projection edge on the first projection edge is AqBq; edge +.>
Figure SMS_7
And->
Figure SMS_16
In the projection axis->
Figure SMS_8
The first projection side is +.>
Figure SMS_18
. First projection side AqBq and second projection side +. >
Figure SMS_1
And do not overlap. There is a projection axis such that the tag text boxes of the two tags do not overlap on the projection axis, indicating that the tag text boxes of the two tags do not overlap. That is, tag 1 and tag 2 do not overlap.
S106: and determining the final rendering level of the label according to the judging result of the label and the initial rendering level of the label.
In the embodiment of the present disclosure, the final rendering level of the tag may be determined according to the determination result of the tag and the initial rendering level of the tag.
And if the label is determined to be overlapped with the adjacent label according to the judgment result of the label, adjusting the initial rendering level of the label to obtain an adjusted rendering level of the label. And adding one to the initial rendering level of the label to obtain an adjusted rendering level of the label, and determining the adjusted rendering level of the label as a final rendering level of the label.
If the label is determined to be not overlapped with the adjacent label according to the judgment result of the label, the initial rendering level of the label is not adjusted, and the initial rendering level of the label can be directly determined to be the final rendering level of the label.
S108: each tag in the ordered set of tags is rendered in a page area between the medical text lines based on a final rendering level of each tag in the ordered set of tags and an original line spacing of the medical text to reveal each tag in the medical text.
In the present description, after traversing each tag in the ordered set of tags, a final rendering level for each tag in the ordered set of tags may be determined. The final rendering level may be an adjusted rendering level obtained by adjusting the initial rendering level, or may be the initial rendering level. Each tag in the ordered set of tags is then rendered in a page area between the rows of medical text based on the final rendering level of each tag in the ordered set of tags and the original row spacing of the medical text to reveal each tag in the medical text.
Specifically, for each label in the ordered label set, determining the product of the final rendering level of the label and the original line spacing of the medical text to obtain the line spacing between the label and the labeling text of the label. And determining the rendering starting position of the label in the page containing the medical text according to the marking starting position of the marking text of the label in the medical text. And finally, rendering the label in a page area corresponding to the rendering start position between the lines of the medical text according to the line spacing between the label and the labeling text of the label.
The position which can be aligned with the marking initial position of the marking text of the label in the medical text and is positioned above the marking text of the label can be determined as the rendering initial position of the label in the page containing the medical text.
When the label is rendered, the line spacing and the rendering start position between the label and the labeling text of the label are used as input parameters and are input into the function of the cascading style sheet (Cascading Style Sheets, CSS), the rendering task is executed by calling the function of the CSS, and the label is rendered in the page area corresponding to the rendering start position between the lines of the medical text.
Wherein the function of CSS may include: position function, top function, left function. The position function is used to set the positioning logic of the rendering, and the input parameters may be relative or absolute. the top function is used for adjusting the vertical distance of rendering, and the input parameter is the line spacing between the label and the labeling text of the label. The left function is used for adjusting the horizontal position of rendering, and the input parameter is the rendering starting position.
Further, the position function of the medical text through the CSS may be set to be relative. Then, traversing each label in the label set, searching out the label text to be labeled in the label starting position and the label ending position of the label in the medical text, taking the label text as a father node, adding a child node (namely, the label) for the father node, wherein the content of the child node is the label name of the label. And then, calling a function of CSS, setting the position of the label as an absolute, and adjusting the vertical distance for rendering the label according to the final rendering level of the label multiplied by the original line spacing of the medical text. In this way, collision or overlapping of a plurality of tags can be avoided.
Embodiments of the present disclosure provide a page schematic for rendering multiple tags in medical text, as shown in fig. 4.
In fig. 4, the medical text is an admission record, and in the category of physical examination, if "two-lung breath sound is thick" is a labeled text, the labels for "two-lung breath sound is thick" are "examination information" and "symptom information". To avoid overlapping of the two labels, the "inspection information" may be rendered above the "symptom information".
In addition, when each label in the label set is rendered, a click event can be added to each label based on the mapping relation between the label and the specific feature information corresponding to the label so as to display the specific feature information corresponding to the label by clicking the label. The specific feature information corresponding to the tag may refer to feature information including multiple dimensions, which is proposed from a labeling text of the tag.
It should be noted that, all actions for acquiring signals, information or text data in the present application are performed under the condition of conforming to the corresponding data protection rule policy of the country of the location and obtaining the authorization given by the owner of the corresponding device.
As can be seen from the method shown in fig. 1, the present specification determines a label set obtained by labeling a medical text, and determines whether two labels overlap according to label information of any two adjacent labels in the label set or a relative positional relationship displayed in a page by a label text box of any two adjacent labels. If the two labels are overlapped, adjusting the initial rendering level of one label to obtain an adjusted rendering level, and taking the adjusted rendering level as a final rendering level; if the two labels are not overlapped, the initial rendering level of the label is directly used as the final rendering level. Finally, each label is rendered in the page area between the medical text lines according to the final rendering level of each label and the original line spacing of the medical text. In this method, a label at the time of labeling the medical text may be rendered into the medical text. In addition, when two adjacent labels are judged to be overlapped, the initial rendering level of one label is adjusted, so that the rendering levels on which the two labels are based are different when being rendered, and the rendering level is a multiple value of the original line spacing of the medical text when the labels are rendered in the medical text, so that the two labels are rendered in the vertical directions of different heights when being rendered, and the two labels are not overlapped and displayed.
Since the browser operates on hypertext markup language (Hyper Text Markup Language, HTML), in order to improve processing efficiency of the browser in the process of sorting tags in a tag set or adjusting a rendering level included in tag information, HTML code may be first converted into a syntax abstract tree, and sorting or adjusting a rendering level of tags may be performed based on the syntax abstract tree.
In generating the grammar abstract tree, a respective grammar abstract tree may be generated for a subset of tags under each class in the medical text.
Specifically, text detection is performed on the medical text, and various categories contained in the medical text and text segments under each category in the medical text are determined. And determining each label obtained by labeling the text segment under the category as a label subset under the category, and determining label information of each label in the label subset under the category. And generating an abstract syntax tree aiming at the label set under the category as an abstract syntax tree corresponding to the category according to the category name, the medical text and the label information of each label in the label subset under the category.
The abstract syntax tree corresponding to the category is tag information of each tag in the category name, the medical text and the tag subset under the category, and the tag information may include: the method comprises the steps of marking a starting position of a marking text of a label in a medical text, marking an ending position of the marking text of the label in the medical text, rendering level of the label and a label name.
That is, the data structure of the abstract syntax tree corresponding to the category is shown in table 1.
Figure SMS_19
In table 1, η is a set composed of a plurality of quaternion arrays, one quaternion array represents tag information of one tag, and one quaternion array contains a tag start position of a tag text in a medical text, a tag end position of the tag text in the medical text, a rendering level of the tag, and a tag name.
The data structure of the tag information for each tag in the subset of tags under the category is shown in table 2.
Figure SMS_20
/>
After generating the abstract syntax tree for each category, the tags in the subset of tags under each category may be ordered based on the abstract syntax tree for each category.
In step S102, according to the labeling start position of the labeling text of each label in the label set in the medical text, the labels in the label set are sorted in ascending order to obtain a sorted label set.
Specifically, for the label subset under each category in the medical text, according to the label starting position of the label text of each label in the abstract syntax tree corresponding to the category, the labels in the label subset under the category are sorted in ascending order to obtain the sorted label subset under the category. That is, the label with the front label at the start position is arranged in front, and the label with the rear label at the start position is arranged in rear. And finally, merging the sorted label subsets under each class to obtain a sorted label set.
When the labels in the label subset under the category are sorted in ascending order according to the label starting position of the label labeling text in the medical text of each label in the abstract syntax tree corresponding to the category, and the sorted label subset under the category is obtained, different sorting modes can be selected according to the number of the labels in the label subset under the category.
Specifically, it is determined whether the number of tags in the subset of tags under the category is greater than a preset number. Wherein the preset number may be 23. If the number of the labels in the label subset under the category is larger than the preset number, according to a quick ordering mode, according to the marking starting position of the marking text of each label in the abstract syntax tree corresponding to the category in the medical text, the labels in the label subset under the category are ordered in an ascending order. If the number of the labels in the label subset under the category is not greater than the preset number, according to a quick ordering mode, according to the marking starting position of the marking text of each label in the abstract syntax tree corresponding to the category in the medical text, the labels in the label subset under the category are ordered in an ascending order.
In step S104, for each tag in the sorted tag set, determining a tag located before and adjacent to the tag from the sorted tag set, as an adjacent tag of the tag, and judging whether the tag and the adjacent tag overlap according to a labeling start position of a labeling text of the tag in a medical text and a labeling end position of a labeling text of the adjacent tag in the medical text, or according to a relative position relationship between a tag text box of the tag and a tag text box of the adjacent tag when displaying in a page containing the medical text, so as to obtain a judgment result of the tag.
Specifically, in the case of the sorted tag subsets under each category, for each tag in the sorted tag subsets under the category, a tag that is located before and adjacent to the tag is determined from the sorted tag subsets under the category as an adjacent tag of the tag. And then, judging whether the label and the adjacent label are overlapped according to the label starting position of the label text of the label in the medical text in the abstract syntax tree corresponding to the category and the label ending position of the label text of the adjacent label in the abstract syntax tree corresponding to the category or according to the relative position relation between the label text box of the label and the label text box of the adjacent label when the label text box of the label is displayed in a page containing the medical text, and obtaining a judging result of the label.
The method for judging whether the label and the adjacent label are overlapped is the same as the method for judging whether the label and the adjacent label are overlapped according to the label starting position of the label in the medical text and the label ending position of the label in the medical text of the label in the abstract syntax tree corresponding to the category, and is not repeated herein.
The method for judging whether the label and the adjacent label are overlapped or not according to the relative position relation between the label text box of the label and the label text box of the adjacent label when the label is displayed in the page containing the medical text, and obtaining the judging result of the label can comprise the following steps:
and determining the tag text box of the tag and the tag text boxes of adjacent tags according to the abstract syntax tree corresponding to the category. And then, judging whether the label is overlapped with the adjacent label according to the relative position relation between the label text box of the label and the label text box of the adjacent label when the label is displayed in the page containing the medical text, and obtaining a judging result of the label. The label and the adjacent label belong to the label under the same category, so that only the abstract syntax tree corresponding to the category is needed to determine the label text box of the label and the label text box of the adjacent label.
When the tag text box of the tag and the tag text boxes of adjacent tags are determined, the abstract syntax tree corresponding to the category can be rendered, and the DOM corresponding to the category can be generated. And then, determining the label text box of the label and the first page position of the label text box of the label when the label text box of the label is displayed in the page containing the medical text according to the DOM corresponding to the category. And simultaneously, determining the label text boxes of the adjacent labels and the second page position of the label text boxes of the adjacent labels when the label text boxes of the adjacent labels are displayed in the pages containing the medical texts according to DOMs corresponding to the categories. And judging whether the label is overlapped with the adjacent label according to the relative position relation between the first page position of the label text box of the label when the label text box of the label is displayed in the page containing the medical text and the second page position of the label text box of the adjacent label when the label text box of the label is displayed in the page containing the medical text.
The specific method for judging whether the label and the adjacent label are overlapped according to the relative position relationship between the first page position of the label text box of the label when being displayed in the page containing the medical text and the second page position of the label text box of the adjacent label when being displayed in the page containing the medical text is described above, and is not repeated here.
After the judgment result of each tag in the sorted tag subset under the category is obtained, in step S106, a final rendering level of the tag is determined according to the judgment result of the tag and the initial rendering level of the tag.
Specifically, for each tag in the sorted tag subset under the category, if it is determined that the tag overlaps with an adjacent tag of the tag according to a determination result of the tag, an initial rendering level of the tag in a grammar abstract tree corresponding to the category is adjusted, so as to obtain an adjusted rendering level of the tag, and the adjusted rendering level is used as a final rendering level of the tag.
If the label is determined to be not overlapped with the adjacent label of the label according to the judging result of the label, the initial rendering level of the label in the grammar abstract tree corresponding to the category is not adjusted, and the initial rendering level of the label can be directly used as the final rendering level of the label.
In step S108, each tag in the ordered set of tags is rendered in a page area between the rows of medical text based on the final rendering level of each tag in the ordered set of tags and the original row spacing of the medical text to reveal each tag in the medical text.
And traversing the labels in the ordered label subset under each class according to the ordered label subset under each class, and obtaining the final rendering level of each label in the ordered label subset under each class. The final rendering level may be an adjusted rendering level obtained by adjusting the initial rendering level, or may be the initial rendering level.
For the ordered tag subset under each category, the abstract syntax tree for the ordered tag subset under the category can be redetermined according to the final rendering level of each tag in the ordered tag subset under the category, and the abstract syntax tree is used as the final abstract syntax tree corresponding to the category. The final abstract syntax tree corresponding to the category comprises category names of the category, medical texts and label information of each label in the ordered label subset under the category, wherein the label information comprises a final rendering level, a label name, a label starting position of the label labeling text in the medical texts and a label ending position of the label labeling text in the medical texts.
And rendering each tag in the ordered tag subset under the category based on a final abstract syntax tree corresponding to the category for each category.
Specifically, for each category, rendering each label in the final abstract syntax tree corresponding to the category in a page area between rows of the medical text based on a final rendering level of each label in the final abstract syntax tree corresponding to the category and an original row spacing of the medical text, so as to display each label in the medical text.
Specifically, for each label in the final abstract syntax tree corresponding to the category, determining the product of the final rendering level of the label and the original line spacing of the medical text to obtain the line spacing between the label and the labeling text of the label. And determining the rendering starting position of the label in the page containing the medical text according to the marking starting position of the marking text of the label in the medical text. And finally, rendering the label in a page area corresponding to the rendering start position between the lines of the medical text according to the line spacing between the label and the labeling text of the label.
The position which can be aligned with the marking initial position of the marking text of the label in the medical text and is positioned above the marking text of the label can be determined as the rendering initial position of the label in the page containing the medical text.
The label rendering method provided for the embodiment of the present specification further provides a corresponding device, a storage medium and an electronic apparatus based on the same concept.
Fig. 5 is a schematic structural diagram of a label rendering device according to an embodiment of the present disclosure, where the device includes:
a first determining module 501, configured to obtain a medical text, and determine a tag set obtained by labeling the medical text and tag information of each tag in the tag set; wherein, for each tag, tag information of the tag includes: the method comprises the steps of marking a marking starting position of a marking text of the tag in the medical text, marking an ending position of the marking text of the tag in the medical text and an initial rendering level of the tag; the rendering level is a multiple value of the original line spacing of the medical text, wherein the vertical distance from the labeling text when the index label is rendered in the medical text;
the sorting module 502 is configured to sort the labels in the label set in ascending order according to the labeling start position of the labeling text of each label in the label set in the medical text, so as to obtain a sorted label set;
a judging module 503, configured to determine, for each tag in the ordered tag set, a tag that is located before and adjacent to the tag from the ordered tag set, as an adjacent tag of the tag, and judge whether the tag and the adjacent tag overlap according to a marking start position of a marking text of the tag in the medical text and a marking end position of a marking text of the adjacent tag in the medical text, or according to a relative positional relationship between a tag text box of the tag and a tag text box of the adjacent tag when the tag text box of the tag and the tag text box of the adjacent tag are displayed in a page including the medical text, so as to obtain a judging result of the tag;
A second determining module 504, configured to determine a final rendering level of the tag according to the determination result of the tag and the initial rendering level of the tag;
a rendering module 505, configured to render each tag in the ordered set of tags in a page area between rows of the medical text based on a final rendering level of each tag in the ordered set of tags and an original row spacing of the medical text, so as to display each tag in the medical text.
Optionally, the sorting module 502 is specifically configured to determine whether the number of tags in the tag set is greater than a preset number; if the number of the labels in the label set is larger than the preset number, according to a quick ordering mode, according to the marking initial position of the marking text of each label in the label set in the medical text, ascending order is carried out on the labels in the label set; if the number of the labels in the label set is not greater than the preset number, according to an insertion ordering mode, according to the marking starting position of the marking text of each label in the label set in the medical text, ascending order is carried out on the labels in the label set.
Optionally, the determining module 503 is specifically configured to determine whether the label and the adjacent label overlap according to a labeling start position of the labeling text of the label in the medical text and a labeling end position of the labeling text of the adjacent label in the medical text; if the marking initial position of the marking text of the label in the medical text is before the marking end position of the marking text of the adjacent label in the medical text, determining that the label is overlapped with the adjacent label, and taking the label as a judging result of the label; if the marking starting position of the marking text of the label in the medical text is behind the marking ending position of the marking text of the adjacent label in the medical text, determining that the label and the adjacent label are not overlapped, and taking the label and the adjacent label as a judging result of the label.
Optionally, the determining module 503 is specifically configured to determine a tag text box of the tag according to a pre-generated abstract syntax tree including tag information of the tag; determining a label text box of the adjacent label according to a pre-generated abstract syntax tree containing label information of the adjacent label; and judging whether the label and the adjacent label are overlapped according to the relative position relation between the label text box of the label and the label text box of the adjacent label when the label is displayed in the page containing the medical text, so as to obtain a judging result of the label.
Optionally, the determining module 503 is specifically configured to determine each projection axis of the tag text box for the tag according to the edge vector of the tag text box of the tag; for each projection axis, projecting each side of the tab text box of the tab onto the projection axis according to the position of the tab text box of the tab when being displayed in a page containing the medical text, so as to obtain each projection side as each first projection side on the projection axis; projecting each side of the label text box of the adjacent label onto the projection shaft according to the position of the label text box of the adjacent label when the label text box is displayed in the page containing the medical text, so as to obtain each projection side as each second projection side on the projection shaft; judging whether each first projection edge and each second projection edge on the projection axis are overlapped or not to obtain a judgment result aiming at the projection axis; if it is determined that at least one first projection edge and at least one second projection edge on each projection axis are not overlapped according to the judgment result of each projection axis, determining that the label is not overlapped with the adjacent label, and taking the label as the judgment result of the label; and if the first projection edges and the second projection edges on each projection axis are overlapped according to the judgment result of each projection axis, determining that the label is overlapped with the adjacent label, and taking the label as the judgment result of the label.
Optionally, the determining module 503 is specifically configured to perform text detection on the medical text, and determine various categories included in the medical text and text segments under each category in the medical text; determining each label obtained by labeling the text segment under the category as a label subset under the category, and determining label information of each label in the label subset under the category; generating an abstract syntax tree aiming at the label set under the category as an abstract syntax tree corresponding to the category according to the category name, the medical text and the label information of each label in the label subset under the category; screening abstract syntax trees containing label information of the labels from abstract syntax trees corresponding to various orders, rendering the abstract syntax trees containing the label information of the labels, and determining label text boxes of the labels; and screening abstract syntax trees containing label information of the adjacent labels from abstract syntax trees corresponding to various orders, rendering the abstract syntax trees containing the label information of the adjacent labels, and determining label text boxes of the adjacent labels.
Optionally, the second determining module 504 is specifically configured to adjust an initial rendering level of the tag if it is determined that the tag overlaps with the adjacent tag according to a determination result of the tag, so as to obtain an adjusted rendering level of the tag, which is used as a final rendering level of the tag; wherein the initial rendering level of the tag is one; and if the label is determined to be not overlapped with the adjacent label according to the judgment result of the label, determining the initial rendering level of the label as the final rendering level of the label.
Optionally, the second determining module 504 is specifically configured to add one to the initial rendering level of the tag, to obtain an adjusted rendering level of the tag.
Optionally, the rendering module 505 is specifically configured to determine, for each tag in the ordered tag set, a product of a final rendering level of the tag and an original line space of the medical text, to obtain a line space between the tag and a labeling text of the tag; determining the rendering starting position of the label in a page containing the medical text according to the marking starting position of the marking text of the label in the medical text; and rendering the label in a page area corresponding to the rendering start position between the medical text lines according to the line spacing.
The present specification also provides a computer readable storage medium storing a computer program which, when executed by a processor, is operable to perform the label rendering method provided in fig. 1 above.
Based on the label rendering method shown in fig. 1, the embodiment of the present disclosure further provides a schematic structural diagram of the electronic device shown in fig. 6. At the hardware level, as in fig. 6, the electronic device includes a processor, an internal bus, a network interface, a memory, and a non-volatile storage, although it may include hardware required for other services. The processor reads the corresponding computer program from the nonvolatile memory into the memory and then runs the computer program to implement the tag rendering method described in fig. 1.
Of course, other implementations, such as logic devices or combinations of hardware and software, are not excluded from the present description, that is, the execution subject of the following processing flows is not limited to each logic unit, but may be hardware or logic devices.
In the 90 s of the 20 th century, improvements to one technology could clearly be distinguished as improvements in hardware (e.g., improvements to circuit structures such as diodes, transistors, switches, etc.) or software (improvements to the process flow). However, with the development of technology, many improvements of the current method flows can be regarded as direct improvements of hardware circuit structures. Designers almost always obtain corresponding hardware circuit structures by programming improved method flows into hardware circuits. Therefore, an improvement of a method flow cannot be said to be realized by a hardware entity module. For example, a programmable logic device (Programmable Logic Device, PLD) (e.g., field programmable gate array (Field Programmable Gate Array, FPGA)) is an integrated circuit whose logic function is determined by the programming of the device by a user. A designer programs to "integrate" a digital system onto a PLD without requiring the chip manufacturer to design and fabricate application-specific integrated circuit chips. Moreover, nowadays, instead of manually manufacturing integrated circuit chips, such programming is mostly implemented by using "logic compiler" software, which is similar to the software compiler used in program development and writing, and the original code before the compiling is also written in a specific programming language, which is called hardware description language (Hardware Description Language, HDL), but not just one of the hdds, but a plurality of kinds, such as ABEL (Advanced Boolean Expression Language), AHDL (Altera Hardware Description Language), confluence, CUPL (Cornell University Programming Language), HDCal, JHDL (Java Hardware Description Language), lava, lola, myHDL, PALASM, RHDL (Ruby Hardware Description Language), etc., VHDL (Very-High-Speed Integrated Circuit Hardware Description Language) and Verilog are currently most commonly used. It will also be apparent to those skilled in the art that a hardware circuit implementing the logic method flow can be readily obtained by merely slightly programming the method flow into an integrated circuit using several of the hardware description languages described above.
The controller may be implemented in any suitable manner, for example, the controller may take the form of, for example, a microprocessor or processor and a computer readable medium storing computer readable program code (e.g., software or firmware) executable by the (micro) processor, logic gates, switches, application specific integrated circuits (Application Specific Integrated Circuit, ASIC), programmable logic controllers, and embedded microcontrollers, examples of which include, but are not limited to, the following microcontrollers: ARC 625D, atmel AT91SAM, microchip PIC18F26K20, and Silicone Labs C8051F320, the memory controller may also be implemented as part of the control logic of the memory. Those skilled in the art will also appreciate that, in addition to implementing the controller in a pure computer readable program code, it is well possible to implement the same functionality by logically programming the method steps such that the controller is in the form of logic gates, switches, application specific integrated circuits, programmable logic controllers, embedded microcontrollers, etc. Such a controller may thus be regarded as a kind of hardware component, and means for performing various functions included therein may also be regarded as structures within the hardware component. Or even means for achieving the various functions may be regarded as either software modules implementing the methods or structures within hardware components.
The system, apparatus, module or unit set forth in the above embodiments may be implemented in particular by a computer chip or entity, or by a product having a certain function. One typical implementation is a computer. In particular, the computer may be, for example, a personal computer, a laptop computer, a cellular telephone, a camera phone, a smart phone, a personal digital assistant, a media player, a navigation device, an email device, a game console, a tablet computer, a wearable device, or a combination of any of these devices.
For convenience of description, the above devices are described as being functionally divided into various units, respectively. Of course, the functions of each element may be implemented in one or more software and/or hardware elements when implemented in the present specification.
It will be appreciated by those skilled in the art that embodiments of the present description may be provided as a method, system, or computer program product. Accordingly, the present specification may take the form of an entirely hardware embodiment, an entirely software embodiment, or an embodiment combining software and hardware aspects. Furthermore, the present description can take the form of a computer program product on one or more computer-usable storage media (including, but not limited to, disk storage, CD-ROM, optical storage, etc.) having computer-usable program code embodied therein.
The present description is described with reference to flowchart illustrations and/or block diagrams of methods, apparatus (systems) and computer program products according to embodiments of the specification. It will be understood that each flow and/or block of the flowchart illustrations and/or block diagrams, and combinations of flows and/or blocks in the flowchart illustrations and/or block diagrams, can be implemented by computer program instructions. These computer program instructions may be provided to a processor of a general purpose computer, special purpose computer, embedded processor, or other programmable data processing apparatus to produce a machine, such that the instructions, which execute via the processor of the computer or other programmable data processing apparatus, create means for implementing the functions specified in the flowchart flow or flows and/or block diagram block or blocks.
These computer program instructions may also be stored in a computer-readable memory that can direct a computer or other programmable data processing apparatus to function in a particular manner, such that the instructions stored in the computer-readable memory produce an article of manufacture including instruction means which implement the function specified in the flowchart flow or flows and/or block diagram block or blocks.
These computer program instructions may also be loaded onto a computer or other programmable data processing apparatus to cause a series of operational steps to be performed on the computer or other programmable apparatus to produce a computer implemented process such that the instructions which execute on the computer or other programmable apparatus provide steps for implementing the functions specified in the flowchart flow or flows and/or block diagram block or blocks.
In one typical configuration, a computing device includes one or more processors (CPUs), input/output interfaces, network interfaces, and memory.
The memory may include volatile memory in a computer-readable medium, random Access Memory (RAM) and/or nonvolatile memory, such as Read Only Memory (ROM) or flash memory (flash RAM). Memory is an example of computer-readable media.
Computer readable media, including both non-transitory and non-transitory, removable and non-removable media, may implement information storage by any method or technology. The information may be computer readable instructions, data structures, modules of a program, or other data. Examples of storage media for a computer include, but are not limited to, phase change memory (PRAM), static Random Access Memory (SRAM), dynamic Random Access Memory (DRAM), other types of Random Access Memory (RAM), read Only Memory (ROM), electrically Erasable Programmable Read Only Memory (EEPROM), flash memory or other memory technology, compact disc read only memory (CD-ROM), digital Versatile Discs (DVD) or other optical storage, magnetic cassettes, magnetic tape magnetic disk storage or other magnetic storage devices, or any other non-transmission medium, which can be used to store information that can be accessed by a computing device. Computer-readable media, as defined herein, does not include transitory computer-readable media (transmission media), such as modulated data signals and carrier waves.
It should also be noted that the terms "comprises," "comprising," or any other variation thereof, are intended to cover a non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements does not include only those elements but may include other elements not expressly listed or inherent to such process, method, article, or apparatus. Without further limitation, an element defined by the phrase "comprising one … …" does not exclude the presence of other like elements in a process, method, article or apparatus that comprises the element.
It will be appreciated by those skilled in the art that embodiments of the present description may be provided as a method, system, or computer program product. Accordingly, the present specification may take the form of an entirely hardware embodiment, an entirely software embodiment or an embodiment combining software and hardware aspects. Furthermore, the present description can take the form of a computer program product on one or more computer-usable storage media (including, but not limited to, disk storage, CD-ROM, optical storage, etc.) having computer-usable program code embodied therein.
The description may be described in the general context of computer-executable instructions, such as program modules, being executed by a computer. Generally, program modules include routines, programs, objects, components, data structures, etc. that perform particular tasks or implement particular abstract data types. The specification may also be practiced in distributed computing environments where tasks are performed by remote processing devices that are linked through a communications network. In a distributed computing environment, program modules may be located in both local and remote computer storage media including memory storage devices.
In this specification, each embodiment is described in a progressive manner, and identical and similar parts of each embodiment are all referred to each other, and each embodiment mainly describes differences from other embodiments. In particular, for system embodiments, since they are substantially similar to method embodiments, the description is relatively simple, as relevant to see a section of the description of method embodiments.
The foregoing is merely exemplary of the present disclosure and is not intended to limit the disclosure. Various modifications and alterations to this specification will become apparent to those skilled in the art. Any modifications, equivalent substitutions, improvements, or the like, which are within the spirit and principles of the present description, are intended to be included within the scope of the claims of the present description.

Claims (16)

1. A label rendering method, comprising:
acquiring a medical text, and determining a label set obtained by labeling the medical text and label information of each label in the label set; wherein, for each tag, tag information of the tag includes: the method comprises the steps of marking a marking starting position of a marking text of the tag in the medical text, marking an ending position of the marking text of the tag in the medical text and an initial rendering level of the tag; the rendering level is a multiple value of the original line spacing of the medical text, wherein the vertical distance from the labeling text when the index label is rendered in the medical text;
according to the labeling initial position of the labeling text of each label in the label set in the medical text, ascending order is carried out on the labels in the label set to obtain an ordered label set;
determining, for each tag in the ordered tag set, a tag that is located before and adjacent to the tag from the ordered tag set, as an adjacent tag of the tag, and judging whether the tag and the adjacent tag overlap according to a marking start position of a marking text of the tag in the medical text and a marking end position of a marking text of the adjacent tag in the medical text, or according to a relative positional relationship between a tag text box of the tag and a tag text box of the adjacent tag when the tag text box of the tag and the tag text box of the adjacent tag are displayed in a page containing the medical text, so as to obtain a judgment result of the tag;
Determining a final rendering level of the label according to the judging result of the label and the initial rendering level of the label;
each tag in the ordered set of tags is rendered in a page area between the medical text lines based on a final rendering level of each tag in the ordered set of tags and an original line spacing of the medical text to reveal each tag in the medical text.
2. The method of claim 1, wherein the ascending order of the labels in the label set is based on the label starting position of the label text of each label in the label set in the medical text, specifically comprising:
judging whether the number of the labels in the label set is larger than a preset number or not;
if the number of the labels in the label set is larger than the preset number, according to a quick ordering mode, according to the marking initial position of the marking text of each label in the label set in the medical text, ascending order is carried out on the labels in the label set;
if the number of the labels in the label set is not greater than the preset number, according to an insertion ordering mode, according to the marking starting position of the marking text of each label in the label set in the medical text, ascending order is carried out on the labels in the label set.
3. The method of claim 1, wherein determining whether the label and the adjacent label overlap according to a labeling start position of the labeling text of the label in the medical text and a labeling end position of the labeling text of the adjacent label in the medical text, or according to a positional relationship between a label text box of the label and a label text box of the adjacent label when displayed in a page containing the medical text, includes:
judging whether the label and the adjacent label are overlapped or not according to the marking starting position of the marking text of the label in the medical text and the marking ending position of the marking text of the adjacent label in the medical text;
if the marking initial position of the marking text of the label in the medical text is before the marking end position of the marking text of the adjacent label in the medical text, determining that the label is overlapped with the adjacent label, and taking the label as a judging result of the label;
if the marking starting position of the marking text of the label in the medical text is behind the marking ending position of the marking text of the adjacent label in the medical text, determining that the label and the adjacent label are not overlapped, and taking the label and the adjacent label as a judging result of the label.
4. The method of claim 1, wherein determining whether the label and the adjacent label overlap according to a labeling start position of the labeling text of the label in the medical text and a labeling end position of the labeling text of the adjacent label in the medical text, or according to a relative positional relationship between a label text box of the label and a label text box of the adjacent label when displayed in a page containing the medical text, specifically includes:
determining a label text box of the label according to a pre-generated abstract syntax tree containing label information of the label; determining a label text box of the adjacent label according to a pre-generated abstract syntax tree containing label information of the adjacent label;
and judging whether the label and the adjacent label are overlapped according to the relative position relation between the label text box of the label and the label text box of the adjacent label when the label is displayed in the page containing the medical text, so as to obtain a judging result of the label.
5. The method of claim 4, wherein determining whether the label and the adjacent label overlap according to a relative positional relationship between the label text box of the label and the label text box of the adjacent label when the label is displayed in a page including the medical text, and obtaining a determination result of the label specifically includes:
Determining each projection axis of the label text box for the label according to the edge vector of the label text box of the label;
for each projection axis, projecting each side of the tab text box of the tab onto the projection axis according to the position of the tab text box of the tab when being displayed in a page containing the medical text, so as to obtain each projection side as each first projection side on the projection axis; projecting each side of the label text box of the adjacent label onto the projection shaft according to the position of the label text box of the adjacent label when the label text box is displayed in the page containing the medical text, so as to obtain each projection side as each second projection side on the projection shaft;
judging whether each first projection edge and each second projection edge on the projection axis are overlapped or not to obtain a judgment result aiming at the projection axis;
if it is determined that at least one first projection edge and at least one second projection edge on each projection axis are not overlapped according to the judgment result of each projection axis, determining that the label is not overlapped with the adjacent label, and taking the label as the judgment result of the label;
and if the first projection edges and the second projection edges on each projection axis are overlapped according to the judgment result of each projection axis, determining that the label is overlapped with the adjacent label, and taking the label as the judgment result of the label.
6. The method of claim 4, wherein determining the tag text box of the tag according to the pre-generated abstract syntax tree containing tag information of the tag, and determining the tag text box of the adjacent tag according to the pre-generated abstract syntax tree containing tag information of the adjacent tag, comprises:
performing text detection on the medical text, and determining various categories contained in the medical text and text segments under each category in the medical text;
determining each label obtained by labeling the text segment under the category as a label subset under the category, and determining label information of each label in the label subset under the category;
generating an abstract syntax tree aiming at the label set under the category as an abstract syntax tree corresponding to the category according to the category name, the medical text and the label information of each label in the label subset under the category;
screening abstract syntax trees containing label information of the labels from abstract syntax trees corresponding to various orders, rendering the abstract syntax trees containing the label information of the labels, and determining label text boxes of the labels; and screening abstract syntax trees containing label information of the adjacent labels from abstract syntax trees corresponding to various orders, rendering the abstract syntax trees containing the label information of the adjacent labels, and determining label text boxes of the adjacent labels.
7. The method of claim 1, wherein determining the final rendering level of the tag according to the determination result of the tag and the initial rendering level of the tag, specifically comprises:
if the label is determined to be overlapped with the adjacent label according to the judgment result of the label, the initial rendering level of the label is adjusted to obtain an adjusted rendering level of the label, and the adjusted rendering level is used as the final rendering level of the label; wherein the initial rendering level of the tag is one;
and if the label is determined to be not overlapped with the adjacent label according to the judgment result of the label, determining the initial rendering level of the label as the final rendering level of the label.
8. The method of claim 7, wherein adjusting the initial rendering level of the tag results in an adjusted rendering level of the tag, comprising:
and adding one to the initial rendering level of the label to obtain an adjusted rendering level of the label.
9. The method of claim 1, wherein rendering each tag in the ordered set of tags in a page area between rows of the medical text based on a final rendering level of each tag in the ordered set of tags and an original row spacing of the medical text, specifically comprising:
Determining the product of the final rendering level of each label and the original line spacing of the medical text for each label in the ordered label set to obtain the line spacing between the label and the labeling text of the label;
determining the rendering starting position of the label in a page containing the medical text according to the marking starting position of the marking text of the label in the medical text;
and rendering the label in a page area corresponding to the rendering start position between the medical text lines according to the line spacing.
10. A label rendering apparatus, comprising:
the first determining module is used for acquiring a medical text and determining a label set obtained by labeling the medical text and label information of each label in the label set; wherein, for each tag, tag information of the tag includes: the method comprises the steps of marking a marking starting position of a marking text of the tag in the medical text, marking an ending position of the marking text of the tag in the medical text and an initial rendering level of the tag; the rendering level is a multiple value of the original line spacing of the medical text, wherein the vertical distance from the labeling text when the index label is rendered in the medical text;
The sorting module is used for sorting the labels in the label set in an ascending order according to the labeling initial position of the labeling text of each label in the label set in the medical text to obtain a sorted label set;
the judging module is used for determining a label which is positioned in front of the label and is adjacent to the label from the label set after sorting according to each label in the label set after sorting, and judging whether the label and the adjacent label are overlapped according to the marking starting position of the marking text of the label in the medical text and the marking ending position of the marking text of the adjacent label in the medical text or according to the relative position relation between the label text box of the label and the label text box of the adjacent label when the label text box of the label is displayed in a page containing the medical text, so as to obtain a judging result of the label;
the second determining module is used for determining the final rendering level of the label according to the judging result of the label and the initial rendering level of the label;
and the rendering module is used for rendering each label in the ordered label set in a page area between the medical text rows based on the final rendering level of each label in the ordered label set and the original row spacing of the medical text so as to display each label in the medical text.
11. The apparatus of claim 10, wherein the ranking module is specifically configured to determine whether the number of tags in the tag set is greater than a preset number; if the number of the labels in the label set is larger than the preset number, according to a quick ordering mode, according to the marking initial position of the marking text of each label in the label set in the medical text, ascending order is carried out on the labels in the label set; if the number of the labels in the label set is not greater than the preset number, according to an insertion ordering mode, according to the marking starting position of the marking text of each label in the label set in the medical text, ascending order is carried out on the labels in the label set.
12. The apparatus according to claim 10, wherein the judging module is specifically configured to judge whether the label and the adjacent label overlap according to a labeling start position of the labeling text of the label in the medical text and a labeling end position of the labeling text of the adjacent label in the medical text; if the marking initial position of the marking text of the label in the medical text is before the marking end position of the marking text of the adjacent label in the medical text, determining that the label is overlapped with the adjacent label, and taking the label as a judging result of the label; if the marking starting position of the marking text of the label in the medical text is behind the marking ending position of the marking text of the adjacent label in the medical text, determining that the label and the adjacent label are not overlapped, and taking the label and the adjacent label as a judging result of the label.
13. The apparatus of claim 10, wherein the judging module is specifically configured to determine a tag text box of the tag according to a pre-generated abstract syntax tree containing tag information of the tag; determining a label text box of the adjacent label according to a pre-generated abstract syntax tree containing label information of the adjacent label; and judging whether the label and the adjacent label are overlapped according to the relative position relation between the label text box of the label and the label text box of the adjacent label when the label is displayed in the page containing the medical text, so as to obtain a judging result of the label.
14. The apparatus of claim 13, wherein the determining module is specifically configured to determine each projection axis of the tag text box for the tag according to an edge vector of the tag text box for the tag; for each projection axis, projecting each side of the tab text box of the tab onto the projection axis according to the position of the tab text box of the tab when being displayed in a page containing the medical text, so as to obtain each projection side as each first projection side on the projection axis; projecting each side of the label text box of the adjacent label onto the projection shaft according to the position of the label text box of the adjacent label when the label text box is displayed in the page containing the medical text, so as to obtain each projection side as each second projection side on the projection shaft; judging whether each first projection edge and each second projection edge on the projection axis are overlapped or not to obtain a judgment result aiming at the projection axis; if it is determined that at least one first projection edge and at least one second projection edge on each projection axis are not overlapped according to the judgment result of each projection axis, determining that the label is not overlapped with the adjacent label, and taking the label as the judgment result of the label; and if the first projection edges and the second projection edges on each projection axis are overlapped according to the judgment result of each projection axis, determining that the label is overlapped with the adjacent label, and taking the label as the judgment result of the label.
15. A computer-readable storage medium, characterized in that the storage medium stores a computer program which, when executed by a processor, implements the method of any of the preceding claims 1-9.
16. An electronic device comprising a memory, a processor and a computer program stored on the memory and executable on the processor, characterized in that the processor implements the method of any of the preceding claims 1-9 when executing the program.
CN202310551004.8A 2023-05-16 2023-05-16 Label rendering method and device, storage medium and electronic equipment Active CN116257622B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202310551004.8A CN116257622B (en) 2023-05-16 2023-05-16 Label rendering method and device, storage medium and electronic equipment

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202310551004.8A CN116257622B (en) 2023-05-16 2023-05-16 Label rendering method and device, storage medium and electronic equipment

Publications (2)

Publication Number Publication Date
CN116257622A CN116257622A (en) 2023-06-13
CN116257622B true CN116257622B (en) 2023-07-11

Family

ID=86686576

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202310551004.8A Active CN116257622B (en) 2023-05-16 2023-05-16 Label rendering method and device, storage medium and electronic equipment

Country Status (1)

Country Link
CN (1) CN116257622B (en)

Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN110807761A (en) * 2019-09-18 2020-02-18 腾讯科技(深圳)有限公司 Method and device for generating label panel, storage medium and computer equipment
CN111128323A (en) * 2019-12-18 2020-05-08 中电云脑(天津)科技有限公司 Medical electronic case labeling method, device, equipment and storage medium
CN112188306A (en) * 2020-09-23 2021-01-05 腾讯科技(深圳)有限公司 Label generation method, device, equipment and storage medium
CN113139033A (en) * 2021-05-13 2021-07-20 平安国际智慧城市科技股份有限公司 Text processing method, device, equipment and storage medium
CN114861612A (en) * 2021-06-10 2022-08-05 四川医枢科技有限责任公司 Text labeling method and device

Family Cites Families (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US10719963B2 (en) * 2017-11-27 2020-07-21 Uber Technologies, Inc. Graphical user interface map feature for a network service

Patent Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN110807761A (en) * 2019-09-18 2020-02-18 腾讯科技(深圳)有限公司 Method and device for generating label panel, storage medium and computer equipment
CN111128323A (en) * 2019-12-18 2020-05-08 中电云脑(天津)科技有限公司 Medical electronic case labeling method, device, equipment and storage medium
CN112188306A (en) * 2020-09-23 2021-01-05 腾讯科技(深圳)有限公司 Label generation method, device, equipment and storage medium
CN113139033A (en) * 2021-05-13 2021-07-20 平安国际智慧城市科技股份有限公司 Text processing method, device, equipment and storage medium
CN114861612A (en) * 2021-06-10 2022-08-05 四川医枢科技有限责任公司 Text labeling method and device

Non-Patent Citations (2)

* Cited by examiner, † Cited by third party
Title
A partially-sorted concentric layout for efficient label localization in augmented reality;zijing zhou等;《IEEE transactions on visualization and computer graphics》;全文 *
字符候选集筛选算法评测方法研究;李荣龙;胡伟;;信息技术(01);全文 *

Also Published As

Publication number Publication date
CN116257622A (en) 2023-06-13

Similar Documents

Publication Publication Date Title
US11922712B2 (en) Technologies for content analysis
US8868609B2 (en) Tagging method and apparatus based on structured data set
AU2006263703A1 (en) User interface for geographic search
CN102930048B (en) Use the data rich found automatically with reference to the semanteme with vision data
CN116737915B (en) Semantic retrieval method, device, equipment and storage medium based on knowledge graph
CN106611058A (en) Method and device for searching test questions
CN116187448B (en) Information display method and device, storage medium and electronic equipment
EP3230892A1 (en) Topic identification based on functional summarization
US20220413997A1 (en) Automated locating of gui elements during testing using multidimensional indices
CN116525125B (en) Virtual electronic medical record generation method and device
Nguyen et al. Openvivqa: Task, dataset, and multimodal fusion models for visual question answering in vietnamese
CN110580294B (en) Entity fusion method, device, equipment and storage medium
CN116257622B (en) Label rendering method and device, storage medium and electronic equipment
CN117152770A (en) Handwriting input-oriented writing capability intelligent evaluation method and system
CN114842982B (en) Knowledge expression method, device and system for medical information system
CN116230146A (en) Data processing method, training method of ICD (ICD coding) model and related equipment
CN109614082B (en) Translation method, device and equipment for data query script
US10860637B2 (en) System and method for rapid annotation of media artifacts with relationship-level semantic content
CN113283248B (en) Automatic natural language generation method and device for scatter diagram description
CN117671426B (en) Concept distillation and CLIP-based hintable segmentation model pre-training method and system
CN117077649B (en) Method, device, medium and equipment for generating medical text extraction template
CN116562271B (en) Quality control method and device for electronic medical record, storage medium and electronic equipment
CN112860958B (en) Information display method and device
Alahmadi Identifying and Extracting Information from Programming Video Tutorials to Support Developer Knowledge Discovery
CN117725188A (en) Question and answer method and device based on artificial intelligence, electronic equipment and storage medium

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
GR01 Patent grant
GR01 Patent grant