Image content extraction method, device and electronic equipment
By performing content recognition and named entity recognition on images, generating knowledge graphs, extracting keywords and splicing fragments, it solves the problem of low efficiency of information search and cumbersome operations in images, and achieves automated information management and efficient image content extraction.
Patent Information
- Application Number
- CN202010808915.0
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2020-08-12
- Publication Date
- 2024-08-27
- Estimated Expiration
- 2040-08-27
AI Technical Summary
In the existing technology, the efficiency of searching for specific information from images is low, and the overall management of the searched content is cumbersome.
By performing content recognition on images, generating knowledge graphs, extracting keywords, finding target correspondences, and splicing target fragments into target documents, automated information extraction and management are achieved.
It improves the efficiency of information search in images and simplifies the operation process, so that users do not need to manually view and edit images one by one, achieving convenient and efficient information management.
Smart Images

Figure CN111967367B
Abstract
Description
Technical Field
[0001] The embodiments of the present invention relate to the field of communication technology, and in particular to an image content extraction method, device and electronic device. Background Art
[0002] With the popularization of electronic devices, more and more users use electronic devices to take photos when studying, reading, and in meetings, and record the content through the images taken, which are stored in local photo albums. In the specific use process, users may use electronic devices to take photos of paper or electronic books, test papers, handouts, slides, etc. The images taken contain a large amount of knowledge document information, including Chinese and English text, mathematical and physical formulas, chemical symbols, tables, and other types of chart information.
[0003] At present, when searching for specific information from a large number of images, it is necessary to open each image one by one for viewing, which is inefficient. When it is necessary to manage specific information in multiple images in a coordinated manner, it is necessary to take screenshots, splice and edit each image containing the specific information, which is cumbersome. Summary of the invention
[0004] The purpose of the embodiments of the present application is to provide an image content extraction method, device and electronic device, which can solve the problems existing in the prior art of low efficiency in searching for specific information from images and cumbersome operations in the overall management of the searched content.
[0005] In order to solve the above-mentioned technical problems, the present invention is achieved as follows:
[0006] In a first aspect, an embodiment of the present application provides an image content extraction method, wherein the method includes: performing content recognition on each image respectively to obtain recognition results corresponding to each image; performing named entity recognition on each of the recognition results respectively to obtain knowledge graphs corresponding to each of the recognition results respectively, wherein the knowledge graph includes: correspondences between image identifiers, named entities, and content location identifiers, each image identifier corresponding to one image; extracting keywords from the named entities; based on the keywords, searching for target correspondences from each of the knowledge graphs respectively; extracting target fragments from each of the recognition results based on each of the target correspondences; and splicing each of the target fragments into a target document.
[0007] In the second aspect, an embodiment of the present application provides an image content extraction device, wherein the device includes: a first recognition module, used to perform content recognition on each image respectively, and obtain recognition results corresponding to each image; a second recognition module, used to perform named entity recognition on each recognition result respectively, and obtain knowledge graphs corresponding to each recognition result respectively, wherein the knowledge graph includes: correspondences between image identifiers, named entities and content location identifiers, and each image icon corresponds to one image; a first extraction module, used to extract keywords from the named entities; a search module, used to search for target correspondences from each knowledge graph based on the keywords; a second extraction module, used to extract target fragments from each recognition result based on each target correspondence; a first splicing module, used to splice each target fragment into a target document.
[0008] In a third aspect, an embodiment of the present application provides an electronic device, which includes a processor, a memory, and a program or instruction stored in the memory and executable on the processor, wherein the program or instruction, when executed by the processor, implements the steps of the method described in the first aspect.
[0009] In a fourth aspect, an embodiment of the present application provides a readable storage medium, on which a program or instruction is stored, and when the program or instruction is executed by a processor, the steps of the method described in the first aspect are implemented.
[0010] In a fifth aspect, an embodiment of the present application provides a chip, comprising a processor and a communication interface, wherein the communication interface is coupled to the processor, and the processor is used to run a program or instruction to implement the method described in the first aspect.
[0011] In the embodiments of the present application, content recognition is performed on each image respectively to obtain recognition results corresponding to each image; named entity recognition is performed on each recognition result respectively to obtain knowledge graphs corresponding to each recognition result; keywords are extracted from the named entities, and target correspondences are searched from each knowledge graph based on the extracted keywords; target fragments are extracted from each recognition result based on each target correspondence; each target fragment is spliced into a target document, and the target fragment corresponding to the keyword can be automatically found from the recognition results corresponding to each image, and the target fragments are spliced to obtain the target document. There is no need for the user to manually check the images one by one to find the target fragment, edit the target fragment, and other overall management operations. The operation is convenient and efficient. BRIEF DESCRIPTION OF THE DRAWINGS
[0012] In order to more clearly illustrate the technical solutions of the embodiments of the present invention, the accompanying drawings required for use in the description of the embodiments of the present invention will be briefly introduced below. Obviously, the accompanying drawings in the following description are only some embodiments of the present invention. For ordinary technicians in this field, other accompanying drawings can be obtained based on these accompanying drawings without paying creative labor.
[0013] Figure 1 is a flowchart showing the steps of an image content extraction method according to an embodiment of the present application;
[0014] Figure 2 is a schematic diagram of image recognition showing an embodiment of the present application;
[0015] Figure 3 is a schematic diagram of a knowledge graph representing an embodiment of the present application;
[0016] Figure 4 is a schematic diagram showing target document generation in an embodiment of the present application;
[0017] Figure 5 is a structural block diagram of an image content extraction device according to an embodiment of the present application;
[0018] Figure 6 is a structural block diagram of an electronic device according to an embodiment of the present application;
[0019] Figure 7 It is a schematic diagram of the hardware structure of an electronic device according to an embodiment of the present application. DETAILED DESCRIPTION
[0020] The following will be combined with the drawings in the embodiments of the present application to clearly and completely describe the technical solutions in the embodiments of the present application. Obviously, the described embodiments are part of the embodiments of the present application, not all of the embodiments. Based on the embodiments in the present application, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of this application.
[0021] The terms "first", "second", etc. in the specification and claims of the present application are used to distinguish similar objects, and are not used to describe a specific order or sequence. It should be understood that the data used in this way can be interchangeable under appropriate circumstances, so that the embodiments of the present application can be implemented in an order other than those illustrated or described here, and the objects distinguished by "first", "second", etc. are generally of one type, and the number of objects is not limited. For example, the first object can be one or more. In addition, "and / or" in the specification and claims represents at least one of the connected objects, and the character " / " generally indicates that the objects associated with each other are in an "or" relationship.
[0022] The following is a detailed description of the image content extraction method provided by the embodiment of the present application through specific embodiments and their application scenarios in conjunction with the accompanying drawings.
[0023] Reference Figure 1 , shows a step flow chart of an image content extraction method according to an embodiment of the present application.
[0024] The image content extraction method of the embodiment of the present application comprises the following steps:
[0025] Step 101: Perform content recognition on each image to obtain recognition results corresponding to each image.
[0026] The images processed in the embodiments of the present application include, but are not limited to: images captured from paper or electronic books, test papers, handouts, slides, etc., which contain a large amount of text and knowledge point information, such as subject classification, major and minor categories of knowledge points, etc.
[0027] When recognizing an image, the image is scanned, the scanned image information is analyzed and processed, the image content and layout information are obtained, and after image recognition, recognition results such as text, mathematical or physical formulas, chemical symbols, etc. are output. Figure 2 is a schematic diagram of image recognition, such as Figure 2 As shown, the recognition result obtained after image recognition contains the content in the image, and the recognition result is editable.
[0028] Step 102: Perform named entity recognition on each recognition result to obtain a knowledge graph corresponding to each recognition result.
[0029] Named entity recognition, also known as proper name recognition or named entity, refers to the recognition of entities with specific meanings in text, mainly including names of people, places, organizations, proper nouns, etc.
[0030] Knowledge graph: It is called knowledge domain visualization or knowledge domain mapping map in the library and information industry. It is a series of various graphics that show the development process and structural relationship of knowledge. It uses visualization technology to describe knowledge resources and their carriers, and mine, analyze, construct, draw and display knowledge and their mutual connections. The knowledge graph generated in the embodiment of the present application includes: the correspondence between image identifiers, named entities and content location identifiers, and each image identifier corresponds to a knowledge graph and an image.
[0031] Combine the following Figure 3 , we take the named entity recognition of the recognition results corresponding to the images generated by shooting math exercise books as an example. When performing named entity analysis on the recognition results of such images, we combine the examination syllabus, teaching materials, question bank data, etc. to perform knowledge reasoning and classification processing, and finally generate a knowledge graph. The generated knowledge graph is as follows Figure 3 As shown, it includes the relationship between image identification-knowledge point-subject / field-question type-grade.
[0032] Knowledge graph: It is called knowledge domain visualization or knowledge domain mapping map in the library and information industry. It is a series of various graphics that show the development process and structural relationship of knowledge. It uses visualization technology to describe knowledge resources and their carriers, and to mine, analyze, construct, draw and display knowledge and their interrelationships.
[0033] Step 103: Extract keywords from the named entities.
[0034] Keywords can be set by users according to actual needs. Keywords can be any named entities or specific categories contained under the named entities.
[0035] Step 104: Based on the keywords, search for target correspondences from each knowledge graph.
[0036] Combine the following Figure 4 The target document generation schematic diagram shown in the figure takes the keyword trigonometric function as an example to explain the target document generation method. After the user extracts the keyword, the system finds that the recognition results of image 1, image 2, and image 3 involve trigonometric function content, and searches for target correspondences involving trigonometric functions from the knowledge graphs corresponding to the three images. The target correspondences found are: Image 1-Question 1-Trigonometric Function-Mathematics / Middle School Mathematics-Answer Questions-Senior Three; Image 2-Question 2-Trigonometric Function-Mathematics / Middle School Mathematics-Answer Questions-Senior Three; Image 3-Question 2-Trigonometric Function-Mathematics / Middle School Mathematics-Answer Questions-Senior Three.
[0037] Step 105: extracting target segments from each recognition result according to each target correspondence.
[0038] An optional method of extracting target segments from each recognition result according to each target correspondence is as follows:
[0039] First, for each target correspondence, find the target image identifier associated with the target correspondence;
[0040] Wherein, each target image identifier corresponds to a target image.
[0041] Secondly, the position of the target segment in the target image is determined according to the content position identifier in the target correspondence;
[0042] Taking the target correspondence relationship of: Image 1-Question 1-Trigonometric Function-Mathematics / Middle School Mathematics-Solved Questions-Senior Three as an example, through the target correspondence relationship, it can be found that the target image associated with the target correspondence relationship is Image 1. The target content position is Question 1.
[0043] Finally, based on the position of the target segment in the target image, the target segment is extracted from the recognition result corresponding to the target image.
[0044] After determining that the position of the target segment in the target image is question 1, the recognition content of question 1 is extracted from the recognition result corresponding to the target image as the target segment.
[0045] Step 106: stitch the target segments into a target document.
[0046] The target document after splicing is as follows Figure 4 As shown, the target document centrally organizes exercises related to trigonometric functions in various images, which is convenient for users to centrally organize questions of the same type.
[0047] After the target segments are stitched together into a target document, the target document can be converted into a target format according to user input, and further operations such as printing, editing or sharing of the target document can be performed. The target format can include but is not limited to: PDF, image and other formats.
[0048] This method of providing users with an operation interface for converting, printing, editing or sharing target documents for users to operate can meet the different needs of users and make the processing of target documents more convenient.
[0049] The image content extraction method provided in the embodiment of the present application can not only extract exercises from an image containing an exercise book, but also be applied to a variety of scenarios by adaptively adjusting named entities and extracting keywords. The following are several exemplary usage scenarios:
[0050] Scenario 1: Automatically detect and crop image content, and archive document images. They can be classified by knowledge points, subjects, and question types to improve image management efficiency.
[0051] Scenario 2: Searching, querying and locating image content, and clustering the content in the image according to different knowledge points can improve knowledge management efficiency.
[0052] Scenario 3: Scan the test papers of different students to obtain multiple images, extract content from the multiple images, automatically classify the wrong questions, extract keywords by question type, knowledge point, subject, and grade, and output a collection of wrong questions.
[0053] Scenario 4: Scan English reading comprehension articles to obtain images, extract content from the images, and automatically output notes on new words, fixed collocations, grammar, sentence patterns, and other knowledge points.
[0054] Scenario 5: Scan reading notes to obtain images, identify key points, outlines, annotations, etc. in the images, and classify the scanned notes by book name, author, chapter, etc. based on the recognition results, and output the classified electronic reading notes.
[0055] Scenario 6: Extract text information from the slides to form a content summary, and search and annotate related proper nouns. When searching, you can classify each slide by keyword to obtain target slides related to the search keywords.
[0056] The image content extraction method provided in the embodiment of the present application performs content recognition on each image to obtain recognition results corresponding to each image; performs named entity recognition on each recognition result to obtain knowledge graphs corresponding to each recognition result; extracts keywords from the named entities; searches for target correspondences from each knowledge graph based on the keywords; extracts target fragments from each recognition result based on each target correspondence; and splices each target fragment into a target document. The target fragment corresponding to the keyword can be automatically found from the recognition results corresponding to each image, and the target fragments are spliced to obtain the target document. There is no need for the user to manually check images one by one to find the target fragment, edit the target fragment, and perform other overall management operations. The operation is convenient and efficient.
[0057] In an optional embodiment, when performing content recognition on each image and obtaining the recognition results corresponding to each image, it can be achieved in the following manner:
[0058] For each image, a target area in the image is determined according to a first input of the image by a user; content recognition is performed on the target area in the image to obtain a recognition result corresponding to the image.
[0059] In this optional method, content recognition can be performed specifically on local areas of the image, which can save time and resources consumed in content recognition compared to content recognition on the entire image.
[0060] In an optional embodiment, the method of searching for target correspondences from each knowledge graph based on keywords is as follows:
[0061] For each knowledge graph, search for a target named entity that matches the keyword in the knowledge graph; determine the corresponding relationship associated with the target named entity as the target corresponding relationship.
[0062] This method of searching for target corresponding relationships can improve the efficiency and accuracy of searching for target corresponding relationships.
[0063] In an optional embodiment, the following operations may also be performed on each image:
[0064] First, obtain the preset parameters of each image;
[0065] The preset parameters include at least one of the following: shooting time, shooting location, shooting style and subject content.
[0066] Secondly, each image is classified according to the preset parameters;
[0067] Finally, the images in the same category are stitched together.
[0068] For example: a user takes multiple target images of slides, paper documents, etc. over a period of time. The system can automatically classify each image based on the preset parameters entered by the user, such as shooting location, time information, etc., and stitch multiple images into a long picture.
[0069] This method of classifying each image according to preset parameters can efficiently classify images without the need for users to manually classify them one by one. By classifying images, it is convenient for users to find target images from a large number of images without having to manually search for them one by one. In addition, since each image is spliced, it is easier for users to comprehensively preview the image content and compare the content between images.
[0070] It should be noted that the image content extraction method provided in the embodiment of the present application can be executed by an image content extraction device or a control module in the image content extraction device for executing the image content extraction method. In the embodiment of the present application, the image content extraction device provided in the embodiment of the present application is described by taking the image content extraction device executing the image content extraction method as an example.
[0071] Figure 5 A structural block diagram of an image content extraction device for implementing an embodiment of the present application.
[0072] Figure 5 The image content extraction device shown in Figures 1 to 4 The image content extraction method shown in .
[0073] The image content extraction device 500 of the embodiment of the present application includes:
[0074] The first recognition module 501 is used to perform content recognition on each image to obtain recognition results corresponding to each image;
[0075] The second recognition module 502 is used to perform named entity recognition on each of the recognition results to obtain a knowledge graph corresponding to each of the recognition results, wherein the knowledge graph includes: a correspondence between an image identifier, a named entity, and a content location identifier, and each of the image identifiers corresponds to an image;
[0076] A first extraction module 503, used to extract keywords from the named entity;
[0077] A search module 504 is used to search for target corresponding relationships from each of the knowledge graphs according to the keywords;
[0078] A second extraction module 505 is used to extract target segments from each of the recognition results according to each of the target correspondences;
[0079] The first splicing module 506 is used to splice the target segments into a target document.
[0080] Optionally, the first recognition module includes: a first submodule, used to determine, for each of the images, a target area in the image based on a first input of the image by a user; and a second submodule, used to perform content recognition on the target area in the image to obtain a recognition result corresponding to the image.
[0081] Optionally, the search module includes: a third sub-module, used to search for a target named entity matching the keyword in the knowledge graph for each of the knowledge graphs; and a fourth sub-module, used to determine the corresponding relationship associated with the target named entity as the target corresponding relationship.
[0082] Optionally, the second extraction module includes: a fifth sub-module, used to search for a target image identifier associated with each target correspondence relationship, wherein each target image identifier corresponds to a target image; a sixth sub-module, used to determine a position of a target segment in the target image based on the content identifier in the target correspondence relationship; and a seventh sub-module, used to extract the target segment from a recognition result corresponding to the target image based on the position.
[0083] Optionally, the device also includes: an acquisition module, used to acquire preset parameters of each of the images, wherein the preset parameters include at least one of the following: shooting time, shooting location, shooting style and subject content; a classification module, used to classify each of the images according to the preset parameters; and a second stitching module, used to stitch the images under the same classification.
[0084] In the present application embodiment Figure 5The image content extraction device shown can be a device, or a component, integrated circuit, or chip in a terminal. The device can be a mobile electronic device or a non-mobile electronic device. Exemplarily, the mobile electronic device can be a mobile phone, a tablet computer, a laptop computer, a palmtop computer, an in-vehicle electronic device, a wearable device, an ultra-mobile personal computer (ultra-mobile personal computer, UMPC), a netbook or a personal digital assistant (personal digital assistant, PDA), etc., and the non-mobile electronic device can be a server, a network attached storage (Network Attached Storage, NAS), a personal computer (personal computer, PC), a television (television, TV), a teller machine or a self-service machine, etc., which is not specifically limited in the embodiments of the present application.
[0085] In the embodiments of this application Figure 5 The image content extraction device shown may be a device having an operating system. The operating system may be an Android operating system, an iOS operating system, or other possible operating systems, which are not specifically limited in the embodiments of the present application.
[0086] The embodiments of the present application provide Figure 5 The image content extraction device shown can achieve Figures 1 to 4 To avoid repetition, the various processes implemented by the method embodiment are not described here.
[0087] The image content extraction device provided in the embodiment of the present application performs content recognition on each image to obtain recognition results corresponding to each image; performs named entity recognition on each recognition result to obtain knowledge graphs corresponding to each recognition result; extracts keywords from the named entities; searches for target correspondences from each knowledge graph based on the extracted keywords; extracts target fragments from each recognition result based on each target correspondence; and splices each target fragment into a target document. The device can automatically search for target fragments corresponding to keywords from the recognition results corresponding to each image, and splices the target fragments to obtain the target document. The user does not need to manually check images one by one to search for target fragments, edit the target fragments, and perform other overall management operations. The operation is convenient and efficient.
[0088] Alternatively, if Figure 6As shown, the embodiment of the present application also provides an electronic device 600, including a processor 601, a memory 602, and a program or instruction stored in the memory 602 and executable on the processor 601. When the program or instruction is executed by the processor 601, each process of the above-mentioned image content extraction method embodiment is implemented, and the same technical effect can be achieved. To avoid repetition, it will not be repeated here.
[0089] It should be noted that the electronic devices in the embodiments of the present application include the mobile electronic devices and non-mobile electronic devices mentioned above.
[0090] Figure 7 A schematic diagram of the hardware structure of an electronic device to implement an embodiment of the present application.
[0091] The electronic device 700 includes but is not limited to: a radio frequency unit 701, a network module 702, an audio output unit 703, an input unit 704, a sensor 705, a display unit 706, a user input unit 707, an interface unit 708, a memory 709, and a processor 710.
[0092] Those skilled in the art will appreciate that the electronic device 700 may also include a power source (such as a battery) for supplying power to each component, and the power source may be logically connected to the processor 710 through a power management system, thereby implementing functions such as managing charging, discharging, and power consumption management through the power management system. Figure 7 The electronic device structure shown in the figure does not constitute a limitation on the electronic device. The electronic device may include more or fewer components than shown in the figure, or combine certain components, or arrange the components differently, which will not be described in detail here.
[0093] Among them, the processor 710 is used to perform content recognition on each image respectively to obtain recognition results corresponding to each image; perform named entity recognition on each of the recognition results respectively to obtain knowledge graphs corresponding to each of the recognition results, wherein the knowledge graph includes: correspondences between image identifiers, named entities and content location identifiers, each image identifier corresponds to an image; extract keywords from the named entities; based on the keywords, search for target correspondences from each of the knowledge graphs respectively; based on each of the target correspondences, extract target fragments from each of the recognition results respectively; and splice each of the target fragments into a target document.
[0094] The electronic device provided in the embodiment of the present application performs content recognition on each image to obtain recognition results corresponding to each image; performs named entity recognition on each recognition result to obtain knowledge graphs corresponding to each recognition result; extracts keywords from the named entities; searches for target correspondences from each knowledge graph based on the extracted keywords; extracts target fragments from each recognition result based on each target correspondence; and splices each target fragment into a target document. The target fragment corresponding to the keyword can be automatically found from the recognition results corresponding to each image, and the target fragments are spliced to obtain the target document. There is no need for the user to manually check images one by one to find the target fragment, and perform overall management operations such as editing on the target fragment. The operation is convenient and efficient.
[0095] Optionally, when the processor 710 performs content recognition on each image respectively and obtains recognition results corresponding to each image, it is specifically used to: for each of the images, determine the target area in the image based on the user's first input to the image; perform content recognition on the target area in the image to obtain the recognition result corresponding to the image.
[0096] Optionally, when the processor 710 searches for the target correspondence from each of the knowledge graphs based on the keyword, it is specifically used to: for each of the knowledge graphs, search for the target named entity that matches the keyword; and determine the correspondence associated with the target named entity as the target correspondence.
[0097] Optionally, when the processor 710 extracts the target segment from each of the recognition results based on each of the target correspondences, it is specifically used to: for each of the target correspondences, search for a target image identifier associated with the target correspondence, wherein each of the target image identifiers corresponds to a target image; determine a position of the target segment in the target image based on the content position identifier in the target correspondence; and extract the target segment from the recognition result corresponding to the target image based on the position.
[0098] Optionally, the processor 710 is also used to: obtain preset parameters of each of the images, wherein the preset parameters include at least one of the following: shooting time, shooting location, shooting style and subject content; classify each of the images according to the preset parameters; and splice the images under the same category.
[0099] It should be understood that in the embodiment of the present application, the input unit 704 may include a graphics processor (Graphics Processing Unit, GPU) 7041 and a microphone 7042, and the graphics processor 7041 processes the image data of the static picture or video obtained by the image capture device (such as a camera) in the video capture mode or the image capture mode. The display unit 706 may include a display panel 7061, and the display panel 7061 may be configured in the form of a liquid crystal display, an organic light emitting diode, etc. The user input unit 707 includes a touch panel 7071 and other input devices 7072. The touch panel 7071 is also called a touch screen. The touch panel 7071 may include two parts: a touch detection device and a touch controller. Other input devices 7072 may include but are not limited to a physical keyboard, a function key (such as a volume control button, a switch button, etc.), a trackball, a mouse, and a joystick, which will not be repeated here. The memory 709 can be used to store software programs and various data, including but not limited to applications and operating systems. The processor 710 can integrate an application processor and a modem processor, wherein the application processor mainly processes an operating system, a user interface, and applications, etc., and the modem processor mainly processes wireless communications. It is understandable that the above-mentioned modem processor may not be integrated into the processor 710.
[0100] The electronic device provided in the embodiment of the present application also provides a readable storage medium, on which a program or instruction is stored. When the program or instruction is executed by the processor, each process of the above-mentioned image content extraction method embodiment is implemented, and the same technical effect can be achieved. To avoid repetition, it will not be repeated here.
[0101] The processor is a processor in the electronic device described in the above embodiment. The readable storage medium includes a computer readable storage medium, such as a computer read-only memory (ROM), a random access memory (RAM), a magnetic disk or an optical disk.
[0102] An embodiment of the present application further provides a chip, which includes a processor and a communication interface, wherein the communication interface is coupled to the processor, and the processor is used to run programs or instructions to implement the various processes of the above-mentioned image content extraction method embodiment, and can achieve the same technical effect. To avoid repetition, it will not be repeated here.
[0103] It should be understood that the chip mentioned in the embodiments of the present application can also be called a system-level chip, a system chip, a chip system or a system-on-chip chip, etc.
[0104] It should be noted that, in this article, the terms "comprise", "include" or any other variant thereof are intended to cover non-exclusive inclusion, so that the process, method, article or device including a series of elements includes not only those elements, but also includes other elements not explicitly listed, or also includes elements inherent to such process, method, article or device. In the absence of further restrictions, the elements defined by the sentence "comprise one..." do not exclude the presence of other identical elements in the process, method, article or device including the element. In addition, it should be pointed out that the scope of the methods and devices in the embodiments of the present application is not limited to performing functions in the order shown or discussed, and may also include performing functions in a substantially simultaneous manner or in reverse order according to the functions involved, for example, the described method may be performed in an order different from that described, and various steps may also be added, omitted, or combined. In addition, the features described with reference to certain examples may be combined in other examples.
[0105] Through the description of the above implementation methods, those skilled in the art can clearly understand that the above-mentioned embodiment methods can be implemented by means of software plus a necessary general hardware platform, and of course by hardware, but in many cases the former is a better implementation method. Based on such an understanding, the technical solution of the present application, or the part that contributes to the prior art, can be embodied in the form of a software product, which is stored in a storage medium (such as ROM / RAM, a magnetic disk, or an optical disk), and includes a number of instructions for a terminal (which can be a mobile phone, a computer, a server, an air conditioner, or a network device, etc.) to execute the methods described in each embodiment of the present application.
[0106] The embodiments of the present application are described above in conjunction with the accompanying drawings, but the present application is not limited to the above-mentioned specific implementation methods. The above-mentioned specific implementation methods are merely illustrative and not restrictive. Under the guidance of the present application, ordinary technicians in this field can also make many forms without departing from the purpose of the present application and the scope of protection of the claims, all of which are within the protection of the present application.
Claims
1. A method for extracting image content, It is characterized in that The method comprises: Perform content recognition on each image respectively to obtain recognition results corresponding to each image; Perform named entity recognition on each of the recognition results to obtain a knowledge graph corresponding to each of the recognition results, wherein the knowledge graph includes: a correspondence between an image identifier, a named entity, and a content location identifier, and each of the image identifiers corresponds to an image; Extracting keywords from the named entities; The keyword is any named entity or a specific category contained under the named entity; According to the keywords, respectively search for target corresponding relationships from each of the knowledge graphs; Extracting target segments from each of the recognition results according to each of the target correspondences; splicing the target fragments into a target document; The method further comprises: Obtaining preset parameters of each image; The preset parameter is at least one of shooting time, shooting location, shooting style, and subject content; Classifying the images according to the preset parameters; The images under the same category are stitched into a target document.
2. The method according to claim 1, It is characterized in that The step of performing content recognition on each image to obtain recognition results corresponding to each image includes: For each of the images, determining a target area in the image according to a first input of the image by a user; Content recognition is performed on the target area in the image to obtain a recognition result corresponding to the image.
3. The method according to claim 1, It is characterized in that The step of searching for target corresponding relationships from each of the knowledge graphs based on the keywords includes: For each of the knowledge graphs, searching for a target named entity in the knowledge graph that matches the keyword; The corresponding relationship associated with the target named entity is determined as the target corresponding relationship.
4. The method according to claim 1, It is characterized in that The step of extracting the target segment from each of the recognition results according to each of the target correspondences comprises: For each of the target correspondence relationships, searching for a target image identifier associated with the target correspondence relationship, wherein each of the target image identifiers corresponds to a target image; Determining the position of the target segment in the target image according to the content position identifier in the target corresponding relationship; Based on the position, a target segment is extracted from a recognition result corresponding to the target image.
5. An image content extraction device, It is characterized in that The device comprises: The first recognition module is used to perform content recognition on each image to obtain recognition results corresponding to each image; A second recognition module is used to perform named entity recognition on each of the recognition results to obtain a knowledge graph corresponding to each of the recognition results, wherein the knowledge graph includes: a correspondence between an image identifier, a named entity, and a content location identifier, and each of the image identifiers corresponds to an image; A first extraction module, used to extract keywords from the named entity; The keyword is any named entity or a specific category contained under the named entity; A search module, used to search for target corresponding relationships from each of the knowledge graphs according to the keywords; A second extraction module, used to extract target segments from each of the recognition results according to each of the target correspondences; A first splicing module, used for splicing the target segments into a target document; The device is also used for: Obtaining preset parameters of each image; The preset parameter is at least one of shooting time, shooting location, shooting style, and subject content; Classifying the images according to the preset parameters; The images under the same category are stitched into a target document.
6. The device according to claim 5, It is characterized in that The first identification module comprises: A first submodule is used to determine, for each of the images, a target area in the image according to a first input of the image by a user; The second submodule is used to perform content recognition on the target area in the image to obtain a recognition result corresponding to the image.
7. The device according to claim 5, It is characterized in that The search module includes: The third submodule is used to search for a target named entity matching the keyword in the knowledge graph for each of the knowledge graphs; The fourth submodule is used to determine the corresponding relationship associated with the target named entity as the target corresponding relationship.
8. The device according to claim 5, It is characterized in that The second extraction module comprises: A fifth submodule is used to search for a target image identifier associated with each target correspondence relationship, wherein each target image identifier corresponds to a target image; A sixth submodule, configured to determine a position of a target segment in the target image according to the content position identifier in the target corresponding relationship; The seventh submodule is used to extract the target segment from the recognition result corresponding to the target image based on the position.
9. An electronic device, It is characterized in that The method comprises a processor, a memory, and a program or instruction stored in the memory and executable on the processor, wherein the program or instruction, when executed by the processor, implements the steps of the image content extraction method as described in any one of claims 1 to 4.
10. A readable storage medium, It is characterized in that The readable storage medium stores a program or instruction, and when the program or instruction is executed by a processor, the steps of the image content extraction method according to any one of claims 1 to 4 are implemented.
