A method, device and computer program for using a microcomputer host
By constructing multiple scores and measurements of candidate words and optimizing keyword extraction, the problem that the RAKE algorithm does not consider the similarity of the meanings is solved, and the effect and efficiency of literary pictures are improved.
Patent Information
- Application Number
- CN202510237634.7
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2025-03-03
- Publication Date
- 2025-05-16
- Estimated Expiration
- 2045-03-03
AI Technical Summary
In the existing text-to-image generation technology, the RAKE algorithm fails to consider the similarity of the word meaning when extracting keywords, resulting in weak correlation between the matching image and the actual text, affecting the effect of the text.
By constructing the initial score, contextual importance, semantic overlap and co-occurrence of candidate words, the score values of candidate words are optimized, and the keywords in the pending text information are filtered out, thereby improving the accuracy of keyword matching.
It improves the effect and efficiency of literary pictures, enhances the correlation between generated images and text information, and reduces the possibility of synonymous keyword extraction.
Smart Images

Figure CN119741717B_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of Vincent graph technology, and in particular to a Vincent graph method, device and computer program using a microcomputer host. Background Art
[0002] In the field of computer science and artificial intelligence, text-to-image generation refers to the technology of generating corresponding images through natural language description. Existing text-to-image generation usually extracts keywords from text information, matches the keywords with the keywords in the text information corresponding to the image, and fuses the matched images to complete the text-to-image generation. The accuracy of keyword extraction directly affects the effect of text-to-image.
[0003] The RAKE algorithm is a commonly used keyword extraction algorithm. The RAKE algorithm evaluates the keyword potential of each word by calculating the co-occurrence relationship between words in the text. However, the RAKE algorithm does not consider the similarity of word meanings. When extracting keywords, synonyms are regarded as different keywords or some less relevant keywords are extracted. As a result, when using keywords for matching, the correlation between the matched image and the actual text is weak, which affects the effect of the text map. Summary of the invention
[0004] In order to solve the above technical problems, the purpose of this application is to provide a method, device and computer program for using a microcomputer host. The technical solutions adopted are as follows:
[0005] In a first aspect, an embodiment of the present application provides a method for generating a Vincent graph using a microcomputer host, the method comprising the following steps:
[0006] Step 1: Construct an image-text dataset and obtain the text information to be processed input by the microcomputer host; the image-text dataset consists of each image and its manually annotated text information;
[0007] Step 2: extract keywords from the text information to be processed according to the distribution characteristics of the candidate words in the text information to be processed; and use the text information to be processed to match the keywords in the text information of all images in the image text data set, and fuse several matched images to obtain the generated image of the text information to be processed; specifically including:
[0008] S1, analyzing the frequency of occurrence of the candidate words in the text information to be processed, as well as the number of characters and the number of co-occurrences between all adjacent candidate words, and constructing an initial score for each candidate word;
[0009] S2, constructing the contextual importance of each candidate word according to the average distribution characteristics of the number of characters between adjacent candidate words of the same candidate word type in the text information to be processed and the number of occurrences of the candidate word in all sentences of the text information to be processed;
[0010] S3, obtaining each meaning of each candidate word and multiple semantic primitives of each meaning; constructing the semantic overlap between candidate words according to the repeated features of semantics and semantic primitives between different candidate words; constructing the co-occurrence degree between candidate words according to the co-occurrence frequency between candidate words in the image text dataset and the co-occurrence frequency between candidate words and their adjacent candidate words; and constructing the synonymy degree between candidate words by combining the semantic overlap degree and the co-occurrence degree;
[0011] S4, using synonymy and context importance to optimize the initial score of each candidate word; using the optimized score value to classify the candidate words, and filter out keywords in the text information to be processed.
[0012] Preferably, the method for obtaining candidate words and candidate characters in step 2 is:
[0013] The text information to be processed is divided into separate characters or words; characters or words whose appearance frequency in the text information to be processed is greater than a preset number are extracted and recorded as candidate characters or candidate words respectively.
[0014] Preferably, in step S1, the method for constructing the initial score of each candidate word is:
[0015] The initial score of candidate word Q is recorded as F, , where M represents the frequency of occurrence of candidate word Q in the text information to be processed, and U represents the type of candidate words adjacent to candidate word Q. represents the number of co-occurrences between candidate word Q and the u-th adjacent candidate word, Represents the average number of characters between candidate word Q and the u-th adjacent candidate word.
[0016] Preferably, in step S2, the method for constructing the context importance of each candidate word is:
[0017] The contextual importance of candidate word Q is recorded as S, ; Where A represents the number of sentences containing candidate word Q in the text information to be processed, Z represents the total number of sentences in the text information to be processed, M represents the frequency of occurrence of candidate word Q in the text information to be processed, and L represents the total number of characters in the text information to be processed. Indicates the number of characters between the mth and m+1th appearances of candidate word Q.
[0018] Preferably, in step S3, the method for constructing the semantic overlap between the candidate words is:
[0019] For two candidate words with the same meaning, the semantic overlap between the two candidate words is assigned a value of 1;
[0020] Otherwise, the semantic overlap between candidate words is constructed based on the repeated features between the semantic primitives; the semantic overlap between candidate word Q and candidate word W is denoted as C, , where norm is the normalization function, y represents the number of identical semantic primitives in candidate word Q and candidate word W, Y represents the number of semantic primitives after the union of candidate word Q and candidate word W, and Yy represents the number of remaining semantic primitives in the union except for the identical semantic primitives in candidate word Q and candidate word W. It represents the maximum value of the cosine similarity between the word vector of the vth remaining sememe and the word vectors of all other remaining sememes.
[0021] Preferably, in step S3, the method for constructing the co-occurrence degree between the candidate words is:
[0022] Obtain the neighboring candidate words of candidate word Q and candidate word W each time they appear in the image text dataset;
[0023] If there is a common neighboring candidate word between candidate word Q and candidate word W, the neighboring candidate word is recorded as a co-occurrence candidate word;
[0024] The co-occurrence between candidate word Q and candidate word W is recorded as G, ,in represents the co-occurrence frequency of candidate word Q and candidate word W in the image text dataset, GX represents the number of co-occurrence candidate words of candidate word Q and candidate word W in the image text dataset, , Respectively represent the co-occurrence frequencies of candidate words Q, W and the gx-th co-occurrence candidate word.
[0025] Preferably, in step S3, the synonymy between the candidate words is determined by the ratio of the semantic overlap to the co-occurrence between the candidate words.
[0026] Preferably, in step S4, the initial score of each candidate word is optimized using synonymy and context importance; the candidate words are classified using the optimized score values to filter out keywords in the text information to be processed, including:
[0027] The optimized score of candidate word Q is recorded as , ; where F represents the initial score of the candidate word Q, S represents the contextual importance of the candidate word Q, Indicates the maximum value of synonymy between candidate word Q and all other candidate words in the text information to be processed;
[0028] All candidate words in the text information to be processed are grouped into two categories according to the difference between the optimized score values; the candidate words in the category with the largest optimized average score value are used as keywords to be screened in the text information to be processed input by the microcomputer host.
[0029] In a second aspect, an embodiment of the present application provides a Vincent graph device, comprising a memory, a processor, and a computer program stored in the memory and running on the processor, wherein when the computer program is executed by the processor, the Vincent graph method using a microcomputer host as described above is implemented.
[0030] In a third aspect, an embodiment of the present application further provides a computer program, which implements any one of the above-mentioned methods of making a Vincent diagram using a microcomputer host.
[0031] It can be seen from the above embodiments that the Wensheng diagram method, device and computer program using a microcomputer host provided by the embodiments of the present application have at least the following beneficial effects:
[0032] In this application, the initial score of each candidate word is constructed by analyzing the frequency of occurrence of candidate words in the text information to be processed, the number of characters and the number of co-occurrences between all adjacent candidate words, and the possibility of each candidate word being extracted as a keyword in the text information to be processed is preliminarily analyzed; the contextual importance of each candidate word is constructed based on the average distribution characteristics of the number of characters between adjacent candidate words of the same candidate word type in the text information to be processed, and the number of occurrences of the candidate word in all sentences of the text information to be processed, which is used to reflect the importance of the information contained in the candidate word; the semantic overlap between candidate words is constructed based on the repetitive features of semantics and semantic primitives between different types of candidate words; and the contextual importance of each candidate word is constructed based on the average distribution characteristics of the number of characters between adjacent candidate words in the text information to be processed and the number of occurrences of the candidate word in all sentences of the text information to be processed. The co-occurrence frequencies of candidate words and their adjacent candidate words are used to construct the co-occurrence degree between candidate words; the synonymy degree between candidate words is constructed by combining the semantic overlap degree and the co-occurrence degree, so that the similarity of semantic information contained in candidate words can be evaluated more deeply; the initial score of each candidate word is optimized by using the synonymy degree and the context importance; the candidate words are classified by using the optimized score values, and the keywords in the text information to be processed are screened out, so that the extracted keywords contain important information in the text information, while reducing the possibility of synonymous keywords appearing in the keywords, and can more accurately reflect the text information; thereby, the image obtained by keyword matching is more closely related to the text information, and the effect and efficiency of the text map are improved. BRIEF DESCRIPTION OF THE DRAWINGS
[0033] In order to more clearly illustrate the technical solutions and advantages in the embodiments of the present application or the prior art, the drawings required for use in the embodiments or the prior art descriptions are briefly introduced below. Obviously, the drawings described below are only some embodiments of the present application. For ordinary technicians in this field, other drawings can be obtained based on these drawings without creative work.
[0034] Figure 1 A flowchart of a method for producing a Vincent graph using a microcomputer host provided by an embodiment of the present application;
[0035] Figure 2 A flowchart of a process for extracting keywords from text information to be processed is provided for one embodiment of the present application. DETAILED DESCRIPTION
[0036] In order to further explain the technical means and effects adopted by the present application to achieve the predetermined invention purpose, the following is a detailed description of the method, device and computer program for using a microcomputer host according to the present application, its specific implementation method, structure, features and effects, in combination with the accompanying drawings and preferred embodiments. In the following description, different "one embodiment" or "another embodiment" does not necessarily refer to the same embodiment. In addition, specific features, structures or characteristics in one or more embodiments may be combined in any suitable form.
[0037] Unless otherwise specified and limited, terms such as "comprises", "comprising" or any other variants thereof are intended to cover non-exclusive inclusion, so that a circuit structure, article or device including a series of elements includes not only those elements, but also includes other elements not explicitly listed, or also includes elements inherent to such articles or devices. In the absence of further restrictions, an element defined by the sentence "comprising a ..." does not exclude the presence of other identical elements in the article or device including the element. In addition, the term "and\or" used herein includes any and all combinations of one or more related listed items. All technical and scientific terms used herein have the same meaning as those commonly understood by technicians in the technical field of this application.
[0038] The following is a detailed description of a specific scheme of a Wensheng diagram method, device and computer program using a microcomputer host provided by the present application in conjunction with the accompanying drawings.
[0039] See also Figure 1 , which shows a flowchart of a method for generating a Vincent graph using a microcomputer host provided by an embodiment of the present application, the method comprising the following steps:
[0040] Step 1: Construct an image-text dataset and obtain the text information to be processed input by the microcomputer host; the image-text dataset consists of each image and its manually annotated text information.
[0041] First, an image text dataset is constructed, which is specifically composed of images with text information. In this embodiment, images publicly available on the Internet are collected, and then the images are manually annotated to obtain the text information corresponding to the images, so that the image text dataset can be constructed.
[0042] When the microcomputer host performs text-generating diagram operations, the text information to be processed input by the microcomputer host can be obtained.
[0043] At this point, the construction of the image text dataset and the acquisition of the text information to be processed can be completed.
[0044] Step 2: Extract keywords from the text information to be processed according to the distribution characteristics of the candidate words in the text information to be processed; and use the text information to be processed to match the keywords in the text information of all images in the image text dataset, and fuse several matched images to obtain the generated image of the text information to be processed.
[0045] According to the above steps, the image text dataset is constructed and the text information to be processed for image generation is obtained. For text images, the image database is usually searched through the text information of the image, and the related images are obtained according to the matching status of the text information, and then the image is fused according to the related images to complete the automatic generation of the image.
[0046] In this process, it is usually necessary to extract keywords from text information and obtain the associated images corresponding to the text through keywords. The accuracy of keyword extraction directly affects the effect of the text map. The RAKE algorithm is a commonly used keyword extraction algorithm. The RAKE algorithm evaluates the keyword potential of each word by calculating the co-occurrence relationship between words in the text. However, the RAKE algorithm does not consider the similarity of word meanings. When extracting keywords, synonyms will be regarded as different keywords or some less relevant keywords will be extracted. As a result, when using keywords for matching, the correlation between the matched image and the actual text is weak, which affects the effect of the text map.
[0047] Accordingly, in this application, the process flow chart of extracting keywords from the text information to be processed is as shown in the attached Figure 2 As shown, specifically including:
[0048] S1, analyzing the frequency of occurrence of candidate words in the text information to be processed, as well as the number of characters and co-occurrence times between all adjacent candidate words, and constructing an initial score for each candidate word.
[0049] Analyze the text information to be processed input by the microcomputer host. Split the text information to be processed into individual characters or words through the RAKE algorithm. First, judge and remove stop words for the split characters or words. Stop words refer to words that have no substantial contribution semantically, generally grammatical function words or common characters, such as "了", "在", "啊", etc., which can be obtained through a pre-set method. Match the stop words for the characters or words obtained by splitting the text information to be processed, so as to remove the stop words in the text information to be processed. In this embodiment, the maximum number of characters of a word in the RAKE algorithm is set to 4, that is, the length of each word does not exceed 4 Chinese characters. Extract the characters or words with an appearance frequency greater than a preset number in the text information to be processed. In this embodiment, the preset number is taken as 2, that is, the characters or words in the text information to be processed will be extracted only when their appearance frequency is greater than or equal to 2. The specific process is a well-known technology and will not be elaborated here.
[0050] According to the above steps, the acquisition of characters and words in the text information to be processed is completed. Denote the obtained characters as candidate characters and the words as candidate words. For each candidate word, construct the initial score F of the candidate word through the appearance frequency of the candidate word in the text information to be processed and the co-occurrence frequency between the candidate word and the adjacent candidate characters. Here, the initial score is only calculated for candidate words because, according to the grammatical structure of the sentence, words are more meaningful than individual characters, such as noun phrases, verb phrases, etc.
[0051] For any candidate word, take the candidate word Q as an example here. First, obtain the appearance frequency of the candidate word Q in the text information to be processed, denoted as M, that is, the candidate word Q appears M times in the text information to be processed. Conduct a statistical analysis on the adjacent candidate characters when the candidate word Q appears each time in the text information to be processed, respectively obtain the number of characters separated between the candidate word and the adjacent candidate characters before and after it each time, and obtain the co-occurrence times R of the candidate word Q and each type of adjacent candidate character.
[0052] Then, the initial score of each candidate word can be constructed by analyzing the appearance frequency of the candidate word in the text information to be processed, and the number of characters separated and the co-occurrence times between all adjacent candidate characters. Take the initial score F of the candidate word Q in this embodiment as an example, , where M represents the appearance frequency of the candidate word Q in the text information to be processed, U represents the types of candidate characters adjacent to the candidate word Q, represents the co-occurrence times of the candidate word Q and the u-th type of adjacent candidate character, It represents the average number of characters between candidate word Q and the u-th adjacent candidate word. The larger the number of characters between them, the more stop words or other characters there are between the candidate word and the candidate word. The smaller the possibility that the candidate word and the candidate word have richer semantics, the smaller the corresponding weight. The +1 in the formula is to prevent the denominator from being 0.
[0053] S2, constructing the contextual importance of each candidate word according to the average distribution characteristics of the number of characters between adjacent candidate words of the same candidate word type in the text information to be processed, and the number of occurrences of the candidate words in all sentences of the text information to be processed.
[0054] According to the above steps, the initial score of each candidate word can be obtained. When the candidate words are directly extracted as keywords based on the initial score, some words with less information may be extracted as keywords due to inappropriate stop word settings or some words themselves containing less information. Therefore, the present application optimizes the initial score through the distribution characteristics of the candidate words in the text information to be processed.
[0055] For the text information to be processed, the text information can be divided into multiple sentences according to the punctuation marks in the text information. Assuming there are Z sentences in total, the number of characters between each appearance of the candidate word Q and the next appearance in the text information to be processed is obtained.
[0056] Furthermore, the context importance of each candidate word can be constructed based on the average distribution characteristics of the number of characters between adjacent candidate words of the same candidate word type in the text information to be processed, and the number of occurrences of the candidate word in all sentences of the text information to be processed. In this embodiment, the context importance S of the candidate word Q is taken as an example. ; Where A represents the number of sentences containing the candidate word Q in the text information to be processed, Z represents the total number of sentences in the text information to be processed, M represents the frequency of occurrence of the candidate word Q in the text information to be processed, and L represents the total number of characters in the text information to be processed, which is used to represent the length information of the text information to be processed. Indicates the number of characters between the mth and m+1th occurrences of candidate word Q. The cumulative average can be used to reflect the uniformity of candidate word distribution in the text information to be processed. The larger the value, the less uniform the candidate word distribution in the text information to be processed, and the smaller the contextual importance corresponding to the candidate word. The +1 is to prevent the denominator from being 0.
[0057] According to the above steps, the context importance of each candidate word can be obtained. The greater the context importance, the more important the information contained in the candidate word in the text, and the greater the corresponding weight during keyword extraction and subsequent matching.
[0058] S3, obtains each meaning of each candidate word and multiple semantic primitives of each meaning; constructs the semantic overlap between candidate words based on the repeated features of semantics and semantic primitives between different candidate words; constructs the co-occurrence degree between candidate words based on the co-occurrence frequency between candidate words in the image text dataset and the co-occurrence frequency between the candidate words and their adjacent candidate words; and constructs the synonymy between candidate words by combining the semantic overlap and co-occurrence.
[0059] Since the RAKE algorithm does not consider the similarity of word meanings, when performing keyword extraction, synonyms will be regarded as different keywords. Therefore, the extracted candidate words are further analyzed in this application, and the candidate words are input into HowNet for querying the candidate words, wherein HowNet is a public Chinese knowledge base, which is mainly used to process the semantic information of Chinese. By constructing a semantic network to represent the relationship between vocabulary and probability, each Chinese word has a corresponding "semantic tag" in HowNet. In HowNet, word meaning is the basic unit used to describe the semantics of words, and each word can correspond to multiple word meanings. Word meaning is composed of semantic primitives, which are the smallest units for describing word meanings and are also the basic building blocks of the HowNet knowledge system. Accordingly, this embodiment can obtain multiple word meanings corresponding to each candidate word through HowNet, and each word meaning is composed of multiple semantic primitives. Then the candidate words can be analyzed, and the synonymy between the candidate words can be constructed through the changes in word meanings and semantic primitives between the candidate words and the co-occurrence features of the candidate words and their neighboring candidate words in the image text data set.
[0060] This embodiment takes candidate words Q and candidate words W in the text information to be processed as examples, obtains multiple meanings corresponding to candidate words Q and W and multiple semantic primitives corresponding to each meaning, and first obtains the semantic overlap between candidate words.
[0061] For two candidate words with the same meaning, the semantic overlap between the two candidate words is assigned a value of 1;
[0062] Otherwise, the semantic overlap between candidate words is constructed based on the repeated features between the semantic primitives; the semantic overlap between candidate word Q and candidate word W is denoted as C, , where norm is the normalization function, y represents the number of identical semantic primitives in candidate word Q and candidate word W, Y represents the number of semantic primitives after the union of candidate word Q and candidate word W, and Yy represents the number of remaining semantic primitives in the union except for the identical semantic primitives in candidate word Q and candidate word W. The maximum value of the cosine similarity between the word vector of the vth remaining sememe and the word vectors of all other remaining sememes. The word vector of the sememe can be obtained through a public word vector model (such as the Glove word vector model). The specific process is well-known and will not be repeated here.
[0063] According to the above steps, the semantic overlap between candidate words can be obtained. Since the semantic overlap is analyzed based on the information contained in the candidate words themselves, it is easy to ignore the semantic relationship in different contexts. Therefore, this application constructs the co-occurrence degree between candidate words through the co-occurrence features between candidate words in the image text dataset and between their adjacent candidate words.
[0064] Here, we still take candidate word Q and candidate word W as examples, and obtain the neighboring candidate words each time candidate word Q and candidate word W appear in the image text data set. The neighboring candidate words in this embodiment are the two candidate words that are closest to candidate word Q or candidate word W. The implementer can adjust the number of neighboring candidate words by himself. If there are identical neighboring candidate words, that is, a certain neighboring candidate word can form corresponding text information with candidate word Q and can also form corresponding text information with candidate word W, then the neighboring candidate word is recorded as a co-occurrence candidate word.
[0065] Furthermore, according to the co-occurrence frequency between the candidate words in the image text data set and the co-occurrence frequency between the candidate words and their adjacent candidate words, the co-occurrence degree between the candidate words is constructed. In this embodiment, taking the candidate words Q and W as an example, the co-occurrence degree between the candidate words Q and W is denoted as G. ,in represents the co-occurrence frequency of candidate word Q and candidate word W in the image text dataset, GX represents the number of co-occurrence candidate words of candidate word Q and candidate word W in the image text dataset, , Respectively represent the co-occurrence frequencies of candidate words Q, W and the gx-th co-occurrence candidate word, and their differences The smaller it is, the more similar the meanings implied by candidate word Q and candidate word W are when the contexts are similar. The bigger the difference The smaller it is, the more inconsistent the implied meaning is, which means the co-occurrence degree should be greater.
[0066] Furthermore, the synonymy between the candidate words can be constructed based on the co-occurrence and semantic overlap between the candidate words. In this embodiment, the synonymy between the candidate word Q and the candidate word W is denoted as H, then Where C represents the semantic overlap between candidate word Q and candidate word W, and G represents the co-occurrence between candidate word Q and candidate word W.
[0067] S4, using synonymy and context importance to optimize the initial score of each candidate word; using the optimized score value to classify the candidate words, and filter out keywords in the text information to be processed.
[0068] The greater the synonymy, the closer the context of use and the semantic information implied between the candidate words are; the smaller the synonymy, the greater the difference between the context of use and the semantic information implied between the candidate words. The initial score of the candidate word can be optimized based on the synonymy and context importance, and the optimized score value is recorded as , ; where F represents the initial score of the candidate word Q, S represents the contextual importance of the candidate word Q, It represents the maximum value of the synonymy between the candidate word Q and all other candidate words in the text information to be processed.
[0069] According to the above steps, the optimized score values of all candidate words in the text information to be processed can be obtained, and then the K-means clustering algorithm is used to cluster all candidate words in the text information to be processed into two categories according to the differences between the optimized score values. The number of cluster categories is set to 2, and the distance metric is the absolute value of the difference between the optimized score values. The initial cluster center is randomly selected. The clustering process is a well-known technology and will not be repeated here. Other clustering algorithms can also be selected in other embodiments.
[0070] The candidate words are divided into two categories, and the candidate words in the category with the largest optimized average score are used as keywords to be screened in the text information to be processed input by the microcomputer host.
[0071] The filtered keywords are matched with the keywords in the text information corresponding to each image in the image text dataset. The extracted keywords can be converted into word vectors through the word vector model, and the cosine similarity between the word vectors is used for matching. The first several images with the largest cosine similarity are fused, and the fused image is the generated image of the text information to be processed.
[0072] Among them, this embodiment selects the first five images with the largest cosine similarity for fusion, which can be set by the implementer; in addition, the keywords in the text information corresponding to each image in the image text data set are obtained through the TF-IDF (term frequency-inverse document frequency) algorithm, and the fusion process uses the pyramid fusion technology. The TF-IDF algorithm, cosine similarity and pyramid fusion technology are all well-known technologies and will not be repeated here.
[0073] In addition, an embodiment of the present application provides a Vincent diagram device, including a memory, a processor, and a computer program stored in the memory and running on the processor. When the computer program is executed by the processor, it implements any one of the above-mentioned Vincent diagram methods using a microcomputer host.
[0074] Based on the same inventive concept as the above method, an embodiment of the present application further provides a computer program, which implements any one of the above-mentioned methods of making a Vincent diagram using a microcomputer host.
[0075] The various embodiments in the present application are described in a progressive manner, and the same or similar parts between the various embodiments can be referenced to each other, and each embodiment focuses on the differences from other embodiments.
[0076] It should be noted that, unless otherwise specified and limited, terms such as "include", "comprises" or any other variants thereof are intended to cover non-exclusive inclusion, so that a circuit structure, article or device including a series of elements includes not only those elements, but also other elements not explicitly listed, or also includes elements inherent to such article or device. In the absence of further restrictions, an element defined by the sentence "including one..." does not exclude the existence of other identical elements in the article or device including the element. In addition, the term "and\or" used herein includes any and all combinations of one or more related listed items.
[0077] Those skilled in the art will readily appreciate other embodiments of the present application after considering the specification and practicing the invention herein. The present application is intended to cover any variations, uses or adaptations of the present application, which follow the general principles of the present application and include common knowledge or customary technical means in the art that are not invented by the present application.
[0078] It should be understood that the present application is not limited to the exact construction that has been described above and shown in the drawings, and that various modifications and changes may be made without departing from the scope thereof.
Claims
1. A method for producing a Vincent graph using a microcomputer host, characterized in that: The method comprises the following steps: Step 1: Construct an image-text dataset and obtain the text information to be processed input by the microcomputer host; the image-text dataset consists of each image and its manually annotated text information; Step 2: extract keywords from the text information to be processed according to the distribution characteristics of the candidate words in the text information to be processed; and use the text information to be processed to match the keywords in the text information of all images in the image text data set, and fuse several matched images to obtain the generated image of the text information to be processed; specifically including: S1, analyzing the frequency of occurrence of the candidate words in the text information to be processed, as well as the number of characters and the number of co-occurrences between all adjacent candidate words, and constructing an initial score for each candidate word; S2, constructing the contextual importance of each candidate word according to the average distribution characteristics of the number of characters between adjacent candidate words of the same candidate word type in the text information to be processed and the number of occurrences of the candidate word in all sentences of the text information to be processed; S3, obtaining each word meaning of each candidate word and multiple semantic primitives of each word meaning; The semantic overlap between two candidate words with the same meaning is assigned a value of 1; Otherwise, the semantic overlap between candidate word Q and candidate word W is recorded as C. , where norm is the normalization function, y represents the number of identical semantic primitives in candidate word Q and candidate word W, Y represents the number of semantic primitives after the union of candidate word Q and candidate word W, and Yy represents the number of remaining semantic primitives in the union except for the identical semantic primitives in candidate word Q and candidate word W. represents the maximum value of the cosine similarity between the word vector of the vth remaining sememe and the word vectors of all other remaining sememes; The same neighboring candidate words between candidate word Q and candidate word W are recorded as co-occurrence candidate words; The co-occurrence between candidate word Q and candidate word W is recorded as G, ,in represents the co-occurrence frequency of candidate word Q and candidate word W in the image text dataset, GX represents the number of co-occurrence candidate words of candidate word Q and candidate word W in the image text dataset, , Respectively represent the co-occurrence frequencies of candidate words Q, W and the gx-th co-occurrence candidate word; The synonymy between candidate words is constructed by combining semantic overlap and co-occurrence; S4, using synonymy and context importance to optimize the initial score of each candidate word; using the optimized score value to classify the candidate words, and filter out keywords in the text information to be processed.
2. A method for producing a Vincent graph using a microcomputer host as claimed in claim 1, characterized in that: The method for obtaining the candidate words and candidate characters in step 2 is: The text information to be processed is divided into separate characters or words; characters or words whose appearance frequency in the text information to be processed is greater than a preset number are extracted and recorded as candidate characters or candidate words respectively.
3. A method for producing a Vincent graph using a microcomputer host as claimed in claim 2, characterized in that: In step S1, the method for constructing the initial score of each candidate word is as follows: The initial score of candidate word Q is recorded as F, , where M represents the frequency of occurrence of candidate word Q in the text information to be processed, and U represents the type of candidate words adjacent to candidate word Q. represents the number of co-occurrences between candidate word Q and the u-th adjacent candidate word, Represents the average number of characters between candidate word Q and the u-th adjacent candidate word.
4. A method for producing a Vincent graph using a microcomputer host as claimed in claim 1, characterized in that: In step S2, the context importance of each candidate word is constructed as follows: The contextual importance of candidate word Q is recorded as S, ; Where A represents the number of sentences containing candidate word Q in the text information to be processed, Z represents the total number of sentences in the text information to be processed, M represents the frequency of occurrence of candidate word Q in the text information to be processed, and L represents the total number of characters in the text information to be processed. Indicates the number of characters between the mth and m+1th appearances of candidate word Q.
5. A method for producing a Vincent graph using a microcomputer host as claimed in claim 1, characterized in that: In step S3, the synonymy between the candidate words is determined by the ratio of the semantic overlap to the co-occurrence between the candidate words.
6. A method for producing a Vincent graph using a microcomputer host as claimed in claim 1, characterized in that: In step S4, the initial score of each candidate word is optimized using synonymy and context importance; The candidate words are classified using the optimized score values, and keywords in the text information to be processed are selected, including: The optimized score of candidate word Q is recorded as , ; where F represents the initial score of the candidate word Q, S represents the contextual importance of the candidate word Q, Indicates the maximum value of synonymy between candidate word Q and all other candidate words in the text information to be processed; All candidate words in the text information to be processed are grouped into two categories according to the difference between the optimized score values; the candidate words in the category with the largest optimized average score value are used as keywords to be screened in the text information to be processed input by the microcomputer host.
7. A Wenshengtu device, comprising a memory, a processor, and a computer program stored in the memory and running on the processor, characterized in that: When the computer program is executed by a processor, a Vincent diagram method using a microcomputer host is implemented as described in any one of claims 1 to 6.
8. A computer program, characterized in that The computer program implements a Vincent diagram method using a microcomputer host as described in any one of claims 1-6.
Citation Information
Patent Citations
Extraction-type text summarization method with comprehensive advantages based on integer linear programming
CN108664598A
Electric power knowledge graph construction method and device
CN112632287A