Crystal information retrieval method, device, electronic device and storage medium
By extracting keywords from the text to be recognized and combining location information and semantic information, neural network technology is used to identify crystal information, which solves the problem of low crystal information retrieval accuracy in the existing technology and achieves higher recognition accuracy and standardization. deal with.
Patent Information
- Application Number
- CN202011265237.4
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2020-11-12
- Publication Date
- 2024-10-29
- Estimated Expiration
- 2040-11-12
AI Technical Summary
The existing crystal information retrieval method is single, resulting in low retrieval accuracy, especially when dealing with abbreviations or aliases, it is difficult to accurately identify crystal information.
By extracting keywords from the text to be recognized, combined with position information and semantic information, the crystal feature information is determined, and techniques such as neural networks are used to splice and classify feature vectors to improve the recognition accuracy of crystal information.
It significantly improves the retrieval accuracy of crystal information, can accurately identify and standardize abbreviations or aliases, and improves the accuracy of describing crystal information.
Smart Images

Figure CN112380869B_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the technical field of text recognition, and in particular to a crystal information retrieval method, device, electronic device and storage medium. Background Art
[0002] Crystal information in the text is generally used as a modifier to modify the crystal. Generally speaking, crystal information can be used to describe the shape of the crystal, for example, the crystal information "iris-claw" is used to describe the lens as iris claw-shaped. It can also be used to describe the location of the lens implantation, for example, the text information "posterior chamber intraocular lens" is used to describe the lens as a posterior chamber intraocular lens. It can also be used to describe the crystal material, for example, the crystal information "silicone lens" is used to describe the crystal as a silicon crystal.
[0003] Enter keywords to retrieve crystal information from text (for example, papers or journals). Based on the crystal information, you can determine what kind of crystal appears in the text, and you can effectively discover new crystals that appear in the industry, which helps speed up scientific researchers' research on crystals.
[0004] Currently, crystal information is generally retrieved from text by keyword recognition, but some text crystal information may be abbreviations or aliases, etc. For example, polymethyl methacrylate can be expressed as the full name "polymethylmethacrylate" or the abbreviation "PMMA".
[0005] Therefore, the existing method for retrieving crystal information is single, and the accuracy of the retrieved crystal information is low. Summary of the invention
[0006] The embodiments of the present application provide a crystal information retrieval method, device, electronic device and storage medium to improve the retrieval accuracy of crystal information.
[0007] In a first aspect, an embodiment of the present application provides a crystal information retrieval method, comprising:
[0008] Get the text to be recognized;
[0009] Extracting keywords for representing crystals from the text to be recognized;
[0010] The crystal information used to represent the crystal features in the text to be recognized is determined according to the position information of the keyword in the text to be recognized and the semantic information of the text to be recognized.
[0011] In a second aspect, an embodiment of the present application provides a crystal information retrieval device, comprising:
[0012] A transceiver unit, used for obtaining the text to be recognized;
[0013] A processing unit, used for extracting keywords representing crystals from the text to be recognized;
[0014] The processing unit is further used to determine the crystal information used to represent the crystal features in the text to be recognized based on the position information of the keyword in the text to be recognized and the semantic information of the text to be recognized.
[0015] In a third aspect, an embodiment of the present application provides an electronic device, comprising: a processor, the processor is connected to a memory, the memory is used to store a computer program, and the processor is used to execute the computer program stored in the memory, so that the electronic device performs the method described in the first aspect.
[0016] In a fourth aspect, an embodiment of the present application provides a computer-readable storage medium, wherein the computer-readable storage medium stores a computer program, and the computer program enables a computer to execute the method described in the first aspect.
[0017] In a fifth aspect, an embodiment of the present application provides a computer program product, which includes a non-transitory computer-readable storage medium storing a computer program, and the computer is operable to cause the computer to execute the method described in the first aspect.
[0018] Implementing the embodiments of the present application has the following beneficial effects:
[0019] It can be seen that in the embodiment of the present application, the keywords used to represent crystals in the text to be identified are first detected, and then the crystal information in the text to be identified is determined based on the position information of the keywords in the text to be identified and the semantic feature information of the text to be identified. Since the position information of the crystal in the text to be identified is combined in the process of identifying the crystal information, rather than simply performing keyword identification, the accuracy of the retrieved crystal information is higher. BRIEF DESCRIPTION OF THE DRAWINGS
[0020] In order to more clearly illustrate the technical solutions in the embodiments of the present application, the drawings required for use in the description of the embodiments will be briefly introduced below. Obviously, the drawings described below are some embodiments of the present application. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying any creative work.
[0021] Figure 1 A schematic diagram of a process for crystal information retrieval provided in an embodiment of the present application;
[0022] Figure 2 A schematic diagram of the structure of a neural network provided in an embodiment of the present application;
[0023] Figure 3 A flowchart of a neural network training method provided in an embodiment of the present application;
[0024] Figure 4 A block diagram of the functional units of a crystal information retrieval device provided in an embodiment of the present application;
[0025] Figure 5 A schematic diagram of the structure of an electronic device provided in an embodiment of the present application. DETAILED DESCRIPTION
[0026] The following will be combined with the drawings in the embodiments of the present application to clearly and completely describe the technical solutions in the embodiments of the present application. Obviously, the described embodiments are part of the embodiments of the present application, not all of the embodiments. Based on the embodiments in the present application, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of this application.
[0027] The terms "first", "second", "third" and "fourth" etc. in the specification and claims of the present application and the drawings are used to distinguish different objects, rather than to describe a specific order. In addition, the terms "including" and "having" and any variations thereof are intended to cover non-exclusive inclusions. For example, a process, method, system, product or device that includes a series of steps or units is not limited to the listed steps or units, but optionally includes steps or units that are not listed, or optionally includes other steps or units inherent to these processes, methods, products or devices.
[0028] Reference to "embodiments" herein means that a particular feature, result, or characteristic described in conjunction with the embodiments may be included in at least one embodiment of the present application. The appearance of the phrase in various locations in the specification does not necessarily refer to the same embodiment, nor is it an independent or alternative embodiment that is mutually exclusive with other embodiments. It is explicitly and implicitly understood by those skilled in the art that the embodiments described herein may be combined with other embodiments.
[0029] See also Figure 1 , Figure 1 A crystal information retrieval method is provided in an embodiment of the present application. The method is applied to a crystal information retrieval device. The method comprises the following steps:
[0030] 101: The crystal information retrieval device obtains a text to be recognized.
[0031] Exemplarily, the text to be recognized can be obtained from medical literature. For example, keyword recognition can be performed on the medical literature to obtain the keyword "crystal", and the sentence containing the keyword "crystal" can be used as the text to be recognized; it should be understood that English keywords corresponding to "crystal" can be recognized in English medical literature, such as "crystal" or "lens", etc., and the sentence containing the English keyword can be used as the text to be recognized.
[0032] Exemplarily, the above-mentioned medical literature may be electronic articles, electronic papers, electronic journals or electronic medical records, etc. in a medical database; wherein the medical database may be a public medicine (PUBMED) database.
[0033] 102: The crystal information retrieval device extracts keywords used to represent crystals from the text to be recognized.
[0034] It should be understood that the crystals mentioned in this application include various other types of crystals such as “artificial crystals” and “natural crystals”.
[0035] Exemplarily, keyword recognition is performed on each word in the text to be recognized to obtain keywords used to characterize crystals in the text to be recognized.
[0036] Exemplarily, semantic features may be extracted from the text to be recognized to obtain a semantic feature vector of the text to be recognized; then, based on the semantic feature vector of the text to be recognized, it is determined whether the text to be recognized contains keywords used to represent crystals; if so, the keywords are output, for example, the position of the keywords in the text to be recognized may be output.
[0037] Specifically, based on the semantic feature vector, the probability of each first word in the text to be recognized belonging to a crystal is determined, and the first word with a probability greater than a threshold is used as the keyword; if there is no first word with a probability greater than the threshold, it means that there is no keyword that can represent the crystal in the text to be recognized.
[0038] For example, if the text to be recognized is “The fixation of asilicone intraocular lens”, then the keyword in the text to be recognized can be recognized as intraocular lens, and the position of the keyword in the text to be recognized can be output, that is, (6,7).
[0039] 103: The crystal information retrieval device determines the crystal information used to represent the crystal characteristics in the text to be recognized according to the position information of the keyword in the text to be recognized and the semantic information of the text to be recognized.
[0040] Exemplarily, the semantic features of the text to be identified can be extracted to obtain a semantic feature vector; the position information of the keyword in the text to be identified can be encoded to obtain a position feature vector; finally, the semantic feature vector and the position feature vector can be concatenated to obtain a target feature vector; and the crystal information in the text to be identified can be determined based on the target feature vector. For example, the probability that each first word in the text to be identified belongs to the crystal information can be determined based on the target feature vector, and the first word with a probability greater than a first threshold can be output to obtain the crystal information.
[0041] Exemplarily, each word in the text to be recognized can be encoded (word embedding) to obtain the first word vector corresponding to each word; then, feature extraction is performed on the first word vector corresponding to each word in the text to be recognized to obtain the semantic feature vector corresponding to the text to be recognized. It should be understood that the word mentioned in this application refers to a complete character in Chinese and a complete word in English.
[0042] Exemplarily, the position marks of the first keyword at the beginning and the second keyword at the end of the keyword in the text to be recognized are determined respectively; then, encoding is performed according to the position marks of the first keyword and the second keyword to obtain the position feature vector.
[0043] Specifically, a preset vector dimension is obtained, and the dimension of the position feature vector is set to the preset vector dimension; then, according to the position mark of the first keyword, the first dimension of the first keyword in the position feature vector is determined, that is, the position of the first keyword in the text information is used as the first dimension of the first keyword in the position feature vector; according to the position mark of the second keyword in the text information, the second dimension of the second keyword in the position feature vector is determined, that is, the position of the second word in the text information is used as the second dimension of the second word in the position feature vector. Finally, the values of the first dimension, the second dimension, and the dimension between the first dimension and the second dimension are all set to the first preset value (such as 1), and the values of the remaining dimensions are all set to the second preset value (such as 0), to obtain the position feature vector.
[0044] For example, if the text to be identified is "The fixation of a silicone intraocular lens", the keyword is intraocular lens, the first keyword is "intraocular lens", and the second keyword is "lens". The position mark of the first keyword "intraocular lens" is 6, and the position mark of the second keyword "lens" is 7. If the preset vector dimension is 100, it can be determined that the position feature vector is (0,0,0,0,0,1,1,...,0). Then, the semantic feature vector is spliced with the position feature vector, that is, horizontally spliced to obtain the target feature vector. For example, the semantic feature vector is (0,1,0,1,...,1) and the position feature vector is (0,1,1,0,...,0). Then, the semantic feature vector is horizontally spliced with the position feature vector to obtain the target feature vector (0,1,0,1,...,1,0,0,0,0,0,1,1,...,0). Finally, classification is performed according to the target feature vector to determine the probability that each first word in the text to be recognized belongs to the crystal information, and the first word "silicone" with a probability greater than a threshold is output, and the crystal information is obtained as "silicone".
[0045] It should be understood that, since the dimension of the position feature vector is preset, when the length of the text to be recognized is greater than the preset vector dimension, where the length of the text to be recognized is the number of words contained in the text to be recognized, the text to be recognized can be split to obtain multiple sub-texts to be recognized, and each sub-text to be recognized is used as the above-mentioned text to be recognized, and crystal information is retrieved for each sub-text to be recognized, and the crystal information retrieved from the multiple sub-texts to be recognized is spliced to obtain the crystal information corresponding to the text to be recognized. Wherein, the number of words contained in each sub-text to be recognized is less than or equal to the preset vector dimension.
[0046] It can be seen that in the embodiment of the present application, the keywords used to represent crystals in the text to be recognized are first detected, and then the crystal information in the text to be recognized is determined based on the position information of the keywords in the text to be recognized and the semantic information of the text to be recognized. Since the position information of the keywords is combined in the process of recognizing the crystal information, the accuracy of the determined crystal information is higher.
[0047] In some possible implementations, since a lot of crystal information contains abbreviations, for example, a modifier used to modify crystals, polymethyl methacrylate, can be represented by the full name "polymethylmethacrylate" or the abbreviation "PMMA". Therefore, in order to improve the accuracy of the description of the crystal information, after determining that the first word with a probability greater than a first threshold value belongs to the crystal information, the first word with a probability greater than the first threshold value can be standardized to obtain a standardized word corresponding to the first word, and the standardized word can be output as the crystal information. Since the first word is standardized, each word in the retrieved crystal information is a standardized second word, so that the accuracy of the retrieved crystal information is relatively high.
[0048] Exemplarily, the first word with a probability greater than the first threshold value can be matched with each second word in the dictionary library to obtain a first edit distance corresponding to each second word, wherein the dictionary library is pre-constructed and each second word in the dictionary library is a standardized word; the edit distance refers to the minimum number of single-character editing operations required to convert one word into the other word between two words, wherein the single-character editing operation includes the following three operations: insertion operation, deletion operation and replacement operation. For example, the minimum single-character editing operations required to convert the word "kitten" into "sitting" are: replace the character "k" with "s", replace the character "e" with "i", and finally insert the character "g". Therefore, the edit distance between the word "kitten" and the word "sitting" is 3; then, based on the length of the first word with a probability greater than the first threshold (i.e., the number of characters contained in the first word), the length of each second word (the number of characters contained in the second word), and the first edit distance corresponding to each second word, determine the first similarity corresponding to the first word with a probability greater than the first threshold and each second word; finally, determine the maximum first similarity among the first similarities corresponding to each second word, and when the maximum first similarity is greater than or equal to the second threshold, use the second word corresponding to the maximum first similarity as the standardized word corresponding to the first word.
[0049] Exemplarily, the first similarity can be expressed by formula (1):
[0050]
[0051] Among them, S1 is the first similarity, A is the first word, B is the second word, distance(AB) is the first edit distance between the first word and the second word, L(A) is the length of the first word, and L(B) is the length of the second word.
[0052] For example, if the text to be recognized is "The fixation of a PMMA intraocular lens", and classification is performed according to the target feature vector, the crystal information obtained is the word "PMMA", then the word "PMMA" is standardized, and the standardized word "polymethylmethacrylate" is converted to the crystal information "polymethylmethacrylate", and the crystal information "polymethylmethacrylate" can be obtained.
[0053] In addition, when the maximum first similarity is less than the second threshold, it is determined whether there is a preset symbol in the first word whose probability is greater than the first threshold, and when it is determined that the preset symbol exists in the first word, the first word is split to obtain a plurality of first sub-words, wherein the preset symbol includes "-", "~", "_", and the like; when there is a preset identification symbol, the first word may be a word formed by connecting several words, resulting in the first word having no corresponding standardized word, and the first word may be split to obtain a plurality of first sub-words; then, each first sub-word is matched with each second word in the dictionary library to obtain the first sub-words corresponding to each second sub-word. second edit distance; determining the second similarity corresponding to each second word according to the length of each first subword, the length of each second word and the second edit distance corresponding to each second word, wherein the method of determining the second similarity is similar to the method of determining the first similarity and is not described again; determining the maximum second similarity corresponding to each first subword according to the second similarity corresponding to each first subword and each second word; when the maximum second similarity is greater than or equal to the second threshold, using the second word corresponding to the maximum similarity as the standardized word corresponding to each first subword; finally, combining the standardized words corresponding to each first subword to obtain the standardized word corresponding to the first word.
[0054] It should be understood that when the maximum second similarity corresponding to a first subword is less than the second threshold, the first subword is retained, it is determined that the first subword has no corresponding standardized word, and the retained first subword and the standardized words corresponding to the other remaining first subwords are combined to obtain the standardized word corresponding to the first word.
[0055] In some possible implementations, in the process of extracting semantic features from the text to be recognized and obtaining a semantic feature vector, semantic feature extraction can be performed based on a self-attention mechanism, thereby making the obtained semantic feature vector more accurate, thereby improving the accuracy of crystal information retrieval.
[0056] Specifically, feature extraction is performed on each first word in the text to be recognized to obtain a first word vector corresponding to each first word; then, the first word vector of each first word is encoded to obtain a query vector, a key value vector and a value vector corresponding to each first word; the similarity between the query vector of the first word A and the key value vector of each first word in the text to be recognized is determined respectively, and the similarity between the first word A and the key value vector of each first word in the text to be recognized is normalized to obtain a weight coefficient between the first word A and each first word in the text to be recognized, wherein the first word A is any first word in the text to be recognized; then, according to the weight coefficient between the first word A and each first word in the text to be recognized, the value vector of each first word is weighted to obtain a second word vector corresponding to the first word A; finally, semantic feature extraction is performed on the second word vector corresponding to each first word in the text to be recognized to obtain a semantic feature vector corresponding to the text to be recognized.
[0057] In one embodiment of the present application, the crystal information retrieval method of the present application can also be applied to the field of smart medicine. For example, medical researchers can accurately retrieve crystal information from medical literature through the crystal information retrieval method, so as to quickly understand the current status of crystal research, assist doctors in formulating correct strategic policies for crystal research, and promote the advancement of medical technology.
[0058] In one embodiment of the present application, the above-mentioned crystal information retrieval method can be implemented by a trained neural network. The training process of the neural network will be described in detail later, and no further description is given here. The implementation process of the crystal information retrieval method of the present application is specifically described below in conjunction with the structure of the neural network.
[0059] See also Figure 2 ,The neural network includes a word embedding network, a semantic feature extraction network, a first ,fully connected layer, a position encoding network, and a second fully connected layer. ,Exemplarily, the word embedding network can be a commonly used natural language processing ,model, such as the BERT model; the semantic feature extraction network can be a commonly used feature extraction ,network, such as the long short term memory network LSTM.
[0060] Among them, the word embedding network is used to perform word embedding processing on each first word in the text to be recognized [X1, X2, X3, …, Xn] to obtain the word vector corresponding to each first word; the semantic feature extraction network is used to perform feature extraction on the word vector corresponding to each first word in the text to be recognized, and obtain the semantic feature vector corresponding to the text to be recognized; the first fully connected layer is used to classify the first words in the text to be recognized according to the semantic feature vector, and obtain the keyword [X2, X3] used to characterize the crystal; then, the position encoding network is used to perform position encoding according to the position information of the keyword [X2, X3] in the text to be recognized [X1, X2, X3, …, Xn] to obtain the position feature vector; then, the semantic feature vector and the position feature vector are spliced to obtain the target feature vector; the second fully connected layer is used to determine the probability that each first word in the text to be recognized [X1, X2, X3, …, Xn] belongs to the crystal information according to the target feature vector.
[0061] Finally, the first word whose probability of belonging to the crystal information is greater than the first threshold is standardized, and the standardized word corresponding to the first word is output as the crystal information in the text to be recognized.
[0062] See also Figure 3 , Figure 3 A flowchart of a neural network training method provided in an embodiment of the present application. Figure 1 The same contents as those in the embodiment shown are not described again here. The method of this embodiment comprises the following steps:
[0063] 301: Acquire a training text, wherein the training text includes a first training label and a second training label, the first training label is used to indicate a real position of a keyword used to indicate a crystal in the training text, and the second training label is used to indicate real crystal information in the training text.
[0064] 302: Input the training sample into the neural network, and perform feature extraction on the training text to obtain a first feature vector.
[0065] The first feature vector is the semantic feature vector of the training text.
[0066] 303: Predicting keywords in the training text according to the third feature vector through the neural network to obtain predicted positions of keywords used to represent crystals in the training text.
[0067] 304: Perform position encoding on the predicted position through the neural network to obtain a second feature vector.
[0068] The second feature vector is the position feature vector of the keyword.
[0069] 305: Concatenate the first feature vector and the second feature vector to obtain a fifth feature vector, and obtain predicted crystal information in the training text according to the third feature vector.
[0070] 306: Adjusting network parameters of the neural network according to the real positions of the keywords in the training text, the predicted positions of the keywords in the training text, the real crystal information in the training text, and the predicted crystal information in the training text.
[0071] Exemplarily, a first loss is obtained based on the actual position and predicted position of the keywords in the training text. For example, the actual position can be encoded to obtain a fourth eigenvector, and the Euclidean distance between the fourth eigenvector and the second eigenvector is used as the first loss; a second loss is obtained based on the actual crystal information and the predicted crystal information in the training text. For example, the Euclidean distance between the actual probability that each word in the training text belongs to the crystal information and the predicted probability is used as the second loss; finally, the first loss and the second loss are weighted to obtain a target loss; the network parameters of the neural network are adjusted according to the target loss and the gradient descent method until the neural network converges, thereby completing the training of the neural network.
[0072] See also Figure 4 , Figure 4 The functional unit composition block diagram of a crystal information retrieval device provided in an embodiment of the present application. The crystal information retrieval 400 includes: a transceiver unit 401 and a processing unit 402, wherein:
[0073] The transceiver unit 401 is used to obtain the text to be recognized;
[0074] The processing unit 402 is used to extract keywords representing crystals from the text to be recognized;
[0075] The processing unit 402 is further configured to determine the crystal information for representing the crystal features in the text to be recognized according to the position information of the keyword in the text to be recognized and the semantic information of the text to be recognized.
[0076] In some possible implementations, in determining the crystal information used to represent the crystal features in the text to be recognized according to the position information of the keyword in the text to be recognized and the semantic information of the text to be recognized, the processing unit 402 is specifically configured to:
[0077] Extracting semantic features of the text to be recognized to obtain a semantic feature vector of the text to be recognized;
[0078] Encoding the position information of the keyword in the text to be recognized to obtain a position feature vector;
[0079] Concatenate the semantic feature vector and the position feature vector to obtain a target feature vector;
[0080] The crystal information in the text to be recognized is determined according to the target feature vector.
[0081] In some possible implementations, in encoding the position information of the keyword in the to-be-recognized text to obtain the position feature vector, the processing unit 402 is specifically configured to:
[0082] Respectively determine the position marks of a first keyword at the beginning of a word and a second keyword at the end of a word in the text to be recognized;
[0083] The position feature vector is obtained by encoding the first keyword and the second keyword according to their position marks.
[0084] In some possible implementations, in determining the crystal information in the to-be-recognized text according to the target feature vector, the processing unit 402 is specifically configured to:
[0085] Determining, according to the target feature vector, the probability that each first word in the to-be-recognized text belongs to the crystal information;
[0086] Performing a normalization process on a first word with a probability greater than a first threshold value to obtain a normalized word corresponding to the first word with a probability greater than the first threshold value;
[0087] The standardized word corresponding to the first word whose probability is greater than the first threshold is output as the crystal information.
[0088] In some possible implementations, in terms of performing standardization processing on the first word whose probability is greater than the first threshold to obtain a standardized word corresponding to the first word whose probability is greater than the first threshold, the processing unit 402 is specifically configured to:
[0089] Matching the first word whose probability is greater than the first threshold with each second word in the dictionary library to obtain a first edit distance corresponding to each second word;
[0090] Determine a first similarity corresponding to each second word according to the length of the first word whose probability is greater than the first threshold, the length of each second word, and the first edit distance corresponding to each second word;
[0091] Determine the maximum first similarity among the first similarities corresponding to each of the second words;
[0092] When the maximum first similarity is greater than or equal to a second threshold, a second word corresponding to the maximum first similarity is used as a standardized word corresponding to the first word.
[0093] In some possible implementations, the processing unit 402 is further configured to:
[0094] In a case where the maximum first similarity is less than the second threshold, determining whether there is a preset symbol in the first word with a probability greater than the first threshold;
[0095] In a case where it is determined that the preset symbol exists in the first word with a probability greater than the first threshold, the first word with a probability greater than the first threshold is split according to the preset symbol to obtain a plurality of first subwords;
[0096] Matching each first subword in the plurality of first subwords with each second word to obtain a second edit distance corresponding to each second word;
[0097] Determine a second similarity corresponding to each second word according to the length of each first subword, the length of each second word, and the second edit distance corresponding to each second word;
[0098] Determine a maximum second similarity corresponding to each first subword according to the second similarities corresponding to each first subword and each second word;
[0099] In the case where the maximum second similarity corresponding to each first subword is greater than or equal to a second threshold, taking the second word corresponding to the maximum second similarity corresponding to each first subword as the standardized word corresponding to each first subword;
[0100] The standardized words corresponding to each of the first subwords are combined to obtain the standardized words corresponding to the first words whose probability is greater than the first threshold.
[0101] In some possible implementations, before extracting keywords for representing crystals from the text to be recognized, the processing unit 402 is further configured to:
[0102] Determine the length of the text to be recognized, where the length is the number of first words contained in the text to be recognized;
[0103] When the length is greater than a preset length, the text to be recognized is divided into multiple sub-texts, and each of the multiple sub-texts is used as a text to be recognized, wherein the number of first words contained in each sub-text is less than or equal to the preset length.
[0104] See also Figure 5 , Figure 5 This is a schematic diagram of the structure of an electronic device provided in an embodiment of the present application. Figure 5 As shown, the electronic device 500 includes a transceiver 501, a processor 502 and a memory 503. They are connected via a bus 504. The memory 503 is used to store computer programs and data, and can transmit the data stored in the memory 503 to the processor 502.
[0105] The processor 502 is used to read the computer program in the memory 503 and perform the following operations:
[0106] Controlling the transceiver 501 to obtain the text to be recognized;
[0107] Extracting keywords for representing crystals from the text to be recognized;
[0108] The crystal information used to represent the crystal features in the text to be recognized is determined according to the position information of the keyword in the text to be recognized and the semantic information of the text to be recognized.
[0109] In some possible implementations, in determining the crystal information used to represent the crystal features in the text to be recognized according to the position information of the keyword in the text to be recognized and the semantic information of the text to be recognized, the processor 502 is used to read the computer program in the memory 503, and specifically perform the following operations:
[0110] Extracting semantic features of the text to be recognized to obtain a semantic feature vector of the text to be recognized;
[0111] Encoding the position information of the keyword in the text to be recognized to obtain a position feature vector;
[0112] Concatenate the semantic feature vector and the position feature vector to obtain a target feature vector;
[0113] The crystal information in the text to be recognized is determined according to the target feature vector.
[0114] In some possible implementations, in encoding the position information of the keyword in the to-be-recognized text to obtain the position feature vector, the processor 502 is used to read the computer program in the memory 503, and specifically perform the following operations:
[0115] Respectively determine the position marks of a first keyword at the beginning of a word and a second keyword at the end of a word in the text to be recognized;
[0116] The position feature vector is obtained by encoding the first keyword and the second keyword according to their position marks.
[0117] In some possible implementations, in determining the crystal information in the to-be-recognized text according to the target feature vector, the processor 502 is used to read the computer program in the memory 503, and specifically perform the following operations:
[0118] Determining, according to the target feature vector, the probability that each first word in the to-be-recognized text belongs to the crystal information;
[0119] Performing a normalization process on a first word with a probability greater than a first threshold value to obtain a normalized word corresponding to the first word with a probability greater than the first threshold value;
[0120] The standardized word corresponding to the first word whose probability is greater than the first threshold is output as the crystal information.
[0121] In some possible implementations, in terms of performing standardization processing on a first word having a probability greater than a first threshold to obtain a standardized word corresponding to the first word having a probability greater than the first threshold, the processor 502 is configured to read a computer program in the memory 503, and specifically perform the following operations:
[0122] Matching the first word whose probability is greater than the first threshold with each second word in the dictionary library to obtain a first edit distance corresponding to each second word;
[0123] Determine a first similarity corresponding to each second word according to the length of the first word whose probability is greater than the first threshold, the length of each second word, and the first edit distance corresponding to each second word;
[0124] Determine the maximum first similarity among the first similarities corresponding to each of the second words;
[0125] When the maximum first similarity is greater than or equal to a second threshold, a second word corresponding to the maximum first similarity is used as a standardized word corresponding to the first word.
[0126] In some possible implementations, the processor 502 is further configured to read the computer program in the memory 503 and perform the following operations:
[0127] In a case where the maximum first similarity is less than the second threshold, determining whether there is a preset symbol in the first word with a probability greater than the first threshold;
[0128] In a case where it is determined that the preset symbol exists in the first word with a probability greater than the first threshold, the first word with a probability greater than the first threshold is split according to the preset symbol to obtain a plurality of first subwords;
[0129] Matching each first subword in the plurality of first subwords with each second word to obtain a second edit distance corresponding to each second word;
[0130] Determine a second similarity corresponding to each second word according to the length of each first subword, the length of each second word, and the second edit distance corresponding to each second word;
[0131] Determine a maximum second similarity corresponding to each first subword according to the second similarities corresponding to each first subword and each second word;
[0132] In the case where the maximum second similarity corresponding to each first subword is greater than or equal to a second threshold, taking the second word corresponding to the maximum second similarity corresponding to each first subword as the standardized word corresponding to each first subword;
[0133] The standardized words corresponding to each of the first subwords are combined to obtain the standardized words corresponding to the first words whose probability is greater than the first threshold.
[0134] In some possible implementations, before extracting keywords for representing crystals from the text to be recognized, the processor 502 is further configured to read a computer program in the memory 503 to perform the following operations:
[0135] Determine the length of the text to be recognized, where the length is the number of first words contained in the text to be recognized;
[0136] When the length is greater than a preset length, the text to be recognized is divided into multiple sub-texts, and each of the multiple sub-texts is used as a text to be recognized, wherein the number of first words contained in each sub-text is less than or equal to the preset length.
[0137] Specifically, the transceiver 501 may be Figure 4 The transceiver unit 401 of the crystal information retrieval device 400 of the embodiment described above, the processor 502 may be Figure 4 The processing unit 402 of the crystal information retrieval device 400 of the embodiment described.
[0138] It should be understood that the crystal information retrieval device in the present application may include a smart phone (such as an Android phone, an iOS phone, a Windows Phone phone, etc.), a tablet computer, a PDA, a laptop computer, a mobile Internet device MID (Mobile Internet Devices, referred to as: MID) or a wearable device, etc. The above-mentioned crystal information retrieval device is only an example, not an exhaustive list, including but not limited to the above-mentioned crystal information retrieval device. In practical applications, the above-mentioned crystal information retrieval device may also include: an intelligent vehicle-mounted terminal, a computer device, and the like.
[0139] An embodiment of the present application also provides a computer storage medium, wherein the computer-readable storage medium stores a computer program, and the computer program is executed by a processor to implement part or all of the steps of any one of the crystal information retrieval methods recorded in the above method embodiments.
[0140] An embodiment of the present application also provides a computer program product, which includes a non-transitory computer-readable storage medium storing a computer program, and the computer program is operable to cause a computer to execute part or all of the steps of any one of the crystal information retrieval methods recorded in the above method embodiments.
[0141] It should be noted that, for the aforementioned method embodiments, for the sake of simplicity, they are all expressed as a series of action combinations, but those skilled in the art should be aware that the present application is not limited by the described order of actions, because according to the present application, certain steps can be performed in other orders or simultaneously. Secondly, those skilled in the art should also be aware that the embodiments described in the specification are all optional embodiments, and the actions and modules involved are not necessarily required by the present application.
[0142] In the above embodiments, the description of each embodiment has its own emphasis. For parts that are not described in detail in a certain embodiment, reference can be made to the relevant descriptions of other embodiments.
[0143] In the several embodiments provided in the present application, it should be understood that the disclosed device can be implemented in other ways. For example, the device embodiments described above are only schematic, such as the division of the units, which is only a logical function division. There may be other division methods in actual implementation, such as multiple units or components can be combined or integrated into another system, or some features can be ignored or not executed. Another point is that the mutual coupling or direct coupling or communication connection shown or discussed can be through some interfaces, and the indirect coupling or communication connection of the device or unit can be electrical or other forms.
[0144] The units described as separate components may or may not be physically separated, and the components shown as units may or may not be physical units, that is, they may be located in one place or distributed on multiple network units. Some or all of the units may be selected according to actual needs to achieve the purpose of the solution of this embodiment.
[0145] In addition, each functional unit in each embodiment of the present application may be integrated into one processing unit, or each unit may exist physically separately, or two or more units may be integrated into one unit. The above integrated unit may be implemented in the form of hardware or in the form of a software program module.
[0146] If the integrated unit is implemented in the form of a software program module and sold or used as an independent product, it can be stored in a computer-readable memory. Based on this understanding, the technical solution of the present application is essentially 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, and the computer software product is stored in a memory, including a number of instructions to enable a computer device (which can be a personal computer, server or network device, etc.) to perform all or part of the steps of the method described in each embodiment of the present application. The aforementioned memory includes: U disk, read-only memory (ROM, Read-Only Memory), random access memory (RAM, Random Access Memory), mobile hard disk, disk or CD-ROM and other media that can store program codes.
[0147] A person skilled in the art can understand that all or part of the steps in the various methods of the above embodiments can be completed by instructing related hardware through a program, and the program can be stored in a computer-readable memory, and the memory can include: a flash drive, a read-only memory (English: Read-Only Memory, abbreviated as: ROM), a random access memory (English: Random Access Memory, abbreviated as: RAM), a magnetic disk or an optical disk, etc.
[0148] The embodiments of the present application are introduced in detail above. Specific examples are used in this article to illustrate the principles and implementation methods of the present application. The description of the above embodiments is only used to help understand the method and core idea of the present application. At the same time, for general technical personnel in this field, according to the idea of the present application, there will be changes in the specific implementation method and application scope. In summary, the content of this specification should not be understood as a limitation on the present application.
Claims
1. A crystal information retrieval method, characterized in that: include: Get the text to be recognized; Extracting keywords for representing crystals from the text to be recognized; Determining crystal information in the text to be recognized for representing crystal features according to position information of the keyword in the text to be recognized and semantic information of the text to be recognized, including: Extracting semantic features from the text to be recognized to obtain a semantic feature vector of the text to be recognized; encoding the position information of the keyword in the text to be recognized to obtain a position feature vector; concatenating the semantic feature vector and the position feature vector to obtain a target feature vector; According to the target feature vector, the probability that each first word in the text to be recognized belongs to the crystal information is determined; the first words whose probability is greater than a first threshold are standardized to obtain standardized words corresponding to the first words whose probability is greater than the first threshold; and the standardized words corresponding to the first words whose probability is greater than the first threshold are output as the crystal information.
2. The method according to claim 1, characterized in that The step of encoding the position information of the keyword in the text to be recognized to obtain a position feature vector includes: Respectively determine the position marks of a first keyword at the beginning of a word and a second keyword at the end of a word in the text to be recognized; The position feature vector is obtained by encoding the first keyword and the second keyword according to their position marks.
3. The method according to claim 1, characterized in that The step of performing a normalization process on the first word whose probability is greater than the first threshold to obtain a normalized word corresponding to the first word whose probability is greater than the first threshold comprises: Matching the first word whose probability is greater than the first threshold with each second word in the dictionary library to obtain a first edit distance corresponding to each second word; Determine a first similarity corresponding to each second word according to the length of the first word whose probability is greater than the first threshold, the length of each second word, and the first edit distance corresponding to each second word; Determine the maximum first similarity among the first similarities corresponding to each of the second words; When the maximum first similarity is greater than or equal to a second threshold, a second word corresponding to the maximum first similarity is used as a standardized word corresponding to the first word.
4. The method according to claim 3, characterized in that The method further comprises: In a case where the maximum first similarity is less than the second threshold, determining whether there is a preset symbol in the first word with a probability greater than the first threshold; In a case where it is determined that the preset symbol exists in the first word with a probability greater than the first threshold, the first word with a probability greater than the first threshold is split according to the preset symbol to obtain a plurality of first subwords; Matching each first subword in the plurality of first subwords with each second word to obtain a second edit distance corresponding to each second word; Determine a second similarity corresponding to each second word according to the length of each first subword, the length of each second word, and the second edit distance corresponding to each second word; Determine a maximum second similarity corresponding to each first subword according to the second similarities corresponding to each first subword and each second word; In the case where the maximum second similarity corresponding to each first subword is greater than or equal to a second threshold, taking the second word corresponding to the maximum second similarity corresponding to each first subword as the standardized word corresponding to each first subword; The standardized words corresponding to each of the first subwords are combined to obtain the standardized words corresponding to the first words whose probability is greater than the first threshold.
5. The method according to any one of claims 1 to 4, characterized in that Before extracting keywords for representing crystals from the text to be recognized, the method further includes: Determine the length of the text to be recognized, where the length of the text to be recognized is the number of first words contained in the text to be recognized; When the length is greater than a preset length, the text to be recognized is divided into multiple sub-texts, and each of the multiple sub-texts is used as a text to be recognized, wherein the number of words contained in each sub-text is less than or equal to the preset length.
6. A crystal information retrieval device, characterized in that: include: A transceiver unit, used for obtaining the text to be recognized; A processing unit, used for extracting keywords representing crystals from the text to be recognized; The processing unit is further used to determine the crystal information used to represent the crystal features in the text to be recognized according to the position information of the keyword in the text to be recognized and the semantic information of the text to be recognized, including: Extracting semantic features from the text to be recognized to obtain a semantic feature vector of the text to be recognized; encoding the position information of the keyword in the text to be recognized to obtain a position feature vector; concatenating the semantic feature vector and the position feature vector to obtain a target feature vector; According to the target feature vector, the probability that each first word in the text to be recognized belongs to the crystal information is determined; the first words whose probability is greater than a first threshold are standardized to obtain standardized words corresponding to the first words whose probability is greater than the first threshold; and the standardized words corresponding to the first words whose probability is greater than the first threshold are output as the crystal information.
7. An electronic device, characterized in that: include: A processor, wherein the processor is connected to a memory, the memory is used to store a computer program, and the processor is used to execute the computer program stored in the memory, so that the electronic device executes the method as described in any one of claims 1 to 5.
8. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores a computer program, and the computer program is executed by a processor to implement the method according to any one of claims 1 to 5.
Citation Information
Patent Citations
Mode-based method for semantic processing of commodity query short texts
CN106227891A
Target emovement analysis method, model training method, medium and equipment
CN111339255A
