A method for expanding ancient compound terms synonyms for integrating thematic knowledge documents
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2025-09-29
- Publication Date
- 2026-08-07
AI Technical Summary
[0005]然而,由于相关基础条件欠缺,现代汉语同义词扩展的两类常用方法在古代汉语同义词扩展中应用受限
(1)本发明充分考虑到古代汉语的灵活性,构建与种子复合术语形式和内容相近的模式串,从而检索所有符合模式串的潜在同义词并进行筛选,能够找到尽可能多的同义词,且结果准确度较高。
Smart Images

Figure CN121257524B_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of information processing technology, and more specifically, to a method for expanding the synonyms of ancient compound terms for the integration of thematic knowledge documents. Background Technology
[0002] The digitization, knowledge-based transformation, and intelligentization of ancient documents are important aspects of national cultural digitization. Currently, my country has established a series of general-purpose ancient document databases, achieving significant progress in digitization. In the future, for the knowledge-based and intelligent utilization of ancient documents, there is an urgent need to integrate ancient specialized knowledge documents through the retrieval of knowledge terms, thereby constructing ancient specialized knowledge document databases and developing ancient specialized knowledge mining systems.
[0003] The grammatical elements of Classical Chinese are primarily monosyllabic, and its terminology is quite diverse in form. It ranges from simple terms consisting of a single morpheme and one or two characters to complex terms containing multiple morphemes and three or more characters. Compared to simple terms, complex terms possess more refined semantic features and contain more explicit knowledge information, making them more suitable for thematic knowledge retrieval. However, Classical Chinese expression is highly flexible; the same word often takes on different parts of speech in different contexts. The large number and diverse structures of complex terms expressing the same meaning make manual searching inefficient, subjective, and unable to retrieve all synonyms. Against this backdrop, developing a synonym expansion technology for Classical Chinese complex terms is crucial.
[0004] Currently, there is no dedicated technology for expanding synonyms in Classical Chinese. Similar methods for expanding synonyms in Modern Chinese can be divided into two categories. The first is context-free synonym expansion, which relies on publicly available thesaurus (such as *Tongyi Cilin*) and uses manual or programming methods to integrate synonym resources from the dictionary to obtain synonyms for the seed word. The second is context-based synonym expansion, which utilizes trained general or specialized language models and employs word vectors and entity embedding methods to compare semantic relationships, thereby identifying synonyms for the seed word.
[0005] However, due to a lack of relevant foundational conditions, the application of two commonly used methods for synonym expansion in modern Chinese is limited in the expansion of synonyms in classical Chinese. On the one hand, there is currently no publicly available dictionary of classical Chinese synonyms, making it impossible to perform synonym expansion without context. On the other hand, existing natural language processing models lack sufficient accuracy in word segmentation, part-of-speech tagging, and named entity recognition in classical Chinese, resulting in incomplete classical Chinese language models. If used for synonym expansion in classical Chinese, the results are less accurate and difficult to support the integration of classical Chinese thematic knowledge documents. Summary of the Invention
[0006] To overcome the shortcomings of existing technologies, this invention proposes a method for expanding the synonyms of ancient compound terms for the integration of thematic knowledge literature. This method utilizes seed compound terms to construct pattern strings with similar forms and content. It then retrieves all potential synonyms matching these pattern strings from a large ancient literature database. Synonyms are filtered by comparing character features in a context window. The expanded synonyms are used as new seed compound terms for iterative analysis until no new synonyms can be expanded. Finally, a search string is constructed using all seed compound terms and all expanded synonyms to find and integrate ancient thematic knowledge literature.
[0007] The objective of this invention can be achieved through the following technical solutions.
[0008] A method for expanding the synonyms of ancient compound terms for thematic knowledge literature integration includes the following steps: S1: Determine the seed compound terminology; S2: Perform single-character segmentation on a single seed compound term to construct the corresponding ordered set of Chinese characters; S3: Based on the above ordered set of Chinese characters, construct a pattern string that is similar in form and content to the seed compound term; S4: Use the pattern string to search in the ancient literature database, save the search results and extract all character combinations that match the pattern string, and filter the character combinations that appear most frequently as potential synonyms. S5: Calculate the context window character similarity between the seed compound term and each potential synonym based on the search results, and select potential synonyms with high context window character similarity as expanded synonyms; S6: Use the extended synonyms as new seed compound terms, repeat steps S2-S5 for iterative operation until no new synonyms can be extended, and finally obtain all the extended synonyms corresponding to the seed compound term. S7: If the number of seed compound terms determined in step S1 is greater than 1, repeat steps S2-S6 to obtain all extended synonyms corresponding to all seed compound terms. Use all seed compound terms and all extended synonyms to construct a search string, find thematic knowledge literature and integrate it.
[0009] Furthermore, the specific process for determining the seed compound term in step S1 is as follows: select representative ancient compound terms as seed compound terms from the ancient thematic knowledge areas for which literature integration is carried out as needed.
[0010] Furthermore, the process of segmenting a single seed compound term into individual characters and constructing a corresponding ordered set of Chinese characters in step S2 is as follows: taking a single Chinese character as the basic unit, the selected single seed compound term is segmented, and an ordered set of Chinese characters corresponding to each character is constructed according to the order in which each character appears in the seed compound term.
[0011] Furthermore, in step S3, based on the aforementioned ordered set of Chinese characters, a pattern string similar in form and content to the seed compound term is constructed. The specific process is as follows: Based on the aforementioned ordered set of Chinese characters, construct all pattern strings that are similar in form and content to the seed compound term, using regular expressions. The construction of each pattern string follows these principles: First, the total number of characters in the pattern string is the same as that of the seed compound term; Second, the number of fixed characters in the pattern string is no less than half of the total number of characters in the pattern string, but less than the total number of characters; Third, the fixed characters in the pattern string are randomly selected from the aforementioned ordered set of Chinese characters, but without repetition; Fourth, the order in which the fixed characters in the pattern string appear is consistent with the order in which they appear in the ordered set of Chinese characters.
[0012] Further, in step S4, the process of using a pattern string to search the ancient literature database, saving the search results, extracting all character combinations that match the pattern string, and filtering out character combinations with high frequency of occurrence as potential synonyms includes: S41: In a large database of ancient documents, using the above pattern string as the search term, perform a full-text search based on regular expressions, save the search results, and extract all character combinations that match the pattern string. S42: Count the frequency of occurrence of all the above character combinations, extract the character combinations whose frequency of occurrence meets the set frequency threshold, and use them as potential synonyms to form a potential synonym list.
[0013] Further, in step S5, the calculation of the context window character similarity between the seed compound term and each potential synonym based on the retrieval results, and the selection of potential synonyms with high context window character similarity as expanded synonyms, is specifically as follows: S51: From the aforementioned search results, extract all near-range context window characters and all far-range context window characters of the seed compound term and potential synonyms, and simultaneously count the total number of search result entries for the seed compound term. and the total number of search results for each potential synonym. , Indicates the first One potential synonym; S52: Find the unique characters in all nearby context windows for the seed compound term and potential synonyms, generate a character set for the nearby context window, and count the total number of characters in the character set for the nearby context window. Find the unique characters in all distant context windows for the seed compound term and potential synonyms, generate a distant context window character set, and count the total number of characters in the distant context window character set. ; S53: Among all the near context window characters of the seed compound term, count the number of context windows in which each character appears in the near context window character set. Combined with the total number of search result entries of the seed compound term, calculate the near context window character frequency of the seed compound term. For the specific calculation method, see formula (1). (1), in, For the first character set of the near-field context window The frequency of occurrence of each character in all nearby context window characters of the seed compound term; For the first character set of the near-field context window One character, Not greater than Positive integers; For all near-context window characters in this seed compound term, the character The number of context windows that appear; This represents the total number of search results for this seed compound term; In all the near context window characters of each potential synonym, the number of context windows in which each character appears in the near context window character set is counted. Combined with the total number of search result entries for each potential synonym, the near context window character frequency of each potential synonym is calculated. For the specific calculation method, please refer to formula (2). (2), in, For the first character set of the near-field context window The character, in the _ ... Potential synonyms Frequency of occurrence in all near-context window characters; For the first character set of the near-field context window One character, Not greater than Positive integers; In the first Potential synonyms Of all the characters in the near-context window, the character The number of context windows that appear; For the first Potential synonyms The total number of search result entries; In all the far-range context window characters of the seed composite term, the number of context windows in which each character appears in the far-range context window character set is counted. Combined with the total number of search result entries of the seed composite term, the far-range context window character frequency of the seed composite term is calculated. For the specific calculation method, please refer to formula (3). (3), in, For the first character set of the remote context window The frequency of occurrence of a character in all distant context window characters of the seed compound term; For the first character set of the remote context window One character, Not greater than Positive integers; For all distant context window characters in this seed compound term, the character The number of context windows that appear; This represents the total number of search results for this seed compound term; In all the far-range context window characters of each potential synonym, the number of context windows in which each character appears in the far-range context window character set is counted. Combined with the total number of search result entries for each potential synonym, the far-range context window character frequency of each potential synonym is calculated. For the specific calculation method, please refer to formula (4). (4), in, For the first character set of the remote context window The character, in the _ ... Potential synonyms Frequency of occurrence in all distant context window characters; For the first character set of the remote context window One character, Not greater than Positive integers; In the first Potential synonyms In all remote context window characters, the character The number of context windows that appear; For the first Potential synonyms The total number of search result entries; S54: Based on the near-context window character frequency of the seed compound term and each potential synonym, establish the near-context window character feature vector of the seed compound term and the near-context window character feature vector of each potential synonym respectively. The order of the elements is according to the character order in the near-context window character set, and the element in the corresponding order is equal to the frequency of occurrence of the character, as expressed by formulas (5) and (6). (5), in, The near-context window character feature vector of the seed compound term; For the first character set of the near-field context window The frequency of occurrence of each character in all nearby context window characters of the seed compound term; The total number of characters in the near-field context window character set. ; (6), in, For the first Character feature vectors of potential synonyms from a near-contextual window; For the first character set of the near-field context window The character, in the _ ... Potential synonyms Frequency of occurrence in all near-context window characters; The total number of characters in the near-field context window character set. ; Based on the far-distance context window character frequencies of the seed compound term and each potential synonym, the far-distance context window character feature vectors of the seed compound term and each potential synonym are established respectively. The order of the elements is in accordance with the character order in the far-distance context window character set, and the element in the corresponding order is equal to the frequency of occurrence of the character, as expressed by formulas (7) and (8). (7), in, The long-range context window character feature vector of the seed compound term; For the first character set of the remote context window The frequency of occurrence of a character in all distant context window characters of the seed compound term; The total number of characters in the character set of the remote context window. ; (8), in, For the first Character feature vectors of potential synonyms from a distant context window; For the first character set of the remote context window The character, in the _ ... Potential synonyms Frequency of occurrence in all distant context window characters; The total number of characters in the character set of the remote context window. ; S55: Using the near-range context window character feature vector of the seed compound term and the near-range context window character feature vector of each potential synonym, calculate the near-range context window character similarity between each potential synonym and the seed compound term. For the specific calculation method, see formula (9). (9), in, For the first Potential synonyms Character similarity in the near-context window to the seed compound term; The near-context window character feature vector of the seed compound term; For the first Character feature vectors of potential synonyms from a near-contextual window; Using the long-distance context window character feature vector of the seed compound term and the long-distance context window character feature vector of each potential synonym, calculate the long-distance context window character similarity between each potential synonym and the seed compound term. For the specific calculation method, see formula (10). (10) in, For the first Potential synonyms Long-range context window character similarity with seed compound terms; The long-range context window character feature vector of the seed compound term; For the first Character feature vectors of potential synonyms from a distant context window; S56: Calculate the weighted similarity between each potential synonym and the seed compound term using the near-range context window character similarity and the far-range context window character similarity. See formula (11) for the specific calculation method. (11), in, For the first Potential synonyms Character similarity with the context window of the seed compound term; For the first k Potential synonyms Character similarity in the near-context window to the seed compound term; For the first k Potential synonyms Character similarity of the seed compound term to the distant context window; For the character similarity weights of the near-field context window, For the character similarity weight of the long-distance context window, Greater than ; S57: Filter potential synonyms whose context window character similarity with the seed compound term is higher than the similarity threshold, as extended synonyms.
[0014] Furthermore, in step S6, each extended synonym is used as a new seed compound term, and steps S2-S5 are repeated for iterative operation. If new synonyms can be extended, the iteration continues until no new synonyms can be extended, and finally all extended synonyms corresponding to the seed compound term are obtained. When repeating step S3, the pattern strings that have appeared in the previous iterations are filtered out, and when repeating step S4, the potential synonyms that have appeared in the previous iterations are filtered out.
[0015] Furthermore, step S7, which involves constructing a search string using all seed compound terms and all expanded synonyms, searching for and integrating topical knowledge literature, specifically includes the following process: S71: Construct a set of compound terms using all seed compound terms and all extended synonyms; S72: Construct search strings using all compound terms in the compound term set, represented by regular expressions. The construction of each search string follows these principles: First, the total number of characters in the search string is no less than 3 characters; Second, the number of fixed characters in the search string is no less than 3 / 4 of the total number of characters in the search string; Third, the fixed characters in the search string come from the same compound term and can be selected arbitrarily without repetition, but the order of appearance must be consistent with the order of appearance in that compound term. S73: In the ancient literature database, use the aforementioned search string to conduct a full-text search based on regular expressions, save the search results, and obtain a collection of specialized knowledge documents.
[0016] Compared with the prior art, the beneficial effects of the technical solution of the present invention are: (1) This invention fully considers the flexibility of ancient Chinese, constructs a pattern string that is similar in form and content to the seed compound term, thereby retrieving and filtering all potential synonyms that match the pattern string, finding as many synonyms as possible, and the results are highly accurate.
[0017] (2) This invention utilizes a large ancient literature database as the context for synonym expansion, and conducts iterative analysis of pattern string construction, pattern string retrieval, and context window character feature comparison. It does not rely on public dictionaries or trained language models, and the efficiency of synonym expansion is high, which can effectively avoid human subjectivity. Attached Figure Description
[0018] Figure 1 This is a flowchart of the ancient compound term synonym expansion method for thematic knowledge literature integration according to the present invention. Detailed Implementation
[0019] To make the objectives, technical solutions, and advantages of the present invention clearer, the embodiments of the present invention will be further described in detail below with reference to the accompanying drawings and specific examples. It should be understood that the specific embodiments described herein are merely intended to explain the present invention and not to limit it. For those skilled in the art, the present invention can be practiced without some of these specific details. The following description of the embodiments is merely to provide a better understanding of this application by illustrating examples of the invention.
[0020] Currently, there is no dedicated technology for expanding synonyms in Classical Chinese. Commonly used methods for expanding synonyms in Modern Chinese rely on publicly available thesaurus or trained language models. These methods are limited in their application in expanding synonyms in Classical Chinese, resulting in low accuracy and making it difficult to support the integration of specialized knowledge documents on ancient Chinese.
[0021] Based on the above background, this invention utilizes seed compound terms to construct pattern strings with similar forms and contents. It then retrieves all potential synonyms that match the pattern strings in a large ancient literature database. By comparing the character features of the context window, it filters synonyms and uses the expanded synonyms as new seed compound terms for iterative analysis until no new synonyms can be expanded. Finally, it uses all synonyms to construct a search string to find and integrate ancient thematic knowledge literature.
[0022] To facilitate understanding of this invention, the following terms mentioned herein will be explained: Ancient specialized knowledge literature refers to ancient documents that revolve around a specific theme or research field.
[0023] Ancient compound terms refer to ancient professional terms that are composed of two or more parts of speech and express specific professional concepts. They are generally three characters or more.
[0024] Seed compound terms refer to one or a group of representative compound terms that serve as initial input in synonym expansion.
[0025] A pattern string is a specific string that needs to be searched, matched, or analyzed in an algorithm. In this embodiment of the invention, a dynamic pattern string limited by regular expressions is used.
[0026] A context window refers to a fixed range of data accessed simultaneously before and after a given unit (word, character, etc.) when processing the current unit. In this invention, it specifically refers to a range of characters before and after a potential synonym.
[0027] A search string is a string expression used in an information retrieval system to find matching content.
[0028] Example 1 To address the technical problems existing in the background art, embodiments of the present invention provide a method for expanding the synonyms of ancient compound terms for thematic knowledge literature integration, see [link to relevant documentation]. Figure 1 The method specifically includes the following steps S1 to S7.
[0029] S1: Determine the seed compound terminology; S2: Perform single-character segmentation on a single seed compound term to construct the corresponding ordered set of Chinese characters; S3: Based on the above ordered set of Chinese characters, construct a pattern string that is similar in form and content to the seed compound term; S4: Use the pattern string to search in the ancient literature database, save the search results and extract all character combinations that match the pattern string, and filter the character combinations that appear most frequently as potential synonyms. S5: Calculate the context window character similarity between the seed compound term and each potential synonym based on the search results, and select potential synonyms with high context window character similarity as expanded synonyms; S6: Use the extended synonyms as new seed compound terms, repeat steps S2-S5 for iterative operation until no new synonyms can be extended, and finally obtain all the extended synonyms corresponding to the seed compound term. S7: If the number of seed compound terms determined in step S1 is greater than 1, that is, if step S1 determined multiple seed compound terms, then steps S2-S6 need to be repeated to obtain all extended synonyms corresponding to all seed compound terms. Finally, a search string is constructed using all seed compound terms and all extended synonyms to find and integrate thematic knowledge literature.
[0030] Example 2 The following detailed description of the specific implementation methods of steps S1 to S7 in Embodiment 1, using specific embodiments and calculation formulas.
[0031] In a possible implementation, the specific process of step S1 above is as follows: According to the ancient specialized knowledge field for which literature integration is to be carried out, representative ancient compound terms are selected as seed compound terms.
[0032] Among them, there can be one or more of the said seed compound terms. For the sake of concisely explaining the technical method of the present invention, this embodiment takes the case of one seed compound term as an example. For example, for the ancient specialized knowledge of "selecting a central location for site selection", "a moderately located place" can be selected as the seed compound term.
[0033] In a possible implementation, the specific process of step S2 above is as follows: Taking a single Chinese character as the basic unit, the selected single seed compound term is segmented, and an ordered set of Chinese characters corresponding to it is constructed according to the order of appearance of each character in the seed compound term.
[0034] For example, for the seed compound term "a moderately located place", it can be segmented into four characters: "适", "中", "之", and "地", and finally an ordered set of Chinese characters {'适': 1, '中': 2, '之': 3, '地': 4} is obtained.
[0035] In a possible implementation, the specific process of step S3 above is as follows: Based on the above ordered set of Chinese characters, all pattern strings similar in form and content to the seed compound term are constructed, and are represented using regular expressions. The construction of each pattern string follows the following principles: First, the total number of characters in the pattern string is the same as that of the seed compound term; Second, the number of fixed characters in the pattern string is not less than half of the total number of characters in the pattern string itself, and less than the total number; Third, the fixed characters in the pattern string are from the above ordered set of Chinese characters and can be arbitrarily selected, but cannot be repeated; Fourth, the order of appearance of the fixed characters in the pattern string is the same as the order of appearance in the ordered set of Chinese characters.
[0036] Taking the seed compound term "a moderately located place" as an example, its ordered set of Chinese characters is {'适': 1, '中': 2, '之': 3, '地': 4}. According to the above principles, there are a total of 36 pattern strings similar in form and content, which are represented using regular expressions as: (适中..|适.中.|适..中|.适中.|.适.中|..适中|适之..|适.之.|适..之|.适之.|.适.之|..适之|适地..|适.地.|适..地|.适地.|.适.地|..适地|中之..|中.之.|中..之|.中之.|.中.之|..中之|中地..|中.地.|中..地|.中地.|.中.地|..中地|之地..|之.地.|之..地|.之地.|.之.地|..之地) In this context, "." represents any single Chinese character.
[0037] In one possible implementation, the specific process of step S4 above includes: S41: In a large database of ancient documents, using the above pattern string as the search term, perform a full-text search based on regular expressions, save the search results, and extract all character combinations that match the pattern string. Among them, the large-scale ancient literature database can be a comprehensive ancient book database with more than 10,000 documents, such as the "Chinese Basic Ancient Books Database", "Chinese Books Digital Library", or "Hantang Collection"; taking the Chinese Basic Ancient Books Database as an example, the search results are texts without punctuation with the search terms centered and a length of 80 Chinese characters.
[0038] S42: Count the frequency of occurrence of all the above character combinations, extract the character combinations whose frequency of occurrence meets the set frequency threshold, and use them as potential synonyms to form a potential synonym list.
[0039] The frequency threshold can be set empirically and adjusted according to specific circumstances; this embodiment of the invention does not impose any limitations. For example, the frequency of occurrence is in the top 50% and greater than 10.
[0040] Taking the seed compound term "moderate land" as an example, potential synonyms extracted may include: moderate land, equitable land, moderate distance, etc.
[0041] In one possible implementation, the specific process in step S5 above includes: S51: From the aforementioned search results, extract all near-range context window characters (e.g., 1-5 characters before and after) and all far-range context window characters (e.g., 6-15 characters before and after) of the seed compound term and potential synonyms, and simultaneously count the total number of search result entries for the seed compound term. and the total number of search results for each potential synonym. , Indicates the first A potential synonym.
[0042] The number of characters in the near-field context window and the number of characters in the far-field context window can be set and adjusted by the user, and this embodiment of the invention does not impose specific limitations.
[0043] S52: Find the unique characters in all nearby context windows for the seed compound term and potential synonyms, generate a character set for the nearby context window, and count the total number of characters in the character set for the nearby context window. Simultaneously, search for unique characters in all distant context windows of the seed compound term and potential synonyms, generate a distant context window character set, and count the total number of characters in the distant context window character set. .
[0044] S53: Among all the near context window characters of the seed compound term, count the number of context windows in which each character appears in the near context window character set. Combined with the total number of search result entries of the seed compound term, calculate the near context window character frequency of the seed compound term. For the specific calculation method, see formula (1). (1), in, For the first character set of the near-field context window The frequency of occurrence of each character in all nearby context window characters of the seed compound term; For the first character set of the near-field context window One character, Not greater than Positive integers; For all near-context window characters in this seed compound term, the character The number of context windows that appear; This represents the total number of search results for this seed compound term.
[0045] In all the near context window characters of each potential synonym, the number of context windows in which each character appears in the near context window character set is counted. Combined with the total number of search result entries for each potential synonym, the near context window character frequency of each potential synonym is calculated. For the specific calculation method, please refer to formula (2). (2), in, For the first character set of the near-field context window The character, in the _ ... Potential synonyms Frequency of occurrence in all near-context window characters; For the first character set of the near-field context window One character, Not greater than Positive integers; In the first Potential synonyms Of all the characters in the near-context window, the character The number of context windows that appear; For the first Potential synonyms The total number of search results entries.
[0046] In all the far-range context window characters of the seed composite term, the number of context windows in which each character appears in the far-range context window character set is counted. Combined with the total number of search result entries of the seed composite term, the far-range context window character frequency of the seed composite term is calculated. For the specific calculation method, please refer to formula (3). (3), in, For the first character set of the remote context window The frequency of occurrence of a character in all distant context window characters of the seed compound term; For the first character set of the remote context window One character, Not greater than Positive integers; For all distant context window characters in this seed compound term, the character The number of context windows that appear; This represents the total number of search results for this seed compound term.
[0047] In all the far-range context window characters of each potential synonym, the number of context windows in which each character appears in the far-range context window character set is counted. Combined with the total number of search result entries for each potential synonym, the far-range context window character frequency of each potential synonym is calculated. For the specific calculation method, please refer to formula (4). (4), in, For the first character set of the remote context window The character, in the _ ... Potential synonyms Frequency of occurrence in all distant context window characters; For the first character set of the remote context window One character, Not greater than Positive integers; In the first Potential synonyms In all remote context window characters, the character The number of context windows that appear; For the first Potential synonyms The total number of search results entries.
[0048] S54: Based on the near-context window character frequency of the seed compound term and each potential synonym, establish the near-context window character feature vector of the seed compound term and the near-context window character feature vector of each potential synonym respectively. The element order is in accordance with the character order in the near-context window character set, and the element in the corresponding order is equal to the occurrence frequency of the character, which can be expressed as formula (5) and (6). (5), in, The near-context window character feature vector of the seed compound term; For the first character set of the near-field context window The frequency of occurrence of each character in all nearby context window characters of the seed compound term; The total number of characters in the near-field context window character set. .
[0049] (6), in, For the first Character feature vectors of potential synonyms from a near-contextual window; For the first character set of the near-field context window The character, in the _ ... Potential synonyms Frequency of occurrence in all near-context window characters; The total number of characters in the near-field context window character set. .
[0050] Based on the far-distance context window character frequencies of the seed compound term and each potential synonym, the far-distance context window character feature vectors of the seed compound term and each potential synonym are established respectively. The order of the elements is in accordance with the character order in the far-distance context window character set, and the element in the corresponding order is equal to the frequency of occurrence of the character, which can be expressed as formulas (7) and (8). (7), in, The long-range context window character feature vector of the seed compound term; For the first character set of the remote context window The frequency of occurrence of a character in all distant context window characters of the seed compound term; The total number of characters in the character set of the remote context window. .
[0051] (8), in, For the first Character feature vectors of potential synonyms from a distant context window; For the first character set of the remote context window The character, in the _ ... Potential synonyms Frequency of occurrence in all distant context window characters; The total number of characters in the character set of the remote context window. .
[0052] S55: Using the near-range context window character feature vector of the seed compound term and the near-range context window character feature vector of each potential synonym, calculate the near-range context window character similarity between each potential synonym and the seed compound term. For the specific calculation method, see formula (9). (9), in, For the first Potential synonyms Character similarity in the near-context window to the seed compound term; The near-context window character feature vector of the seed compound term; For the first Character feature vectors of potential synonyms within a near-contextual window.
[0053] Using the long-distance context window character feature vector of the seed compound term and the long-distance context window character feature vector of each potential synonym, calculate the long-distance context window character similarity between each potential synonym and the seed compound term. For the specific calculation method, see formula (10). (10) in, For the first Potential synonyms Long-range context window character similarity with seed compound terms; The long-range context window character feature vector of the seed compound term; For the first Character feature vectors of potential synonyms in a distant context window.
[0054] S56: Calculate the weighted similarity between each potential synonym and the seed compound term using the near-range context window character similarity and the far-range context window character similarity. See formula (11) for the specific calculation method. (11), in, For the first Potential synonyms Character similarity with the context window of the seed compound term; For the first k Potential synonyms Character similarity in the near-context window to the seed compound term; For the first k Potential synonyms Character similarity of the seed compound term to the distant context window; For the character similarity weights of the near-field context window, For the character similarity weight of the long-distance context window, Greater than (like , (Note: The specific numerical values are not limited in the embodiments of the present invention.)
[0055] S57: Filter potential synonyms whose context window character similarity with the seed compound term is higher than a similarity threshold, and use them as expanded synonyms. The similarity threshold can be adjusted according to specific circumstances, and this embodiment of the invention does not limit its application.
[0056] In one possible implementation, the specific process of step S6 is as follows: take each extended synonym as a new seed compound term, repeat steps S2-S5 for iterative operation, if new synonyms can be extended, continue iterating until no new synonyms can be extended, and finally obtain all extended synonyms corresponding to the seed compound term; in order to avoid invalid repeated calculations, filter out the pattern strings that have appeared in the previous iterations when repeating step S3, and filter out the potential synonyms that have appeared in the previous iterations when repeating step S4.
[0057] In one possible implementation, step S7 above, which involves constructing a search string using all seed compound terms and all extended synonyms, searching for and integrating topical knowledge literature, specifically includes: S71: Construct a set of compound terms using all seed compound terms and all extended synonyms; S72: Construct search strings using all compound terms in the compound term set, represented by regular expressions. The construction of each search string follows these principles: First, the total number of characters in the search string is no less than 3 characters; Second, the number of fixed characters in the search string is no less than 3 / 4 of the total number of characters in the search string; Third, the fixed characters in the search string come from the same compound term and can be selected arbitrarily without repetition, but the order of appearance must be consistent with the order of appearance in that compound term. S73: In the ancient literature database, use the aforementioned search string to conduct a full-text search based on regular expressions, save the search results, and obtain a collection of specialized knowledge documents.
[0058] In summary, this invention utilizes seed compound terms to construct pattern strings with similar forms and content. It then retrieves all potential synonyms matching these pattern strings from a large ancient literature database. Synonyms are filtered by comparing character features in the context window, and the expanded synonyms are used as new seed compound terms for iterative analysis until no new synonyms can be derived. Finally, a search string is constructed using all seed compound terms and all expanded synonyms to find and integrate ancient thematic knowledge literature. This method achieves high efficiency and accuracy in synonym expansion, effectively avoiding human subjectivity and finding as many synonyms as possible.
[0059] To concisely illustrate the technical method of the present invention, this embodiment of the invention is illustrated using the case of a single seed compound term; however, the technical method of the present invention is also applicable to the case of multiple seed compound terms, which can be achieved through repeated operations.
[0060] Those skilled in the art will understand that the accompanying drawings are merely schematic diagrams of a preferred embodiment, and the sequence numbers of the above embodiments of the present invention are for descriptive purposes only and do not represent the superiority or inferiority of the embodiments.
[0061] The above description is only a preferred embodiment of the present invention and is not intended to limit the present invention. Any modifications, equivalent substitutions, improvements, etc., made within the spirit and principles of the present invention should be included within the protection scope of the present invention.
Claims
1. A method for expanding the synonyms of ancient compound terms for thematic knowledge literature integration, characterized in that, Includes the following steps: S1: Determine the seed compound terminology; S2: Perform single-character segmentation on a single seed compound term to construct the corresponding ordered set of Chinese characters; S3: Based on the above ordered set of Chinese characters, construct a pattern string that is similar in form and content to the seed compound term, using regular expressions. The construction of each pattern string follows the following principles: First, the total number of characters in the pattern string is the same as that of the seed compound term; Second, the number of fixed characters in the pattern string is not less than half of the total number of characters in the pattern string, but less than the total number of characters. Third, the fixed characters in the pattern string are selected arbitrarily from the aforementioned ordered set of Chinese characters, but without repetition; fourth, the order in which the fixed characters in the pattern string appear is consistent with the order in which they appear in the ordered set of Chinese characters. S4: Use the pattern string to search in the ancient literature database, save the search results and extract all character combinations that match the pattern string, and filter the character combinations that appear most frequently as potential synonyms. S5: Calculate the context window character similarity between the seed compound term and each potential synonym based on the search results, and select potential synonyms with high context window character similarity as expanded synonyms; S6: Use the extended synonyms as new seed compound terms, repeat steps S2-S5 for iterative operation until no new synonyms can be extended, and finally obtain all the extended synonyms corresponding to the seed compound term. S7: If the number of seed compound terms determined in step S1 is greater than 1, repeat steps S2-S6 to obtain all extended synonyms corresponding to all seed compound terms. Use all seed compound terms and all extended synonyms to construct a search string, find thematic knowledge literature and integrate it.
2. The method for expanding the synonyms of ancient compound terms for thematic knowledge literature integration according to claim 1, characterized in that, The specific process for determining seed compound terms in step S1 is as follows: select representative ancient compound terms as seed compound terms from the ancient thematic knowledge areas for which literature integration is carried out as needed.
3. The method for expanding the synonyms of ancient compound terms for thematic knowledge literature integration according to claim 1, characterized in that, The process of segmenting a single seed compound term into individual characters and constructing a corresponding ordered set of Chinese characters in step S2 is as follows: taking a single Chinese character as the basic unit, the selected single seed compound term is segmented, and an ordered set of Chinese characters corresponding to each character is constructed according to the order in which each character appears in the seed compound term.
4. The method for expanding the synonyms of ancient compound terms for thematic knowledge literature integration according to claim 1, characterized in that, Step S4 involves using a pattern string to search an ancient literature database, saving the search results, extracting all character combinations that match the pattern string, and filtering out the most frequent character combinations as potential synonyms. The specific process includes: S41: In a large database of ancient documents, using the above pattern string as the search term, perform a full-text search based on regular expressions, save the search results, and extract all character combinations that match the pattern string. S42: Count the frequency of occurrence of all the above character combinations, extract the character combinations whose frequency of occurrence meets the set frequency threshold, and use them as potential synonyms to form a potential synonym list.
5. The method for expanding the synonyms of ancient compound terms for thematic knowledge literature integration according to claim 1, characterized in that, Step S5, which involves calculating the context window character similarity between the seed compound term and each potential synonym based on the search results, and selecting potential synonyms with high context window character similarity as expanded synonyms, is as follows: S51: From the aforementioned search results, extract all near-range context window characters and all far-range context window characters of the seed compound term and potential synonyms, and simultaneously count the total number of search result entries for the seed compound term. and the total number of search results for each potential synonym. , Indicates the first One potential synonym; S52: Find the unique characters in all nearby context windows for the seed compound term and potential synonyms, generate a character set for the nearby context window, and count the total number of characters in the character set for the nearby context window. ; Find the unique characters in all distant context windows for the seed compound term and potential synonyms, generate a distant context window character set, and count the total number of characters in the distant context window character set. ; S53: Among all the near context window characters of the seed compound term, count the number of context windows in which each character appears in the near context window character set. Combined with the total number of search result entries of the seed compound term, calculate the near context window character frequency of the seed compound term. For the specific calculation method, see formula (1). (1), in, For the first character set of the near-field context window The frequency of occurrence of each character in all nearby context window characters of the seed compound term; For the first character set of the near-field context window One character, Not greater than Positive integers; For all near-context window characters of this seed compound term, The number of context windows that appear; This represents the total number of search results for this seed compound term; In all the near context window characters of each potential synonym, the number of context windows in which each character appears in the near context window character set is counted. Combined with the total number of search result entries for each potential synonym, the near context window character frequency of each potential synonym is calculated. For the specific calculation method, please refer to formula (2). (2), in, For the first character set of the near-field context window The character, in the _ ... Potential synonyms Frequency of occurrence in all near-context window characters; For the first character set of the near-field context window One character, Not greater than Positive integers; In the first Potential synonyms Of all the characters in the near-context window, the character The number of context windows that appear; For the first Potential synonyms The total number of search result entries; In all the far-range context window characters of the seed composite term, the number of context windows in which each character appears in the far-range context window character set is counted. Combined with the total number of search result entries of the seed composite term, the far-range context window character frequency of the seed composite term is calculated. For the specific calculation method, please refer to formula (3). (3), in, For the first character set of the remote context window The frequency of occurrence of a character in all distant context window characters of the seed compound term; For the first character set of the remote context window One character, Not greater than Positive integers; For all distant context window characters in this seed compound term, the character The number of context windows that appear; This represents the total number of search results for this seed compound term; In all the far-range context window characters of each potential synonym, the number of context windows in which each character appears in the far-range context window character set is counted. Combined with the total number of search result entries for each potential synonym, the far-range context window character frequency of each potential synonym is calculated. For the specific calculation method, please refer to formula (4). (4), in, For the first character set of the remote context window The character, in the _ ... Potential synonyms Frequency of occurrence in all distant context window characters; For the first character set of the remote context window One character, Not greater than Positive integers; In the first Potential synonyms In all remote context window characters, the character The number of context windows that appear; For the first Potential synonyms The total number of search result entries; S54: Based on the near-context window character frequency of the seed compound term and each potential synonym, establish the near-context window character feature vector of the seed compound term and the near-context window character feature vector of each potential synonym respectively. The order of the elements is according to the character order in the near-context window character set, and the element in the corresponding order is equal to the frequency of occurrence of the character, as expressed by formulas (5) and (6). (5), in, The near-context window character feature vector of the seed compound term; For the first character set of the near-field context window The frequency of occurrence of each character in all nearby context window characters of the seed compound term; The total number of characters in the near-field context window character set. ; (6), in, For the first Character feature vectors of potential synonyms from a near-contextual window; For the first character set of the near-field context window The character, in the _ ... Potential synonyms Frequency of occurrence in all near-context window characters; The total number of characters in the near-field context window character set. ; Based on the far-distance context window character frequencies of the seed compound term and each potential synonym, the far-distance context window character feature vectors of the seed compound term and each potential synonym are established respectively. The order of the elements is in accordance with the character order in the far-distance context window character set, and the element in the corresponding order is equal to the frequency of occurrence of the character, as expressed by formulas (7) and (8). (7), in, The long-range context window character feature vector of the seed compound term; For the first character set of the remote context window The frequency of occurrence of a character in all distant context window characters of the seed compound term; The total number of characters in the character set of the remote context window. ; (8), in, For the first Character feature vectors of potential synonyms from a distant context window; For the first character set of the remote context window The character, in the _ ... Potential synonyms Frequency of occurrence in all distant context window characters; The total number of characters in the character set of the remote context window. ; S55: Using the near-range context window character feature vector of the seed compound term and the near-range context window character feature vector of each potential synonym, calculate the near-range context window character similarity between each potential synonym and the seed compound term. For the specific calculation method, see formula (9). (9), in, For the first Potential synonyms Character similarity in the near-context window to the seed compound term; The near-context window character feature vector of the seed compound term; For the first Character feature vectors of potential synonyms from a near-contextual window; Using the long-distance context window character feature vector of the seed compound term and the long-distance context window character feature vector of each potential synonym, calculate the long-distance context window character similarity between each potential synonym and the seed compound term. For the specific calculation method, see formula (10). (10), in, For the first Potential synonyms Long-range context window character similarity with seed compound terms; The long-range context window character feature vector of the seed compound term; For the first Character feature vectors of potential synonyms from a distant context window; S56: Calculate the weighted similarity between each potential synonym and the seed compound term using the near-range context window character similarity and the far-range context window character similarity. See formula (11) for the specific calculation method. (11), in, For the first Potential synonyms Character similarity with the context window of the seed compound term; For the first k Potential synonyms Character similarity in the near-context window to the seed compound term; For the first k Potential synonyms Character similarity of the seed compound term to the distant context window; For the character similarity weights of the near-field context window, For the character similarity weight of the long-distance context window, Greater than ; S57: Filter potential synonyms whose context window character similarity with the seed compound term is higher than the similarity threshold, as extended synonyms.
6. The method for expanding the synonyms of ancient compound terms for thematic knowledge literature integration according to claim 1, characterized in that, In step S6, each extended synonym is used as a new seed compound term. Steps S2-S5 are repeated for iterative operation. If new synonyms can be extended, the iteration continues until no new synonyms can be extended. Finally, all extended synonyms corresponding to the seed compound term are obtained. When repeating step S3, the pattern strings that have appeared in the previous iterations are filtered out. When repeating step S4, the potential synonyms that have appeared in the previous iterations are filtered out.
7. The method for expanding the synonyms of ancient compound terms for thematic knowledge literature integration according to claim 1, characterized in that, Step S7 describes constructing a search string using all seed compound terms and all expanded synonyms, searching for and integrating topical knowledge literature. The specific process includes: S71: Construct a set of compound terms using all seed compound terms and all extended synonyms; S72: Construct search strings using all compound terms in the compound term set, represented by regular expressions. The construction of each search string follows these principles: First, the total number of characters in the search string is no less than 3 characters; Second, the number of fixed characters in the search string is no less than 3 / 4 of the total number of characters in the search string; Third, the fixed characters in the search string come from the same compound term and can be selected arbitrarily without repetition, but the order of appearance must be consistent with the order of appearance in that compound term. S73: In the ancient literature database, use the aforementioned search string to conduct a full-text search based on regular expressions, save the search results, and obtain a collection of specialized knowledge documents.
Citation Information
Patent Citations
Method for expanding domain knowledge database attribute
CN104573009A
Iterative extraction of Chinese synonyms based on pattern learning
CN109522547A