A document semantic information processing method, system, device and medium
By mapping measurable quantity information units to RGB channels, establishing and processing a mapped color image, the problem of semantic information loss in existing technologies is solved, and comprehensive representation and processing of measurable quantity information is achieved.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- SOUTH CHINA NORMAL UNIV
- Filing Date
- 2023-03-09
- Publication Date
- 2026-04-21
AI Technical Summary
Existing technologies, when processing measurable quantitative information of documents, suffer from the loss of overall semantic information due to the decoupling method, and cannot effectively represent the semantic information of measurable quantitative information.
By mapping measurable quantitative information units to RGB channels, a mapped color image is established, and corresponding processing tasks such as similarity judgment, domain classification, and error detection are performed. By combining color calculation and semantic calculation, the overall semantics of measurable quantitative information is fused and represented.
It effectively avoids the loss of overall semantic information, can better integrate and represent semantic information with measurable quantity information, and improves the accuracy and completeness of semantic information processing.
Smart Images

Figure CN116362254B_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of document information technology, and in particular to a method, system, apparatus and medium for processing document semantic information. Background Technology
[0002] In recent years, with the development of technologies such as big data and artificial intelligence, document information processing has taken on new directions, and people have begun to apply these technologies to document information processing. Among them, the ability to extract semantic information contained in documents and perform semantic calculations using these emerging technologies has attracted much attention due to its potential to greatly facilitate document information processing.
[0003] Currently, in the field of natural language processing, when processing the set of measurable quantitative information of a document, the usual approach is to decompose the set of measurable quantitative information into four parts (i.e., entities, values, units, and comparison relations) and then compare them separately. Although this decoupling approach can effectively combine mature technical solutions such as knowledge graphs and reinforcement learning, it also loses, to some extent, the semantic information represented by the measurable quantitative information as a whole. It cannot adequately represent the semantic information of the measurable quantitative information as a whole, which is not conducive to subsequent semantic information processing.
[0004] Therefore, the problems existing in the current technology still need to be solved and optimized. Summary of the Invention
[0005] The purpose of this application is to at least partially solve one of the technical problems existing in the related art.
[0006] Therefore, one objective of this application is to provide a method for processing document semantic information. This method combines color calculation and semantic calculation of measurable quantity information, thereby avoiding a certain degree of loss of overall semantic information. It can better integrate and represent the overall semantic information of measurable quantity information, thus providing some assistance to semantic information processing.
[0007] Another objective of this application is to provide a document semantic information processing system.
[0008] To achieve the above-mentioned technical objectives, the technical solutions adopted in the embodiments of this application include:
[0009] In a first aspect, embodiments of this application provide a method for processing document semantic information, including:
[0010] Obtain the information document to be parsed, and after parsing the information document, obtain all measurable quantity information units within the information document;
[0011] Each of the measurable quantity information units is mapped to an RGB channel to obtain the mapped color of each of the measurable quantity information units;
[0012] A mapped color image is constructed based on the mapped colors of all the measurable quantity information units;
[0013] Perform corresponding processing tasks based on the mapped color image.
[0014] In addition, the processing method according to the above embodiments of this application may also have the following additional technical features:
[0015] Furthermore, in one embodiment of this application, obtaining all measurable quantity information units within the information document after parsing it includes:
[0016] Parse the measurable quantity information of the information document to obtain a set of all measurable quantity information;
[0017] Each measurable quantity information unit is constructed according to each of the measurable quantity information sets. The measurable quantity information unit includes numerical information, entity semantics, and comparison relationships. The numerical information includes numerical value and unit.
[0018] Furthermore, in one embodiment of this application, mapping the measurable quantity information unit to an RGB channel to obtain the mapped color of the measurable quantity information unit includes:
[0019] Map the entity semantics to the R channel in the RGB channel, and obtain the R mapping value of the entity semantics in the R channel;
[0020] The numerical information is mapped to the G channel in the RGB channel, and the G mapping value of the numerical information mapped to the G channel is obtained;
[0021] Map the comparison relationship to the B channel in the RGB channel, and obtain the B mapping value of the comparison relationship to the B channel;
[0022] The mapping color of the measurable quantity information unit is determined based on the obtained R mapping value, G mapping value, and B mapping value.
[0023] Furthermore, in one embodiment of this application, performing the corresponding processing task based on the mapped color image includes:
[0024] The first mapped color image of the first measurable quantity information unit and the second mapped color image of the second measurable quantity information unit are determined based on the mapped color image.
[0025] The first mapped color image and the second mapped color image are overlaid to obtain an overlaid mapped color image;
[0026] The superimposed mapped color image is sequentially processed by grayscale and binarization to obtain a binary image;
[0027] The similarity between the first measurable quantity information unit and the second measurable quantity information unit is determined based on the binary image.
[0028] Further, in one embodiment of this application, the step of sequentially performing grayscale processing and binarization processing on the overlaid mapped color image to obtain a binary image includes:
[0029] Obtain the user-defined binarization threshold;
[0030] The superimposed mapped color image is subjected to grayscale processing to obtain a grayscale image, and the grayscale image is subjected to binarization processing according to the binarization threshold to obtain the binary image;
[0031] Wherein, when the grayscale value of the grayscale image is greater than the binarization threshold, the grayscale value of the binary image is 255, and when the grayscale value of the grayscale image is less than or equal to the binarization threshold, the grayscale value of the binary image is 0.
[0032] Furthermore, in one embodiment of this application, performing the corresponding processing task based on the mapped color image includes:
[0033] The mapped color of all the measurable quantity information units is determined based on the mapped color image;
[0034] Obtain the mapping rules between user-defined mapping colors and domains;
[0035] The measurable quantity information unit is classified into different domains based on a machine learning algorithm trained according to the corresponding rules and the mapped color of the measurable quantity information unit.
[0036] Furthermore, in one embodiment of this application, performing the corresponding processing task based on the mapped color image includes:
[0037] The mapped color cluster block where each measurable quantity information unit is located is determined based on the mapped color image;
[0038] Error detection of the measurable quantity information unit is achieved by performing noise analysis and / or discrete point analysis on each of the mapped color cluster blocks.
[0039] Secondly, embodiments of this application provide a document semantic information processing system, including:
[0040] The acquisition module is used to acquire the information document to be parsed, and to obtain all measurable quantity information units within the information document after parsing the information document;
[0041] The mapping module is used to map each of the measurable quantity information units to the RGB channels respectively, so as to obtain the mapped color of each of the measurable quantity information units;
[0042] A module is established to create a mapped color image based on the mapped colors of all the measurable quantity information units;
[0043] The processing module is used to perform corresponding processing tasks based on the mapped color image.
[0044] Thirdly, embodiments of this application also provide a document semantic information processing apparatus, including:
[0045] At least one processor;
[0046] At least one memory for storing at least one program;
[0047] When the at least one program is executed by the at least one processor, the at least one processor implements the document semantic information processing method of the first aspect described above.
[0048] Fourthly, embodiments of this application also provide a computer-readable storage medium storing a processor-executable program, which, when executed by a processor, is used to implement the document semantic information processing method described in the first aspect.
[0049] The advantages and beneficial effects of this application will be set forth in part in the description which follows, and in part will be obvious from the description, or may be learned by practice of this application:
[0050] This application discloses a method, system, apparatus, and medium for processing document semantic information. The method involves acquiring an information document to be parsed, parsing the document to obtain all measurable quantity information units within it, mapping each measurable quantity information unit to an RGB channel to obtain a mapped color for each unit, constructing a mapped color image based on the mapped colors of all the measurable quantity information units, and performing corresponding processing tasks based on the mapped color image. This method combines color calculation with semantic calculation of measurable quantity information, avoiding a certain degree of loss of overall semantic information. It can better integrate and represent the overall semantic information of measurable quantity information, thus providing some assistance in semantic information processing. Attached Figure Description
[0051] To more clearly illustrate the technical solutions in the embodiments of this application or the prior art, the following description is provided with accompanying drawings of the relevant technical solutions in the embodiments of this application or the prior art. It should be understood that the accompanying drawings described below are only for the purpose of clearly illustrating some embodiments of the technical solutions in this application. For those skilled in the art, other drawings can be obtained based on these drawings without any creative effort.
[0052] Figure 1 A flowchart illustrating a method for processing document semantic information provided in an embodiment of this application;
[0053] Figure 2 This is a specific schematic diagram of a mapped color image provided in an embodiment of this application;
[0054] Figure 3 A schematic diagram of a specific process for step 110 provided in an embodiment of this application;
[0055] Figure 4 A detailed flowchart of step 120 provided in an embodiment of this application;
[0056] Figure 5 A detailed flowchart of the first step 140 provided in the embodiments of this application;
[0057] Figure 6 A detailed flowchart of step 143 provided in an embodiment of this application;
[0058] Figure 7 A detailed flowchart of the second step 140 provided in this application embodiment;
[0059] Figure 8 A detailed flowchart of the third step 140 provided in the embodiments of this application;
[0060] Figure 9 This is a specific schematic diagram illustrating an error detection method provided in an embodiment of this application;
[0061] Figure 10 A schematic diagram of the structure of a document semantic information processing system provided in this application embodiment;
[0062] Figure 11 This is a schematic diagram of the structure of a document semantic information processing device provided in an embodiment of this application. Detailed Implementation
[0063] The embodiments of this application are described in detail below. Examples of these embodiments are shown in the accompanying drawings, wherein the same or similar reference numerals denote the same or similar elements or elements having the same or similar functions throughout. The embodiments described below with reference to the accompanying drawings are exemplary and are only used to explain this application, and should not be construed as limiting this application. The step numbers in the following embodiments are set only for ease of explanation, and there is no limitation on the order between the steps. The execution order of each step in the embodiments can be adaptively adjusted according to the understanding of those skilled in the art.
[0064] Unless otherwise defined, all technical and scientific terms used herein have the same meaning as commonly understood by one of ordinary skill in the art to which this application belongs. The terminology used herein is for the purpose of describing embodiments of this application only and is not intended to limit this application.
[0065] It should be noted that the technical features involved in the various embodiments of the present invention described below can be combined with each other as long as they do not conflict with each other.
[0066] Before providing a further detailed description of the embodiments of this application, some of the nouns and terms involved in the embodiments of this application will be explained. The nouns and terms involved in the embodiments of this application are subject to the following interpretations.
[0067] RGB: The RGB color system is a widely used color standard in today's society. It obtains various colors by changing the three color channels of red (R), green (G), and blue (B) and superimposing them. RGB represents the colors of the three channels of red, green, and blue.
[0068] Currently, in the field of natural language processing, when processing the set of measurable quantitative information of a document, the usual approach is to decompose the set of measurable quantitative information into four parts (i.e., entities, values, units, and comparison relations) and then compare them separately. Although this decoupling approach can effectively combine mature technical solutions such as knowledge graphs and reinforcement learning, it to some extent loses the semantic information represented by the measurable quantitative information itself as a whole, and cannot well represent the semantic information of the measurable quantitative information as a whole.
[0069] In view of this, embodiments of the present invention provide a method for processing document semantic information. This method combines color calculation and semantic calculation of measurable quantity information, avoiding a certain degree of loss of overall semantic information. It can better integrate and represent the overall semantic information of measurable quantity information, thus providing some assistance to semantic information processing.
[0070] Specifically, refer to Figure 1In this application embodiment, a method for processing document semantic information includes:
[0071] Step 110: Obtain the information document to be parsed, and after parsing the information document, obtain all measurable quantity information units within the information document;
[0072] In this step, the information document can be text and image materials created by people in social activities, using materials such as computer disks, solid-state drives, hard disks, magnetic disks, and optical disks as carriers. It relies on computer systems for access and can be transmitted over communication networks, mainly including electronic documents, electronic letters, electronic reports, electronic drawings, and electronic versions of paper documents. In the embodiments of this application, the information document can be any one of electronic documents, electronic letters, electronic reports, etc. This application is only for illustrative purposes and does not impose any limitations on the information document. Furthermore, to make the explanation of this application easy to understand, the specific embodiments are described using standard text documents as examples, while other types of documents, provided they meet the requirements of this application, also fall within the protection scope of this application.
[0073] Understandably, in the era of rapid development of big data, various industries have increased their demand for accurate acquisition of measurable quantitative information. Measurable quantitative information units are a flexible, interoperable and standardized format for representing measurable quantitative information. They can be used for information extraction and natural language processing tasks, and can better meet the demand for accurate acquisition of measurable quantitative information while also being compatible with various application systems.
[0074] Step 120: Map each of the measurable quantity information units to the RGB channels to obtain the mapped color of each of the measurable quantity information units;
[0075] In this step, RGB channel is the collective name for the three color channels in the RGB color system. The RGB color system is a color standard widely used in today's society. It obtains various colors by changing the three color channels of red (R), green (G), and blue (B) and superimposing them with each other.
[0076] It is understandable that the mapped color is the color displayed after the measurable quantity information unit is mapped to the RGB channel. Specifically, since the color mixing method of the RGB color system is to mix the colors of the three color channels and superimpose the brightness, and different measurable quantity information units will have certain differences in brightness in the three color channels, after color mixing and brightness superposition, the mapped colors of different measurable quantity information units mapped to the RGB channel are different.
[0077] Step 130: Establish a mapped color image based on the mapped colors of all the measurable quantity information units;
[0078] Step 140: Perform the corresponding processing task based on the mapped color image.
[0079] In steps 130 and 140, the mapped color image can be an image that includes the mapped colors of all measurable quantity information units. Because different measurable quantity information units exist, their colors and / or positions on the mapped color image will differ.
[0080] It is understood that the processing tasks include similarity judgment, domain classification, and error detection. Similarity judgment is used to determine the similarity between two or more measurable information units. Domain classification is used to classify the measurable information units to be classified based on all current measurable information units. Error detection is similar in principle to domain classification, and will not be elaborated further here. In the embodiments of this application, the similarity judgment of measurable information units can be the similarity judgment of measurable information units within a single document, or the similarity judgment of measurable information units between multiple documents. The domain classification and error detection of measurable information units are similar to the aforementioned content, and will not be elaborated further here. Furthermore, for the similarity judgment and domain classification of measurable information units, the similarity judgment and domain classification of measurable information units between multiple documents is a preferred choice in this application; for the error detection of measurable information units, the error detection of measurable information units within a single document is a preferred choice in this application.
[0081] Specifically, Figure 2 This application provides a mapped color image with three mapped color clusters located at the upper left, lower center, and upper right of the image. Taking the upper right cluster as an example, the mapped colors of the various mapped color points in the upper right cluster are similar or the same, although the positions of the mapped color points have slight differences. It is understood that the upper left and lower center clusters are similar to the upper right cluster, and will not be described further in this application.
[0082] Reference Figure 3 In some embodiments, step 110, obtaining all measurable quantity information units within the information document after parsing the information document, includes:
[0083] Step 111: Parse the measurable quantity information of the information document to obtain the set of all measurable quantity information;
[0084] Step 112: Construct corresponding measurable quantity information units according to each of the measurable quantity information sets, wherein the measurable quantity information unit includes numerical information, entity semantics and comparison relations, and the numerical information includes numerical value and unit.
[0085] In this embodiment of the application, the measurable quantity information of the parsed information document can be processed by natural language processing (NLP) technology. The obtained measurable quantity information set includes numerical information, entities and comparison relations. Then, semantic analysis technology is used to extract the semantics of the entities in the measurable quantity information set. The extracted entity semantics can be used together with numerical information and comparison relations to construct a measurable quantity information unit.
[0086] It is understood that entity semantics can be determined jointly by the entity, numerical information, and comparison relations, or by at least one of the entity, numerical information, or comparison relations. Specifically, the entity semantics corresponding to the entity "apple" could be "fruit" or "enterprise." Since measurable quantity information units with the entity semantics of "fruit" and measurable quantity information units with the entity semantics of "enterprise" differ in at least one of their entity semantics, numerical information, or comparison relations, they may present different mapped colors when mapped to RGB channels. Therefore, based on whether the unit included in the numerical information is "kg" or "kilogram," it can be determined that the entity semantics corresponding to the entity "apple" is "fruit," not "enterprise." It is worth noting that this application uses the example of determining the entity semantics corresponding to the entity "apple" when the unit included in the numerical information is "kg" or "kilogram" as a special example, merely for illustrative purposes and not intended to impose any limitations on this application.
[0087] It is also understood that in some embodiments, the numerical information and / or comparison relation attributes of the measurable quantity information set may be missing. Therefore, the semantics of entities in the measurable quantity information set can also be determined by parsing the document context content in which the entity resides using semantic analysis techniques. Specifically, the document context content for the entity "short sleeves" is "Summer is here, and people on the street are wearing short sleeves to make themselves feel comfortable." In this context content, the entity in the measurable quantity information set is "short sleeves." Since the numerical information attribute is missing, the numerical information is "blank." Since the comparison relation attribute is also missing, the comparison relation is "blank." The entity semantics of the entity "short sleeves" determined based on the context content can be "clothes." This example is for illustrative purposes only and does not constitute any limitation on this application.
[0088] It's also worth noting that when the numerical information and / or comparison relations of a set of measurable quantity information are "left blank," the numerical information and / or comparison relations of the corresponding constructed measurable quantity information units are also "left blank." Furthermore, "left blank" only indicates a partial absence of attributes in the numerical information and / or comparison relations. Specifically, numerical information includes both the value and the unit. If the unit is missing from the numerical information, but the value is present, then the numerical information can be "left blank." Understandably, based on the information loss status of the numerical information and / or comparison relations, characters corresponding to different levels of loss can be filled into the numerical information and / or comparison relations to represent the missing attributes.
[0089] Reference Figure 4 In some embodiments, step 120, mapping the measurable quantity information unit to an RGB channel to obtain the mapped color of the measurable quantity information unit, includes:
[0090] Step 121: Map the entity semantics to the R channel in the RGB channel, and obtain the R mapping value of the entity semantics in the R channel;
[0091] Step 122: Map the numerical information to the G channel in the RGB channel, and obtain the G mapping value of the numerical information mapped to the G channel;
[0092] Step 123: Map the comparison relationship to the B channel in the RGB channel, and obtain the B mapping value of the comparison relationship to the B channel;
[0093] Step 124: Determine the mapping color of the measurable quantity information unit based on the obtained R mapping value, G mapping value and B mapping value.
[0094] In this embodiment, entity semantics is mapped to the R channel, and the color representing entity semantics is red; numerical information is mapped to the G channel, and the color representing numerical information is green; comparison relations are mapped to the B channel, and the comparison relations are mapped to blue. It is understood that the channels mapped to entity semantics, numerical information, and comparison relations can be flexibly changed according to actual circumstances. For example, entity semantics can be mapped to the G channel, numerical information to the B channel, and comparison relations to the R channel. Simple substitution of mapping channels also falls within the scope of protection of this application, and will not be elaborated further here.
[0095] It is understandable that the R mapping value is used to represent the red component of the entity semantics in the mapped color. The larger the R mapping value, the more red component there is in the mapped color. The G mapping value and B mapping value are similar to those mentioned above regarding the R mapping value, and will not be elaborated further here. It is also understandable that the R mapping value, G mapping value, and B mapping value range from 0 to 255, and there are a total of 256 × 256 × 256 = 16,777,216 possible colors for mapping, which is sufficient to meet the needs of representing measurable information units.
[0096] It is understandable that, to fully represent entity semantics, the determined entity semantics are usually represented by high-dimensional entity semantic vectors. When mapping entity semantics to the R channel, it is necessary to extract features from the main feature categories of the entity semantic vector, reduce the dimensionality to dimension 1, and limit its output value range to 0 to 255. Since the R mapping value is obtained after feature extraction and dimensionality reduction of the main feature categories of the entity semantic vector, the entity semantics of measurable information units can be represented by the R mapping value on the R channel. Specifically, in the embodiments of this application, a neural network can be used to process the entity semantic vector accordingly, as shown in the following formula:
[0097]
[0098] Where R is the R-map value of the entity semantics on the R channel; neural_network is the neural network function; is the entity semantic vector of the neural network function; 1 is the target dimension of the entity semantic vector; 0 to 255 is the numerical range of the R mapping value.
[0099] It is understandable that, since the entities in a measurable quantity information set are closely semantically related to the entities in a measurable quantity information unit, the R-mapping value on the R channel can also be used to represent the entities in the measurable quantity information set. Furthermore, besides using neural networks to process entity semantic vectors, classical algorithms such as principal component analysis, factor analysis, and independence weight analysis can also be used, which will not be elaborated upon further in this application.
[0100] It is understandable that numerical information includes both numerical value and unit, and the numerical value and unit affect the semantics of the numerical information. The same numerical value may have different semantics depending on the unit, for example, "10cm" and "10kg"; conversely, different numerical values may have the same semantics depending on the unit, for example, "1cm" and "10mm". Therefore, in this embodiment, to ensure the accuracy of subsequent similarity judgment of measurable quantity information units, the numerical value is represented as a numerical vector, and the unit is represented as a unit vector, considered as a whole, as shown in the following formula:
[0101]
[0102] Where G is the G-mapped value of the numerical information on the G channel, and the numerical range to which G is mapped is 0 to 255; σ is the standard deviation of the color. It is a numerical vector; It is a unit vector.
[0103] It is understandable that the value of σ can be set according to actual needs, as long as the G mapping value is within the range of 0 to 255. Furthermore, in this formula, σ can effectively suppress drastic color changes caused by large changes in numerical information. Simply changing the numerical value does not necessarily mean that the G mapping value will change drastically. For example, the G mapping values of "apple greater than 100g" and "apple greater than 150g" may be the same or slightly different under the influence of σ. It is understood that in this embodiment, when mixing colors using the RGB color system, the G mapping value is first rounded to the nearest integer, and the R and B mapping values are processed similarly.
[0104] Understandably, in special cases, due to the missing attributes of the numerical information in the obtained set of measurable quantity information, the numerical information of the corresponding constructed measurable quantity information unit can be "left blank" or a pre-set special character. The G mapping value mapped to the G channel can be set according to the actual situation to meet the actual needs.
[0105] It is understood that, in this embodiment of the application, since there are relatively few comparison relationships for measurable quantity information units, the B mapping value of the comparison relationship to the B channel can be determined by pre-setting a mapping rule between the comparison relationship and the B mapping value. Specifically, the mapping rule can be:
[0106]
[0107] Where x represents the comparison relation, and B(x) is the B-mapped value of the comparison relation on the B channel.
[0108] Understandably, in specific cases where the comparison relationship attributes of the obtained measurable quantity information set are missing, the comparison relationship of the corresponding constructed measurable quantity information unit can be "left blank" or a pre-set special character. Its mapping value to the B channel can be set according to the actual situation, as long as it meets the actual needs. Furthermore, the comparison relationship also includes cases such as greater than or equal to, less than or equal to, and not equal to. The examples in this application are not exhaustive; they are for illustrative purposes only and do not impose any limitations on this application. Meeting the actual needs is sufficient.
[0109] It is understandable that the mapped color determined by the R-mapping value, G-mapping value, and B-mapping value effectively integrates the feature information of each part of the measurable quantity information unit, and can better integrate and represent the overall features of the measurable quantity information unit. Specifically, according to the color mixing mechanism of the RGB color system, the mapped color is determined by the red component (R-mapping value), the green component (G-mapping value), and the blue component (B-mapping value). The red component (R-mapping value) can represent the feature information of the entity semantics of the measurable quantity information unit in the R channel, and can also represent the R-mapping value of the entity corresponding to the entity semantics in the R channel; the green component (G-mapping value) and the blue component (B-mapping value) are similar, and will not be elaborated further in this application.
[0110] It is also understandable that, referring to Figure 2 , Figure 2 The subtle positional differences of the mapped color points in the mapped color cluster block in the upper right corner are influenced by the combined effects of the R, G, and B mapping values. Since there are a total of 256 × 256 × 256 = 16,777,216 mapped colors, in a mapped color image, mapped color points with similar or identical colors will exhibit clustering. This clustering is as follows: Figure 2 As shown in the upper right corner of the image, in this embodiment of the application, the mapped color cluster block can be derived from the number of mapped color points within a certain area and the minimum center radius.
[0111] Reference Figure 5 In some embodiments, step 140, performing corresponding processing tasks based on the mapped color image, includes:
[0112] Step 141: Determine the first mapped color image of the first measurable quantity information unit and the second mapped color image of the second measurable quantity information unit based on the mapped color image;
[0113] Step 142: Perform color overlay processing on the first mapped color image and the second mapped color image to obtain an overlaid mapped color image;
[0114] Step 143: Perform grayscale processing and binarization processing on the superimposed mapped color image in sequence to obtain a binary image;
[0115] Step 144: Determine the similarity between the first measurable quantity information unit and the second measurable quantity information unit based on the binary image.
[0116] In this embodiment, the first measurable quantity information unit may be a measurable quantity information unit located in the same document as the second measurable quantity information unit, or it may be a measurable quantity information unit located in different documents. Color overlay processing may involve extracting the first mapped color from the first mapped color image and extracting the second mapped color from the second mapped color image, then overlaying the first and second mapped colors to obtain an overlaid mapped color, and finally obtaining an overlaid mapped color image based on the overlaid mapping.
[0117] It is understandable that binary images have only two values: one value can be used to determine if the first measurable information unit and the second measurable information unit are similar, and the other value can be used to determine if the first measurable information unit and the second measurable information unit are not similar.
[0118] It is also understood that, in the embodiments of this application, the mapped color can not only well express the overall semantic information of the measurable quantity information unit, and use the overall semantic information of the measurable quantity information unit as the basis for similarity judgment, but also convert the semantic distance calculation of traditional similarity judgment into image processing, thus avoiding the loss of the overall semantic information of the measurable quantity information unit.
[0119] Reference Figure 6 In some embodiments, step 143, obtaining a binary image by sequentially performing grayscale processing and binarization processing on the superimposed mapped color image, includes:
[0120] Step 1431: Obtain the user-defined binarization threshold;
[0121] Step 1432: Perform grayscale processing on the superimposed mapped color image to obtain a grayscale image, and perform binarization processing on the grayscale image according to the binarization threshold to obtain the binary image;
[0122] Wherein, when the grayscale value of the grayscale image is greater than the binarization threshold, the grayscale value of the binary image is 255, and when the grayscale value of the grayscale image is less than or equal to the binarization threshold, the grayscale value of the binary image is 0.
[0123] In this embodiment, the specific value of the binarization threshold can be flexibly set according to specific actual needs. Specifically, the binarization threshold can be any one of 127, 230, etc. Grayscale processing can make the R-mapped value, G-mapped value, and B-mapped value of the superimposed mapped color image equal, that is, convert the three color channels into a single channel. At this time, the grayscale value range of the grayscale image is 0 to 255. Then, the grayscale value of the grayscale image is binarized with the binarization threshold to obtain a binary image. When the grayscale value of the binary image is 255, it can be determined that the first measurable quantity information unit and the second measurable quantity information unit are similar. When the grayscale value of the binary image is 0, it can be determined that the second measurable quantity information unit of the first measurable quantity information unit is not similar.
[0124] It is understandable that when the binarization threshold is 230, it can represent the condition for judging the similarity between the first measurable quantity information unit and the second measurable quantity information unit. Specifically, the condition is that the similarity value is about 0.9. The specific similarity value can be obtained by the quotient of the binarization threshold and the number 255. Other binarization thresholds can be derived by analogy. This application will not elaborate further here.
[0125] Reference Figure 7 In some embodiments, step 140, performing corresponding processing tasks based on the mapped color image, includes:
[0126] Step 145: Determine the mapped color of all the measurable quantity information units based on the mapped color image;
[0127] Step 146: Obtain the correspondence rules between the user-defined mapping colors and the domains;
[0128] Step 147: Classify the measurable quantity information unit by domain according to the machine learning algorithm trained by the corresponding rules and the mapped color of the measurable quantity information unit.
[0129] In this embodiment, the correspondence rules are used to establish a correspondence between colors and domains, thereby realizing the association between colors and domains based on measurable quantitative information units. Machine learning algorithms can be k-means clustering, Mean-Shift clustering, DBSCAN clustering, etc.; this application uses k-means clustering as an example. The k-means clustering algorithm trained with the correspondence rules can classify the mapped colors of all measurable quantitative information units into domains, thus achieving domain classification of measurable quantitative information units.
[0130] Specifically, for example, refer to Figure 2 , Figure 2The CCP contains three mapped color clusters, located at the top left, bottom middle, and top right. The entities at each point in the top right color cluster can be "apple", "banana", or "watermelon". In the visualization view, the user can determine that the top right color cluster is the fruit domain based on the entities in the top right color cluster and set the corresponding rules accordingly. The same applies to the other color clusters.
[0131] It is understood that, in the embodiments of this application, reference is made to... Figure 2 Since there are a total of 256×256×256=16,777,216 possible mapped colors, and mapped color points with similar or identical colors will exhibit clustering, the colors of the color clusters in the upper right corner are all similar to yellow. Therefore, the color clusters in the upper right corner can be considered as yellow color clusters. Thus, when processing the input measurable quantity information units, if the mapped color of the input measurable quantity information unit is yellow, after processing by the k-means clustering algorithm, its mapped color point in the mapped color image will be near the color cluster in the upper right corner. The neighborhood of the input measurable quantity information unit can be judged to belong to the fruit neighborhood, thereby realizing the neighborhood classification of the measurable information unit.
[0132] It is worth noting that in some embodiments, the entity semantics and the domain are not the same. For example, the entity semantics of "apple" can be "pear" and the entity semantics of "watermelon" can be "gourd". However, in terms of domain classification, both "apple" and "watermelon" can belong to the fruit domain. As for the specific domain division, such as whether to use "pear" or "fruit" as the domain, it can be flexibly set according to actual needs. This application will not elaborate further here.
[0133] Reference Figure 8 In some embodiments, step 140, performing corresponding processing tasks based on the mapped color image, includes:
[0134] Step 148: Determine the mapped color cluster block where each of the measurable quantity information units is located based on the mapped color image;
[0135] Step 149: Error detection of the measurable quantity information unit is achieved by performing noise analysis and / or discrete point analysis on each of the mapped color cluster blocks.
[0136] In this embodiment, since the measurable quantity information units obtained by natural language processing (NLP) from parsing information documents cannot guarantee 100% accuracy, noise analysis and / or discrete point analysis can be performed on each mapped color cluster to detect errors in the measurable quantity information units. It is worth noting that in some cases, the error detection results of the measurable quantity information units can also be negatively fed back to the NLP algorithm model, thereby improving the accuracy of the NLP algorithm model.
[0137] For example, an information document might contain the sentence "The standard for apples is not less than 1kg, but greater than or equal to 1.5kg." In some cases, the set of measurable quantity information extracted using natural language processing (NLP) might be "apple, 1kg, less than," which is incorrect. The correct set of measurable quantity information would be "apple, 1.5kg, greater than or equal to." Furthermore, since measurable quantity information units are determined by the set of measurable quantity information, the mapped color is influenced by the entity semantics, numerical information, and comparison relationships of the measurable quantity information unit. Incorrect and correct measurable quantity information units will have different mapped colors, and their positions in the mapped color image may also differ. Specifically, refer to... Figure 9 Yellow represents the mapping color corresponding to the correct measurable quantity information unit, black represents the mapping color corresponding to the incorrect measurable quantity information unit, and the blue circle indicates the range of the mapping color cluster block with the yellow mapping color. For noise analysis, within the mapping color cluster block, the mapping color corresponding to the correct measurable quantity information unit can be obtained by calculating the mode. Mapping colors that differ from the correct measurable quantity information unit's mapping color are considered noise. Figure 9 In the diagram, the black areas within the blue circle represent noise; for discrete point analysis, the mapped colors outside the mapped color clusters are considered discrete points. Figure 9 In the diagram, the black dots outside the blue circles represent discrete points. It's worth noting that yellow is used to represent... Figure 9 The example shows the overall color of the mapped color clusters. Specifically, if the mapped colors of measurable information units are similar or identical, they can be presented as mapped color clusters in the mapped color image, and whether the mapped colors are similar can be set according to actual needs. The following describes in detail, with reference to the accompanying drawings, a document semantic information processing system provided according to an embodiment of this application.
[0138] Reference Figure 10 The document semantic information processing system proposed in this application includes:
[0139] The acquisition module 101 is used to acquire the information document to be parsed, and to obtain all measurable quantity information units in the information document after parsing the information document;
[0140] The mapping module 102 is used to map each of the measurable quantity information units to the RGB channels respectively, so as to obtain the mapped color of each of the measurable quantity information units;
[0141] Module 103 is used to establish a mapped color image based on the mapped colors of all the measurable quantity information units;
[0142] The processing module 104 is used to perform corresponding processing tasks based on the mapped color image.
[0143] It is understood that the content of the above method embodiments is applicable to this system embodiment. The specific functions implemented in this system embodiment are the same as those in the above method embodiments, and the beneficial effects achieved are also the same as those achieved in the above method embodiments.
[0144] Reference Figure 11 This application also provides a document semantic information processing apparatus, including:
[0145] At least one processor 201;
[0146] At least one memory 202 is used to store at least one program;
[0147] When the at least one program is executed by the at least one processor 201, the at least one processor 201 implements the above-described embodiment of a document semantic information processing method.
[0148] Similarly, it can be understood that the content of the above method embodiments is applicable to this device embodiment. The specific functions implemented by this device embodiment are the same as those of the above method embodiments, and the beneficial effects achieved are also the same as those achieved by the above method embodiments.
[0149] This application also provides a computer-readable storage medium storing a program executable by a processor 201, which, when executed by the processor 201, is used to implement the above-described embodiment of a document semantic information processing method.
[0150] Similarly, the content of the above method embodiments is applicable to the present computer-readable storage medium embodiments. The specific functions implemented by the present computer-readable storage medium embodiments are the same as those of the above method embodiments, and the beneficial effects achieved are also the same as those achieved by the above method embodiments.
[0151] In some alternative embodiments, the functions / operations mentioned in the block diagrams may not occur in the order shown in the operation diagrams. For example, depending on the functions / operations involved, two consecutively shown blocks may actually be executed substantially simultaneously, or the blocks may sometimes be executed in reverse order. Furthermore, the embodiments presented and described in the flowcharts of this application are provided by way of example to provide a more comprehensive understanding of the technology. The disclosed methods are not limited to the operations and logic flows presented herein. Alternative embodiments are contemplated in which the order of various operations is changed and sub-operations described as part of a larger operation are executed independently.
[0152] Furthermore, although this application is described in the context of functional modules, it should be understood that, unless otherwise stated to the contrary, one or more of the functions and / or features may be integrated into a single physical device and / or software module, or one or more functions and / or features may be implemented in a separate physical device or software module. It is also understood that a detailed discussion of the actual implementation of each module is unnecessary for understanding this application. Rather, given the properties, functions, and internal relationships of the various functional modules in the apparatus disclosed herein, the actual implementation of the module will be understood within the scope of conventional technology for an engineer. Therefore, those skilled in the art can implement the application set forth in the claims using ordinary techniques without excessive experimentation. It is also understood that the specific concepts disclosed are merely illustrative and not intended to limit the scope of this application, which is determined by the full scope of the appended claims and their equivalents.
[0153] If a function 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 this application, in essence, or the part that contributes to the prior art, or a 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 of the various embodiments of this application. The aforementioned storage medium includes various media capable of storing program code, such as a USB flash drive, a portable hard drive, a read-only memory (ROM), a random access memory (RAM), a magnetic disk, or an optical disk.
[0154] The logic and / or steps represented in the flowchart or otherwise described herein, for example, can be considered as a sequenced list of executable instructions for implementing logical functions, and can be embodied in any computer-readable medium for use by, or in conjunction with, an instruction execution system, apparatus, or device (such as a computer-based system, a processor-included system, or other system that can fetch and execute instructions from, an instruction execution system, apparatus, or device). For the purposes of this specification, "computer-readable medium" can be any means that can contain, store, communicate, propagate, or transmit programs for use by, or in conjunction with, an instruction execution system, apparatus, or device.
[0155] More specific examples of computer-readable media (a non-exhaustive list) include: electrical connections (electronic devices) having one or more wires, portable computer disk drives (magnetic devices), random access memory (RAM), read-only memory (ROM), erasable and editable read-only memory (EPROM or flash memory), fiber optic devices, and portable optical disc read-only memory (CDROM). Furthermore, computer-readable media can even be paper or other suitable media on which programs can be printed, because programs can be obtained electronically, for example, by optically scanning the paper or other medium, followed by editing, interpreting, or otherwise processing as necessary, and then stored in computer memory.
[0156] It should be understood that various parts of this application can be implemented using hardware, software, firmware, or a combination thereof. In the above embodiments, multiple steps or methods can be implemented using software or firmware stored in memory and executed by a suitable instruction execution system. For example, if implemented in hardware, as in another embodiment, it can be implemented using any one or a combination of the following techniques known in the art: discrete logic circuits having logic gates for implementing logical functions on data signals, application-specific integrated circuits (ASICs) having suitable combinational logic gates, programmable gate arrays (PGAs), field-programmable gate arrays (FPGAs), etc.
[0157] In the foregoing description of this specification, the references to terms such as "one embodiment," "another embodiment," or "some embodiments," etc., indicate that a specific feature, structure, material, or characteristic described in connection with an embodiment or example is included in at least one embodiment or example of this application. In this specification, the illustrative expressions of the above terms do not necessarily refer to the same embodiment or example. Furthermore, the specific features, structures, materials, or characteristics described may be combined in any suitable manner in one or more embodiments or examples.
[0158] Although embodiments of this application have been shown and described, those skilled in the art will understand that various changes, modifications, substitutions and variations can be made to these embodiments without departing from the principles and spirit of this application, the scope of which is defined by the claims and their equivalents.
[0159] The above is a detailed description of the preferred embodiments of this application, but this application is not limited to the embodiments. Those skilled in the art can make various equivalent modifications or substitutions without departing from the spirit of this application, and these equivalent modifications or substitutions are all included within the scope defined by the claims of this application.
Claims
1. A method for processing semantic information of a document, characterized in that, include: Obtain the information document to be parsed, and after parsing the information document, obtain all measurable quantity information units within the information document; Each of the measurable quantity information units is mapped to an RGB channel to obtain the mapped color of each of the measurable quantity information units; A mapped color image is constructed based on the mapped colors of all the measurable quantity information units; Perform corresponding processing tasks based on the mapped color image; The step of parsing the information document to obtain all measurable quantity information units within the information document includes: Parse the measurable quantity information of the information document to obtain a set of all measurable quantity information; Each measurable quantity information unit is constructed according to each of the measurable quantity information sets. The measurable quantity information unit includes numerical information, entity semantics, and comparison relations. The numerical information includes numerical value and unit.
2. The processing method according to claim 1, characterized in that, Mapping the measurable quantity information unit to the RGB channel to obtain the mapped color of the measurable quantity information unit includes: Map the entity semantics to the R channel in the RGB channel, and obtain the R mapping value of the entity semantics in the R channel; The numerical information is mapped to the G channel in the RGB channel, and the G mapping value of the numerical information mapped to the G channel is obtained; Map the comparison relationship to the B channel in the RGB channel, and obtain the B mapping value of the comparison relationship to the B channel; The mapping color of the measurable quantity information unit is determined based on the obtained R mapping value, G mapping value, and B mapping value.
3. The processing method according to claim 2, characterized in that, The step of performing corresponding processing tasks based on the mapped color image includes: The first mapped color image of the first measurable quantity information unit and the second mapped color image of the second measurable quantity information unit are determined based on the mapped color image. The first mapped color image and the second mapped color image are overlaid to obtain an overlaid mapped color image; The superimposed mapped color image is sequentially processed by grayscale and binarization to obtain a binary image; The similarity between the first measurable quantity information unit and the second measurable quantity information unit is determined based on the binary image.
4. The processing method according to claim 3, characterized in that, The step of sequentially performing grayscale processing and binarization processing on the superimposed mapped color image to obtain a binary image includes: Obtain the user-defined binarization threshold; The superimposed mapped color image is subjected to grayscale processing to obtain a grayscale image, and the grayscale image is subjected to binarization processing according to the binarization threshold to obtain the binary image; Wherein, when the grayscale value of the grayscale image is greater than the binarization threshold, the grayscale value of the binary image is 255, and when the grayscale value of the grayscale image is less than or equal to the binarization threshold, the grayscale value of the binary image is 0.
5. The processing method according to claim 2, characterized in that, The step of performing corresponding processing tasks based on the mapped color image includes: The mapped color of all the measurable quantity information units is determined based on the mapped color image; Obtain the mapping rules between user-defined mapping colors and domains; The measurable quantity information unit is classified into different domains based on a machine learning algorithm trained according to the corresponding rules and the mapped color of the measurable quantity information unit.
6. The processing method according to claim 2, characterized in that, The step of performing corresponding processing tasks based on the mapped color image includes: The mapped color cluster block where each measurable quantity information unit is located is determined based on the mapped color image; Error detection of the measurable quantity information unit is achieved by performing noise analysis and / or discrete point analysis on each of the mapped color cluster blocks.
7. A document semantic information processing system, characterized in that, include: The acquisition module is used to acquire the information document to be parsed, and to obtain all measurable quantity information units within the information document after parsing the information document; The mapping module is used to map each of the measurable quantity information units to the RGB channels respectively, so as to obtain the mapped color of each of the measurable quantity information units; A module is established to create a mapped color image based on the mapped colors of all the measurable quantity information units; The processing module is used to perform corresponding processing tasks based on the mapped color image; The step of parsing the information document to obtain all measurable quantity information units within the information document includes: Parse the measurable quantity information of the information document to obtain a set of all measurable quantity information; Each measurable quantity information unit is constructed according to each of the measurable quantity information sets. The measurable quantity information unit includes numerical information, entity semantics, and comparison relations. The numerical information includes numerical value and unit.
8. A semantic computing device, characterized in that, include: At least one processor; At least one memory for storing at least one program; When the at least one program is executed by the at least one processor, the at least one processor implements the document semantic information processing method as described in any one of claims 1-6.
9. A computer-readable storage medium storing a processor-executable program, characterized in that, The processor-executable program, when executed by the processor, is used to implement the document semantic information processing method as described in any one of claims 1-6.
Citation Information
Patent Citations
Data processing method and device
CN114692187A