A method and apparatus for searching a compound name
By combining fuzzy matching and exact matching, the accuracy problem of compound name matching is solved, enabling efficient and flexible retrieval of compound names, which is suitable for chemical research, drug discovery and chemical database management.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- TSINGHUA UNIVERSITY
- Filing Date
- 2023-12-27
- Publication Date
- 2026-07-21
AI Technical Summary
Existing compound name matching methods require the input name to be completely identical to the database, which can lead to incorrect matching due to typos, abbreviations, synonyms, or other differences, thus increasing the difficulty of matching.
A fuzzy matching method is adopted, which calculates similarity through Levenshtein distance, taking into account spelling errors, synonyms, abbreviations and word order tolerance. It is combined with exact matching, expands the search scope by using synonyms, and uses efficient string matching algorithms and index structures to accelerate retrieval.
It improves the flexibility and accuracy of compound name matching, effectively handles complex chemical nomenclature rules and incomplete or erroneous input, and enhances the efficiency of chemical information retrieval and management.
Smart Images

Figure CN117786174B_ABST
Abstract
Description
Technical Field
[0001] This article relates to information retrieval technology, and in particular to a method and apparatus for retrieving compound names. Background Technology
[0002] In fields such as chemical research, drug discovery, and the chemical industry, it is frequently necessary to identify and match various compound names. However, due to different naming conventions used by different laboratories, publishers, and databases, the spelling and representation of compound names also vary. Furthermore, relevant compound name matching methods require the input name to be completely identical to the name in the database for a correct match. This leads to situations where, in practical use, typos, abbreviations, synonyms, or other differences prevent successful matching, increasing the difficulty of compound name matching. Summary of the Invention
[0003] This application provides a method and apparatus for retrieving compound names, wherein:
[0004] A method for retrieving compound names, comprising:
[0005] After receiving a search request for the compound name, determine the target search terms;
[0006] The target search term is fuzzily matched with the compound names in a preset database to obtain the first round of matching results, wherein the first round of matching results includes a preset number of candidate targets;
[0007] The target search term is precisely matched with the filtering data corresponding to each candidate target in the first round of matching results to obtain the second round of matching results, wherein the filtering data corresponding to each candidate target includes the candidate target and the synonym of the candidate target in the database.
[0008] Based on the second round of matching results, the search target corresponding to the search request is determined from the candidate targets in the first round of matching results.
[0009] A compound name retrieval device, comprising:
[0010] The first determination module is configured to determine the target search terms after receiving a search request for the name of a compound.
[0011] The fuzzy matching module is configured to perform fuzzy matching between the target search term and the compound names in a preset database to obtain a first round of matching results, wherein the first round of matching results includes a preset number of candidate targets;
[0012] The precise matching module is configured to perform precise matching between the target search term and the filtering data corresponding to each candidate target in the first round of matching results to obtain the second round of matching results, wherein the filtering data corresponding to each candidate target includes the candidate target and the synonym of the candidate target in the database.
[0013] The second determining module is configured to determine the retrieval target corresponding to the retrieval request from the candidate targets in the first round of matching results based on the second round of matching results.
[0014] A storage medium storing a computer program, wherein the computer program is configured to execute the method described above when run.
[0015] An electronic device includes a memory and a processor, the memory storing a computer program and the processor being configured to run the computer program to perform the methods described above.
[0016] This application's embodiments introduce fuzzy matching, making matching more flexible and improving matching accuracy. It effectively handles complex chemical naming rules, synonym matching, and incomplete or erroneous input, thereby improving the efficiency of chemical information retrieval and management. Then, the target search term is precisely matched with the first round of matching results obtained from fuzzy matching, performing comprehensive matching of character content within a smaller search range, thus efficiently and accurately obtaining the search target corresponding to the search request.
[0017] Other features and advantages of this application will be set forth in the following description, and will be apparent in part from the description, or may be learned by practicing the application. Other advantages of this application can be realized and obtained by means of the solutions described in the description and the accompanying drawings. Attached Figure Description
[0018] The accompanying drawings are used to provide an understanding of the technical solutions of this application and constitute a part of the specification. They are used together with the embodiments of this application to explain the technical solutions of this application and do not constitute a limitation on the technical solutions of this application.
[0019] Figure 1 A schematic flowchart illustrating the compound name retrieval method provided in this application embodiment;
[0020] Figure 2 Another schematic flowchart illustrating the compound name retrieval method provided in the embodiments of this application;
[0021] Figure 3 This is a schematic diagram of the compound name retrieval device provided in an embodiment of this application. Detailed Implementation
[0022] This application describes several embodiments, but these descriptions are exemplary and not restrictive, and it will be apparent to those skilled in the art that many more embodiments and implementations are possible within the scope of the embodiments described herein. Although many possible combinations of features are shown in the drawings and discussed in the detailed description, many other combinations of the disclosed features are also possible. Unless specifically limited, any feature or element of any embodiment may be used in combination with, or may replace, any feature or element of any other embodiment.
[0023] This application includes and contemplates combinations of features and elements known to those skilled in the art. The embodiments, features, and elements disclosed in this application can also be combined with any conventional features or elements to form unique inventive solutions. Any feature or element of any embodiment can also be combined with features or elements from other inventive solutions to form another unique inventive solution. Therefore, it should be understood that any feature shown and / or discussed in this application can be implemented individually or in any suitable combination. Therefore, the embodiments are not limited except by the limitations imposed by the appended claims and their equivalents. Furthermore, various modifications and changes can be made within the scope of the appended claims.
[0024] Furthermore, in describing representative embodiments, the specification may have presented methods and / or processes as a specific sequence of steps. However, the method or process should not be limited to the specific order of steps described herein, to the extent that it does not depend on such a specific order. As will be understood by those skilled in the art, other sequences of steps are also possible. Therefore, the specific order of steps set forth in the specification should not be construed as a limitation of the claims. Moreover, the claims concerning the method and / or process should not be limited to the steps performed in the written order, and those skilled in the art will readily understand that these orders can be varied and still remain within the spirit and scope of the embodiments of this application.
[0025] Compound name matching methods in related technologies typically require the input name to match exactly with the name in the database, which may lead to omissions or errors in identifying compounds. To address this problem, embodiments of this application provide the following solution:
[0026] Figure 1 This is a schematic flowchart illustrating the compound name retrieval method provided in an embodiment of this application. Figure 1 As shown, the method includes:
[0027] Step 101: After receiving a search request for the compound name, determine the target search terms;
[0028] Specifically, the search terms carried in the search request can be directly used as target search terms, or the words carried in the search request can be optimized and the resulting search terms can be used as target search terms.
[0029] The search terms carried in the search request can be called initial search terms, which can be obtained from preset input boxes on the webpage, or by parsing the received voice signal.
[0030] Step 102: Perform fuzzy matching between the target search term and the compound names in the preset database to obtain the first round of matching results, wherein the first round of matching results includes a preset number of candidate targets;
[0031] The similarity between the target search term and the compound names in the database is determined by the degree of matching. A matching threshold can be set to exclude less similar names.
[0032] By introducing fuzzy search matching, the matching becomes more flexible and accurate, effectively handling complex chemical naming rules, synonym matching, and incomplete or erroneous input, thereby improving the efficiency of chemical information retrieval and management.
[0033] In the embodiments of this application, the naming rules based on compound names may adopt the following fuzzy matching principles, including at least:
[0034] 1. Spelling Error Tolerance: To account for potential spelling errors in user input, a fuzzy matching algorithm (Levenshtein distance) is used to compare the similarity between the query compound name and compound names in the database. Smaller edit distance values indicate higher similarity.
[0035] 2. Synonym Matching: Compound names may have multiple synonyms or different naming conventions. When performing fuzzy matching, the query compound name is matched against synonyms in the database to broaden the search scope.
[0036] 3. Abbreviation and Shorthand Matching: Compound names may contain abbreviations or shorthand forms. During fuzzy matching, the query compound name is matched against the full name or other commonly used forms in the database.
[0037] 4. Word Order Tolerance: The word order in compound names may vary or be incorrect. When performing fuzzy matching, word-level matching of the query compound name can be considered, without requiring strict adherence to the given order. That is, fuzzy matching results for word order ABC and word order ACB will be the same.
[0038] 5. Case Tolerance: Compound names may contain inconsistent capitalization. During fuzzy matching, case is ignored; the query compound name is compared with the names in the database, and lowercase is used consistently.
[0039] 6. Special Character Handling: Compound names may contain special characters or punctuation marks. When performing fuzzy matching, consider removing or ignoring these special characters to increase matching accuracy.
[0040] Step 103: Perform precise matching between the target search term and the filtering data corresponding to each candidate target in the first round of matching results to obtain the second round of matching results, wherein the filtering data corresponding to each candidate target includes the candidate target and the synonym of the candidate target in the database;
[0041] Since there are many candidate targets in the first round of matching results obtained based on fuzzy matching, they cannot be directly output as search results. Furthermore, since the first round of matching results is based on fuzzy matching, misjudgments may occur. Therefore, precise matching is used to perform precise matching on the candidate targets in the first round of matching results to obtain a more accurate matching degree for the candidate targets.
[0042] In this embodiment of the application, although an additional round of matching operation is added, the limited number of candidate targets will not significantly increase the processing pressure of the retrieval operation. Moreover, after the above-mentioned precise matching, the matching degree of the candidate targets can be obtained significantly more accurately.
[0043] It should be noted that, for exact matching, if the compound name has at least two words, the matching should be performed according to the order of the words.
[0044] In this embodiment of the application, when performing precision matching, the target search term is not directly matched with the candidate target. Instead, the filtering data corresponding to the candidate target is determined. The filtering data includes not only the candidate target itself, but also the synonyms of the candidate target in the database. The synonyms of the candidate target are used to assist the matching operation between the target search term and the candidate target, so that the matching result between the target search term and the filtering data corresponding to the candidate target is taken as the matching result between the target search term and the candidate target.
[0045] Step 104: Based on the second round of matching results, determine the search target corresponding to the search request from the candidate targets in the first round of matching results;
[0046] Specifically, the top 10 candidate targets in the second round of matching results can be selected directly as the search targets and output according to the matching degree from high to low; or, the second round of matching results can be corrected, and the search targets corresponding to the search request can be determined using the corrected second round of matching results.
[0047] The method provided in this application introduces fuzzy matching, which makes matching more flexible and improves matching accuracy. It effectively handles complex chemical naming rules, synonym matching, and incomplete or incorrect input, thereby improving the efficiency of chemical information retrieval and management. Then, the target search term is precisely matched with the first round of matching results obtained by fuzzy matching, and comprehensive matching of character content is performed within a smaller search range, so as to efficiently and accurately obtain the search target corresponding to the search request.
[0048] The method provided in the embodiments of this application is described below:
[0049] In one exemplary embodiment, determining the target search term includes:
[0050] Obtain the initial search terms corresponding to the search request;
[0051] Determine whether the string of the initial search term includes preset interference characters, wherein the interference characters are determined according to a preset naming strategy for compound names, and wherein the interference characters can narrow the search scope of the initial search term in the database.
[0052] If the string of the initial search term does not contain any interfering characters, then the initial search term is used as the target search term; otherwise, the target search term corresponding to the initial search term is generated based on the interfering characters in the initial search term.
[0053] Specifically, if the initial search terms contain interfering characters, the search scope in the database will be significantly narrowed by directly using the initial search terms, thus affecting the accuracy of the search results. Therefore, by performing the above judgment operation, the search terms used in the search operation can be optimized to avoid affecting the accuracy of the search results due to unreasonable search terms, and to ensure that the content in the database can be fully searched to obtain the search target required by the search request.
[0054] In one exemplary embodiment, the interfering characters include at least one of a first interfering content and a second interfering content, wherein:
[0055] The first type of interference is the character content located at the beginning of the initial search term and that needs to be deleted from the initial search term;
[0056] The second interference content is the replaceable characters in the initial search terms, wherein the replaceable character content in the database has one or at least two character contents with the same meaning but different content;
[0057] Correspondingly, generating the target search term corresponding to the initial search term based on the interfering characters in the initial search term includes:
[0058] If the interfering characters only include the first interfering content, then the target search term is obtained after deleting the first interfering content from the beginning of the initial search term;
[0059] If the interfering characters only include the second interfering content, then the second interfering content is replaced with one or at least two synonyms to obtain the replacement word corresponding to the initial search term, and both the initial search term and its replacement word are used as the target search term;
[0060] If the interfering characters include a first interfering content and a second interfering content, then delete the first interfering content located at the beginning of the initial search term to obtain a simplified search term. Replace the second interfering content in the simplified search term with one or at least two synonyms to obtain the replacement word corresponding to the simplified search term. Both the simplified search term and its replacement word are used as the target search term.
[0061] Specifically, one type of interference is a fixed character content that appears at the beginning of the compound name, including: the character content is N,N; or, the character content is (+); or, the character content is (-).
[0062] Another type of primary interference content is character content appearing at the beginning of the compound name, where the value of the numbers in the content can vary, including: character content as the number + R; or, character content as the number + S; or, character content as the number + L; or, character content as the number + E; or, character content as the number + D; or, character content as (number + R); or, character content as (number + S); or, character content as (number + L); or, character content as (number + E); or, character content as (number + D).
[0063] For example, if the character content is the number +R, it can be represented as 5R in the compound name. The "+" only indicates that the number and the character are adjacent and is not considered as the actual character content.
[0064] If the initial search terms contain special characters or punctuation marks, these special characters can be removed or ignored before performing the matching operation to increase the accuracy of the match.
[0065] A second type of interference is character content appearing in compound names, including:
[0066] The character content that expresses the value alpha includes the character content being alpha; or the character content being α; or the character content being a;
[0067] The character content that expresses the value beta includes the character content being beta; or the character content being β; or the character content being b.
[0068] The character content that expresses the value "gamma" includes the character content being "gamma"; or the character content being "γ"; or the character content being "y".
[0069] Another type of second interference content includes character content appearing at the end of the compound name, including:
[0070] The character content that expresses acidity includes the character content "ate" or "ic acid".
[0071] Let's take a word whose header does not include any interfering characters as an example:
[0072] If a word ends in "ate", then one of the target search terms is that word, and the other is the word obtained by replacing the last "ate" of the original word with "ic acid".
[0073] If a word ends in "ic acid", then one of the target search terms is that word, and the other is the word obtained by replacing the last "ic acid" with "ate".
[0074] Because compound names may have multiple synonyms or different naming conventions, the search scope is broadened by matching the initial search terms with synonyms in the database.
[0075] If a word contains alpha, then one of the target search terms is that word, another is the word obtained by replacing the alpha of that word with α, and yet another is the word obtained by replacing the alpha of that word with a.
[0076] If a word contains beta, then one of the target search terms is that word, another is that word's beta replaced with β, and yet another is that word's beta replaced with b;
[0077] If a word contains "gamma", then one of the target search terms is that word, another is the original word whose "gamma" is replaced with "γ", and yet another is the original word whose "gamma" is replaced with "y".
[0078] Since compound names may contain abbreviations or shortened forms, the initial search terms can be generated into words with different expressions so that they can be matched with the full names or other common forms in the database.
[0079] In an exemplary embodiment, determining the retrieval target corresponding to the retrieval request from each candidate target in the first round of matching results based on the second round of matching results includes:
[0080] The target search term is precisely matched with each candidate target to obtain the third round of matching results;
[0081] The results of the third round of matching are used to correct the results of the second round of matching, resulting in the corrected results of the second round of matching.
[0082] Using the corrected second-round matching results, the retrieval target corresponding to the retrieval request is determined from each candidate target in the first-round matching results.
[0083] Since synonyms in the screening data corresponding to candidate targets in the second round of matching results can affect the matching degree between the target search term and the candidate target to some extent, the second round of matching results are corrected using the third round of matching results to improve the importance of candidate targets in their corresponding screening data and further expand the difference between compound names and synonyms, so that the corrected second round of matching results can more accurately represent the matching degree between the target search term and the candidate target.
[0084] In an exemplary embodiment, the step of correcting the second-round matching result using the third-round matching result to obtain the corrected second-round matching result includes:
[0085] Calculate the product between the preset adjustment coefficient and the matching degree of each candidate target in the third round of matching results to obtain the matching degree correction value of each candidate target;
[0086] The sum of the matching degree of each candidate target and its respective matching degree correction value in the second round of matching results is calculated to obtain the corrected second round of matching results.
[0087] When the matching degree of each candidate target in the second and third rounds of matching results ranges from 0 to 100, the adjustment coefficient is 0.1.
[0088] Since the purpose of the third round of matching is to broaden the differences between compound names and synonyms, the adjustment coefficient is set to a small value of 0.1.
[0089] The matching operation in the execution process of at least one of the first round of matching results, the second round of matching results, and the third round of matching results is based on the use of an efficient string matching algorithm.
[0090] Specifically, efficient string matching algorithms were used for string similarity matching, mainly the KMP algorithm, Boyer-Moore algorithm, and Rabin-Karp algorithm. These algorithms can quickly find pattern strings in text and return matching results.
[0091] To speed up the string matching process, an index structure is used to store and retrieve strings. For example, using a suffix array or suffix tree to store and retrieve strings in text allows for quick finding of matching strings without traversing the entire text. This step requires creating an index on the HMDB database beforehand.
[0092] Additionally, an edit distance-based algorithm (Levenshtein distance) can quickly calculate the similarity between strings to identify candidate targets. Furthermore, considering potential spelling errors in user input, a fuzzy matching algorithm (Levenshtein distance) is used to compare the similarity between the query compound name and compound names in the database. Smaller edit distance values indicate higher similarity.
[0093] When calculating similarity, multi-threaded computation is used, and the string similarity matching task is assigned to multiple cores, so that multiple tasks can be performed independently.
[0094] Figure 2 Another schematic flowchart illustrating the compound name retrieval method provided in this application embodiment. For example... Figure 2 As shown, the method includes:
[0095] Step 201: After receiving the search request for the compound, obtain the name of the compound to be searched and obtain the initial search terms;
[0096] For example, a name can be obtained through a pre-set input box on a webpage, or by receiving a voice signal and parsing it.
[0097] Step 202: Determine whether the string of the initial search term includes preset interference characters, wherein the interference characters can narrow the search range of the initial search term in the database;
[0098] If the string of the initial search term does not contain interfering characters, then the initial search term is used as the target search term, and step 204 is executed; otherwise, step 203 is executed first, and then step 204 is executed.
[0099] Step 203: Generate the target search term corresponding to the initial search term based on the interfering characters in the initial search term;
[0100] Since compound names may have multiple synonyms or different naming conventions, it is necessary to use the initial search terms and synonyms in the database as search terms to broaden the search scope. Similarly, since compound names may have abbreviations or shortened forms, the initial search terms can be generated into words with different expressions, and these other expressions can also be used as search terms to match the full names or other commonly used forms in the database.
[0101] In one exemplary embodiment, the compound names in the local database and the target search terms can be converted to lowercase before filtering the compound names.
[0102] Because the word order in compound names may vary or be incorrect, word-level matching is performed on the target search terms, rather than requiring a strict matching order. That is, the first round of matching for target search terms ABC and ACB should yield the same result.
[0103] Step 204: Use the target search terms to perform fuzzy matching on the compound names in the local database to obtain the first round of matching results, wherein the first round of matching results includes a preset number of candidate targets;
[0104] In one exemplary embodiment, the target search term can be split into at least two words, and the multiple words obtained from the split can be used for matching operations.
[0105] In one exemplary embodiment, the candidate data and target search terms corresponding to each candidate target can be converted to lowercase before filtering the compound names.
[0106] Specifically, fuzzy matching refers to a rough screening of compound names within the entire database, while simultaneously ensuring both short search time and accurate results. This is achieved by first loading the data into memory and using a fast search program (such as Python's RapidFuzzy package). The requirement for accuracy is simply that the actual search target appears in the first round of matching results. Therefore, all compound names and synonyms in the entire database are first converted to lowercase. Then, the lowercase target search terms are used to perform fast partial matching on the lowercase compound names in the database, selecting the top 500 compounds with the highest matching scores as the first round of matching results.
[0107] Step 205: Perform precise matching between the target search term and the filtering data corresponding to each candidate target to obtain the second round of matching results. The filtering data corresponding to each candidate target includes the candidate target and its synonyms in the database.
[0108] In one exemplary embodiment, the screening data and target search terms corresponding to each candidate target can be converted to lowercase before screening the compound names.
[0109] In one exemplary embodiment, exact matching is performed according to the order of words in the target search term.
[0110] Specifically, for each candidate target in the first round of matching results, synonyms for the candidate target are determined, and the corresponding filtering data for each candidate target is obtained. Then, the filtering data for each candidate target is converted to lowercase strings, and a full match is performed on the filtering data for each candidate target using the lowercase target search terms. Finally, the similarity score for these 500 compounds is calculated, resulting in the second_score. The purpose of this filtering is to further refine the similarity score.
[0111] Step 206: Perform exact matching between the target search term and each candidate target to obtain the third round of matching results;
[0112] In one exemplary embodiment, the target search term and each candidate target are converted to lowercase before precise matching is performed.
[0113] In one exemplary embodiment, exact matching is performed according to the order of words in the target search term.
[0114] Specifically, for each candidate target in the first round of matching results, a full match is performed on each candidate target using lowercase search terms, and the similarity score of these 500 compounds is calculated to obtain the third_score.
[0115] Step 207: Use the results of the third round of matching to correct the results of the second round of matching, and obtain the corrected results of the second round of matching;
[0116] Since the purpose of the third round of matching is to further expand the differences between candidate targets and synonyms in the selected data, the importance of candidate targets in the third round of matching is much lower than that in the second round of matching.
[0117] The difference in importance can be represented by adjusting the coefficient settings. That is, the adjustment coefficient for the matching degree of the candidate target in the second round of matching results is 1, and the adjustment coefficient for the matching degree of the candidate target in the third round of matching results is 0.1.
[0118] Correspondingly, in the corrected second-round matching results, the score for each candidate target is score = second_score + 0.1 * third_score.
[0119] Step 208: Based on the corrected second-round matching results, determine the search target corresponding to the search request;
[0120] Specifically, based on the scores of the candidate targets in the revised second-round matching results, the top 10 candidate targets can be selected and output in descending order of their scores.
[0121] The method provided in this application, utilizing a fuzzy search algorithm, can reduce the difficulty of matching compound names, allow for more flexible matching methods, improve the accuracy of compound name matching, and avoid the problem of incorrect matching due to naming differences. It can be widely applied in fields such as chemical research, drug discovery, chemical database management, and laboratory information systems. This provides scientists, researchers, and engineers with more reliable chemical data and information.
[0122] Figure 3 This is a schematic diagram of the compound name retrieval device provided in an embodiment of this application. Figure 3 As shown, the device includes:
[0123] The first determining module 301 is configured to determine the target search term after receiving a search request for the name of a compound;
[0124] The fuzzy matching module 302 is configured to perform fuzzy matching between the target search term and the compound names in a preset database to obtain a first round of matching results, wherein the first round of matching results includes a preset number of candidate targets;
[0125] The precise matching module 303 is configured to perform precise matching between the target search term and the filtering data corresponding to each candidate target in the first round of matching results to obtain the second round of matching results. The second round of matching results includes the matching degree corresponding to each candidate target, and the filtering data corresponding to each candidate target includes the candidate target and the synonym of the candidate target in the database.
[0126] The second determining module 304 is configured to determine the retrieval target corresponding to the retrieval request from the candidate targets in the first round of matching results based on the second round of matching results.
[0127] The apparatus provided in this application introduces fuzzy matching, which makes matching more flexible and improves matching accuracy. It effectively handles complex chemical naming rules, synonym matching, and incomplete or incorrect input, thereby improving the efficiency of chemical information retrieval and management. Then, it performs precise matching between the target search term and the first round of matching results obtained by fuzzy matching, and performs comprehensive matching of character content within a smaller search range, thereby efficiently and accurately obtaining the search target corresponding to the search request.
[0128] This application provides a storage medium storing a computer program, wherein the computer program is configured to execute the method described above when running.
[0129] This application provides an electronic device including a memory and a processor. The memory stores a computer program, and the processor is configured to run the computer program to perform the methods described above.
[0130] It will be understood by those skilled in the art that all or some of the steps, systems, or apparatuses disclosed above, and their functional modules / units, can be implemented as software, firmware, hardware, or suitable combinations thereof. In hardware implementations, the division between functional modules / units mentioned above does not necessarily correspond to the division of physical components; for example, a physical component may have multiple functions, or a function or step may be performed collaboratively by several physical components. Some or all components may be implemented as software executed by a processor, such as a digital signal processor or microprocessor, or as hardware, or as an integrated circuit, such as an application-specific integrated circuit (ASIC). Such software may be distributed on a computer-readable medium, which may include computer storage media (or non-transitory media) and communication media (or transient media). As is known to those skilled in the art, the term "computer storage medium" includes volatile and non-volatile, removable and non-removable media implemented in any method or technology for storing information (such as computer-readable instructions, data structures, program modules, or other data). Computer storage media include, but are not limited to, RAM, ROM, EEPROM, flash memory or other memory technologies, CD-ROM, digital versatile disc (DVD) or other optical disc storage, magnetic cartridges, magnetic tape, disk storage or other magnetic storage devices, or any other medium that can be used to store desired information and can be accessed by a computer. Furthermore, it is well known to those skilled in the art that communication media typically contain computer-readable instructions, data structures, program modules, or other data in modulated data signals such as carrier waves or other transmission mechanisms, and may include any information delivery medium.
Claims
1. A method for retrieving compound names, characterized in that, include: After receiving a search request for the compound name, determine the target search terms; The target search term is fuzzily matched with the compound names in a preset database to obtain the first round of matching results, wherein the first round of matching results includes a preset number of candidate targets; The target search term is precisely matched with the filtering data corresponding to each candidate target in the first round of matching results to obtain the second round of matching results, wherein the filtering data corresponding to each candidate target includes the candidate target and the synonym of the candidate target in the database. Based on the second round of matching results, the search target corresponding to the search request is determined from the candidate targets in the first round of matching results; The step of determining the retrieval target corresponding to the retrieval request from each candidate target in the first round of matching results based on the second round of matching results includes: The target search term is precisely matched with each candidate target to obtain the third round of matching results; The results of the third round of matching are used to correct the results of the second round of matching, resulting in the corrected results of the second round of matching. Using the corrected second-round matching results, the retrieval target corresponding to the retrieval request is determined from each candidate target in the first-round matching results; The step of correcting the second-round matching result using the third-round matching result to obtain the corrected second-round matching result includes: Calculate the product between the preset adjustment coefficient and the matching degree of each candidate target in the third round of matching results to obtain the matching degree correction value of each candidate target; The sum of the matching degree of each candidate target and its respective matching degree correction value in the second round of matching results is calculated to obtain the corrected second round of matching results.
2. The method according to claim 1, characterized in that, The determination of the target search term includes: Obtain the initial search terms corresponding to the search request; Determine whether the string of the initial search term includes preset interference characters, wherein the interference characters are determined according to a preset naming strategy for compound names, and wherein the interference characters can narrow the search scope of the initial search term in the database. If the string of the initial search term does not contain any interfering characters, then the initial search term is used as the target search term; otherwise, the target search term corresponding to the initial search term is generated based on the interfering characters in the initial search term.
3. The method according to claim 2, characterized in that: The interfering characters include at least one of a first interfering content and a second interfering content. The first interfering content is a character content located at the beginning of the initial search term and which needs to be deleted from the initial search term. The second interfering content is a replaceable character in the initial search term. The second interfering content is a replaceable character content, wherein the replaceable character content has one or at least two character contents with the same meaning but different content in the database. Correspondingly, generating the target search term corresponding to the initial search term based on the interfering characters in the initial search term includes: If the interfering characters only include the first interfering content, then the target search term is obtained after deleting the first interfering content from the beginning of the initial search term; If the interfering characters only include the second interfering content, then the second interfering content is replaced with one or at least two synonyms to obtain the replacement word corresponding to the initial search term, and both the initial search term and its replacement word are used as the target search term; If the interfering characters include a first interfering content and a second interfering content, then delete the first interfering content located at the beginning of the initial search term to obtain a simplified search term. Replace the second interfering content in the simplified search term with one or at least two synonyms to obtain the replacement word corresponding to the simplified search term. Both the simplified search term and its replacement word are used as the target search term.
4. The method according to claim 3, characterized in that: One type of interference is character content that appears at the beginning of the compound name and whose content remains unchanged, including: character content as N,N; or, character content as (+); or, character content as (-); Another type of primary interference content is character content appearing at the beginning of the compound name, where the value of the numbers in the content can vary, including: character content as the number + R; or, character content as the number + S; or, character content as the number + L; or, character content as the number + E; or, character content as the number + D; or, character content as (number + R); or, character content as (number + S); or, character content as (number + L); or, character content as (number + E); or, character content as (number + D). A second type of interference is character content appearing in compound names, including: The character content that expresses the value alpha includes the character content being alpha; or the character content being α; or the character content being a; The character content that expresses the value beta includes the character content being beta; or the character content being β; or the character content being b. The character content that expresses the value "gamma" includes the character content being "gamma"; or the character content being "γ"; or the character content being "y". Another type of second interference content includes character content appearing at the end of the compound name, including: The character content that expresses acidity includes the character content "ate" or "ic acid".
5. The method according to claim 1, characterized in that, When the matching degree of each candidate target in the second and third rounds of matching results ranges from 0 to 100, the adjustment coefficient is 0.
1.
6. A compound name retrieval device, characterized in that, include: The first determination module is configured to determine the target search terms after receiving a search request for the name of a compound. The fuzzy matching module is configured to perform fuzzy matching between the target search term and the compound names in a preset database to obtain a first round of matching results, wherein the first round of matching results includes a preset number of candidate targets; The precise matching module is configured to perform precise matching between the target search term and the filtering data corresponding to each candidate target in the first round of matching results to obtain the second round of matching results, wherein the filtering data corresponding to each candidate target includes the candidate target and the synonym of the candidate target in the database. The second determining module is configured to determine the retrieval target corresponding to the retrieval request from the candidate targets in the first round of matching results based on the second round of matching results; The step of determining the retrieval target corresponding to the retrieval request from each candidate target in the first round of matching results based on the second round of matching results includes: The target search term is precisely matched with each candidate target to obtain the third round of matching results; The results of the third round of matching are used to correct the results of the second round of matching, resulting in the corrected results of the second round of matching. Using the corrected second-round matching results, the retrieval target corresponding to the retrieval request is determined from each candidate target in the first-round matching results; The step of correcting the second-round matching result using the third-round matching result to obtain the corrected second-round matching result includes: Calculate the product between the preset adjustment coefficient and the matching degree of each candidate target in the third round of matching results to obtain the matching degree correction value of each candidate target; The sum of the matching degree of each candidate target and its respective matching degree correction value in the second round of matching results is calculated to obtain the corrected second round of matching results.
7. A storage medium, characterized in that, The storage medium stores a computer program, wherein the computer program is configured to execute the method described in any one of claims 1 to 5 when it is run.
8. An electronic device comprising a memory and a processor, characterized in that, The memory stores a computer program, and the processor is configured to run the computer program to perform the method as described in any one of claims 1 to 5.