CN111259180A - Image pushing method and device, electronic equipment and storage medium - Google Patents
Image pushing method and device, electronic equipment and storage medium Download PDFInfo
- Publication number
- CN111259180A CN111259180A CN202010037232.XA CN202010037232A CN111259180A CN 111259180 A CN111259180 A CN 111259180A CN 202010037232 A CN202010037232 A CN 202010037232A CN 111259180 A CN111259180 A CN 111259180A
- Authority
- CN
- China
- Prior art keywords
- keyword
- image
- text
- target
- chapter
- Prior art date
- Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
- Granted
Links
- 238000000034 method Methods 0.000 title claims abstract description 64
- 239000013598 vector Substances 0.000 claims description 83
- 238000013256 Gubra-Amylin NASH model Methods 0.000 claims description 34
- 238000012545 processing Methods 0.000 claims description 25
- 238000012549 training Methods 0.000 claims description 17
- 238000012217 deletion Methods 0.000 claims description 11
- 230000037430 deletion Effects 0.000 claims description 11
- 230000008569 process Effects 0.000 description 9
- PEDCQBHIVMGVHV-UHFFFAOYSA-N Glycerine Chemical compound OCC(O)CO PEDCQBHIVMGVHV-UHFFFAOYSA-N 0.000 description 8
- 238000009826 distribution Methods 0.000 description 8
- 238000010586 diagram Methods 0.000 description 6
- 230000008859 change Effects 0.000 description 4
- 230000003796 beauty Effects 0.000 description 3
- 230000008878 coupling Effects 0.000 description 3
- 238000010168 coupling process Methods 0.000 description 3
- 238000005859 coupling reaction Methods 0.000 description 3
- 238000013528 artificial neural network Methods 0.000 description 2
- 238000004364 calculation method Methods 0.000 description 2
- 238000004891 communication Methods 0.000 description 2
- 230000011218 segmentation Effects 0.000 description 2
- 241000124033 Salix Species 0.000 description 1
- 238000004458 analytical method Methods 0.000 description 1
- 230000001413 cellular effect Effects 0.000 description 1
- 230000000694 effects Effects 0.000 description 1
- 238000005516 engineering process Methods 0.000 description 1
- ZZUFCTLCJUWOSV-UHFFFAOYSA-N furosemide Chemical compound C1=C(Cl)C(S(=O)(=O)N)=CC(C(O)=O)=C1NCC1=CC=CO1 ZZUFCTLCJUWOSV-UHFFFAOYSA-N 0.000 description 1
- 238000010801 machine learning Methods 0.000 description 1
- 238000012986 modification Methods 0.000 description 1
- 230000004048 modification Effects 0.000 description 1
- 230000003287 optical effect Effects 0.000 description 1
- 238000006467 substitution reaction Methods 0.000 description 1
Images
Classifications
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F16/00—Information retrieval; Database structures therefor; File system structures therefor
- G06F16/50—Information retrieval; Database structures therefor; File system structures therefor of still image data
- G06F16/53—Querying
- G06F16/535—Filtering based on additional data, e.g. user or group profiles
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F16/00—Information retrieval; Database structures therefor; File system structures therefor
- G06F16/50—Information retrieval; Database structures therefor; File system structures therefor of still image data
- G06F16/58—Retrieval characterised by using metadata, e.g. metadata not derived from the content or metadata generated manually
- G06F16/5866—Retrieval characterised by using metadata, e.g. metadata not derived from the content or metadata generated manually using information manually generated, e.g. tags, keywords, comments, manually generated location and time information
-
- Y—GENERAL TAGGING OF NEW TECHNOLOGICAL DEVELOPMENTS; GENERAL TAGGING OF CROSS-SECTIONAL TECHNOLOGIES SPANNING OVER SEVERAL SECTIONS OF THE IPC; TECHNICAL SUBJECTS COVERED BY FORMER USPC CROSS-REFERENCE ART COLLECTIONS [XRACs] AND DIGESTS
- Y02—TECHNOLOGIES OR APPLICATIONS FOR MITIGATION OR ADAPTATION AGAINST CLIMATE CHANGE
- Y02D—CLIMATE CHANGE MITIGATION TECHNOLOGIES IN INFORMATION AND COMMUNICATION TECHNOLOGIES [ICT], I.E. INFORMATION AND COMMUNICATION TECHNOLOGIES AIMING AT THE REDUCTION OF THEIR OWN ENERGY USE
- Y02D10/00—Energy efficient computing, e.g. low power processors, power management or thermal management
Landscapes
- Engineering & Computer Science (AREA)
- Theoretical Computer Science (AREA)
- Data Mining & Analysis (AREA)
- Databases & Information Systems (AREA)
- Physics & Mathematics (AREA)
- General Engineering & Computer Science (AREA)
- General Physics & Mathematics (AREA)
- Library & Information Science (AREA)
- Information Retrieval, Db Structures And Fs Structures Therefor (AREA)
Abstract
The application provides an image pushing method, an image pushing device, electronic equipment and a storage medium, wherein the method comprises the following steps: receiving text input by a user; according to the text, acquiring an image of a target keyword in an image database, wherein the similarity between the target keyword and the keyword in the text is greater than a first similarity threshold, the target keyword is the keyword in the text database, and the image database comprises the image of the keyword in the text database; and pushing images of the target keywords, wherein the images of the keywords in the text base are generated according to the keywords in the text base. The image of the keywords in the text base is stored in advance, the image of the keywords similar to the text can be pushed according to the text input by the user, and the efficiency of the user for obtaining the image is improved.
Description
Technical Field
The present application relates to the field of confrontation network image generation technologies, and in particular, to an image pushing method and apparatus, an electronic device, and a storage medium.
Background
In order to facilitate the users to make courseware, various types of courseware making software are produced, such as Powerpoint (PPT) software, Flash software and the like. When a user uses these software to make a courseware, images are sometimes inserted to visually illustrate text in the courseware through the images.
In the prior art, a user needs to search for an image corresponding to a text in a search engine and select a proper image from the images to insert into a courseware. Illustratively, a user inputs a text of "moonlight" in a search engine to obtain a search result containing images of moonlight, and then selects an appropriate image from the search result to insert into a courseware. The method for obtaining the image through searching is time-consuming, other irrelevant images may exist in the searched image result, the user is required to select the images, and the efficiency is low.
Disclosure of Invention
The application provides an image pushing method, an image pushing device, electronic equipment and a storage medium, which can improve the efficiency of a user for obtaining an image.
A first aspect of the present application provides an image pushing method, including:
receiving a text input by a user, acquiring an image of a target keyword in an image database according to the text, and pushing the image of the target keyword; the similarity between the target keyword and the keyword in the text is greater than a first similarity threshold, the target keyword is a keyword in a text library, the image database comprises images of the keyword in the text library, and the images of the keyword in the text library are generated according to the keyword in the text library.
Optionally, the text library comprises a plurality of chapters; the acquiring of the image of the target keyword in the image database includes: determining a target section associated with the text among the plurality of sections; acquiring similarity between the keywords of the target section and the keywords in the text, and taking the keywords with the similarity larger than a first similarity threshold value in the target section as the target keywords; and acquiring the image of the target keyword in the image database.
Optionally, the determining, among the plurality of sections, a target section associated with the text includes: vectorizing the text to obtain a vector corresponding to the text; extracting a feature vector of a vector corresponding to the text; and acquiring the similarity between the feature vector of the text and the feature vector of each chapter in the text library, and taking the chapter with the similarity larger than a second similarity threshold value in the text library as the target chapter.
Optionally, before the obtaining the image of the target keyword in the image database, the method further includes: and segmenting the text, and taking words with preset parts of speech as keywords of the text.
Optionally, the method further includes: and inputting the keywords of each section into a confrontation network GAN model to obtain an image of the keywords of each section, wherein the GAN model is used for representing the corresponding relation between the keywords and the generated image.
Optionally, the method further includes: acquiring a keyword of each chapter; acquiring a search image of the keyword of each chapter; and training the GAN model by taking a vector corresponding to the search image of each keyword of the chapter, a disorder vector corresponding to the search image of each keyword of the chapter input by a user and an expected result as training data, wherein the expected result is that the vector corresponding to the search image of each keyword of the chapter is different from the corresponding disorder vector.
Optionally, after the obtaining of the search image of the keyword of each chapter, the method further includes: displaying a search image of a keyword of each of the chapters; receiving a deletion instruction of the user, and deleting a search image with the semantic of the representation different from that of the keyword of each chapter; vectorizing the keyword search image of each section after deletion processing to obtain a vector corresponding to the search image of the keyword of each section.
A second aspect of the present application provides an image pushing apparatus comprising:
the receiving and sending module is used for receiving a text input by a user;
the processing module is used for acquiring an image of a target keyword in an image database according to the text and pushing the image of the target keyword; the similarity between the target keyword and the keyword in the text is greater than a first similarity threshold, the target keyword is a keyword in a text library, the image database comprises images of the keyword in the text library, and the images of the keyword in the text library are generated according to the keyword in the text library.
Optionally, the text library comprises a plurality of chapters.
The processing module is specifically configured to determine a target chapter associated with the text in the chapters, obtain similarity between keywords of the target chapter and keywords in the text, use the keywords with similarity higher than a first similarity threshold value in the target chapter as the target keywords, and obtain an image of the target keywords in the image database.
Optionally, the processing module is specifically configured to vectorize the text, obtain a vector corresponding to the text, extract a feature vector of the vector corresponding to the text, obtain a similarity between the feature vector of the text and a feature vector of each chapter in the text library, and take the chapter with the similarity greater than a second similarity threshold in the text library as the target chapter.
Optionally, the processing module is further configured to perform word segmentation on the text, and use a word with a preset part of speech as a keyword of the text.
Optionally, the processing module is further configured to input the keyword of each of the sections into a confrontation network GAN model to obtain an image of the keyword of each of the sections, where the GAN model is used to represent a corresponding relationship between the keyword and the generated image.
Optionally, the processing module is further configured to obtain each keyword of the chapter and each search image of the keyword of the chapter, train the GAN model by using a vector corresponding to the search image of each keyword of the chapter, a disorder vector corresponding to the search image of each keyword of the chapter input by a user, and an expected result as training data, where the expected result is that the vector corresponding to the search image of each keyword of the chapter is different from the corresponding disorder vector.
The display module is used for displaying the search image of the key word of each chapter;
the receiving and sending module is used for receiving a deletion instruction of the user and deleting the search image with the represented semantics different from the semantics of the keywords of each chapter;
the processing module is further configured to vectorize the keyword search image of each of the sections after the deletion processing, so as to obtain a vector corresponding to the search image of the keyword of each of the sections.
A third aspect of the present application provides an electronic device comprising: at least one processor and memory;
the memory stores computer-executable instructions;
the at least one processor executes the computer-executable instructions stored by the memory, so that the electronic device executes the image pushing method.
A fourth aspect of the present application provides a computer-readable storage medium having stored thereon computer-executable instructions, which, when executed by a processor, implement the above-mentioned image push method.
The application provides an image pushing method, an image pushing device, electronic equipment and a storage medium, wherein the method comprises the following steps: receiving text input by a user; according to the text, acquiring an image of a target keyword in an image database, wherein the similarity between the target keyword and the keyword in the text is greater than a first similarity threshold, the target keyword is the keyword in the text database, and the image database comprises the image of the keyword in the text database; and pushing images of the target keywords, wherein the images of the keywords in the text base are generated according to the keywords in the text base. The image of the keyword in the text library is stored in advance, the image of the keyword similar to the text can be pushed according to the text input by the user, and the efficiency of the user for obtaining the image is improved.
Drawings
FIG. 1 is a schematic diagram of a prior art interface change;
fig. 2 is a first flowchart illustrating an image pushing method provided in the present application;
FIG. 3 is a schematic view of the interface change provided herein;
fig. 4 is a second flowchart illustrating an image pushing method provided in the present application;
FIG. 5 is a schematic flow chart of a process for training a GAN model provided herein;
FIG. 6 is a schematic structural diagram of an image pushing apparatus provided in the present application;
fig. 7 is a schematic structural diagram of an electronic device provided in the present application.
Detailed Description
In order to make the objects, technical solutions and advantages of the present application clearer, the technical solutions in the embodiments of the present application will be clearly and completely described below with reference to the embodiments of the present application, and it is obvious that the described embodiments are some but not all of the embodiments of the present application. All other embodiments, which can be derived by a person skilled in the art from the embodiments given herein without making any creative effort, shall fall within the protection scope of the present application.
In order to more clearly explain the image pushing method provided by the present application, the following describes a process of acquiring an image when a user makes a courseware in the prior art. In the prior art, a user may search for an acquired image through a search engine. Fig. 1 is a schematic diagram of interface change in the prior art. It should be understood that fig. 1 illustrates a computer as an example. As shown in the interface 101 in fig. 1, a user may input "moonlight" in an input box of a browser displayed in the interface 101, and further may select a menu option "picture" in the interface 101, and accordingly, the interface 101 may jump to the interface 102, and an image of "moonlight" may be displayed in the interface 102. The user can select the image required by the user from the images displayed in the interface 102 to store the image so as to insert the image into the courseware. However, in the method in the prior art, the user needs to search for the image through the search engine, and as shown in the above-mentioned interface 102, many other images unrelated to "moonlight" exist in the search result, such as image 2 and image 3.
In order to avoid the problem that a user needs to search and select images in the courseware making process, the image pushing method is provided, and images related to the texts are pushed for the user according to the texts input by the user in the courseware making process, so that the image obtaining efficiency of the user is improved.
It should be understood that a main body performing the image push method in the present application may be an image push apparatus, and the image push method may be a terminal device having a display screen. The terminal device in the present application may include, but is not limited to, a mobile terminal device or a fixed terminal device. Mobile terminal devices include, but are not limited to, cellular phones, Personal Digital Assistants (PDAs), tablet computers, portable devices (e.g., laptop computers, pocket computers, or handheld computers), and the like. Fixed terminals include, but are not limited to, desktop computers and the like.
The image pushing method provided by the present application is described below with reference to specific embodiments. Fig. 2 is a first flowchart of an image pushing method provided in the present application. As shown in fig. 2, the image pushing method provided in this embodiment may include:
s201, receiving a text input by a user.
In this embodiment, when a user makes a courseware or other display type document, the user may input a text, and correspondingly, the image pushing apparatus may receive the text input by the user. It should be understood that the text is text entered by the user in real time.
Fig. 3 is a schematic view of the interface change provided in the present application. As shown in the interface 301 of fig. 3, the text entered on the interface by the user is "today's moonlight beauty". If the user inputs the next sentence "pleasant" of "today's moonlight is true", the text input by the user is "pleasant".
S202, according to the text, obtaining an image of the target keyword in the image database, wherein the similarity between the target keyword and the keyword in the text is larger than a first similarity threshold value, the target keyword is the keyword in the text database, the image database comprises images of the keyword in the text database, and the images of the keyword in the text database are generated according to the keyword in the text database.
The text library in this embodiment includes a plurality of keywords, and the image database includes images of the keywords in the text library. It should be understood that the images of the keywords in the image database are generated from the keywords in the text corpus. Optionally, in this embodiment, an image of the keyword generated against the generated web GAN model and the keyword in the text library may be adopted. The image of the keyword is generated by adopting the GAN model, so that the problem that the image searched in a search engine is directly adopted to cause infringement can be avoided.
In this embodiment, the image of the target keyword may be acquired in the image database according to the text. Specifically, the target keyword is obtained from the keywords in the text library according to the similarity between the keywords in the text and each keyword in the text library, and then the image of the target keyword is obtained from the image database. In this embodiment, keywords in the text, whose similarity to the keywords of the text is greater than the first similarity threshold, may be used as the target keywords.
Optionally, in this embodiment, the method for obtaining the similarity between the keyword of the text and each keyword in the text library may be, but is not limited to: similarity based on keywords (such as N-gram similarity or Jaccard similarity), or similarity based on vector space (such as euclidean distance, manhattan distance, or cosine similarity obtained by adopting methods such as Word2vec or Latent Semantic Analysis (LSA) to represent similarity of vector space), and the like.
Optionally, if the number of the target keywords is greater than the preset number, the target keywords may be arranged in a manner that the similarity is from large to small, and the top target keywords are taken as the target keywords. Alternatively, the keyword having the greatest similarity may be used as the target keyword.
In this embodiment, the text may be segmented to obtain keywords of the text. Specifically, words with preset parts of speech, such as nouns, may be used as keywords of the text. Illustratively, the text "today's moonlight is true" is segmented, and "today's moonlight", "moonlight", and "true" can be acquired. Wherein, the keyword of the text can be "moonlight". Correspondingly, the target keywords acquired in the text database may be "moonlight" and "moon", and then the images of "moonlight" and "moon" are acquired in the image database.
S203, pushing the image of the target keyword.
In this embodiment, after the image of the target keyword is obtained, the image of the target keyword may be pushed.
Optionally, the manner of pushing the image of the target keyword may be: and displaying the images of the target keywords on the interface, or displaying the images of a preset number of target keywords on the interface.
In order to improve the user experience and reduce the interference on the courseware making of the user, the mode of pushing the image of the target keyword can also be as follows: and displaying the link of the image corresponding to the target keyword. When a selection instruction of a link of the image corresponding to the target keyword by a user is received, the image of the target keyword can be displayed.
Illustratively, interface 301 may jump to interface 302 as described above, where interface 302 may have a link to "moonlight" and "moonlight" images displayed thereon. Where links to images that may be displayed on the interface 302 are identified with text of "moonlight" and "moon". If the user clicks on "moon" on the interface, the interface 302 may jump to interface 303, with an image of "moon" displayed on interface 303.
The image pushing method provided in the embodiment includes: receiving text input by a user; according to the text, acquiring an image of a target keyword in an image database, wherein the similarity between the target keyword and the keyword in the text is greater than a first similarity threshold, the target keyword is the keyword in the text database, and the image database comprises the image of the keyword in the text database; and pushing an image of the target keyword. In the embodiment, the images of the keywords in the text library are stored in advance, and then the images of the keywords similar to the text are pushed for the user according to the similarity between the keywords of the text and the keywords in the text library, so that the problem that the user needs to obtain the images in a search engine is avoided, and the efficiency of obtaining the images by the user is improved.
Based on the above embodiments, the image pushing method provided by the present application is further described below with reference to fig. 4. Fig. 4 is a flowchart illustrating a second image pushing method according to the present application. As shown in fig. 4, the image pushing method provided in this embodiment may include:
s401, receiving a text input by a user.
S402, determining a target chapter related to the text in the plurality of chapters.
The text library in this embodiment includes a plurality of chapters. Optionally, the text library may be a textbook text of the student, the textbook text includes a plurality of chapters, the user may be a teacher, and the corresponding scene is used for making courseware for the teacher; or the text library can also be a professional technical text in a certain field, the professional technical text comprises a plurality of chapters, the user is a technician, and the corresponding scene is used for making courseware for the technician; or the text library may be other types of text according to different application scenarios.
In order to reduce the amount of calculation of the similarity with the keyword in the text input by the user, a target section associated with the text may be determined among a plurality of sections, and the similarity between the keyword in the target section and the keyword in the text may be calculated.
In this embodiment, a chapter containing a text input by a user in the text library may be used as a target chapter. Sometimes, when the user makes courseware, the text possibly input is not the original text in the text library, but the text with similar semantics after the user understands. Therefore, in this embodiment, the text may be vectorized to obtain a vector corresponding to the text. Optionally, the text vectorization method in this embodiment may be: word2vec, Neural Network Language Model (NNLM), and the like.
After the vector corresponding to the text is obtained, the feature vector of the vector corresponding to the text can be extracted, and then the section with the similarity larger than the second similarity threshold in the text library is taken as the target section according to the similarity between the obtained feature vector of the text and the feature vector of each section in the text library. The feature vector of each chapter in the text library may be a feature vector of a text included in each chapter, and a manner of acquiring the feature vector of the text included in each chapter in this embodiment is the same as the manner of acquiring the feature vector of the text input by the user. The second similarity threshold may be the same as or different from the first similarity threshold described above. Optionally, in this embodiment, Bi-LSTM and Attention models are used to extract feature vectors.
For example, if the section having the feature vector of the text "today's moonlight beauty" larger than the second similarity threshold value is the second section of the text library, the second section may be used as the target section.
S403, acquiring similarity between the keywords of the target section and the keywords in the text, and taking the keywords with the similarity larger than a first similarity threshold value in the target section as the target keywords.
In this embodiment, after the target section is determined, the similarity between the keyword of the target section and the keyword in the text may be obtained, so as to avoid calculating the similarity between the keywords of all sections in the text library and the keyword in the text.
When the similarity between the keywords of the target section and the keywords in the text is obtained, the keywords with the similarity larger than the first similarity threshold in the target section can be used as the target keywords.
Illustratively, the keywords in the second section include keywords such as "moon", "salix populi", "lake", and the like, so as to obtain the similarity between these keywords and the keyword "moon" in the text "today's moonlight beauty" input by the user, and the keyword "moon" in the second section, whose similarity is greater than the first similarity threshold, is taken as the target keyword.
S404, acquiring an image of the target keyword in the image database.
The image database in this embodiment includes an image of a keyword in each chapter of the text base, and after the target keyword is obtained, the image of the target keyword may be obtained in the image database.
The image of the target keyword in the present embodiment is generated by using the countermeasure generation network GAN model. It should be understood that GAN models are used to characterize the correspondence between keywords and generated images. In this embodiment, the keyword of each chapter is input to the countermeasure network GAN model in advance, and an image of the keyword of each chapter can be obtained. Since the image is generated anew by the GAN model, the original image of the keyword searched in the search engine is not used, and the problem that the user may infringe on using the image can be avoided.
The following describes a method for training GAN model in the present application. Fig. 5 is a schematic flowchart of the GAN model training process provided in the present application. As shown in fig. 5, the method for obtaining a GAN model according to this embodiment may include:
s501, keywords of each chapter are obtained.
In this embodiment, the keywords of each chapter in the text library may be acquired. The method for acquiring the keywords of each chapter in the text library can be as follows: and segmenting the text in each section to take words with preset parts of speech in the segmented text in each section as keywords. It should be understood that the manner of obtaining the keywords of each chapter may be the same as the manner of obtaining the keywords of the text input by the user in the foregoing embodiment, and details are not described here.
S502, acquiring a search image of the keyword of each chapter.
After the keywords of each section are obtained, the keywords of each section can be sequentially input into a search engine, and a search image of the keywords of each section is obtained. Alternatively, the keyword of each chapter may be displayed so that the user searches a search engine for an image of the keyword of each chapter, and then receives an image of the keyword of each chapter input by the user.
Optionally, since the image of the keyword of each chapter is obtained by using a search engine, an image having a different semantic meaning from the keyword may exist in the image of the keyword of each chapter output by the search engine. In order to improve the accuracy of the trained GAN model, the image of the keyword of each chapter may be processed in this embodiment.
Wherein the search image of the keyword of each chapter can be displayed so that the user can see the search image of the keyword of each chapter. The user can delete the unsuitable image, and specifically, the unsuitable image can be a search image with different representation semantics and keywords semantics.
Correspondingly, in the embodiment, a deletion instruction of the user can be received, and the search image with the semantic of the representation different from that of the keyword of each chapter can be deleted. Where deletion indicates that the search image used to indicate that the semantics of the tokens are different from the semantics of the keywords of each chapter, as shown in interface 102 in fig. 1, images 2 and 3 may be deleted. Wherein, the semanteme of the representation of the image 2 and the image 3 is different from the semanteme of the keyword 'moonlight'.
In this embodiment, the search image of the keyword of each chapter after the deletion processing is vectorized, and a vector corresponding to the search image of the keyword of each chapter is obtained. In which search images are vectorized, i.e., features of a graph are represented by a point in a multidimensional vector space, to facilitate processing using a machine learning method.
S503, training the GAN model by taking the vector corresponding to the search image of the keyword of each chapter, the disorder vector corresponding to the search image of the keyword of each chapter input by the user and the expected result as training data, wherein the expected result is that the vector corresponding to the search image of the keyword of each chapter is different from the corresponding disorder vector.
In this embodiment, the user may input at least one unordered vector for a vector corresponding to the search image of the keyword of each chapter. The vector corresponding to the search image of the keyword of each chapter and the unordered vector corresponding to the search image of the keyword of each chapter are different vectors, and the process of training the GAN model is that the vector of the search image of the keyword of each chapter and the corresponding unordered vector are different vectors.
And training the GAN model by taking the vector corresponding to the search image of the keyword of each chapter, the unordered vector corresponding to the search image of the keyword of each chapter input by the user and the expected result as training data. Wherein the vector corresponding to the search image for which the desired result is the keyword for each chapter is different from the corresponding unordered vector. It should be understood that the process of training the GAN model is a process of continuously iteratively acquiring parameters of a neural network layer in the GAN model, and an output result of the GAN model obtained by final training is the same as an expected result or has a difference value within a preset range.
In this embodiment, the recognition of the vector of the search image and the corresponding disorder vector for the keyword of each chapter may be characterized by the loss value of the discriminator in the GAN model. The discriminator needs to resolve the two vector distributions as much as possible, and the conditions in the following formula one need to be satisfied:
LossD=Ex~p(x)(logD(x))+Ex~q(x)(log (1-D (x))) formula one
Where p (x) is the distribution of vectors of the search image for the keyword for each chapter. We approximate it with a controllable, known distribution disorder vector q (x), or let the distributions of the two vectors coincide as much as possible. Therein, LossDFor the loss value of the discriminator, x-p (x) the distribution of the vectors of the search images for the keywords of each chapter is subject to p (x), x-q (x) the distribution of the unordered vectors corresponding to the search images for the keywords of each chapter is subject to q (x), Ex~p(x)(logD (x)) is a distribution value of a vector of a search image of the keyword of each chapter, Ex~q(x)(log (1-d (x)) is a distribution value of the disorder vector corresponding to the search image of the keyword of each chapter, and d (x) is an output value of the GAN model. The purpose in this embodiment is to make the obtained Loss value Loss of the discriminator in the process of training the GAN modelDAnd minimum.
In this embodiment, in order to reduce the calculation amount of the similarity between the text and the keyword in the text input by the user, a target chapter associated with the text may be determined in multiple chapters, and then the similarity between the keyword in the target chapter and the keyword in the text is calculated, and sometimes when the user makes a courseware, the text that may be input is not an original text in the text library, and the similarity between the text and the target chapter of the text is determined by using the similarity between the feature vectors of the text in the corresponding embodiment. Further, the present application discloses that an image of a keyword in an image database is generated from a trained GAN model, and since the GAN model is a regenerated image, it is not an original image of the keyword searched in a search engine, and thus it is possible to avoid the problem of infringement.
Fig. 6 is a schematic structural diagram of an image pushing apparatus provided in the present application. As shown in fig. 6, the image pushing apparatus 600 includes: a transceiver module 601, a processing module 602 and a display module 603.
A transceiver module 601, configured to receive a text input by a user;
the processing module 602 is configured to obtain an image of the target keyword in the image database according to the text, and push the image of the target keyword; the similarity between the target keyword and the keyword in the text is larger than a first similarity threshold, the target keyword is the keyword in the text library, the image database comprises images of the keyword in the text library, and the images of the keyword in the text library are generated according to the keyword in the text library.
Optionally, the text library comprises a plurality of chapters.
The processing module 602 is specifically configured to determine a target chapter associated with the text in the multiple chapters, obtain similarity between a keyword of the target chapter and the keyword in the text, take the keyword in the target chapter whose similarity is greater than a first similarity threshold as the target keyword, and obtain an image of the target keyword in an image database.
Optionally, the processing module 602 is specifically configured to vectorize the text, obtain a vector corresponding to the text, extract a feature vector of the vector corresponding to the text, obtain a similarity between the feature vector of the text and a feature vector of each chapter in the text library, and use the chapter with the similarity greater than the second similarity threshold in the text library as the target chapter.
Optionally, the processing module 602 is further configured to perform word segmentation on the text, and use a word with a preset part of speech as a keyword of the text.
Optionally, the processing module 602 is further configured to input the keyword of each section into the countermeasure network GAN model to obtain an image of the keyword of each section, where the GAN model is used to represent a corresponding relationship between the keyword and the generated image.
Optionally, the processing module 602 is further configured to obtain a keyword of each chapter and a search image of the keyword of each chapter, and train the GAN model by using a vector corresponding to the search image of the keyword of each chapter, a disorder vector corresponding to the search image of the keyword of each chapter input by the user, and an expected result as training data, where the expected result is that the vector corresponding to the search image of the keyword of each chapter is different from the corresponding disorder vector.
A display module 603 for displaying a search image of the keyword for each chapter;
a transceiver module 601, configured to receive a deletion instruction from a user, and delete a search image whose represented semantics are different from the semantics of the keywords of each chapter;
the processing module 602 is further configured to vectorize the keyword search image of each section after the deletion processing, so as to obtain a vector corresponding to the search image of the keyword of each section.
The principle and technical effect of the image pushing apparatus provided in this embodiment are similar to those of the image pushing method, and are not described herein again.
Fig. 7 is a schematic structural diagram of an electronic device provided in the present application. The electronic device may be the image pushing apparatus in fig. 6 described above. As shown in fig. 7, the electronic device 700 includes: a memory 701 and at least one processor 702.
A memory 701 for storing program instructions.
The processor 702 is configured to implement the image pushing method in this embodiment when the program instructions are executed, and specific implementation principles may be referred to in the foregoing embodiments, which are not described herein again.
The electronic device 700 may also include an input/output interface 703.
The input/output interface 703 may include a separate output interface and input interface, or may be an integrated interface that integrates input and output. The output interface is used for outputting data, the input interface is used for acquiring input data, the output data is a general name output in the method embodiment, and the input data is a general name input in the method embodiment.
The present application further provides a readable storage medium, in which an execution instruction is stored, and when the execution instruction is executed by at least one processor of the electronic device, when the computer execution instruction is executed by the processor, the image pushing method in the above embodiments is implemented.
The present application also provides a program product comprising execution instructions stored in a readable storage medium. The at least one processor of the electronic device may read the execution instruction from the readable storage medium, and the execution of the execution instruction by the at least one processor causes the electronic device to implement the image pushing method provided in the various embodiments described above.
In the several embodiments provided in the present application, it should be understood that the disclosed apparatus and method may be implemented in other ways. For example, the above-described apparatus embodiments are merely illustrative, and for example, the division of the modules is merely a logical division, and in actual implementation, there may be other divisions, for example, multiple modules or components may be combined or integrated into another system, or some features may be omitted, or not implemented. In addition, the shown or discussed mutual coupling or direct coupling or communication connection may be an indirect coupling or communication connection through some interfaces, devices or modules, and may be in an electrical, mechanical or other form.
The modules described as separate parts may or may not be physically separate, and parts displayed as modules may or may not be physical modules, may be located in one place, or may be distributed on a plurality of network modules. Some or all of the modules may be selected according to actual needs to achieve the purpose of the solution of the present embodiment.
In addition, functional modules in the embodiments of the present application may be integrated into one processing module, or each of the modules may exist alone physically, or two or more modules are integrated into one module. The integrated module can be realized in a hardware form, and can also be realized in a form of hardware and a software functional module.
The integrated module implemented in the form of a software functional module may be stored in a computer-readable storage medium. The software functional module is stored in a storage medium and includes several instructions for enabling a computer device (which may be a personal computer, a server, or a network device) or a processor (processor) to execute some steps of the methods according to the embodiments of the present application. And the aforementioned storage medium includes: a U disk, a removable hard disk, a Read-Only Memory (ROM), a Random Access Memory (RAM), a magnetic disk or an optical disk, and other various media capable of storing program codes.
In the foregoing embodiments of the network device or the terminal device, it should be understood that the Processing module may be a Central Processing Unit (CPU), or may also be another general-purpose Processor, a Digital Signal Processor (DSP), an Application Specific Integrated Circuit (ASIC), or the like. A general purpose processor may be a microprocessor or the processor may be any conventional processor or the like. The steps of a method disclosed in connection with the present application may be embodied directly in a hardware processor, or in a combination of the hardware and software modules in the processor.
Finally, it should be noted that: the above embodiments are only used for illustrating the technical solutions of the present application, and not for limiting the same; although the present application has been described in detail with reference to the foregoing embodiments, it should be understood by those of ordinary skill in the art that: the technical solutions described in the foregoing embodiments may still be modified, or some or all of the technical features may be equivalently replaced; and the modifications or the substitutions do not make the essence of the corresponding technical solutions depart from the scope of the technical solutions of the embodiments of the present application.
Claims (10)
1. An image pushing method, comprising:
receiving text input by a user;
according to the text, acquiring an image of a target keyword in an image database, wherein the similarity between the target keyword and the keyword in the text is greater than a first similarity threshold, the target keyword is a keyword in a text library, the image database comprises images of the keyword in the text library, and the image of the keyword in the text library is generated according to the keyword in the text library;
and pushing the image of the target keyword.
2. The method of claim 1, wherein the text library comprises a plurality of chapters; the acquiring of the image of the target keyword in the image database includes:
determining a target section associated with the text among the plurality of sections;
acquiring similarity between the keywords of the target section and the keywords in the text, and taking the keywords with the similarity larger than a first similarity threshold value in the target section as the target keywords;
and acquiring the image of the target keyword in the image database.
3. The method of claim 2, wherein determining the target section of the plurality of sections associated with the text comprises:
vectorizing the text to obtain a vector corresponding to the text;
extracting a feature vector of a vector corresponding to the text;
and acquiring the similarity between the feature vector of the text and the feature vector of each chapter in the text library, and taking the chapter with the similarity larger than a second similarity threshold value in the text library as the target chapter.
4. The method of any one of claims 1-3, wherein prior to obtaining the image of the target keyword in the image database, further comprising:
and segmenting the text, and taking words with preset parts of speech as keywords of the text.
5. The method of claim 2, further comprising:
and inputting the keywords of each section into a confrontation network GAN model to obtain an image of the keywords of each section, wherein the GAN model is used for representing the corresponding relation between the keywords and the generated image.
6. The method of claim 5, further comprising:
acquiring a keyword of each chapter;
acquiring a search image of the keyword of each chapter;
and training the GAN model by taking a vector corresponding to the search image of each keyword of the chapter, a disorder vector corresponding to the search image of each keyword of the chapter input by a user and an expected result as training data, wherein the expected result is that the vector corresponding to the search image of each keyword of the chapter is different from the corresponding disorder vector.
7. The method according to claim 6, wherein after the obtaining of the search image of the keyword of each of the chapters, the method further comprises:
displaying a search image of a keyword of each of the chapters;
receiving a deletion instruction of the user, and deleting a search image with the semantic of the representation different from that of the keyword of each chapter;
vectorizing the keyword search image of each section after deletion processing to obtain a vector corresponding to the search image of the keyword of each section.
8. An image pushing apparatus, comprising:
the receiving and sending module is used for receiving a text input by a user;
the processing module is used for acquiring an image of a target keyword in an image database according to the text and pushing the image of the target keyword; the similarity between the target keyword and the keyword in the text is greater than a first similarity threshold, the target keyword is a keyword in a text library, the image database comprises images of the keyword in the text library, and the images of the keyword in the text library are generated according to the keyword in the text library.
9. An electronic device, comprising: at least one processor and memory;
the memory stores computer-executable instructions;
the at least one processor executing the computer-executable instructions stored by the memory causes the electronic device to perform the method of any of claims 1-7.
10. A computer-readable storage medium having computer-executable instructions stored thereon which, when executed by a processor, implement the method of any one of claims 1-7.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202010037232.XA CN111259180B (en) | 2020-01-14 | 2020-01-14 | Image pushing method, device, electronic equipment and storage medium |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202010037232.XA CN111259180B (en) | 2020-01-14 | 2020-01-14 | Image pushing method, device, electronic equipment and storage medium |
Publications (2)
Publication Number | Publication Date |
---|---|
CN111259180A true CN111259180A (en) | 2020-06-09 |
CN111259180B CN111259180B (en) | 2024-04-19 |
Family
ID=70950466
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN202010037232.XA Active CN111259180B (en) | 2020-01-14 | 2020-01-14 | Image pushing method, device, electronic equipment and storage medium |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN111259180B (en) |
Cited By (2)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN111881307A (en) * | 2020-07-28 | 2020-11-03 | 平安科技(深圳)有限公司 | Demonstration manuscript generation method and device, computer equipment and storage medium |
CN113961736A (en) * | 2021-09-14 | 2022-01-21 | 华南理工大学 | Method and device for generating image by text, computer equipment and storage medium |
Citations (8)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
US6804683B1 (en) * | 1999-11-25 | 2004-10-12 | Olympus Corporation | Similar image retrieving apparatus, three-dimensional image database apparatus and method for constructing three-dimensional image database |
US20080082497A1 (en) * | 2006-09-29 | 2008-04-03 | Leblang Jonathan A | Method and system for identifying and displaying images in response to search queries |
CN106355429A (en) * | 2016-08-16 | 2017-01-25 | 北京小米移动软件有限公司 | Image material recommendation method and device |
CN109325223A (en) * | 2018-07-24 | 2019-02-12 | 广州神马移动信息科技有限公司 | Article recommended method, device and electronic equipment |
CN109543058A (en) * | 2018-11-23 | 2019-03-29 | 连尚(新昌)网络科技有限公司 | For the method for detection image, electronic equipment and computer-readable medium |
CN109684797A (en) * | 2018-11-21 | 2019-04-26 | 众安信息技术服务有限公司 | Confrontation network based on block chain generates the virtual IP address guard method and system of picture |
CN110096641A (en) * | 2019-03-19 | 2019-08-06 | 深圳壹账通智能科技有限公司 | Picture and text matching process, device, equipment and storage medium based on image analysis |
CN110209862A (en) * | 2019-05-22 | 2019-09-06 | 招商局金融科技有限公司 | Text matches drawing method, electronic device and computer readable storage medium |
-
2020
- 2020-01-14 CN CN202010037232.XA patent/CN111259180B/en active Active
Patent Citations (8)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
US6804683B1 (en) * | 1999-11-25 | 2004-10-12 | Olympus Corporation | Similar image retrieving apparatus, three-dimensional image database apparatus and method for constructing three-dimensional image database |
US20080082497A1 (en) * | 2006-09-29 | 2008-04-03 | Leblang Jonathan A | Method and system for identifying and displaying images in response to search queries |
CN106355429A (en) * | 2016-08-16 | 2017-01-25 | 北京小米移动软件有限公司 | Image material recommendation method and device |
CN109325223A (en) * | 2018-07-24 | 2019-02-12 | 广州神马移动信息科技有限公司 | Article recommended method, device and electronic equipment |
CN109684797A (en) * | 2018-11-21 | 2019-04-26 | 众安信息技术服务有限公司 | Confrontation network based on block chain generates the virtual IP address guard method and system of picture |
CN109543058A (en) * | 2018-11-23 | 2019-03-29 | 连尚(新昌)网络科技有限公司 | For the method for detection image, electronic equipment and computer-readable medium |
CN110096641A (en) * | 2019-03-19 | 2019-08-06 | 深圳壹账通智能科技有限公司 | Picture and text matching process, device, equipment and storage medium based on image analysis |
CN110209862A (en) * | 2019-05-22 | 2019-09-06 | 招商局金融科技有限公司 | Text matches drawing method, electronic device and computer readable storage medium |
Cited By (4)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN111881307A (en) * | 2020-07-28 | 2020-11-03 | 平安科技(深圳)有限公司 | Demonstration manuscript generation method and device, computer equipment and storage medium |
CN111881307B (en) * | 2020-07-28 | 2024-04-05 | 平安科技(深圳)有限公司 | Presentation generation method and device, computer equipment and storage medium |
CN113961736A (en) * | 2021-09-14 | 2022-01-21 | 华南理工大学 | Method and device for generating image by text, computer equipment and storage medium |
CN113961736B (en) * | 2021-09-14 | 2024-07-23 | 华南理工大学 | Method, apparatus, computer device and storage medium for text generation image |
Also Published As
Publication number | Publication date |
---|---|
CN111259180B (en) | 2024-04-19 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
CN108319627B (en) | Keyword extraction method and keyword extraction device | |
CN110929038B (en) | Knowledge graph-based entity linking method, device, equipment and storage medium | |
CN106874441B (en) | Intelligent question-answering method and device | |
CN107168954B (en) | Text keyword generation method and device, electronic equipment and readable storage medium | |
CN109697239B (en) | Method for generating teletext information | |
CN109299280B (en) | Short text clustering analysis method and device and terminal equipment | |
CN111444320A (en) | Text retrieval method and device, computer equipment and storage medium | |
CN105069143B (en) | Extract the method and device of keyword in document | |
CN112256822A (en) | Text search method and device, computer equipment and storage medium | |
CN111198939B (en) | Statement similarity analysis method and device and computer equipment | |
CN110941951B (en) | Text similarity calculation method, text similarity calculation device, text similarity calculation medium and electronic equipment | |
CN114861889B (en) | Deep learning model training method, target object detection method and device | |
CN112633000B (en) | Method and device for associating entities in text, electronic equipment and storage medium | |
CN107885717B (en) | Keyword extraction method and device | |
CN110598201B (en) | Identifying accurate transcriptions from probabilistic inputs | |
CN117520523A (en) | Data processing method, device, equipment and storage medium | |
CN113407814B (en) | Text searching method and device, readable medium and electronic equipment | |
CN111813993A (en) | Video content expanding method and device, terminal equipment and storage medium | |
CN112182255A (en) | Method and apparatus for storing media files and for retrieving media files | |
CN111259180B (en) | Image pushing method, device, electronic equipment and storage medium | |
CN112347267A (en) | Text processing method and device, computer equipment and storage medium | |
CN111538830A (en) | French retrieval method, French retrieval device, computer equipment and storage medium | |
CN112559711B (en) | Synonymous text prompting method and device and electronic equipment | |
CN112307738B (en) | Method and device for processing text | |
CN110427626B (en) | Keyword extraction method and device |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
PB01 | Publication | ||
PB01 | Publication | ||
SE01 | Entry into force of request for substantive examination | ||
SE01 | Entry into force of request for substantive examination | ||
GR01 | Patent grant | ||
GR01 | Patent grant |