Automatic illustrating method, device and equipment for PowerPoint and storage medium
By extracting multi-channel description sentences and matching degree filtering, automatic illustrations of presentations are realized, which solves the problem of low efficiency of illustrations in the existing technology and improves the accuracy and efficiency of automatic illustrations.
Patent Information
- Application Number
- CN202410564728.0
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-05-08
- Publication Date
- 2024-08-23
- Estimated Expiration
- 2044-05-08
AI Technical Summary
Existing presentation editing software is inefficient in matching images, especially finding suitable images among massive image resources takes time and labor costs.
By extracting multi-channel description sentences, matching candidate images, and filtering out target images based on matching degree, automatic mapping is achieved. The method includes extracting title and text content from the presentation, generating multi-channel description sentences, matching the characteristics of the image encoder and text encoder, calculating the matching degree of the candidate image and the page to be illustrated, and filtering out suitable illustrations.
It improves the efficiency of presentation editing, reduces manual intervention, can automatically and accurately screen out suitable illustrations, and improves the recall rate and quality of illustrations.
Smart Images

Figure CN118537446A
Abstract
Description
Technical Field
[0001] The present disclosure relates to the field of data processing technology, and in particular to technical fields such as artificial intelligence, deep learning, and natural language understanding. Background Art
[0002] A presentation can express the theme clearly and concisely and convey the core content. Presentations are mostly used in teaching, scientific research, and business activities. Compared with pure text content, presentations with pictures and text can convey the core idea vividly. Therefore, the production of a presentation requires not only the organization of text content, but also the provision of related images. Summary of the invention
[0003] The present disclosure provides a method, device, equipment and storage medium for automatically matching pictures of a presentation.
[0004] According to one aspect of the present disclosure, a method for automatically matching images to a presentation is provided, comprising:
[0005] Extract multiple description sentences from the page to be matched with pictures in the presentation;
[0006] Match each description statement with a corresponding candidate image to obtain a candidate image set;
[0007] Determine the matching degree between each candidate image in the candidate image set and the page to be matched;
[0008] Based on the matching degree between each candidate image and the page to be matched with an image, a target image is screened out for the page to be matched with an image as an illustration of the page to be matched with an image.
[0009] According to another aspect of the present disclosure, there is provided an automatic presentation diagram matching device, comprising:
[0010] An extraction module, used to extract multiple description sentences from the page to be matched with pictures in the presentation;
[0011] A matching module, used for matching corresponding candidate images for each description statement to obtain a candidate image set;
[0012] A determination module is used to determine the matching degree between each candidate image in the candidate image set and the page to be matched;
[0013] The screening module is used to screen out target images for the page to be matched with pictures based on the matching degree between each candidate image and the page to be matched with pictures, as illustrations of the page to be matched with pictures.
[0014] According to another aspect of the present disclosure, there is provided an electronic device, comprising:
[0015] at least one processor; and
[0016] a memory communicatively connected to the at least one processor; wherein,
[0017] The memory stores instructions that can be executed by the at least one processor, and the instructions are executed by the at least one processor to enable the at least one processor to execute any method in the embodiments of the present disclosure.
[0018] According to another aspect of the present disclosure, a non-transitory computer-readable storage medium storing computer instructions is provided, wherein the computer instructions are used to enable the computer to execute any method according to the embodiments of the present disclosure.
[0019] According to another aspect of the present disclosure, a computer program product is provided, including a computer program, which implements any method according to the embodiments of the present disclosure when executed by a processor.
[0020] In the disclosed embodiment, by extracting multiple description sentences, suitable illustrations can be automatically and accurately selected for the page to be equipped with illustrations.
[0021] It should be understood that the content described in this section is not intended to identify the key or important features of the embodiments of the present disclosure, nor is it intended to limit the scope of the present disclosure. Other features of the present disclosure will become easily understood through the following description. BRIEF DESCRIPTION OF THE DRAWINGS
[0022] The accompanying drawings are used to better understand the present solution and do not constitute a limitation of the present disclosure.
[0023] Figure 1 It is a flowchart of a method for automatically matching pictures to a presentation according to an embodiment of the present disclosure;
[0024] Figure 2 is a schematic diagram of generating multiple description sentences based on titles and texts according to an embodiment of the present disclosure;
[0025] Figure 3 is a schematic diagram of a process for further limiting the requirements for candidate images according to an embodiment of the present disclosure;
[0026] Figure 4 is a schematic diagram of extracting description statements according to an embodiment of the present disclosure;
[0027] Figure 5 is a schematic diagram of searching for candidate images and final illustrations using a cross-modal retrieval model according to an embodiment of the present disclosure;
[0028] Figure 6 is a schematic diagram of a process of obtaining candidate images for each description sentence according to an embodiment of the present disclosure;
[0029] Figure 7It is a schematic diagram of a process of determining the matching degree between each candidate image in a candidate image set and the page to be matched with an image according to an embodiment of the present disclosure;
[0030] Figure 8 is a schematic diagram of a comparison result according to an embodiment of the present disclosure;
[0031] Fig. 9 is a structural schematic diagram of an automatic image matching device for presentations according to an embodiment of the present disclosure;
[0032] Fig.10 The block diagram of an electronic device used to implement the method for automatically matching pictures to a presentation according to an embodiment of the present disclosure. DETAILED DESCRIPTION
[0033] The following is a description of exemplary embodiments of the present disclosure in conjunction with the accompanying drawings, including various details of the embodiments of the present disclosure to facilitate understanding, which should be considered as merely exemplary. Therefore, it should be recognized by those of ordinary skill in the art that various changes and modifications may be made to the embodiments described herein without departing from the scope of the present disclosure. Similarly, for the sake of clarity and conciseness, the description of well-known functions and structures is omitted in the following description.
[0034] The terms "first", "second", etc. in this disclosure are used to distinguish similar objects, and are not necessarily used to describe a specific order or precedence. In addition, the terms "including" and "having" and any variations thereof are intended to cover non-exclusive inclusions, for example, including a series of steps or units. The method, system, product or device is not necessarily limited to those steps or units clearly listed, but may include other steps or units that are not clearly listed or inherent to these processes, methods, products or devices.
[0035] The presentation in the disclosed embodiment may include PPT (Power Point, software for making slides and briefings), word (Office Word, document), WPS (Word Processing System, text editing system), PDF (Portable Document Format, portable document format) and other electronic documents with editable graphics and text.
[0036] Although some presentation editing software can provide a lot of functions to help users edit presentations with pictures and texts, manual editing is inefficient. Especially in terms of picture matching, facing a huge amount of image resources, how to find the right picture matching also takes time and manpower costs.
[0037] In view of this, in order to improve the editing efficiency of presentations, the embodiments of the present disclosure provide a method for automatically matching presentations. It is understandable that the processing method of the embodiments of the present disclosure is the same for any page to be matched with presentations, and the embodiments are described with reference to any page to be matched with presentations. After the text information is edited on the page to be matched with presentations, automatic matching can be implemented based on the method in the embodiments of the present disclosure. Figure 1 As shown, it is a flow chart of the method, which includes the following contents:
[0038] S101, extracting multiple description sentences from a page of a presentation to be matched with pictures.
[0039] Among them, each description sentence extracted in the embodiment of the present disclosure can describe the core content to be conveyed by the page to be equipped with pictures from different dimensions or granularities, and express the requirements of the page to be equipped with pictures for pictures. Therefore, the picture requirements expressed by the generated multiple description sentences are similar, but the description methods are different. How to extract multiple description sentences will be introduced later, and will not be repeated here.
[0040] S102, matching corresponding candidate images for each description statement to obtain a candidate image set.
[0041] For example, in the case where the multi-way description sentence includes description sentence 1 and description sentence 2. Description sentence 1 matches m candidate images, and description sentence 2 matches n candidate images, then the candidate image set is the union of the candidate images matched by description sentence 1 and description sentence 2. For example, the candidate image set may include (m+n) images.
[0042] S103, determining the matching degree between each candidate image in the candidate image set and the page to be matched with an image.
[0043] S104: based on the matching degree between each candidate image and the page to be matched with an image, a target image is selected for the page to be matched with an image as an illustration of the page to be matched with an image.
[0044] During implementation, a preset number of candidate images with high matching degrees are preferentially selected to illustrate the page to be illustrated. The preset number is determined based on the number of illustrations required for the page to be illustrated. In the disclosed embodiment, the character content and typesetting style in the page to be illustrated can be generated based on manual operation, or can be generated based on the function of automatically generating text content. Whether manually or automatically, the page to be illustrated can correspond to the required number of illustrations. Therefore, when the illustrations are finally screened, the preset number of candidate images can be selected as illustrations in the order of the matching degree of each candidate image with the page to be illustrated from high to low.
[0045] In summary, in the embodiments of the present disclosure, by extracting multiple description statements, the requirements of the page to be illustrated for illustrations can be described from different dimensions and / or granularities. Through multiple description statements, candidate images related to the page to be illustrated can be recalled as much as possible, thereby improving the recall rate of the candidate image set. In this way, suitable images are preliminarily screened out. On this basis, by determining the degree of match between each candidate image and the page to be illustrated, illustrations that can assist the page to be illustrated in expressing the core idea can be further screened out. The entire illustration process can automatically and step by step screen out suitable illustrations for the page to be illustrated without the need for manual intervention.
[0046] For ease of understanding, the process of generating a multi-way description statement and filtering an image is described below.
[0047] 1) Generate multi-way description statements
[0048] In the disclosed embodiment, it is supported to describe the requirements of the page to be illustrated from different dimensions and / or granularity as much as possible. In a possible implementation, it is necessary to extract the title information and text content of the page to be illustrated from the presentation; and generate multiple description sentences based on the title information and text content.
[0049] Taking a PPT document as an example, a PPT document may include a title and a body text, and multiple description sentences may be extracted based on these text contents.
[0050] For example, the title serves as an outline and can summarize the core content. The body of the presentation describes the core content to be conveyed in detail.
[0051] In the disclosed embodiments, the requirements for illustrations can be described at different granularities through the title and the body content. The title and the body content can express the illustration requirements of the page to be illustrated clearly and concisely, and the title and the body content are also easy to extract, and multiple description statements can be obtained accurately and quickly, thereby improving the efficiency of illustration for the page to be illustrated.
[0052] Furthermore, in order to improve the recall rate of the candidate image set, in the embodiment of the present disclosure, at least the following two operations may be performed to generate multiple description sentences based on the title and the text content, such as Figure 2 As shown:
[0053] S201, according to the level of the title, sequentially splice the titles of each level in the title information to obtain a first description sentence.
[0054] For example, Figure 2 As shown in the figure, the page to be matched with pictures is used to introduce the freehand description of mountains in ancient poems. Assuming that the title of the current page to be matched with pictures is from the first-level title Poems, to the second-level title Mountain, to the third-level title Mountain Flowers and Peach Sunflowers. Then this page belongs to the first level of the multi-level title. Figure 2As shown, the questions on the page to be illustrated only include the third-level title "Mountain Flowers: Peach and Sunflower", and the content in the page text includes:
[0055] All the flowers in the human world have withered in April, but the peach blossoms in the mountain temple are just in bloom. - Bai Juyi, "Peach Blossoms in the Temple of Great Forest"
[0056] In the clear and gentle April when the rain has just cleared, the southern mountain becomes clearly visible right in front of the door. There are no more catkins swirling in the wind, only sunflowers turning towards the sun. - Sima Guang
[0057] To extract the title information of the page to be illustrated from the presentation. When the page to be illustrated includes multi-level titles, extract the title information (including multi-level titles) from this page to be illustrated; when the page to be illustrated only includes the title of this page itself, extract the title information (including multi-level titles) for this page to be illustrated from the title outline of the presentation.
[0058] The title outline can use different symbols to represent the title levels. The examples are as follows. Different numbers of # symbols are used to represent the title levels:
[0059] # Poems (first-level title)
[0060] ## Mountains (second-level title)
[0061] Mountain Flowers: Peach and Sunflower (third-level title)
[0062] As Figure 2 shown, after extracting the title information, sort and splice it according to the title levels to obtain the first description statement: Poems Mountains Mountain Flowers: Peach and Sunflower.
[0063] It should be noted that the splicing order can be in descending order of the title levels or in ascending order of the title levels.
[0064] In addition, when splicing, different-level titles can be separated by spaces or by a preset connection symbol. This embodiment of the present disclosure does not make any limitations in this regard.
[0065] Through the first description statement, the spliced multi-level titles can concisely express the relationship between the page to be illustrated and the previous text, thereby facilitating the sorting out of the relationship between the current page to be illustrated and the expressed title, and recalling candidate images that can express the core framework.
[0066] S202, splice the first description statement and the text content in a preset order to obtain the second description statement.
[0067] Based on Figure 2Taking the page to be matched as an example, the first description sentence and the main text can be spliced together. The spliced title in the second description sentence can reflect the relationship between the content described by the current page to be matched and the core content of the previous text to a certain extent, and can also accurately describe the requirements of the current page to be matched for image content details through the main text content. Therefore, the second description sentence can help recall candidate images that can express both the framework idea and the detail requirements.
[0068] S203: Based on the first keyword extraction method, extract at least one first category keyword from the title information and the text content to construct a third description sentence.
[0069] Continue with Figure 2 Taking the page to be matched with pictures as an example, the keyword "April" can be extracted based on word frequency. April further limits the time and puts forward requirements for image content from the time dimension.
[0070] There are many ways to extract keywords, such as extracting keywords based on word frequency, extracting keywords based on a neural network model, extracting keywords based on a candidate keyword list, extracting keywords based on semantics or part of speech, etc. The specific method of extracting keywords is not limited in the disclosed embodiment. It should be noted that in the disclosed embodiment, the first keyword extraction method is used to extract the first category of keywords to construct the third description statement. The requirements for the content of the picture can be described from the perspective of keywords in order to improve the recall rate of candidate images.
[0071] S204, extracting target words in order from low to high levels of the titles; wherein, when target words are extracted from any level of title, target words are no longer extracted from titles with a higher level than any level of title.
[0072] For example, assuming there are n levels of titles in total, if the target word is extracted from the n-level title, the operation is terminated; if the target word is not extracted, the target word will continue to be extracted from the n-1-level title. If the target word is extracted, the operation is terminated, otherwise it will continue to be extracted from the previous level (n-2) title.
[0073] S205: construct a fourth description sentence based on the extracted target-type words.
[0074] For example, target words can be defined according to parts of speech, such as nouns, verbs, etc. Target words can also be further required to be what kind of noun, such as place names, names of people, animals, plants, etc.
[0075] In the disclosed embodiment, different extraction templates can be generated for different target words. When automatically matching images, the user can select the corresponding template to complete the image search. For example, the template for introducing characters is specially used to match images for presentations related to character introductions. The template for tourism introduction can be used to extract images of place names and scenery for matching images.
[0076] Continue with Figure 2 Taking the page of pictures to be matched in as an example, assuming that the target word is a plant noun, peach and sunflower can be further extracted to further limit the image content of the candidate images.
[0077] By extracting target words, we can further constrain the image details, improve the image recall rate, and improve the efficiency of automatic image matching. In addition, target words are specifically set for titles. Starting from the last level title, we can improve the efficiency of extracting target words and thus improve the efficiency of automatic image matching.
[0078] Of course, it should be noted that the descriptions of different paths support content overlap, for example, the extracted keywords and the extracted target words can overlap. Different descriptions put forward requirements for images from different perspectives, which can improve the efficiency of image matching.
[0079] For the fourth description sentence, when multiple target words are obtained, the multiple target words can be spliced to obtain the fourth description sentence. The splicing method can be spliced in order according to the weight of each target word. The weight can be allocated based on the word frequency, and the higher the word frequency, the higher the weight.
[0080] In other embodiments, in order to improve the recall rate while limiting the number of recalled images as much as possible, constructing the fourth description sentence can be implemented as follows: adding an explanation text in a preset format to the target class words to obtain the fourth description sentence.
[0081] Continue with Figure 2 For example, if the target word extracted is peach, it can be further interpreted as peach blossoms in the mountains according to the description of the page to be matched. This avoids recalling peach blossoms and peaches in the plains.
[0082] In addition, assuming that the target word is a person's name, when a person's name is extracted, it can be further explained that: *** is a person. This can help understand the type of object pointed to by the target word and avoid recalling the image of flowers when the person's name contains the word "flower".
[0083] In summary, the explanation text can be defined based on the template, or it can be automatically generated through natural language understanding based on the text information of the page to be matched with the picture, and the understanding ability of the natural language understanding model can be used to automatically generate the explanation text. During implementation, the neural network model can be trained to sort out the information of the page to be matched with the picture, and automatically generate appropriate explanation text for the target class.
[0084] It can be seen that by interpreting the text, we can provide restrictive descriptions for target words, reduce misunderstandings of target words, improve the recall rate, and improve the recall accuracy of candidate images.
[0085] It should be noted that when multiple target words are extracted, each target word and the corresponding explanation text constitute an overall expression, so as to determine the correspondence between the target word and the explanation text. In implementation, the explanation text can be represented by a specified symbol. For example: A[A is a person], this expression can be used as the overall expression of the target word A. Finally, the overall expressions of different target words can be spliced in sequence to obtain the fourth description sentence.
[0086] In the case of obtaining the above multiple description sentences, the recall rate can be effectively improved. However, in order to improve the quality of the candidate images, in the embodiment of the present disclosure, at least one description sentence can be optimized to further define the requirements for the candidate images. It can be implemented as follows Figure 3 As shown:
[0087] S301, extracting a target proper noun from a preset proper noun type set from the title information and the text content.
[0088] S302: When a target proper name is extracted, the target proper name is added to at least one description statement in the multiple description statements.
[0089] In the embodiment of the present disclosure, the type of the target proper noun extracted from the preset proper noun type set may be the same as or different from the type of the target class word, and during implementation, it may be determined according to actual needs.
[0090] When the two are the same, the target proper name can be added to the description statements except the fourth description statement. When the two are different, the target proper name can be added to each of the above four description statements.
[0091] After adding the target name, each description statement further defines the requirements for illustrations in a fine-grained manner, which can improve the quality of the recalled candidate images while improving the recall rate.
[0092] Take the PPT presentation of introducing people as an example. In the current page to be matched with pictures, the title is represented by #. One # represents a first-level title, two ## represent a second-level title, and so on up to the fourth-level title; the content after the fourth-level title is the text. The content of the page to be matched with pictures is as follows:
[0093] #Table Tennis Grand Slam Players (First Level Title)
[0094] ##Grand Slam Players (Secondary Title)
[0095] ###AAA(Level 3 title)
[0096] #### Men's Singles Grand Slam (Level 4 Title)
[0097] He won the men's singles championship at the ** World Table Tennis Championships, the men's singles and men's team championships at the ** Olympic Games, and the men's singles championship at the ** World Table Tennis Championships. (Text)
[0098] like Figure 4 As shown in the figure, the description sentences extracted based on the above method are:
[0099] The first description sentence constructed based on the title: All-time Table Tennis Grand Slam Players Grand Slam Players AAA Men's Singles Grand Slam;
[0100] The second description sentence constructed based on the title and body content: Past table tennis Grand Slam players, Grand Slam players, AAA men's singles Grand Slam, ** World Table Tennis Championships men's singles champion, ** Olympic table tennis men's singles and men's team champions, ** World Table Tennis Championships men's singles champion.
[0101] The third description sentence constructed based on the keywords in the title and body content: AAA Grand Slam Table Tennis Champion Men's Singles.
[0102] Based on the target words, the fourth description sentence constructed for the name in this example is: AAA [is a person].
[0103] Assuming that the extracted proper name is also a person's name, the target proper name to be extracted is AAA. Add the target proper name AAA to the first three-way description statement, and the final four-way description statement is:
[0104] The final first-way description sentence: All-time table tennis Grand Slam players Grand Slam players AAA men's singles Grand Slam AAA;
[0105] The final second description sentence: All-time table tennis Grand Slam players, Grand Slam players AAA men's singles Grand Slam, ** World Table Tennis Championships men's singles champion, ** Olympic table tennis men's singles and men's team champions, ** World Table Tennis Championships men's singles champion AAA.
[0106] The final third description sentence: AAA Grand Slam Table Tennis Champion Men's Singles.
[0107] Based on the target words, the fourth description sentence constructed for the name in this example is: AAA [is a person].
[0108] It is understandable that even if the extracted target proper noun is repeated in some road description sentences, it can still play a role in emphasizing the target proper noun and help screen out candidate images that are strongly related to the target proper noun.
[0109] In summary, the construction process of multiple description statements is introduced. The following further explains how to match appropriate illustrations based on each description statement.
[0110] 2) Filter images
[0111] In the disclosed embodiment, candidate images and final illustrations may be found based on a cross-modal retrieval model.
[0112] like Figure 5 As shown, the key parts of the cross-modal retrieval model may include an image encoder and a text encoder.
[0113] Among them, the image encoder can adopt the VIT (Vision Transformer, visual processing model) model, and the text encoder can adopt the BERT (Bidirectional Encoder Representation from Transformers, pre-trained language representation model) model.
[0114] In the embodiment of the present disclosure, the training sample is constructed by an image-text pair, that is, an image and its corresponding text description are a training sample.
[0115] The retrieval model can be fine-tuned based on the CLIP model (Contrastive Language-Image Pre-training, a pre-training model based on contrasting text-image pairs) to enable it to more focus on the application scenarios of image-text relevance in presentations such as AIPPT (Artificial Intelligence Power Point, a software for making slides and briefings based on artificial intelligence). Fine-tuning can include two stages:
[0116] The first stage, such as Figure 5 As shown in the figure, the image encoder is frozen and only the text encoder is fine-tuned. Based on the training samples, the text encoder is fine-tuned to make it easier to align the features obtained by the image encoder, which facilitates faster convergence during the second stage of full fine-tuning.
[0117] In the second stage, the training samples are used to fine-tune the full model parameters of the retrieval model. In order to better extract image features, the resolution of the images in the training samples can be improved in the second stage so that more image features can be extracted.
[0118] During the training phase, model parameters can be adjusted through contrast loss.
[0119] After two stages of fine-tuning, the image and text features are aligned, where the output features of the text and image vectors can be mapped to a unified dimension, such as 512 dimensions.
[0120] In the inference phase, descriptive features of the same length can be obtained by merging the features of the two encoders.
[0121] After the retrieval model is trained, the screening of candidate image sets and illustrations can be completed in the inference stage.
[0122] (1) Screening candidate image sets
[0123] In the embodiment of the present disclosure, the operation for each description statement is the same. For each description statement, the candidate image of the description statement can be obtained by the following method, such as Figure 6 As shown:
[0124] S601: extracting text features of the road description sentence through a text encoder.
[0125] S602, determining the similarity between the text feature and each image feature in the image feature set.
[0126] S603: Based on the similarity, select an image matching the text feature as a candidate image.
[0127] Among them, the images with higher similarity are selected as candidate images. In implementation, the first m images can be selected as candidate images, or images with similarity higher than a similarity threshold can be selected as candidate images.
[0128] In the disclosed embodiment, the feature extraction capability based on the neural network model can extract key features from the description sentence to facilitate the recall of suitable candidate images, which can help improve the accuracy of the matching pictures.
[0129] In the disclosed embodiment, when pictures are needed, the retrieval model can be used to extract the image features of each image and compare them with the text features of each description sentence.
[0130] In addition, in order to improve the efficiency of image matching, the image feature set is generated and stored in advance. The image features of the image can be extracted in advance and stored in the cache accordingly, so that when matching is needed, the operation of repeatedly extracting image features can be reduced, and the efficiency of image matching can be accelerated.
[0131] Furthermore, in the embodiment of the present disclosure, in order to meet the needs of matching pictures, the image features stored in the image feature set include not only the features extracted by the image encoder, but also the text features extracted based on the text of the corresponding image.
[0132] In order to better describe the feature expression of the image, in the embodiment of the present disclosure, the image features of each image to be matched in the image set to be matched are obtained based on the following method:
[0133] Step A1, extracting a first feature expression of the image to be matched based on the image encoder; and
[0134] Step A2: extracting a second feature expression of the image text corresponding to the image to be matched based on the text encoder.
[0135] It should be noted that the execution order of step A1 and step A2 is not limited.
[0136] Step A3: Perform weighted summation on the first feature expression and the second feature expression to obtain image features of the image to be matched.
[0137] During implementation, the weights can be obtained through training when training the retrieval model. For example, after the second stage of training, the model parameters of the image encoder and the text encoder are frozen, and appropriate weights are trained using training samples. When training the weights, a supervised training method is used to compare the comprehensive features of the candidate text and the image (i.e., the features after weighted summation), determine the similarity between the two, and adjust the weights based on the contrast loss. That is, the weights are trained by maximizing the similarity between the candidate text and image features that express the same or similar content, and minimizing the similarity between the candidate text and image features that express different or dissimilar content. The disclosed embodiments are not limited to this.
[0138] In the disclosed embodiment, the image features used for retrieval combine the features extracted by the image encoder and the text encoder, and can describe the image from multiple dimensions. In particular, when matching text with images, the features described by the text encoder dimensions can better adapt to the text of the page to be matched with images, thereby improving the efficiency of matching images.
[0139] (2) Screening illustrations
[0140] In the embodiment of the present disclosure, since each description statement recalls candidate images separately, there may be duplicate images between the candidate images recalled by each description statement. In order to improve the efficiency of image matching, in the embodiment of the present disclosure, duplicates are removed from the candidate image set based on the following method:
[0141] Step B1, obtaining image features of each candidate image in the candidate image set.
[0142] Step B2: normalize the image features of each candidate image to obtain the normalized features of each candidate image.
[0143] Through the normalization operation, the features of different images can be expressed in a smaller feature space, which can appropriately reduce the amount of calculation and improve the efficiency of deduplication.
[0144] Step B3: construct a feature matrix based on the normalized features of each candidate image.
[0145] For example, in the feature matrix, elements in the same row are associated with each candidate image, and elements in the same column are also associated with each candidate image. Therefore, for different candidate characteristics, the feature matrix can be used to sort out pairs of images so that in step B4, multiple threads created based on at least one kernel perform product operations on the feature matrix elements to obtain the similarity between any two candidate images.
[0146] Step B5: taking two candidate images whose similarity is higher than a preset threshold as duplicate images and obtaining a duplicate image mark.
[0147] Step B6: performing image deduplication operation on the candidate image set based on the duplicate image tags.
[0148] For repeated images, only one image is retained in the candidate image set. In implementation, which candidate image to retain can be determined based on the similarity between the candidate image and the page to be matched. That is, the candidate image with the highest similarity is retained. Alternatively, if the repeated images are of one category, the class center vector of the category is found, and the candidate image closest to the class center vector is selected and retained.
[0149] In the disclosed embodiment, the recall rate is improved through multi-channel recall, but the amount of recalled images may be large. To this end, the image is optimized through deduplication operation to improve the efficiency of image matching. In order to reduce the amount of images to be processed later as much as possible, normalization and kernel multi-threading technology are used to further improve the deduplication efficiency, and finally achieve the purpose of improving the efficiency of image matching.
[0150] In the embodiment of the present disclosure, determining the matching degree between each candidate image in the candidate image set and the page to be matched with an image can be implemented as follows: Figure 7 As shown:
[0151] S701, extracting at least one second keyword from the text of the page to be matched with pictures based on the second keyword extraction method.
[0152] In the disclosed embodiment, the second keyword extraction method is different from the first keyword extraction method. In this way, different keywords are used to describe the illustration requirements at different stages, which can help improve the quality of illustrations.
[0153] For example, the first keyword extraction method may extract keywords based on word frequency, and the second keyword extraction method may use a large model to extract keywords.
[0154] The prompt example of a large model is as follows:
[0155] "Input:\n#hh and gg\n##Comparison of writing styles between hh and gg\n###Select similarities and differences\n-hh's works mostly involve social reality, human nature exploration, youth growth, etc., focusing on the living conditions and fate of people at the bottom of society, and conveying deep thinking about society.\n-gg's works mostly revolve around love, friendship, dreams, etc., focusing on the individual's inner emotional world and growth process, expressing the yearning and pursuit of beautiful things.\nThe above is the text in the ppt page, # represents different levels of titles.\n represents carriage return. It is required to extract the key information in the text to search for related pictures and match the ppt\n\nOutput:\nWith a photo of hh / gg\n\n\nInput:\n{}\n\nThe above is the text in the ppt page, # represents different levels of titles.\n represents carriage return. It is required to extract the key information in the text to search for related pictures and match the ppt\n\nOutput:\n".
[0156] That is, the prompt gives an example of a page that needs to be equipped with pictures, and explains the title and task in the example. Based on this example, the big model can be guided to extract keywords for the page to be equipped with pictures.
[0157] S702, concatenating the second category of keywords into the text of the page to be matched with pictures to obtain an intermediate text.
[0158] S703, using a text encoder to extract text features of the intermediate text.
[0159] S704, calculating the matching degree of the text features of the intermediate text and the image features of each candidate image in the candidate image set, and obtaining the matching degree of each candidate image in the candidate image set and the page to be matched.
[0160] Afterwards, suitable illustrations can be selected based on the matching degree to complete the illustration operation.
[0161] In the disclosed embodiment, by further expanding keywords to assist in improving the text description of the page to be matched with pictures, the text encoder can be helped to further understand the content in the page to be matched with pictures, extract reasonable text features, and thus find suitable illustrations.
[0162] In the embodiments of the present disclosure, the experimental results can be further described through comparative experiments. Figure 8 As shown, the left column of pictures is the effect of not using the scheme provided by the embodiment of the present disclosure, and the right column is the effect of using the scheme provided by the embodiment of the present disclosure. Figure 8 It can be seen from the comparison diagram in the first row that the illustrations in the embodiments of the present disclosure can intuitively express the scene to be described. Figure 8 It can be seen from the comparison chart in the second row that the illustration of the logistics scene in the left picture is relatively simple, while the illustration provided by the embodiment of the present disclosure has a richer display of the logistics scene and can better fit the text language.
[0163] Based on the same technical concept, the embodiment of the present disclosure also provides an automatic presentation image matching device 900, such as Fig. 9 As shown, including:
[0164] Extraction module 901, used to extract multiple description sentences from the page to be matched with pictures in the presentation;
[0165] A matching module 902 is used to match corresponding candidate images for each description statement to obtain a candidate image set;
[0166] The determination module 903 is used to determine the matching degree between each candidate image in the candidate image set and the page to be matched with an image;
[0167] The screening module 904 is used to screen out a target image for the page to be matched with a picture based on the matching degree between each candidate image and the page to be matched with a picture, as an illustration of the page to be matched with a picture.
[0168] In some embodiments, the extraction module includes:
[0169] An extraction unit, used for extracting the title information and text content of the page to be matched with the picture from the presentation;
[0170] A generating unit is used to generate the multi-channel description sentence based on the title information and the text content.
[0171] In some embodiments, the generating unit is used to perform at least two of the following operations to generate the multi-path description statement:
[0172] According to the level of the title, the titles of each level in the title information are sequentially spliced to obtain a first description statement;
[0173] The first description sentence is concatenated with the text content in a preset order to obtain a second description sentence;
[0174] Based on the first keyword extraction method, extract at least one first-category keyword from the title information and the text content to construct a third description sentence;
[0175] Target-class words are extracted in order from low to high levels of the titles; and a fourth description statement is constructed based on the extracted target-class words; wherein, when the target-class words are extracted from a title of any level, the target-class words will no longer be extracted from a title of a level higher than that of the title of any level.
[0176] In some embodiments, an add module is further included, including:
[0177] Extracting a target proper name from a preset proper name type set from the title information and the text content;
[0178] When the target specific name is extracted, the target specific name is added to at least one description statement in the multiple description statements.
[0179] In some embodiments, the generating unit is specifically configured to:
[0180] An explanation text in a preset format is added to the target word to obtain the fourth description sentence.
[0181] In some embodiments, the matching module is specifically used to:
[0182] For each description sentence, extract the text features of the description sentence through a text encoder;
[0183] Determine the similarity between the text feature and each image feature in the image feature set;
[0184] Based on the similarity, an image matching the text feature is selected as a candidate image.
[0185] In some embodiments, an image feature extraction module is further included, which is used to:
[0186] Extracting a first feature expression of the image to be matched based on an image encoder; and
[0187] Extracting a second feature expression of the image text corresponding to the image to be matched based on the text encoder;
[0188] The first feature expression and the second feature expression are weightedly summed to obtain the image feature of the image to be matched.
[0189] In some embodiments, the determination module is specifically configured to:
[0190] Based on the second keyword extraction method, extract at least one second keyword from the text of the page to be matched with the image;
[0191] Splicing the second category of keywords into the text of the page to be matched with pictures to obtain an intermediate text;
[0192] A text encoder is used to extract text features of the intermediate text;
[0193] The text features of the intermediate text and the image features of each candidate image in the candidate image set are respectively calculated to obtain the matching degree between each candidate image in the candidate image set and the page to be matched with an image.
[0194] In some embodiments, a deduplication module is further included for:
[0195] Obtaining image features of each candidate image in the candidate image set;
[0196] Normalizing the image features of each candidate image to obtain normalized features of each candidate image;
[0197] Based on the normalized features of each candidate image, a feature matrix is constructed;
[0198] A plurality of threads created based on at least one core perform a product operation between elements of the feature matrix to obtain a similarity between any two candidate images;
[0199] The two candidate images whose similarity is higher than a preset threshold are regarded as duplicate images, and a duplicate image mark is obtained;
[0200] An image deduplication operation is performed on the candidate image set based on the duplicate image tags.
[0201] For the description of specific functions and examples of each module and submodule of the device in the embodiment of the present disclosure, reference can be made to the relevant description of the corresponding steps in the above method embodiment, which will not be repeated here.
[0202] In the technical solution disclosed herein, the acquisition, storage and application of user personal information involved are in compliance with the provisions of relevant laws and regulations and do not violate public order and good morals.
[0203] According to an embodiment of the present disclosure, the present disclosure also provides an electronic device, a readable storage medium and a computer program product.
[0204] Fig.10A schematic block diagram of an example electronic device 1000 that can be used to implement an embodiment of the present disclosure is shown. The electronic device is intended to represent various forms of digital computers, such as laptop computers, desktop computers, workstations, personal digital assistants, servers, blade servers, mainframe computers, and other suitable computers. The electronic device can also represent various forms of mobile devices, such as personal digital assistants, cellular phones, smart phones, wearable devices, and other similar computing devices. The components shown herein, their connections and relationships, and their functions are merely examples and are not intended to limit the implementation of the present disclosure described and / or required herein.
[0205] like Fig.10 As shown, the device 1000 includes a computing unit 1001, which can perform various appropriate actions and processes according to a computer program stored in a read-only memory (ROM) 1002 or a computer program loaded from a storage unit 1008 into a random access memory (RAM) 1003. In the RAM 1003, various programs and data required for the operation of the device 1000 can also be stored. The computing unit 1001, the ROM 1002, and the RAM 1003 are connected to each other via a bus 1004. An input / output (I / O) interface 1005 is also connected to the bus 1004.
[0206] A number of components in the device 1000 are connected to the I / O interface 1005, including: an input unit 1006, such as a keyboard, a mouse, etc.; an output unit 1007, such as various types of displays, speakers, etc.; a storage unit 1008, such as a disk, an optical disk, etc.; and a communication unit 1009, such as a network card, a modem, a wireless communication transceiver, etc. The communication unit 1009 allows the device 1000 to exchange information / data with other devices through a computer network such as the Internet and / or various telecommunication networks.
[0207] The computing unit 1001 may be a variety of general and / or special processing components with processing and computing capabilities. Some examples of the computing unit 1001 include, but are not limited to, a central processing unit (CPU), a graphics processing unit (GPU), various dedicated artificial intelligence (AI) computing chips, various computing units running machine learning model algorithms, digital signal processors (DSPs), and any appropriate processors, controllers, microcontrollers, etc. The computing unit 1001 performs the various methods and processes described above, such as the automatic drawing method for a presentation. For example, in some embodiments, the automatic drawing method for a presentation may be implemented as a computer software program, which is tangibly included in a machine-readable medium, such as a storage unit 1008. In some embodiments, part or all of the computer program may be loaded and / or installed on the device 1000 via the ROM 1002 and / or the communication unit 1009. When the computer program is loaded into the RAM 1003 and executed by the computing unit 1001, one or more steps of the automatic drawing method for the presentation described above may be performed. Alternatively, in other embodiments, the computing unit 1001 may be configured to execute the method for automatically matching presentation images in any other appropriate manner (eg, by means of firmware).
[0208] Various implementations of the systems and techniques described above herein can be implemented in digital electronic circuit systems, integrated circuit systems, field programmable gate arrays (FPGAs), application specific integrated circuits (ASICs), application specific standard products (ASSPs), systems on chips (SOCs), load programmable logic devices (CPLDs), computer hardware, firmware, software, and / or combinations thereof. These various implementations can include: being implemented in one or more computer programs that can be executed and / or interpreted on a programmable system including at least one programmable processor, which can be a special purpose or general purpose programmable processor that can receive data and instructions from a storage system, at least one input device, and at least one output device, and transmit data and instructions to the storage system, the at least one input device, and the at least one output device.
[0209] The program code for implementing the method of the present disclosure may be written in any combination of one or more programming languages. These program codes may be provided to a processor or controller of a general-purpose computer, a special-purpose computer, or other programmable data processing device, so that the program code, when executed by the processor or controller, enables the functions / operations specified in the flow chart and / or block diagram to be implemented. The program code may be executed entirely on the machine, partially on the machine, partially on the machine and partially on a remote machine as a stand-alone software package, or entirely on a remote machine or server.
[0210] In the context of the present disclosure, a machine-readable medium may be a tangible medium that may contain or store a program for use by or in conjunction with an instruction execution system, device, or equipment. A machine-readable medium may be a machine-readable signal medium or a machine-readable storage medium. A machine-readable medium may include, but is not limited to, an electronic, magnetic, optical, electromagnetic, infrared, or semiconductor system, device, or equipment, or any suitable combination of the foregoing. A more specific example of a machine-readable storage medium may include an electrical connection based on one or more lines, a portable computer disk, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disk read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the foregoing.
[0211] To provide interaction with a user, the systems and techniques described herein can be implemented on a computer having: a display device (e.g., a CRT (cathode ray tube) or LCD (liquid crystal display) monitor) for displaying information to the user; and a keyboard and pointing device (e.g., a mouse or trackball) through which the user can provide input to the computer. Other types of devices can also be used to provide interaction with the user; for example, the feedback provided to the user can be any form of sensory feedback (e.g., visual feedback, auditory feedback, or tactile feedback); and input from the user can be received in any form (including acoustic input, voice input, or tactile input).
[0212] The systems and techniques described herein may be implemented in a computing system that includes back-end components (e.g., as a data server), or a computing system that includes middleware components (e.g., an application server), or a computing system that includes front-end components (e.g., a user computer with a graphical user interface or a web browser through which a user can interact with implementations of the systems and techniques described herein), or a computing system that includes any combination of such back-end components, middleware components, or front-end components. The components of the system may be interconnected by any form or medium of digital data communication (e.g., a communication network). Examples of communication networks include: a local area network (LAN), a wide area network (WAN), and the Internet.
[0213] A computer system may include a client and a server. The client and the server are generally remote from each other and usually interact through a communication network. The relationship of client and server is generated by computer programs running on respective computers and having a client-server relationship with each other. The server may be a cloud server, a server of a distributed system, or a server combined with a blockchain.
[0214] Based on the aforementioned electronic device, the present disclosure also provides a vehicle, which may include electronic devices, and may also include communication components, a display screen for realizing a human-machine interface, and an information collection device for collecting surrounding environment information, etc. The communication components, the display screen, the information collection device and the electronic device are communicatively connected.
[0215] According to the embodiments of the present disclosure, the electronic device may be integrated with the communication component, the display screen and the information collection device, or may be separately provided with the communication component, the display screen and the information collection device.
[0216] It should be understood that the various forms of processes shown above can be used to reorder, add or delete steps. For example, the steps recorded in this disclosure can be executed in parallel, sequentially or in different orders, as long as the desired results of the technical solutions disclosed in this disclosure can be achieved, and this document does not limit this.
[0217] The above specific implementations do not constitute a limitation on the protection scope of the present disclosure. It should be understood by those skilled in the art that various modifications, combinations, sub-combinations and substitutions can be made according to design requirements and other factors. Any modification, equivalent substitution and improvement made within the principles of the present disclosure shall be included in the protection scope of the present disclosure.
Claims
1. A method for automatically matching pictures to a presentation, comprising: Extract multiple description sentences from the page to be matched with pictures in the presentation; Match each description statement with a corresponding candidate image to obtain a candidate image set; Determine the matching degree between each candidate image in the candidate image set and the page to be matched with an image; Based on the matching degree between each candidate image and the page to be matched with an image, a target image is screened out for the page to be matched with an image as an illustration of the page to be matched with an image.
2. The method according to claim 1, wherein: The step of extracting multiple description sentences from the page to be matched with pictures in the presentation includes: Extract the title information and text content of the page to be matched with pictures from the presentation; The multiple description sentences are generated based on the title information and the body content.
3. The method according to claim 2, wherein: The generating the multiple description sentences based on the title information and the text content includes: Perform at least two of the following operations to generate the multi-path description statement: According to the level of the title, the titles of each level in the title information are sequentially spliced to obtain a first description statement; The first description statement is concatenated with the text content in a preset order to obtain a second description statement; Based on the first keyword extraction method, extract at least one first-category keyword from the title information and the text content to construct a third description sentence; Target-class words are extracted in order from low to high levels of the titles; and a fourth description statement is constructed based on the extracted target-class words; wherein, when the target-class words are extracted from a title of any level, the target-class words will no longer be extracted from a title of a level higher than that of the title of any level.
4. The method according to claim 2 or 3, further comprising: Extracting a target proper noun from a preset proper noun type set from the title information and the text content; When the target specific name is extracted, the target specific name is added to at least one description statement among the multiple description statements.
5. The method according to claim 3, wherein: The step of constructing a fourth description sentence based on the extracted target words includes: An explanation text in a preset format is added to the target word to obtain the fourth description sentence.
6. The method according to claim 1, wherein: The step of matching each description statement with a corresponding candidate image includes: For each description sentence, extract the text features of the description sentence through a text encoder; Determining the similarity between the text feature and each image feature in the image feature set; Based on the similarity, an image matching the text feature is selected as a candidate image.
7. The method according to claim 6, wherein: It also includes obtaining the image features of each image to be matched in the image set to be matched based on the following method: Extracting a first feature expression of the image to be matched based on an image encoder; as well as, Extracting a second feature expression of the image text corresponding to the image to be matched based on the text encoder; Perform a weighted summation of the first feature expression and the second feature expression to obtain the image feature of the image to be matched.
8. The method according to claim 1, wherein: The determining of the matching degree between each candidate image in the candidate image set and the page to be matched with an image comprises: Based on the second keyword extraction method, extract at least one second keyword from the text of the page to be matched with the image; Adding the second category of keywords to the text of the page to be matched with pictures to obtain an intermediate text; Using a text encoder to extract text features of the intermediate text; The text features of the intermediate text and the image features of each candidate image in the candidate image set are respectively calculated to obtain the matching degree between each candidate image in the candidate image set and the page to be matched with an image.
9. The method according to any one of claims 1 to 8, further comprising: Acquire image features of each candidate image in the candidate image set; Normalizing the image features of each candidate image to obtain normalized features of each candidate image; Based on the normalized features of each candidate image, a feature matrix is constructed; Based on the multiple threads created by at least one core, a product operation is performed between the elements of the feature matrix to obtain the similarity between any two candidate images; The two candidate images whose similarity is higher than a preset threshold are regarded as duplicate images, and a duplicate image mark is obtained; An image deduplication operation is performed on the candidate image set based on the duplicate image tags.
10. An automatic picture matching device for presentation, comprising: An extraction module, used to extract multiple description sentences from the page to be matched with pictures in the presentation; A matching module, used for matching corresponding candidate images for each description statement to obtain a candidate image set; A determination module, used to determine the matching degree between each candidate image in the candidate image set and the page to be matched with an image; The screening module is used to screen out a target image for the page to be matched with a picture based on the matching degree between each candidate image and the page to be matched with a picture, as an illustration of the page to be matched with a picture.
11. The device according to claim 10, wherein: The extraction module comprises: An extraction unit, used for extracting the title information and text content of the page to be matched with the picture from the presentation; A generating unit is used to generate the multi-channel description sentences based on the title information and the text content.
12. The device according to claim 11, wherein The generating unit is used to perform at least two of the following operations to generate the multi-path description statement: According to the level of the title, the titles of each level in the title information are sequentially spliced to obtain a first description statement; The first description statement is concatenated with the text content in a preset order to obtain a second description statement; Based on the first keyword extraction method, extract at least one first-category keyword from the title information and the text content to construct a third description sentence; Extract target words in order from low to high levels of titles; And based on the extracted target-class words, a fourth description statement is constructed; wherein, when the target-class words are extracted from any level of title, the target-class words will no longer be extracted from titles of a level higher than that of any level of title.
13. The device according to claim 11 or 12, further comprising an adding module, comprising: Extracting a target proper noun from a preset proper noun type set from the title information and the text content; When the target specific name is extracted, the target specific name is added to at least one description statement among the multiple description statements.
14. The device according to claim 12, wherein: The generating unit is specifically used for: An explanation text in a preset format is added to the target word to obtain the fourth description sentence.
15. The device according to claim 10, wherein: The matching module is specifically used for: For each description sentence, extract the text features of the description sentence through a text encoder; Determining the similarity between the text feature and each image feature in the image feature set; Based on the similarity, an image matching the text feature is selected as a candidate image.
16. The device according to claim 15, wherein: It also includes an image feature extraction module for: Extracting a first feature expression of the image to be matched based on an image encoder; as well as, Extracting a second feature expression of the image text corresponding to the image to be matched based on the text encoder; Perform a weighted summation of the first feature expression and the second feature expression to obtain the image feature of the image to be matched.
17. The device according to claim 10, wherein: The determination module is specifically used for: Based on the second keyword extraction method, extract at least one second keyword from the text of the page to be matched with the image; Adding the second category of keywords to the text of the page to be matched with pictures to obtain an intermediate text; Using a text encoder to extract text features of the intermediate text; The text features of the intermediate text and the image features of each candidate image in the candidate image set are respectively calculated to obtain the matching degree between each candidate image in the candidate image set and the page to be matched with an image.
18. The apparatus according to any one of claims 10 to 17, further comprising a deduplication module, configured to: Acquire image features of each candidate image in the candidate image set; Normalizing the image features of each candidate image to obtain normalized features of each candidate image; Based on the normalized features of each candidate image, a feature matrix is constructed; Based on the multiple threads created by at least one core, a product operation is performed between the elements of the feature matrix to obtain the similarity between any two candidate images; The two candidate images whose similarity is higher than a preset threshold are regarded as duplicate images, and a duplicate image mark is obtained; An image deduplication operation is performed on the candidate image set based on the duplicate image tags.
19. An electronic device comprising: at least one processor; as well as a memory communicatively connected to the at least one processor; wherein, The memory stores instructions that can be executed by the at least one processor, and the instructions are executed by the at least one processor to enable the at least one processor to perform the method according to any one of claims 1 to 9.
20. A non-transitory computer-readable storage medium storing computer instructions, wherein: The computer instructions are used to cause the computer to execute the method according to any one of claims 1-9.
21. A computer program product comprising a computer program, which, when executed by a processor, implements the method according to any one of claims 1 to 9.
Citation Information
Patent Citations
News illustration method and device, equipment and storage medium
CN113343012A
Method and device for matching rule text for image, electronic equipment and storage medium
CN117333886A
Powerpoint generation method and device, electronic equipment and storage medium
CN117436415A
Powerpoint content generation method and device, electronic equipment and storage medium
CN117951290A
Method for generating inforgraphic information and method for generating image database
WO2020103899A1
Cited By
Image searching method and device, intelligent agent, electronic equipment and storage medium
CN119597955A
