Entity identification method and device for ultrasonic report and storage medium
By obtaining character and location codes from ultrasound reports, constructing text fragment codes, and combining them with model recognition, the problem of inaccurate entity recognition in ultrasound reports was solved, achieving higher recognition accuracy and type differentiation.
Patent Information
- Application Number
- CN202511985526.4
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-12-26
- Publication Date
- 2026-01-27
AI Technical Summary
Existing technologies have low accuracy in entity identification in ultrasound reports, especially due to the diversity of technical terms and abbreviations.
By acquiring the character and position codes of the ultrasound report text, text fragments are identified, and absolute position difference coding is used to construct text fragment codes. Combined with entity judgment and type recognition models, the accuracy of entity recognition is improved.
It improves the accuracy of entity recognition in ultrasound reports, effectively distinguishes similar structures at the beginning and end of sentences, suppresses noise span, increases sensitivity to fixed template positions, and enhances the accuracy of entity type recognition.
Smart Images

Figure CN121413615A_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of medical information technology, and in particular to a method, device and storage medium for entity recognition in ultrasound reports. Background Technology
[0002] With the in-depth development of medical informatization, medical data such as ultrasound reports and medical test reports are growing explosively. Entity identification of this data can provide support for business scenarios such as medical knowledge graph construction and medical big data analysis.
[0003] In existing technologies, entity recognition for ultrasound reports can be performed using common text-based entity recognition methods. This approach typically involves first extracting features from the text to obtain corresponding text features (such as the semantic features of each character, the semantic features of each word, and the overall semantic features of the text). Then, an entity recognition model is used to identify entities based on these text features, thereby determining each entity word in the text and its corresponding entity type.
[0004] However, ultrasound reports contain numerous technical terms and abbreviations, and the same concept often has multiple expressions (such as "echo enhancement" and "hyperecho"). Existing entity recognition methods have low accuracy in scenarios similar to ultrasound reports.
[0005] There is currently no effective solution to the technical problem of low accuracy in entity recognition in scenarios similar to ultrasound reports using existing entity recognition methods. Summary of the Invention
[0006] The embodiments of this disclosure provide a method, apparatus, and storage medium for entity recognition in ultrasound reports, to at least solve the technical problem of low accuracy in entity recognition in scenarios similar to ultrasound reports using existing entity recognition methods.
[0007] According to one aspect of the present disclosure, an entity recognition method for an ultrasound report is provided, comprising: acquiring the report text of the ultrasound report; determining the semantic code and positional code corresponding to each character in the report text, and determining a plurality of text segments contained in the report text; determining a text segment code corresponding to a text segment based on the semantic code and positional code of the characters contained in the text segment, wherein the text segment code includes at least an absolute position difference code, the absolute position difference code being used to represent the difference between a first positional code of the start character and a second positional code of the end character of the corresponding text segment; and performing entity recognition on the report text based on the text segment code corresponding to each text segment.
[0008] According to another aspect of the present disclosure, a storage medium is also provided, the storage medium including a stored program, wherein the methods described above are executed by a processor when the program is running.
[0009] According to another aspect of the present disclosure, an entity recognition device for an ultrasound report is also provided, comprising: an acquisition module for acquiring the report text of an ultrasound report; a text segment determination module for determining the semantic code and position code corresponding to each character in the report text, and determining a plurality of text segments contained in the report text; a text segment encoding determination module for determining a text segment code corresponding to a text segment based on the semantic code and position code of the characters contained in the text segment, wherein the text segment code includes at least an absolute position difference code, the absolute position difference code being used to represent the difference between a first position code of the start character and a second position code of the end character of the corresponding text segment; and an entity recognition module for performing entity recognition on the report text based on the text segment code corresponding to each text segment.
[0010] According to another aspect of the present disclosure, an entity recognition device for an ultrasound report is also provided, comprising: a processor; and a memory connected to the processor, configured to provide the processor with instructions to perform the following processing steps: acquiring the report text of the ultrasound report; determining the semantic code and position code corresponding to each character in the report text, and determining a plurality of text segments contained in the report text; determining a text segment code corresponding to a text segment based on the semantic code and position code of the characters contained in the text segment, wherein the text segment code includes at least an absolute position difference code, the absolute position difference code being used to represent the difference between a first position code of the start character and a second position code of the end character of the corresponding text segment; and performing entity recognition on the report text based on the text segment code corresponding to each text segment.
[0011] In this embodiment, according to the technical solution, in the scenario of entity recognition of an ultrasound report, multiple text segments in the report text are first identified. Then, the text segment code of the text segment is determined based on the semantic and positional encoding of the characters in the corresponding text segment. In particular, the text segment code of the corresponding text segment includes absolute position difference encoding, which can represent the absolute positional difference between the two ends of the text segment in the original report text. Then, the computing device can perform entity recognition on the corresponding text segment based on the text segment code, for example, determining whether the corresponding text segment belongs to an entity and what type of entity it belongs to based on the text segment code. This solution introduces absolute position difference encoding in entity recognition, which helps to distinguish similar structures at the beginning and end of a text segment (such as "no abnormality found" and "abnormality not found"); suppress noise spans far from the key description area (i.e., text segments that do not belong to entities); and improve sensitivity to fixed template positions (such as "approximately X cm in size" often appears in the middle of the report text). Thus, in scenarios similar to entity recognition of ultrasound reports, the entity recognition method provided by this embodiment can improve the accuracy of entity recognition. Attached Figure Description
[0012] The accompanying drawings, which are included to provide a further understanding of this disclosure and form part of this application, illustrate exemplary embodiments of this disclosure and are used to explain this disclosure, but do not constitute an undue limitation of this disclosure. In the drawings: Figure 1 This is a hardware structure block diagram of a computing device for implementing the method described in Embodiment 1 of this disclosure; Figure 2 This is a flowchart illustrating the entity recognition method for ultrasound reports according to the first aspect of Embodiment 1 of this disclosure; Figure 3 This is a schematic diagram illustrating the relationship between the report text, text fragments, and characters as described in the first aspect of Embodiment 1 of this disclosure; Figure 4 This is a schematic diagram of a process for entity recognition using an entity judgment model and an entity type recognition model, according to the first aspect of Embodiment 1 of this disclosure. Figure 5 This is a schematic diagram of the entity recognition device for ultrasound reports according to Embodiment 2 of this disclosure; and Figure 6 This is a schematic diagram of an entity recognition device for ultrasound reports according to Embodiment 3 of this disclosure. Detailed Implementation
[0013] To enable those skilled in the art to better understand the technical solutions of this disclosure, the technical solutions of the embodiments of this disclosure will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are merely some embodiments of this disclosure, and not all embodiments. Based on the embodiments of this disclosure, all other embodiments obtained by those skilled in the art without creative effort should fall within the scope of protection of this disclosure.
[0014] It should be noted that the terms "first," "second," etc., in the specification, claims, and accompanying drawings of this disclosure are used to distinguish similar objects and are not necessarily used to describe a specific order or sequence. It should be understood that such data can be interchanged where appropriate so that the embodiments of this disclosure described herein can be implemented in orders other than those illustrated or described herein. Furthermore, the terms "comprising" and "having," and any variations thereof, are intended to cover non-exclusive inclusion; for example, a process, method, system, product, or apparatus that comprises a series of steps or units is not necessarily limited to those steps or units explicitly listed, but may include other steps or units not explicitly listed or inherent to such processes, methods, products, or apparatus.
[0015] Example 1 According to this embodiment, a method embodiment for entity recognition in an ultrasound report is provided. It should be noted that the steps shown in the flowchart in the accompanying drawings can be executed in a computer system such as a set of computer-executable instructions. Also, although a logical order is shown in the flowchart, in some cases, the steps shown or described may be executed in a different order than that shown here.
[0016] The method embodiments provided in this example can be executed on a computer terminal, server, or similar computing device. Figure 1 A hardware block diagram of a computing device for implementing an entity recognition method in ultrasound reporting is shown. Figure 1 As shown, a computing device may include one or more processors (processors may include, but are not limited to, microprocessors such as MCUs or programmable logic devices such as FPGAs), a memory for storing data, a transmission device for communication functions, and an input / output interface. The memory, transmission device, and input / output interface are connected to the processor via a bus. In addition, it may also include a display, keyboard, and cursor control device connected to the input / output interface. Those skilled in the art will understand that... Figure 1 The structure shown is for illustrative purposes only and does not limit the structure of the aforementioned electronic device. For example, a computing device may also include... Figure 1 The more or fewer components shown, or having the same Figure 1The different configurations shown.
[0017] It should be noted that the aforementioned one or more processors and / or other data processing circuits are generally referred to herein as "data processing circuits". These data processing circuits may be embodied, in whole or in part, in software, hardware, firmware, or any other combination thereof. Furthermore, the data processing circuits may be a single, independent processing module, or may be integrated, in whole or in part, into any other element in a computing device. As involved in the embodiments of this disclosure, the data processing circuits serve as processor control (e.g., selection of a variable resistor termination path connected to an interface).
[0018] The memory can be used to store software programs and modules of application software, such as the program instructions / data storage device corresponding to the entity recognition generation method for ultrasound reports in this embodiment of the present disclosure. The processor executes various functional applications and data processing by running the software programs and modules stored in the memory, thereby realizing the entity recognition method for ultrasound reports of the aforementioned application. The memory may include high-speed random access memory, and may also include non-volatile memory, such as one or more magnetic storage devices, flash memory, or other non-volatile solid-state memory. In some instances, the memory may further include memory remotely located relative to the processor, and these remote memories can be connected to the computing device via a network. Examples of the aforementioned networks include, but are not limited to, the Internet, corporate intranets, local area networks, mobile communication networks, and combinations thereof.
[0019] The transmission device is used to receive or send data via a network. Specific examples of the network described above may include a wireless network provided by the computing device's communication provider. In one example, the transmission device includes a Network Interface Controller (NIC), which can connect to other network devices via a base station to communicate with the Internet. In another example, the transmission device may be a Radio Frequency (RF) module used for wireless communication with the Internet.
[0020] The display can be, for example, a touchscreen liquid crystal display (LCD), which allows users to interact with the user interface of the computing device.
[0021] It should be noted here that, in some optional embodiments, the above... Figure 1 The computing device shown may include hardware elements (including circuitry), software elements (including computer code stored on a computer-readable medium), or a combination of both hardware and software elements. It should be noted that... Figure 1 This is only one instance of a specific particular instance, and is intended to illustrate the types of components that may exist in the aforementioned computing devices.
[0022] Under the aforementioned operating environment, according to the first aspect of this embodiment, a method for entity recognition in ultrasound reports is provided, the method comprising: Figure 1 The computing device shown is implemented. Figure 2 A flowchart illustrating the method is shown below. (Refer to...) Figure 2 As shown, the method includes: S202: Obtain the report text of the ultrasound report; S204: Determine the semantic and positional codes for each character in the report text, and determine the multiple text fragments contained in the report text; S206: Determine the text segment code corresponding to the text segment based on the semantic and positional codes of the characters contained in the text segment. The text segment code includes at least an absolute positional difference code, which is used to represent the difference between the first positional code of the start character and the second positional code of the end character of the corresponding text segment. S208: Perform entity recognition on the report text based on the text segment code corresponding to each text segment.
[0023] First, the computing device can obtain the report text of the ultrasound report (S202).
[0024] Then, the computing device can determine the semantic and positional encoding of each character in the report text, as well as the multiple text segments contained in the report text (S204).
[0025] For example, the report text might read, "A 2.3cm hypoechoic nodule with clear borders was observed in the left lobe of the liver." The computing device can segment the report text character by character to obtain a text sequence. This text sequence is then input into a semantic encoder (e.g., a pre-trained language model like MedicalBERT) to determine the semantic code for each character in the text sequence, as shown in the following formula:
[0026] in, Let be the semantic code for the i-th character in the text sequence, d be the feature dimension of the semantic code, and n be the number of characters in the text sequence. Furthermore, the computing device also determines the positional code for each character in the text sequence, as shown in the following formula.
[0027]
[0028] in, Encode the position of the i-th character in the text sequence. This is a feature dimension for positional encoding. Positional encoding is used to represent the absolute position information of the corresponding character in the report text.
[0029] The positional encoding of the corresponding character can be the encoding output by the positional encoding layer (position embedding layer) in the pre-trained medical language model. Alternatively, the positional information of the character (the positional information of the character in the report text) can be embedded by an independent positional embedding layer to obtain the positional encoding of the corresponding character.
[0030] Before performing entity recognition, the computing device needs to identify multiple text segments contained in the report text. A text segment refers to any character, word, or phrase that could potentially constitute an entity (in the context of ultrasound report entity recognition, this could be a medically related entity). Specifically, each text segment in the report text can be identified through enumeration; the method for identifying text segments will be explained later.
[0031] Then, the computing device can determine the text segment code corresponding to the text segment based on the semantic and positional codes of each character contained in the text segment (S206). The text segment code includes at least an absolute positional difference code, which is used to represent the difference between the first positional code of the starting character and the second positional code of the ending character of the corresponding text segment. That is, the absolute positional difference code can represent the positional difference between the two ends of the corresponding text segment in the report text (original text).
[0032] Finally, the computing device can perform entity recognition on the report text based on the text segment encoding corresponding to each text segment (S208).
[0033] Specifically, Figure 3 The diagram uses graphics to illustrate the relationships between report text, text fragments, and characters. Figure 3 The report text uses small squares to represent individual characters, from... Figure 3 As can be seen, each text fragment contains at least one character, and the report text may contain multiple text fragments, which may overlap.
[0034] Optionally, the operation of determining multiple text segments in the report text includes: determining multiple sets of entity start positions and entity end positions based on the report text and a pre-trained word position recognition model, and determining multiple text segments based on the multiple sets of entity start positions and entity end positions; and / or performing word segmentation based on the report text to obtain word segmentation results, and enumerating multiple text segments contained in the report text based on the word segmentation results.
[0035] In this embodiment, since it is necessary to further determine the entities and entity types based on the text fragments in subsequent steps, the computing device needs to determine all text fragments (spans) in the report text that may belong to entities, thereby improving the performance of subsequent entity recognition.
[0036] Specifically, the computing device can input the report text into a pre-trained word location recognition model to determine multiple sets of entity start positions and entity end positions. Each set of entity start and end positions can identify a text segment present in the report text. The word location recognition model is pre-trained in a supervised manner.
[0037] Furthermore, the computing device can also identify all text fragments present in the report text through enumeration. Specifically, the computing device can first perform word segmentation on the report text, obtaining segmentation results, which may contain the individual words or characters segmented from the report text. Then, based on the segmentation results, the computing device can combine words that can be further combined (such as consecutive words in a sentence) to obtain combined words. Both the combined words and the words or characters in the segmentation results can be used as text fragments, thereby enumerating as many text fragments as possible contained in the report text.
[0038] As described in the background section, ultrasound reports contain numerous technical terms and abbreviations, and the same concept often has multiple expressions (such as "echo enhancement" and "hyperecho"). Existing entity recognition methods have low accuracy in scenarios similar to ultrasound reports.
[0039] Therefore, in the scenario of entity recognition in ultrasound reports, this solution first identifies multiple text segments in the report text, and then determines the text segment code based on the semantic and positional codes of the characters in the corresponding text segments. In particular, the text segment code includes absolute position difference coding, which represents the absolute positional difference between the two ends of the text segment in the original report text. Then, the computing device can perform entity recognition on the corresponding text segment based on the text segment code, for example, determining whether the corresponding text segment belongs to an entity and what type of entity it belongs to. This solution introduces absolute position difference coding into entity recognition, which helps the model determine the absolute position of the text segment span in the report text, thereby further improving the accuracy of entity recognition in the report text. For example, by introducing absolute position difference coding, it can suppress noisy spans far from key descriptive regions (i.e., text segments that do not belong to entities); and improve sensitivity to fixed template positions (such as "approximately X cm in size" often appearing in the middle of the report text). Therefore, in scenarios similar to entity recognition in ultrasound reports, the entity recognition method provided in this embodiment can improve the accuracy of entity recognition.
[0040] Optionally, the text segment code corresponding to the text segment is determined based on the semantic and positional codes of the characters contained in the text segment, including: determining the first semantic code of the starting character and the second semantic code of the ending character in the text segment; averaging the semantic codes of each character contained in the text segment to determine the average semantic code corresponding to each character in the text segment; determining the length code of the text segment; determining the first positional code of the starting character and the second positional code of the ending character in the text segment, and determining the difference between the first positional code and the second positional code to obtain the absolute positional difference code; and determining the text segment code of the text segment based on the first semantic code of the starting character, the second semantic code of the ending character, the average semantic code, the length code, and the absolute positional difference code.
[0041] Specifically, after determining the semantic and positional codes of each character in the report text, as well as the text segments within the report text, the computing device can determine the text segment code corresponding to each text segment. The text segment code for any text segment in the report text is shown in the following formula:
[0042] Where i represents the position of the first character of the text segment (i.e., the first character in the text segment) in the report text, and j represents the position of the last character of the text segment (i.e., the last character in the text segment) in the report text. In other words, This represents the text segment encoding of a text segment from the i-th character to the j-th character in the report text. The semantic encoding (first semantic encoding) of the starting character in the corresponding text segment. The semantic encoding (second semantic encoding) of the ending character in the corresponding text segment. This represents the average semantic code obtained by averaging the semantic codes of each character contained in the corresponding text segment. This represents the length encoding obtained by vectorizing the length information of the corresponding text segment. This length encoding is used to distinguish text segments (spans) of different lengths. The length encoding can be a learnable vector that can be obtained through a length encoding layer. This represents the absolute position difference code of the corresponding text segment, which is the difference between the position code of the start character (first position code) and the position code of the end character (second position code). This absolute position difference code is used to represent the absolute positional difference between the two ends of the text segment (Span) in the report text.
[0043] Although the span length has been increased from Capture, but absolute position difference encoding ( It retains directional and global positioning information. For example, "nodule is located in the left liver" and "nodule found in the left liver" have similar words but different locations. This difference helps the model perceive the start and end coordinates of the text segment in the full text of the report, improving the accuracy of boundary judgment.
[0044] Optionally, the operation of entity recognition of the report text based on the text fragment encoding includes: inputting the text fragment encoding into an entity judgment model to obtain an entity judgment result, wherein the entity judgment result is used to indicate whether the text fragment corresponding to the text fragment encoding belongs to the target entity; and, if it is determined from the entity judgment result that the text fragment corresponding to the text fragment encoding belongs to the target entity, determining the entity type of the text fragment corresponding to the text fragment encoding through an entity type recognition model based on the text fragment encoding.
[0045] For details, please refer to Figure 4 As shown, after the computing device determines the text segment code of the text fragment, it can input the text segment code into the entity recognition model to determine whether the text fragment belongs to the target entity. In the scenario of entity recognition of ultrasound reports, the target entity can refer to any type of entity related to the ultrasound report. The entity recognition model is a binary classifier. The calculation process is shown in the following formula:
[0046] in This represents the Sigmoid function, W is the weight matrix of the entity judgment model, and b is the bias. This indicates whether the corresponding text segment (Span) belongs to any type of entity. In other words, the goal of the entity identification model is to determine whether the corresponding text segment (Span) is an entity or not. Binary cross-entropy loss is used during training. If the text segment covers any target entity (regardless of the entity type), it is a positive sample; otherwise, if the text segment does not belong to any target entity, it is a negative sample.
[0047] Continuing with the example of the report text "A 2.3cm hypoechoic nodule with clear borders was observed in the left lobe of the liver," the output results of the entity judgment model are shown in Table 1 below.
[0048] Table 1
[0049] Optionally, the operation of determining the entity type of the text fragment corresponding to the text fragment encoding through an entity type recognition model based on the text fragment encoding includes: determining the entity type of the text fragment corresponding to the text fragment encoding through an entity type recognition model based on the text fragment encoding, the context encoding corresponding to the report text, and the type hint encoding.
[0050] Further reference Figure 4 As shown, after the computing device determines all text segments that are entities through the entity judgment model, it can determine the entity type of the corresponding text segment through the entity type recognition model.
[0051] Specifically, to better distinguish the entity types of text fragments, more types of features are introduced in this step. That is, for a text fragment that has been identified as an entity, an information-enhanced encoding corresponding to that text fragment is constructed. The information-enhanced encoding includes the text fragment encoding, the context encoding corresponding to the report text, and the type hint encoding, as shown in the following formula:
[0052] Indicates information enhancement coding, Indicates context encoding, This represents the type hint encoding. This type hint encoding can be used to indicate the type of each entity. The predefined entity types mentioned later can be converted into an encoded form through a preset type encoding layer to obtain the corresponding type hint encoding. Context encoding can be a global representation of the entire report text, such as the [CLS] tag vector output by the semantic encoder MedicalBERT. Context encoding can also be the text segment encoding of two text segments adjacent to each other in the report text.
[0053] Then, the computing device can enhance the encoding of the information in the text fragment. The input entity type recognition model (a multi-classifier, such as a model structure using fully connected layers and a softmax layer) determines the entity type of the corresponding text fragment. Predefined entity types include: "conjunction," "positive sign," "negative sign," "location," "proper noun," "location," "attribute," "state," "qualitative," "numerical unit," "unit of measurement," and "non-entity." In other words, the entity type of the text fragment determined by the entity type recognition model belongs to any one or any combination of these predefined entity types.
[0054] In the context of entity recognition in ultrasound reports, the same text fragment may belong to different entities simultaneously. Therefore, the entity type of a text fragment identified by an entity type recognition model can have multiple entity types.
[0055] The "Non-Entity" type is used to filter text fragments that the entity judgment model mistakenly identifies as not entities but are actually non-entities (false positives).
[0056] Continuing with the examples shown in Table 1, specific examples of determining the entity type of text fragments using the entity type recognition model are shown in Table 2 below. As can be seen from Table 2, text fragments for entity type recognition using the entity type recognition model only include: text fragments that have been determined to belong to entities by the entity judgment model.
[0057] Table 2
[0058] As shown in Table 2, the two-layer judgment mechanism of entity type recognition model and entity judgment model can more accurately filter out text fragments that are misclassified as entities but are not actually entities. Furthermore, the entity type recognition model can output multiple entity types to which the same text fragment belongs. In the scenario of entity recognition in ultrasound reports, the definition of entity types is often ambiguous (e.g., there is overlap between "proper noun" and "positive sign"). This approach can solve the problem of inaccurate entity recognition caused by overlap between different entity types (e.g., existing entity recognition methods may only identify one entity type).
[0059] During the training phase, the computing device uses multi-class cross-entropy loss to train the entity type recognition model. It should be noted that both the entity type recognition model and the entity judgment model are pre-trained using supervised learning. The position embedding layer and length encoding layer mentioned above can participate in the training of the entity judgment model and the entity type recognition model, sharing the loss of both models.
[0060] In addition, refer to Figure 1 As shown, according to a second aspect of this embodiment, a storage medium is provided. The storage medium includes a stored program, wherein, when the program is executed, a processor performs any of the methods described above.
[0061] Therefore, according to the technical solution of this embodiment, firstly, all text segments (Span) in the report text that may be entities can be enumerated. Then, the text segment code of each text segment is determined. The text segment code includes the semantic code of the start character, the semantic code of the end character, the average semantic code of all characters, the length code, and the absolute position difference code. This can reflect the semantics of the text segment and the absolute position and absolute length of the text segment in the report text. Then, the text segment code is used to determine whether the text segment is an entity, thereby improving the accuracy of entity judgment. Furthermore, the rich semantic and contextual information, such as text segment code, context code, and type hint code, is used to determine the entity type of the text segment that has been judged as an entity, thereby further improving the accuracy of entity type recognition.
[0062] It should be noted that, for the sake of simplicity, the foregoing method embodiments are all described as a series of actions. However, those skilled in the art should understand that the present invention is not limited to the described order of actions, because according to the present invention, some steps can be performed in other orders or simultaneously. Furthermore, those skilled in the art should also understand that the embodiments described in the specification are preferred embodiments, and the actions and modules involved are not necessarily essential to the present invention.
[0063] Through the above description of the embodiments, those skilled in the art can clearly understand that the methods according to the above embodiments can be implemented by means of software plus necessary general-purpose hardware platforms. Of course, they can also be implemented by hardware, but in many cases the former is a better implementation method. Based on this understanding, the technical solution of the present invention, in essence, or the part that contributes to the prior art, can be embodied in the form of a software product. This computer software product is stored in a storage medium (such as ROM / RAM, magnetic disk, optical disk) and includes several instructions to cause a terminal device (which may be a mobile phone, computer, server, or network device, etc.) to execute the methods described in the various embodiments of the present invention.
[0064] Example 2 Figure 5 An entity recognition device 500 for ultrasound reports according to this embodiment is shown, which corresponds to the method described according to the first aspect of Embodiment 1. (See reference...) Figure 5As shown, the entity recognition device includes: an acquisition module 510 for acquiring the report text of an ultrasound report; a text fragment determination module 520 for determining the semantic code and position code corresponding to each character in the report text, and for determining multiple text fragments contained in the report text; a text fragment encoding determination module 530 for determining the text fragment encoding corresponding to the text fragment based on the semantic code and position code of the characters contained in the text fragment, wherein the text fragment encoding includes at least an absolute position difference code, the absolute position difference code being used to represent the difference between the first position code of the start character and the second position code of the end character of the corresponding text fragment; and an entity recognition module 540 for performing entity recognition on the report text based on the text fragment encoding corresponding to each text fragment.
[0065] Optionally, the text fragment determination module 520 is used to determine multiple sets of entity start positions and entity end positions based on the report text and a pre-trained word position recognition model, and to determine multiple text fragments based on the multiple sets of entity start positions and entity end positions; and / or to perform word segmentation based on the report text to obtain word segmentation results, and to enumerate multiple text fragments contained in the report text based on the word segmentation results.
[0066] Optionally, the text segment encoding determination module 530 is used to determine the first semantic code of the starting character and the second semantic code of the ending character in the text segment; average the semantic codes of each character contained in the text segment to determine the average semantic code corresponding to each character contained in the text segment; determine the length code of the text segment; determine the first position code of the starting character and the second position code of the ending character in the text segment, and determine the difference between the first position code and the second position code to obtain the absolute position difference code; and determine the text segment encoding of the text segment based on the first semantic code of the starting character and the second semantic code of the ending character, the average semantic code, the length code and the absolute position difference code.
[0067] Optionally, the entity recognition module 540 is used to input the text fragment encoding into the entity judgment model to obtain the entity judgment result, which is used to indicate whether the text fragment corresponding to the text fragment encoding belongs to the target entity; and when it is determined that the text fragment corresponding to the text fragment encoding belongs to the target entity according to the entity judgment result, the entity type of the text fragment corresponding to the text fragment encoding is determined by the entity type recognition model according to the text fragment encoding.
[0068] Optionally, the entity recognition module 540 is used to determine the entity type of the text fragment corresponding to the text fragment encoding based on the text fragment encoding, the context encoding corresponding to the report text, and the type hint encoding, through an entity type recognition model.
[0069] Therefore, according to the technical solution of this embodiment, all possible text segments (Span) in the report text can first be enumerated, and then the text segment code of each text segment can be determined. The text segment code includes the semantic code of the start character, the semantic code of the end character, the average semantic code of all characters, the length code, and the absolute position difference code, so as to reflect the semantics of the text segment and the absolute position and absolute length of the text segment in the report text. Then, the text segment code is used to determine whether the text segment is an entity, thereby improving the accuracy of entity judgment. Furthermore, the entity type of the text segment that has been judged as an entity is determined by the text segment code, context code, and type hint code, thereby further improving the accuracy of entity type recognition.
[0070] Example 3 Figure 6 An entity recognition device 600 for ultrasound reports according to this embodiment is shown, which corresponds to the method described according to the first aspect of Embodiment 1. Reference Figure 6 As shown, the entity recognition device includes: a processor 610; and a memory 620 connected to the processor 610, for providing the processor 610 with instructions to process the following steps: acquiring the report text of an ultrasound report; determining the semantic code and position code corresponding to each character in the report text, and determining multiple text segments contained in the report text; determining the text segment code corresponding to the text segment based on the semantic code and position code of the characters contained in the text segment, wherein the text segment code includes at least an absolute position difference code, the absolute position difference code being used to represent the difference between the first position code of the start character and the second position code of the end character of the corresponding text segment; and performing entity recognition on the report text based on the text segment code corresponding to each text segment.
[0071] Optionally, the operation of determining multiple text segments in the report text includes: determining multiple sets of entity start positions and entity end positions based on the report text and a pre-trained word position recognition model, and determining multiple text segments based on the multiple sets of entity start positions and entity end positions; and / or performing word segmentation based on the report text to obtain word segmentation results, and enumerating multiple text segments contained in the report text based on the word segmentation results.
[0072] Optionally, the text segment code corresponding to the text segment is determined based on the semantic and positional codes of the characters contained in the text segment, including: determining the first semantic code of the starting character and the second semantic code of the ending character in the text segment; averaging the semantic codes of each character contained in the text segment to determine the average semantic code corresponding to each character in the text segment; determining the length code of the text segment; determining the first positional code of the starting character and the second positional code of the ending character in the text segment, and determining the difference between the first positional code and the second positional code to obtain the absolute positional difference code; and determining the text segment code of the text segment based on the first semantic code of the starting character, the second semantic code of the ending character, the average semantic code, the length code, and the absolute positional difference code.
[0073] Optionally, the operation of entity recognition of the report text based on the text fragment encoding includes: inputting the text fragment encoding into an entity judgment model to obtain an entity judgment result, wherein the entity judgment result is used to indicate whether the text fragment corresponding to the text fragment encoding belongs to the target entity; and, if it is determined from the entity judgment result that the text fragment corresponding to the text fragment encoding belongs to the target entity, determining the entity type of the text fragment corresponding to the text fragment encoding through an entity type recognition model based on the text fragment encoding.
[0074] Optionally, the operation of determining the entity type of the text fragment corresponding to the text fragment encoding through an entity type recognition model based on the text fragment encoding includes: determining the entity type of the text fragment corresponding to the text fragment encoding through an entity type recognition model based on the text fragment encoding, the context encoding corresponding to the report text, and the type hint encoding.
[0075] Therefore, according to the technical solution of this embodiment, all possible text segments (Span) in the report text can first be enumerated, and then the text segment code of each text segment can be determined. The text segment code includes the semantic code of the start character, the semantic code of the end character, the average semantic code of all characters, the length code, and the absolute position difference code, so as to reflect the semantics of the text segment and the absolute position and absolute length of the text segment in the report text. Then, the text segment code is used to determine whether the text segment is an entity, thereby improving the accuracy of entity judgment. Furthermore, the entity type of the text segment that has been judged as an entity is determined by the text segment code, context code, and type hint code, thereby further improving the accuracy of entity type recognition.
[0076] The sequence numbers of the above embodiments of the present invention are for descriptive purposes only and do not represent the superiority or inferiority of the embodiments.
[0077] In the above embodiments of the present invention, the descriptions of each embodiment have different focuses. For parts not described in detail in a certain embodiment, please refer to the relevant descriptions of other embodiments.
[0078] In the several embodiments provided in this application, it should be understood that the disclosed technical content can be implemented in other ways. The device embodiments described above are merely illustrative; for example, the division of units is only a logical functional division, and in actual implementation, there may be other division methods. For example, multiple units or components may be combined or integrated into another system, or some features may be ignored or not executed. Furthermore, the displayed or discussed mutual coupling, direct coupling, or communication connection may be through some interfaces; the indirect coupling or communication connection between units or modules may be electrical or other forms.
[0079] The units described as separate components may or may not be physically separate. The components shown as units may or may not be physical units; that is, they may be located in one place or distributed across multiple network units. Some or all of the units can be selected to achieve the purpose of this embodiment according to actual needs.
[0080] Furthermore, the functional units in the various embodiments of the present invention can be integrated into one processing unit, or each unit can exist physically separately, or two or more units can be integrated into one unit. The integrated unit can be implemented in hardware or as a software functional unit.
[0081] If the integrated unit is implemented as a software functional unit and sold or used as an independent product, it can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of the present invention, in essence, or the part that contributes to the prior art, or all or part of the technical solution, can be embodied in the form of a software product. This computer software product is stored in a storage medium and includes several instructions to cause a computer device (which may be a personal computer, server, or network device, etc.) to execute all or part of the steps of the methods described in the various embodiments of the present invention. The aforementioned storage medium includes various media capable of storing program code, such as USB flash drives, read-only memory (ROM), random access memory (RAM), portable hard drives, magnetic disks, or optical disks.
[0082] The above description is only a preferred embodiment of the present invention. It should be noted that for those skilled in the art, several improvements and modifications can be made without departing from the principle of the present invention, and these improvements and modifications should also be considered within the scope of protection of the present invention.
Claims
1. A method for entity recognition in an ultrasound report, characterized in that, include: Obtain the text of the ultrasound report; Determine the semantic and positional encodings of each character in the report text, and determine the multiple text fragments contained in the report text; Based on the semantic and positional encodings of the characters contained in the text segment, a text segment encoding corresponding to the text segment is determined. This text segment encoding includes at least an absolute positional difference encoding, which represents the difference between the first positional encoding of the starting character and the second positional encoding of the ending character of the corresponding text segment. Entity recognition is performed on the report text based on the text segment code corresponding to each text segment.
2. The method according to claim 1, characterized in that, The operation of determining multiple text fragments in the report text includes: Based on the report text, and using a pre-trained word position recognition model, multiple sets of entity start positions and entity end positions are determined, and multiple text segments are determined based on these multiple sets of entity start positions and entity end positions; and / or The report text is segmented into words to obtain segmentation results, and multiple text fragments contained in the report text are enumerated based on the segmentation results.
3. The method according to claim 1, characterized in that, Based on the semantic and positional encodings of the characters contained in the text segment, the text segment encoding corresponding to the text segment is determined, including: Determine the first semantic code of the start character and the second semantic code of the end character in the text segment; The semantic codes of each character contained in the text segment are averaged to determine the average semantic code corresponding to each character contained in the text segment; Determine the length encoding of the text segment; Determine the first position code of the starting character and the second position code of the ending character in the text segment, and determine the difference between the first position code and the second position code to obtain the absolute position difference code; and The text segment encoding is determined based on the first semantic code of the starting character, the second semantic code of the ending character, the average semantic code, the length code, and the absolute position difference code of the text segment.
4. The method according to claim 1, characterized in that, The operation of entity recognition on the report text based on the text fragment encoding includes: The encoded text fragment is input into an entity determination model to obtain an entity determination result, which indicates whether the text fragment corresponding to the encoded text fragment belongs to the target entity; and If, based on the entity determination result, it is determined that the text fragment corresponding to the text fragment encoding belongs to the target entity, then, based on the text fragment encoding, the entity type of the text fragment corresponding to the text fragment encoding is determined through an entity type recognition model.
5. The method according to claim 4, characterized in that, Based on the text fragment encoding, the operation of determining the entity type of the text fragment corresponding to the text fragment encoding using an entity type recognition model includes: Based on the text fragment encoding, the context encoding corresponding to the report text, and the type hint encoding, the entity type of the text fragment corresponding to the text fragment encoding is determined by the entity type recognition model.
6. A storage medium, characterized in that, The storage medium includes a stored program, wherein, when the program is executed, the method described in any one of claims 1 to 5 is performed by a processor.
7. An entity recognition device for ultrasound reports, characterized in that, include: The acquisition module is used to acquire the report text of the ultrasound report; The text fragment determination module is used to determine the semantic encoding and positional encoding corresponding to each character in the report text, and to determine multiple text fragments contained in the report text; A text segment encoding determination module is used to determine a text segment encoding corresponding to the text segment based on the semantic and positional encodings of the characters contained in the text segment. The text segment encoding includes at least an absolute positional difference encoding, which represents the difference between the first positional encoding of the starting character and the second positional encoding of the ending character of the corresponding text segment. The entity recognition module is used to perform entity recognition on the report text based on the text segment encoding corresponding to each text segment.
8. The apparatus according to claim 7, characterized in that, The text segment determination module is used to: determine multiple sets of entity start positions and entity end positions based on the report text and a pre-trained word position recognition model; determine multiple text segments based on the multiple sets of entity start positions and entity end positions; and / or perform word segmentation based on the report text to obtain word segmentation results; and enumerate multiple text segments contained in the report text based on the word segmentation results.
9. The apparatus according to claim 7, characterized in that, The text segment encoding determination module is used to: determine the first semantic code of the starting character and the second semantic code of the ending character in the text segment; average the semantic codes of each character contained in the text segment to determine the average semantic code corresponding to each character contained in the text segment; and determine the length code of the text segment. The first position code of the starting character and the second position code of the ending character in the text segment are determined, and the difference between the first position code and the second position code is determined to obtain the absolute position difference code; and the text segment code of the text segment is determined according to the first semantic code of the starting character, the second semantic code of the ending character, the average semantic code, the length code and the absolute position difference code in the text segment.
10. An entity recognition device for ultrasound reports, characterized in that, include: processor; as well as A memory, connected to the processor, for providing the processor with instructions to perform the following processing steps: Obtain the text of the ultrasound report; Determine the semantic and positional encodings of the characters in the report text, and determine the multiple text fragments contained in the report text; Based on the semantic and positional codes of each character contained in the text segment, a text segment code corresponding to the text segment is determined. This text segment code includes at least an absolute positional difference code, which represents the difference between the first positional code of the starting character and the second positional code of the ending character of the corresponding text segment. Entity recognition is performed on the report text based on the text segment code corresponding to each text segment.
Citation Information
Patent Citations
Named entity identification method, electronic equipment and storage medium
CN112395882A
Nested entity identification method and system with low labeling cost
CN114547232A
Named entity extraction method and device, electronic equipment and storage medium
CN114638297A
Semantic enhancement type Chinese entity relation extraction method and system based on relation constraint
CN117252205A
Contract text processing method and device, electronic equipment and storage medium
CN117494719A