Information acquisition method, device, storage medium and equipment
By segmenting the image and extracting keywords, feature information is used to extract the content of any layout image, which solves the problem of poor applicability of information extraction in the existing technology and improves the accuracy and efficiency of extraction.
Patent Information
- Application Number
- CN202111197119.9
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2021-10-14
- Publication Date
- 2024-10-18
- Estimated Expiration
- 2041-10-14
AI Technical Summary
When extracting information in an image, the existing technology needs to save the target position in advance, resulting in poor applicability and inability to effectively extract information when the content in the image is shifted or the layout is changed.
By segmenting the image to be recognized, extracting the text recognition area, performing text extraction and indicative keyword extraction, and using keyword feature information for information extraction, image content extraction of any layout can be achieved.
It improves the applicability and accuracy of information extraction, can effectively handle the content extraction of any layout in the image, and reduces the amount of manual intervention and calculation.
Smart Images

Figure CN114120299B_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of information processing technology, and in particular to an information acquisition method, apparatus, storage medium and device. Background Art
[0002] With the rapid development of information networks, people usually choose to quickly and conveniently save relevant information by taking images. When it is necessary to extract relevant information from the captured images, the relevant information of the images can be extracted by equipment instead of manual extraction, which can reduce labor costs and realize intelligent image information acquisition.
[0003] Currently, when extracting relevant information from an image, it is necessary to pre-save the target location of the information to be extracted in the image (for example, pre-save the target location of the ID card number in an ID card image). This method can only extract the information at the target location in the image, but it is only suitable for extracting content at a fixed location in the image, and its applicability is poor. When the content in the image shifts or the layout of the image content changes, extraction errors will occur, and the information extraction accuracy is poor. Summary of the Invention
[0004] The technical problem to be solved by the embodiments of the present application is to provide an information acquisition method, device, storage medium and equipment that can extract information from image content of any layout in an image, improve the applicability of information extraction and improve the accuracy of information extraction.
[0005] In a first aspect, the present application provides an information acquisition method, comprising:
[0006] Obtain an image to be recognized, perform image segmentation on the image to be recognized, and obtain a text recognition area in the image to be recognized;
[0007] Performing text extraction on the text recognition area to obtain the text content in the text recognition area;
[0008] Extract indicative keywords from the text content to obtain M indicative keywords in the text content, where M is a positive integer;
[0009] Obtain keyword feature information corresponding to the M indicative keywords respectively, perform information extraction on the text content according to the keyword feature information of each indicative keyword, obtain the target text corresponding to each indicative keyword, output each indicative keyword and the target text corresponding to each indicative keyword, and the keyword feature information includes keyword type and keyword position.
[0010] It can be seen that the embodiment of the present application can reduce the computational complexity of subsequent text extraction and improve the efficiency of text extraction by performing image segmentation on the image to be recognized. Text extraction is performed on the text area to obtain text content, and indicative keywords are extracted from the text content to obtain M indicative keywords. Based on the keyword type and keyword position of the M indicative keywords, information extraction is performed on the text content to obtain the target text corresponding to each indicative keyword. This can achieve information extraction of image content of any layout in the image to be recognized, improve the applicability of information extraction, and improve the accuracy of information extraction.
[0011] In conjunction with the first aspect, in a possible implementation, performing image segmentation on the image to be recognized to obtain a text recognition area in the image to be recognized includes:
[0012] Calling the information extraction model, extracting pixel features of the image to be identified through the region segmentation layer in the information extraction model, and obtaining a pixel probability map of the image to be identified, the pixel probability map including the probability that each pixel in the image to be identified is a text pixel;
[0013] Based on the pixel probability map, determine the area in the image to be identified where the probability of the pixel point is greater than or equal to the target probability;
[0014] An area where the probability of the pixel point is greater than or equal to the target probability is segmented from the image to be recognized, and a text recognition area in the image to be recognized is obtained.
[0015] In conjunction with the first aspect, in one possible implementation, performing text extraction on the text recognition area to obtain text content within the text recognition area includes:
[0016] Calling the information extraction model, and performing text extraction on the text recognition area through the text recognition layer in the information extraction model to obtain a text sequence of the text recognition area;
[0017] Perform feature prediction on the text sequence to obtain text pixel features of the text sequence;
[0018] Obtain candidate text features corresponding to N candidate text contents in the text library, and obtain the matching degree between the text pixel feature and the candidate text feature of each candidate text content in the N candidate text contents, where N is a positive integer;
[0019] The candidate text content with the greatest matching degree with the pixel feature of the text among the N candidate text contents is determined as the text content within the text recognition area.
[0020] In conjunction with the first aspect, in one possible implementation, the method further includes:
[0021] Obtaining the maximum matching degree among N matching degrees between the text pixel feature and the candidate text features corresponding to the N candidate text contents;
[0022] Determine whether the maximum matching degree is less than or equal to the target matching degree;
[0023] If the maximum matching degree is less than or equal to the target matching degree, a prompt message is output to prompt the user to re-extract text from the text recognition area.
[0024] In conjunction with the first aspect, in a possible implementation, the text content is subjected to indicative keyword extraction to obtain M indicative keywords in the text content, including:
[0025] Perform keyword extraction on the text content to obtain Q initial keywords in the text content, where Q is a positive integer greater than or equal to M;
[0026] Get the initial keyword Q i The matching degree between the initial keyword Q and the multiple sample indicative keywords in the indicative keyword library is respectively i Belongs to the Q initial keywords, i is a positive integer less than or equal to Q;
[0027] If the initial keyword Q i If there is a matching degree greater than or equal to a preset threshold among the multiple matching degrees between the multiple sample indicative keywords, the initial keyword Q i Identified as indicative keywords;
[0028] M indicative keywords are determined from the Q initial keywords, and a matching degree between an indicative keyword among the M indicative keywords and a sample indicative keyword in the indicative keyword library is greater than or equal to the preset threshold.
[0029] In conjunction with the first aspect, in a possible implementation, the text content is extracted based on the keyword feature information of each indicative keyword to obtain the target text corresponding to each indicative keyword, including:
[0030] According to the indicative keyword M j The keyword type is obtained from the first corresponding relationship table. j The corresponding target text format, the first correspondence includes the correspondence between the keyword type and the text format, the indicative keyword M j Belongs to the M indicative keywords, j is a positive integer less than or equal to M;
[0031] Obtain the indicative keyword M from the second correspondence tablej The corresponding text indication position, wherein the second corresponding relationship includes a corresponding relationship between the indicative keyword and the text indication position, and the text indication position is used to reflect the position of the target text relative to the indicative keyword;
[0032] According to the indicative keyword M j The keyword position, the text indication position and the target text format are used to extract information from the text content to obtain the indicative keyword M j The corresponding target text.
[0033] In combination with the first aspect, in a possible implementation, the indicative keyword M j The keyword position, the text indication position and the target text format are used to extract information from the text content to obtain the indicative keyword M j The corresponding target text includes:
[0034] According to the indicative keyword M j The target position of the target text in the text content is determined based on the keyword position and the text indication position;
[0035] A target text located in the target position in the text content is extracted, and the text format of the target text is the target text format.
[0036] In a second aspect, the present application provides an information acquisition device, comprising:
[0037] An image segmentation module is used to obtain an image to be identified, perform image segmentation on the image to be identified, and obtain a text recognition area in the image to be identified;
[0038] A text extraction module is used to extract text from the text recognition area to obtain the text content in the text recognition area;
[0039] an indicative keyword extraction module, configured to extract indicative keywords from the text content to obtain M indicative keywords from the text content, where M is a positive integer;
[0040] An information extraction module is used to obtain keyword feature information corresponding to the M indicative keywords respectively, extract information from the text content based on the keyword feature information of each indicative keyword, obtain the target text corresponding to each indicative keyword, and output each indicative keyword and the target text corresponding to each indicative keyword. The keyword feature information includes keyword type and keyword position.
[0041] In conjunction with the second aspect, in one possible implementation, the image segmentation module includes:
[0042] a pixel feature extraction unit, configured to call an information extraction model and extract pixel features of the image to be identified through a region segmentation layer in the information extraction model to obtain a pixel probability map of the image to be identified, wherein the pixel probability map includes a probability that each pixel in the image to be identified is a text pixel;
[0043] A first determining unit is configured to determine, based on the pixel probability map, an area in the image to be identified where the probability of the pixel point is greater than or equal to the target probability;
[0044] The segmentation unit is used to segment the image to be recognized into an area where the probability of the pixel point is greater than or equal to the target probability, so as to obtain a text recognition area in the image to be recognized.
[0045] In conjunction with the second aspect, in one possible implementation, the text extraction module includes:
[0046] A text extraction unit is used to call the information extraction model, and extract text from the text recognition area through the text recognition layer in the information extraction model to obtain a text sequence of the text recognition area;
[0047] A feature prediction unit, configured to perform feature prediction on the text sequence to obtain text pixel features of the text sequence;
[0048] The first acquisition unit is used to obtain candidate text features corresponding to N candidate text contents in the text library, and obtain the matching degree between the text pixel feature and the candidate text feature of each candidate text content in the N candidate text contents, where N is a positive integer;
[0049] The second determining unit is configured to determine the candidate text content having the greatest matching degree with the text pixel feature among the N candidate text contents as the text content within the text recognition area.
[0050] In conjunction with the second aspect, in one possible implementation, the text extraction module further includes:
[0051] A second obtaining unit is configured to obtain a maximum matching degree among N matching degrees between the text pixel feature and the candidate text features corresponding to the N candidate text contents;
[0052] A judging unit, configured to judge whether the maximum matching degree is less than or equal to a target matching degree;
[0053] The output unit is configured to output a prompt message if the maximum matching degree is less than or equal to the target matching degree, so as to prompt the user to re-extract text from the text recognition area.
[0054] In conjunction with the second aspect, in one possible implementation, the indicative keyword extraction module includes:
[0055] A keyword extraction unit is used to extract keywords from the text content to obtain Q initial keywords in the text content, where Q is a positive integer greater than or equal to M;
[0056] The third acquisition unit is used to obtain the initial keyword Q i The matching degree between the initial keyword Q and the multiple sample indicative keywords in the indicative keyword library is respectively i Belongs to the Q initial keywords, i is a positive integer less than or equal to Q;
[0057] The third determining unit is used to determine if the initial keyword Q i If there is a matching degree greater than or equal to a preset threshold among the multiple matching degrees between the multiple sample indicative keywords, the initial keyword Q i Identified as indicative keywords;
[0058] The fourth determining unit is configured to determine M indicative keywords from the Q initial keywords, wherein a matching degree between an indicative keyword in the M indicative keywords and a sample indicative keyword in the indicative keyword library is greater than or equal to the preset threshold.
[0059] In conjunction with the second aspect, in one possible implementation, the information extraction module includes:
[0060] The fourth acquisition unit is used to obtain the indicative keyword M j The keyword type is obtained from the first corresponding relationship table. j The corresponding target text format, the first correspondence includes the correspondence between the keyword type and the text format, the indicative keyword M j Belongs to the M indicative keywords, j is a positive integer less than or equal to M;
[0061] The fifth acquiring unit is configured to acquire the indicative keyword M from the second correspondence table. j The corresponding text indication position, wherein the second corresponding relationship includes a corresponding relationship between the indicative keyword and the text indication position, and the text indication position is used to reflect the position of the target text relative to the indicative keyword;
[0062] The information extraction unit is used to extract the information according to the indicative keyword M j The keyword position, the text indication position and the target text format are used to extract information from the text content to obtain the indicative keyword M j The corresponding target text.
[0063] In conjunction with the second aspect, in one possible implementation, the information extraction unit is specifically configured to:
[0064] According to the indicative keyword M j The target position of the target text in the text content is determined based on the keyword position and the text indication position;
[0065] A target text located in the target position in the text content is extracted, and the text format of the target text is the target text format.
[0066] In a third aspect, the present application provides a computer device, comprising: a processor and a memory;
[0067] The processor is connected to a memory, wherein the memory is used to store a computer program. When the computer program is executed by the processor, the computer device executes the method provided in the embodiment of the present application.
[0068] In a fourth aspect, the present application provides a computer-readable storage medium, which stores a computer program, and the computer program is suitable for being loaded and executed by a processor so that a computer device having the processor executes the method provided in an embodiment of the present application.
[0069] In a fifth aspect, the present application provides a computer program product or computer program, which includes computer instructions stored in a computer-readable storage medium. A processor of a computer device reads the computer instructions from the computer-readable storage medium and executes the computer instructions, causing the computer device to perform the method provided in the embodiments of the present application.
[0070] In an embodiment of the present application, by acquiring an image to be recognized and performing image segmentation on the image to be recognized, a text recognition region within the image to be recognized is obtained. This reduces the computational complexity of subsequent text extraction and improves text extraction efficiency. Text extraction is then performed on the text recognition region to obtain the text content within the text recognition region. Indicative keyword extraction is then performed on the text content to obtain M indicative keywords within the text content. Keyword feature information corresponding to each of the M indicative keywords is then obtained, and the keyword feature information includes keyword type and keyword position. Based on the keyword feature information of each indicative keyword, information extraction is performed on the text content to obtain the target text corresponding to each indicative keyword. Each indicative keyword and the target text corresponding to each indicative keyword are then output. Thus, by performing information extraction on the text content based on the keyword type and keyword position of the M indicative keywords and obtaining the target text corresponding to each indicative keyword, information extraction can be performed on image content of any layout within the image to be recognized, improving the applicability and accuracy of information extraction. Through the present application, information extraction can be performed on image content of any layout within the image to be recognized, improving the applicability and accuracy of information extraction. BRIEF DESCRIPTION OF THE DRAWINGS
[0071] In order to more clearly illustrate the embodiments of the present application or the technical solutions in the prior art, the following briefly introduces the drawings required for use in the embodiments or the description of the prior art. Obviously, the drawings described below are only some embodiments of the present application. For ordinary technicians in this field, other drawings can be obtained based on these drawings without any creative work.
[0072] Figure 1 This is a schematic diagram of the architecture of an information acquisition system provided in an embodiment of the present application;
[0073] Figure 2 This is a flow chart of an information acquisition method provided in an embodiment of the present application;
[0074] Figure 3 This is a flow chart of another information acquisition method provided in an embodiment of the present application;
[0075] Figure 4 This is a schematic diagram of the structure of an information acquisition device provided in an embodiment of the present application;
[0076] Figure 5 It is a structural diagram of a computer device provided in an embodiment of the present application. DETAILED DESCRIPTION
[0077] The following will be combined with the drawings in the embodiments of this application to clearly and completely describe the technical solutions in the embodiments of this application. Obviously, the embodiments described are only part of the embodiments of this application, not all of the embodiments. Based on the embodiments in this application, all other embodiments obtained by ordinary technicians in this field without making creative efforts are within the scope of protection of this application.
[0078] The embodiments of the present application can acquire and process relevant data based on artificial intelligence technology. Artificial Intelligence (AI) is the theory, method, technology, and application system that uses digital computers or machines controlled by digital computers to simulate, extend, and expand human intelligence, perceive the environment, acquire knowledge, and use knowledge to achieve optimal results.
[0079] Fundamental AI technologies generally include sensors, dedicated AI chips, cloud computing, distributed storage, big data processing, operating / interaction systems, and mechatronics. AI software technologies primarily encompass computer vision, robotics, biometrics, speech processing, natural language processing, and machine learning / deep learning.
[0080] See Figure 1 , Figure 1 This is a structural diagram of an information acquisition system provided by an embodiment of the present application. Figure 1 As shown, the information acquisition system may include a server 10 and a user terminal cluster. The user terminal cluster may include one or more user terminals, and the number of user terminals is not limited here. Figure 1 As shown, it may specifically include user terminal 100a, user terminal 100b, user terminal 100c, ..., user terminal 100n. Figure 1 As shown, the user terminal 100a, the user terminal 100b, the user terminal 100c, ..., the user terminal 100n can respectively establish a network connection with the server 10, so that each user terminal can exchange data with the server 10 through the network connection.
[0081] Each user terminal in the user terminal cluster may include: smart phones, tablet computers, laptop computers, desktop computers, wearable devices, smart homes, head-mounted devices, vehicle-mounted terminals and other smart terminals with information acquisition functions. Figure 1 Each user terminal in the user terminal cluster shown in FIG. 1 may be installed with a target application (ie, an application client). When the application client runs in each user terminal, it may be respectively connected to the above-mentioned Figure 1 The servers 10 shown here interact with each other.
[0082] Among them, such as Figure 1 As shown, the server 10 can be an independent physical server, a server cluster or distributed system composed of multiple physical servers, or a cloud server that provides basic cloud computing services such as cloud services, cloud databases, cloud computing, cloud functions, cloud storage, network services, cloud communications, middleware services, domain name services, security services, CDN, as well as big data and artificial intelligence platforms.
[0083] For ease of understanding, the embodiments of the present application can be Figure 1 Select one user terminal from the multiple user terminals shown as the target user terminal, which may include: smart phones, tablet computers, laptops, desktop computers, smart TVs and other smart terminals with information acquisition functions. For example, for ease of understanding, the embodiment of the present application may Figure 1 User terminal 100a is shown as the target user terminal. User terminal 100a can obtain an image to be recognized, send the image to be recognized to server 10, and request server 19 to return the indicative keywords and target text corresponding to the indicative keywords in the image to be recognized. After receiving the image to be recognized from user terminal 100a, server 10 can perform image segmentation on the image to be recognized to obtain a text recognition region in the image to be recognized. Server 10 can perform text extraction on the text recognition region to obtain the text content within the text recognition region, and then perform indicative keyword extraction on the text content to obtain M indicative keywords from the text content, where M is a positive integer, such as 1, 2, 3, etc. Server 10 can obtain keyword feature information corresponding to each of the M indicative keywords. This keyword feature information may include keyword type and keyword location information. Based on the keyword feature information of each indicative keyword, server 10 performs information extraction on the text content to obtain the target text corresponding to each indicative keyword. The server 10 then returns the M indicative keywords and the target text corresponding to each indicative keyword to user terminal 100a. The user terminal 100a can output each indicative keyword and the target text corresponding to each indicative keyword, so that downstream related services such as information collection can be carried out. For example, information extraction can be performed on an ID card image to obtain each indicative keyword and the target text corresponding to each indicative keyword (such as the indicative keyword "ID card number" and the specific number corresponding to the "ID card number"). In this way, information extraction can be performed on image content of any layout in the image, improving the applicability and accuracy of information extraction.
[0084] See Figure 2 , Figure 2 This is a flow chart of an information acquisition method provided by an embodiment of the present application. The information acquisition method can be executed by a computer device, which can be a server (such as the above Figure 1 Server 10 in the above), or user terminal (as mentioned above Figure 1 Any user terminal in a user terminal cluster), or a system consisting of a server and a user terminal, which is not limited in this application. Figure 2 As shown, the information acquisition method may include but is not limited to the following steps:
[0085] S101 , obtaining an image to be recognized, performing image segmentation on the image to be recognized, and obtaining a text recognition area in the image to be recognized.
[0086] Specifically, information extraction is performed on the image by a computer device to obtain relevant information in the image. In this way, intelligent image information extraction can be achieved without human intervention, which is convenient for subsequent information collection, information verification and other related business processing. Specifically, the computer device can obtain an image to be identified. The image to be identified can refer to a shooting instruction sent by the computer device to a shooting component so that the shooting component shoots and obtains an image, or it can refer to an image uploaded to the computer device by a user. The computer device can perform image segmentation on the image to be identified to obtain a text recognition area in the image to be identified. The text recognition area is an area in the area to be identified that contains text information. The computer device can identify the area where the text information is located in the image to be identified, and segment the area where the text information is located in the area to be identified to obtain the text recognition area in the image to be identified.
[0087] Optionally, the computer device may perform image segmentation on the image to be identified, and a specific method for obtaining the text recognition area in the image to be identified may include: calling an information extraction model, performing pixel feature extraction on the image to be identified through the region segmentation layer in the information extraction model, and obtaining a pixel probability map of the image to be identified, wherein the pixel probability map includes the probability that each pixel point in the image to be identified is a text pixel point. Based on the pixel probability map, an area in the image to be identified where the probability of the pixel point is greater than or equal to the target probability is determined. An area in the image to be identified where the probability of the pixel point is greater than or equal to the target probability is segmented to obtain the text recognition area in the image to be identified.
[0088] Specifically, the computer device can invoke an information extraction model to extract information from the image to be identified and obtain target text corresponding to indicative keywords and indicative key words in the image to be identified. The computer device can use the region segmentation layer in the information extraction model to extract pixel features from the image to be identified and obtain a pixel probability map of the image to be identified, which includes the probability that each pixel in the image to be identified is a text pixel. The information extraction model can be trained using a large amount of sample data.
[0089] Optionally, when the region segmentation layer extracts pixel features from the image to be identified, if a pixel point A in the image to be identified is determined to be a specific pixel (e.g., a pixel value greater than or equal to a target pixel value), multiple pixel points near the pixel point A are obtained (e.g., pixels within a circular area with a radius of x), and the pixel values corresponding to the multiple nearby pixel points are obtained. Based on the pixel values corresponding to the multiple nearby pixel points, pixel points with pixel values greater than or equal to the target pixel value are obtained from the multiple nearby pixel points, and the pixel positions corresponding to the pixel points with pixel values greater than or equal to the target pixel value are obtained. Based on the pixel position of pixel point A and the pixel positions corresponding to the pixel points with pixel values greater than or equal to the target pixel value, pixel point A and the pixel points with pixel values greater than or equal to the target pixel value are connected to obtain a target image, and it is determined whether the target image is a text image. If the target image is determined to be a text image, the probability of determining that pixel point A is a text pixel point is 100%; if the target image is determined not to be a text image, the probability of determining that pixel point A is a text pixel point can be determined to be 0. The computer device may determine the probability that the target graphic is a text graphic as the probability that the pixel point A is a text pixel point.
[0090] Specifically, after the computer device obtains the pixel probability map through the region segmentation layer in the information extraction model, it can determine the pixel points in the text recognition area that are greater than or equal to the target pixel value based on the pixel probability map. The computer device can obtain the area in the text recognition area where the pixel points are greater than or equal to the target pixel value, and segment the area where the pixel points are greater than or equal to the target pixel value from the area to be recognized to obtain the text recognition area in the image to be recognized. The number of text recognition areas can be multiple, and the computer device can segment multiple text recognition areas in the image to be recognized. For example, when text information B and text information C in the image to be recognized are far apart, the computer device can segment the area where text information B is located to obtain a text recognition area, and the computer device can segment the area where text information C is located to obtain a text recognition area. In this way, the area size of the text recognition area can be reduced, the amount of computation required for subsequent text extraction in the text recognition area can be reduced, and the efficiency of text extraction can be improved.
[0091] The region segmentation layer may refer to a DBNet neural network, and the DBNet (Differentiable binarization Net) neural network is a text detection neural network used for segmentation.
[0092] In another implementation, the computer device can pre-process the image to be identified (e.g., grayscale processing) to reduce interference information in the image to be identified, thereby improving the efficiency and accuracy of information extraction. For example, the computer device can pre-grayscale the image to be identified. Grayscale processing refers to the process of converting a color image into a grayscale image. Since the image to be identified may be a color image, the color of each pixel in the color image is determined by three color components, and each color component has 255 possible values. Therefore, the color range of a pixel can exceed 16 million (255*255*255). A grayscale image is a special color image with the same three color components, and the range of color variation for a pixel is 255. Therefore, grayscale processing of the image to be identified can reduce the computational complexity of subsequent processing and improve the efficiency of information extraction.
[0093] S102: extract text from the text recognition area to obtain text content in the text recognition area.
[0094] Specifically, the computer device may perform text extraction on the text recognition area to obtain text content in the text recognition area.
[0095] Optionally, the computer device extracts text from the text recognition area, and the specific method for obtaining the text content in the text recognition area may include: calling the information extraction model, and extracting text from the text recognition area through the text recognition layer in the information extraction model to obtain a text sequence in the text recognition area. Perform feature prediction on the text sequence to obtain text pixel features of the text sequence. Obtain candidate text features corresponding to N candidate text contents in the text library, obtain the matching degree between the text pixel features and the candidate text features of each candidate text content in the N candidate text contents, where N is a positive integer. The candidate text content with the greatest matching degree with the text pixel features among the N candidate text contents is determined as the text content in the text recognition area.
[0096] Specifically, the computer device can call an information extraction model, which is the same as the information extraction model described above, to extract information from the image to be identified and obtain target text corresponding to the indicative key words and indicative keywords in the image to be identified. The computer device can use the text recognition layer in the information extraction model to extract text from the text recognition area to obtain a text sequence in the text recognition area. The computer device can use the text recognition layer to perform feature prediction on the text sequence to obtain text pixel features of the text sequence, and obtain candidate text features corresponding to N candidate text contents in the text library, where N is a positive integer, such as 1, 2, 3, etc. The computer device can obtain the degree of match between the text pixel features of the text sequence and the candidate text features of each candidate text content in the N candidate text contents, and determine the candidate text content with the greatest degree of match with the text pixel features among the N candidate text contents as the text content in the text recognition area.
[0097] Optionally, the computer device may further obtain a maximum matching degree among N matching degrees between the text pixel features and the candidate text features of the N candidate text contents, determine whether the maximum matching degree is less than or equal to a target matching degree, and output a prompt message if the maximum matching degree is less than or equal to the target matching degree to prompt re-extraction of text in the text recognition area.
[0098] Specifically, the computer device can obtain the maximum matching degree among the N matching degrees between the text pixel features of the text sequence and the candidate text features corresponding to the N candidate text contents. The computer device can determine whether the maximum matching degree is less than or equal to the target matching degree. If the maximum matching degree is less than the target matching degree, the match may not be very accurate, and a prompt message can be output to prompt manual re-extraction of text in the text recognition area, or the computer device can re-extract text in the text recognition area. In this way, the accuracy of text extraction in the text recognition area can be improved, thereby improving the accuracy of image information extraction.
[0099] The text recognition layer refers to a CRNN neural network. The CRNN (Convolutional Recurrent Neural Network) neural network is a convolutional recurrent neural network structure used to solve image-based sequence recognition problems. It is used to recognize text sequences of indefinite length without first cutting individual characters. Instead, it converts text recognition into a time-dependent sequence learning problem, which is image-based sequence recognition.
[0100] The text recognition layer can also output the confidence level of each target character in the text content and correct each target character in the text content based on the confidence level. For example, if the confidence level of each target character is less than the target confidence level, the character recognition is repeated or a prompt message is output to prompt the administrator to perform manual recognition. The confidence level refers to the degree of match between each initial character and a sample character in the text library after the computer device obtains each initial character in the text recognition area through the text recognition layer. The maximum matching level among multiple matching levels between multiple sample characters in the text library and the initial character is determined as the confidence level of the corresponding initial character. For example, after the computer device extracts initial text Q from the text recognition area, it obtains the matching level between the initial text Q and multiple sample characters in the text library. If the maximum matching level among multiple matching levels between the initial text Q and multiple sample characters in the text library is 88%, the sample text corresponding to the maximum matching level can be determined as the target character, and the confidence level of the target text is determined to be 88%.
[0101] When the computer device obtains the text content in the text recognition area, it can also obtain the text position information of each target text in the text content to facilitate subsequent information extraction.
[0102] Optionally, before extracting text from the text recognition area, the computer device may use a direction detection model to detect the direction of the text in each area of the text recognition area, obtain the text angle corresponding to each area of the text, and correct each area of the text according to the text angle corresponding to each area of the text, and correct the text direction of each area of the text to the target direction, so as to facilitate subsequent text extraction from the text recognition area and obtain the text content in the text recognition area. For example, the target direction may refer to a conventional arrangement direction that is convenient for users to view (i.e., the direction in which the text is normally arranged on paper). The text angle corresponding to the target direction may be determined as 0 degrees. With the target direction as a reference, the direction detection model may be used to output the text angle of each text (e.g., 90 degrees, which is offset by 90 degrees from the target direction). Based on the text angle of each area of the text, each area of the text is corrected, that is, each area of the text is adjusted to the target direction, so as to facilitate the subsequent acquisition of the text content in the text recognition area, which can improve the accuracy of information extraction.
[0103] S103: extract indicative keywords from the text content to obtain M indicative keywords from the text content.
[0104] Specifically, the computer device can extract indicative keywords from the text content to obtain M indicative keywords from the text content, where M is a positive integer, such as 1, 2, 3, etc. The indicative keywords refer to indicative words, such as name, gender, home address, telephone number, and ID number.
[0105] Optionally, the computer device extracts indicative keywords from the text content to obtain M indicative keywords from the text content. The specific method may include: extracting keywords from the text content to obtain Q initial keywords from the text content, where Q is a positive integer greater than or equal to M. i The matching degree between the initial keyword Q and the multiple sample indicative keywords in the indicative keyword library is i Belong to Q initial keywords, i is a positive integer less than or equal to Q. If the initial keyword Q i If there is a matching degree greater than or equal to a preset threshold among the multiple matching degrees between the multiple sample indicative keywords, the initial keyword Q i Determine as an indicative keyword. Determine M indicative keywords from the Q initial keywords, and the matching degree between one of the M indicative keywords and a sample indicative keyword in the indicative keyword library is greater than or equal to a preset threshold.
[0106] Specifically, after the computer device obtains the text content, it can extract keywords from the text content to obtain Q initial keywords in the text content, where Q is a positive integer greater than or equal to M, such as Q can be 1, 2, 3... The computer device can obtain the initial keywords Q i The matching degree between the initial keyword Q and the multiple sample indicative keywords in the indicative keyword library is respectively i Belong to any one of the Q initial keywords, i is a positive integer less than or equal to Q, such as i can be 1, 2, 3... If the initial keyword Q i If there is a matching degree greater than or equal to a preset threshold among the multiple matching degrees between the multiple sample indication keywords, the initial keyword Q i Determined as an indicative keyword. That is, after the computer device extracts Q initial keywords from the text content, it can obtain the matching degree between each initial keyword and each sample indicative keyword in the indicative keyword library. If there is a matching degree greater than or equal to a preset threshold, the initial keyword can be determined to be an indicative keyword, that is, whether each initial keyword is an indicative keyword can be determined. The preset threshold can be 100%, 90%, etc., and can be set according to the specific situation. This embodiment of the present application is not limited here.
[0107] In another implementation, when the computer device pre-builds the indicative keyword library, it can construct an extended keyword for each sample indicative keyword in the indicative keyword library. For example, the extended keyword of the sample indicative keyword "can be "phone number", "Phone (phone)" or "PhoneNumber (phone number)", etc. As long as there is an initial keyword in the text content that is the same as any of the keywords such as "phone", "phone number", "Phone" or "PhoneNumber" (that is, the matching degree is 100%), the initial keyword that is the same as any of the keywords such as "phone", "phone number", "Phone" or "PhoneNumber" can be used as an indicative keyword.
[0108] In another implementation, the computer device can use the keyword recognition layer in the information extraction model to perform indicative keyword recognition on the Q initial keywords, and determine M indicative keywords from the Q initial keywords. The keyword recognition layer can be a NER (Named Entity Recognition, abbreviated as NER) neural network. The NER neural network refers to named entity recognition, which is an important basic tool in application fields such as information extraction, question-answering systems, syntactic analysis, and machine translation. It occupies an important position in the process of natural language processing technology becoming practical. The computer device can obtain the word features corresponding to the Q initial keywords respectively, predict the probability that the initial keyword is an indicative keyword based on the word features, and determine the initial indicative keyword with a predicted probability greater than the target probability as an indicative keyword.
[0109] S104, obtain keyword feature information corresponding to M indicative keywords respectively, extract information from the text content according to the keyword feature information of each indicative keyword, obtain the target text corresponding to each indicative keyword, and output each indicative keyword and the target text corresponding to each indicative keyword.
[0110] Specifically, the computer device can obtain keyword feature information corresponding to M indicative keywords, and the keyword feature information includes keyword type and keyword position. The computer device can determine the text format of the corresponding target text according to the keyword type of each indicative keyword, and determine the text position of the corresponding target text according to the keyword position corresponding to each indicative keyword. The computer device can extract the target text corresponding to each indicative keyword from the text content according to the text format and text position of the target text, and output each indicative keyword and the target text corresponding to each indicative keyword so that the business downstream can perform business processing. For example, the computer device can extract each indicative keyword (such as the express number) in the express order and the target text corresponding to each indicative keyword (that is, the specific value of the express number) so that the user's express logistics information can be queried based on the express number.
[0111] In an embodiment of the present application, an image to be identified is acquired, image segmented, and a text recognition region within the image to be identified is obtained. This reduces the computational complexity of subsequent text extraction and improves text extraction efficiency. Text extraction is then performed on the text recognition region to obtain the text content within the text recognition region. Indicative keyword extraction is then performed on the text content to obtain M indicative keywords within the text content. Keyword feature information corresponding to each of the M indicative keywords is then obtained, including keyword type and keyword position. Based on the keyword feature information for each indicative keyword, information extraction is performed on the text content to obtain the target text corresponding to each indicative keyword. Each indicative keyword and the target text corresponding to each indicative keyword are then output. Thus, by extracting information from the text content based on the keyword type and keyword position of the M indicative keywords and obtaining the target text corresponding to each indicative keyword, information extraction can be performed on image content of any layout within the image to be identified, improving the applicability and accuracy of information extraction. Furthermore, an information extraction model can be used to extract each indicative keyword and the target text corresponding to each indicative keyword within the image to be identified, thereby improving the efficiency of image information extraction. Through this application, it is possible to extract information from image content of any layout in an image to be identified, thereby improving the applicability and accuracy of information extraction.
[0112] See Figure 3 , Figure 3 This is a flow chart of another information acquisition method provided by an embodiment of the present application. The information acquisition method can be executed by an information acquisition device, which can be a computer program (including program code) running on a computer device. For example, the information acquisition device is an application software, and the computer device can be a server (such as the above-mentioned Figure 1Server 10 in the above), or user terminal (as mentioned above Figure 1 Any user terminal in a user terminal cluster), or a system consisting of a server and a user terminal, which is not limited in this application. Figure 3 As shown, the information acquisition method may include but is not limited to the following steps:
[0113] S201 , obtaining an image to be recognized, performing image segmentation on the image to be recognized, and obtaining a text recognition area in the image to be recognized.
[0114] S202: extract text from the text recognition area to obtain text content in the text recognition area.
[0115] S203 , extracting indicative keywords from the text content to obtain M indicative keywords in the text content, where M is a positive integer.
[0116] S204: Obtain keyword feature information corresponding to the M indicative keywords respectively, where the keyword feature information includes keyword type and keyword position.
[0117] Specifically, the specific contents of steps S201-S204 in the embodiment of the present application can be found in Figure 2 The contents of steps S101-S104 in this embodiment of the present application will not be repeated here.
[0118] S205, according to the indicative keyword M j Keyword type, obtain the indicative keyword M from the first correspondence table j The corresponding target text format.
[0119] Specifically, the computer device can be used according to the indicative keyword M j Keyword type, obtain the indicative keyword M from the first correspondence table j The corresponding target text format, the keyword type can refer to the name keyword type, gender keyword type, etc. The first correspondence includes the correspondence between the keyword type and the text format, the indicative keyword M j There are M indicative keywords, where j is a positive integer less than or equal to M. For example, j can be 1, 2, 3, etc. For example, when the indicative keyword is of the "citizen ID number" keyword type, the corresponding target text format can be an 18-digit number, that is, the citizen ID number is a pure 18-digit number. For example, when the indicative keyword is of the Swiftcode (bank wire transfer number) keyword type, the corresponding target text format is an 8-digit or 11-digit number.
[0120] S206, obtaining the indicative keyword M from the second correspondence table j The corresponding text indicates the location.
[0121] Specifically, the computer device can obtain the indicative keyword M from the second correspondence table. j The corresponding text indication position, the second corresponding relationship includes the corresponding relationship between the indicative keyword and the text indication position, and the text indication position is used to reflect the position of the target text relative to the indicative keyword. For example, after the computer device obtains the indicative keyword "citizen identification number", it can obtain from the second corresponding relationship that the text indication position corresponding to the indicative keyword "citizen identification number" is on the right or lower right, etc. The text indication position is used to reflect the position of the target text relative to the indicative keyword, that is, the specific value of the ID number is to the right or lower right of the indicative keyword "citizen identification number".
[0122] S207, according to the indicative keyword M j The keyword position, text indication position and target text format are extracted from the text content to obtain the indicative keyword M j The corresponding target text outputs each indicative keyword and the target text corresponding to each indicative keyword.
[0123] Specifically, the computer device can be used according to the indicative keyword M j The keyword position and text indication position of the target text are determined from the text content, the format of the target text is determined according to the target text format, and the information of the target text area is extracted from the text content to obtain the indicative keyword M j The corresponding target text outputs each indicative keyword and the target text corresponding to each indicative keyword.
[0124] Optionally, the computer device may obtain the indicative keyword M j The specific methods of the corresponding target text may include: according to the indicative keyword M j The target position of the target text in the text content is determined based on the keyword position and the text indication position. The target text located in the target position in the text content is extracted, and the text format of the target text is the target text format.
[0125] Specifically, the computer device can be used according to the indicative keyword M jThe target position of the target text in the text content is determined based on the keyword position and text indication position of the indicative keyword "citizen identification number". For example, the keyword position of the indicative keyword "citizen identification number" is (x1, y1), and the text indication position is on the right. Then, the target position (x2, y2) where the specific value of the identification number is located can be determined based on the keyword position of "citizen identification number" being (x1, y1) and the text indication position "right". The computer device can extract the target text located in the target position in the text content, and the text format of the target text is the target text format. For example, if the target text format corresponding to the indicative keyword is an 18-bit number, the 18-bit number located at the target position (x2, y2) in the text content can be extracted as the target text corresponding to the indicative keyword.
[0126] Optionally, the computer device may analyze the keyword type and keyword position of each indicative keyword through the information recognition layer in the information extraction model, and determine the target text corresponding to each indicative keyword in the text content. The information recognition layer may refer to a GCN neural network (Graph Convolutional Network), which is used to extract spatial features of a topological graph. In an embodiment of the present application, the GCN neural network may be used to extract positional relationship features between the indicative keyword and the corresponding target text, and determine the target text corresponding to the indicative keyword from the text content based on the positional relationship features.
[0127] Optionally, after obtaining the target texts corresponding to the M indicative keywords, the computer device can also obtain the business content to be extracted required by the target business, determine the indicative keyword with the highest degree of match with the business content to be extracted from the N indicative keywords, use it as the target indicative keyword, use the target text corresponding to the target indicative keyword as the business text information corresponding to the business content to be extracted, and output the business text information. For example, in a remittance business, specific information of the business content to be extracted, "payee," is required. After obtaining the M indicative keywords and the target text corresponding to each indicative keyword in the remittance material image, the indicative keyword with the highest degree of match with the extracted business content, "payee," can be determined from the M indicative keywords as the target indicative keyword, use the target text corresponding to the target indicative keyword (e.g., ** Co., Ltd.) as the business text information of the business content to be extracted, and output the business text information "** Co., Ltd.".
[0128] In an embodiment of the present application, by acquiring an image to be recognized, performing image segmentation on the image to be recognized, and obtaining a text recognition area in the image to be recognized, the computational effort for subsequent text extraction can be reduced, thereby improving text extraction efficiency. Text extraction is performed on the text recognition area to obtain the text content within the text recognition area. Indicative keyword extraction is performed on the text content to obtain M indicative keywords in the text content, and keyword feature information corresponding to each of the M indicative keywords is obtained. The keyword feature information includes keyword type and keyword position. A target text format is determined based on the keyword type of each indicative keyword, a text indicative position of each indicative keyword is obtained, a target position is determined based on the text indicative position, and a target text located at the target position in the text content is extracted. Each indicative keyword and the target text corresponding to each indicative keyword are output. Thus, by extracting information from the text content based on the keyword type and keyword position of the M indicative keywords and obtaining the target text corresponding to each indicative keyword, information extraction can be performed on image content of any layout in the image to be recognized, improving the applicability and accuracy of information extraction. In addition, the information extraction model can also be used to extract each indicative keyword and the target text corresponding to each indicative keyword in the image to be identified, which can improve the efficiency of image information extraction. Through this application, it is possible to extract information from image content of any layout in the image to be identified, improving the applicability and accuracy of information extraction.
[0129] See Figure 4 , Figure 4 This is a schematic diagram of the structure of an information acquisition device provided in an embodiment of the present application. The above-mentioned information acquisition device can be a computer program (including program code) running on a computer device, for example, the information acquisition device is an application software; the information acquisition device can be used to execute the corresponding steps in the information acquisition method provided in the embodiment of the present application. Figure 4 As shown, the information acquisition device may include: an image segmentation module 11 , a text extraction module 12 , an indicative keyword extraction module 13 and an information extraction module 14 .
[0130] An image segmentation module 11 is used to obtain an image to be recognized, perform image segmentation on the image to be recognized, and obtain a text recognition area in the image to be recognized;
[0131] A text extraction module 12 is used to extract text from the text recognition area to obtain the text content in the text recognition area;
[0132] The indicative keyword extraction module 13 is used to extract indicative keywords from the text content to obtain M indicative keywords in the text content, where M is a positive integer;
[0133] The information extraction module 14 is used to obtain the keyword feature information corresponding to the M indicative keywords respectively, perform information extraction on the text content according to the keyword feature information of each indicative keyword, obtain the target text corresponding to each indicative keyword, and output each indicative keyword and the target text corresponding to each indicative keyword. The keyword feature information includes the keyword type and keyword position.
[0134] In conjunction with the second aspect, in a possible implementation, the image segmentation module 11 includes:
[0135] The pixel feature extraction unit 1101 is configured to call an information extraction model and extract pixel features of the image to be identified through a region segmentation layer in the information extraction model to obtain a pixel probability map of the image to be identified. The pixel probability map includes the probability that each pixel in the image to be identified is a text pixel.
[0136] A first determining unit 1102 is configured to determine, based on the pixel probability map, an area in the image to be identified where the probability of the pixel point is greater than or equal to the target probability;
[0137] The segmentation unit 1103 is configured to segment an area in the image to be recognized where the probability of the pixel point is greater than or equal to the target probability, thereby obtaining a text recognition area in the image to be recognized.
[0138] In conjunction with the second aspect, in one possible implementation, the text extraction module 12 includes:
[0139] The text extraction unit 1201 is used to call the information extraction model and perform text extraction on the text recognition area through the text recognition layer in the information extraction model to obtain a text sequence of the text recognition area;
[0140] A feature prediction unit 1202 is used to perform feature prediction on the text sequence to obtain text pixel features of the text sequence;
[0141] The first acquisition unit 1203 is used to obtain candidate text features corresponding to N candidate text contents in the text library, and obtain the matching degree between the text pixel feature and the candidate text feature of each candidate text content in the N candidate text contents, where N is a positive integer;
[0142] The second determining unit 1204 is configured to determine the candidate text content with the greatest matching degree with the text pixel feature among the N candidate text contents as the text content within the text recognition area.
[0143] In conjunction with the second aspect, in a possible implementation, the text extraction module 12 further includes:
[0144] The second obtaining unit 1205 is configured to obtain the maximum matching degree among N matching degrees between the text pixel feature and the candidate text features corresponding to the N candidate text contents;
[0145] A judging unit 1206 is configured to judge whether the maximum matching degree is less than or equal to a target matching degree;
[0146] The output unit 1207 is configured to output a prompt message to prompt the user to re-extract text from the text recognition area if the maximum matching degree is less than or equal to the target matching degree.
[0147] In conjunction with the second aspect, in a possible implementation, the indicative keyword extraction module 13 includes:
[0148] The keyword extraction unit 1301 is used to extract keywords from the text content to obtain Q initial keywords from the text content, where Q is a positive integer greater than or equal to M;
[0149] The third acquisition unit 1302 is used to acquire the initial keyword Q i The matching degree between the initial keyword Q and the multiple sample indicative keywords in the indicative keyword library is respectively i Belongs to the Q initial keywords, i is a positive integer less than or equal to Q;
[0150] The third determining unit 1303 is used to determine if the initial keyword Q i If there is a matching degree greater than or equal to a preset threshold among the multiple matching degrees between the multiple sample indicative keywords, the initial keyword Q i Identified as indicative keywords;
[0151] The fourth determining unit 1304 is configured to determine M indicative keywords from the Q initial keywords, wherein a matching degree between an indicative keyword in the M indicative keywords and a sample indicative keyword in the indicative keyword library is greater than or equal to the preset threshold.
[0152] In conjunction with the second aspect, in one possible implementation, the information extraction module 14 includes:
[0153] The fourth acquiring unit 1401 is configured to obtain the indicative keyword M j The keyword type is obtained from the first corresponding relationship table. j The corresponding target text format, the first correspondence includes the correspondence between the keyword type and the text format, the indicative keyword M j Belongs to the M indicative keywords, j is a positive integer less than or equal to M;
[0154] The fifth acquiring unit 1402 is configured to acquire the indicative keyword M from the second correspondence table. j The corresponding text indication position, wherein the second corresponding relationship includes a corresponding relationship between the indicative keyword and the text indication position, and the text indication position is used to reflect the position of the target text relative to the indicative keyword;
[0155] The information extraction unit 1403 is used to extract the information according to the indicative keyword M j The keyword position, the text indication position and the target text format are used to extract information from the text content to obtain the indicative keyword M j The corresponding target text.
[0156] In conjunction with the second aspect, in one possible implementation, the information extraction unit 1403 is specifically configured to:
[0157] According to the indicative keyword M j The target position of the target text in the text content is determined based on the keyword position and the text indication position;
[0158] A target text located in the target position in the text content is extracted, and the text format of the target text is the target text format.
[0159] According to one embodiment of the present application, Figure 4 The various modules in the information acquisition device shown can be individually or all combined into one or several units to constitute, or one (some) of the units can be further split into multiple smaller sub-units in function, and the same operation can be achieved without affecting the realization of the technical effects of the embodiments of the present application. The above-mentioned modules are divided based on logical functions. In actual applications, the functions of a module can also be implemented by multiple units, or the functions of multiple modules can be implemented by one unit. In other embodiments of the present application, the information acquisition device may also include other units. In actual applications, these functions can also be implemented with the assistance of other units, and can be implemented by the collaboration of multiple units.
[0160] In an embodiment of the present application, by acquiring an image to be recognized, performing image segmentation on the image to be recognized, and obtaining a text recognition area in the image to be recognized, the computational effort for subsequent text extraction can be reduced, thereby improving text extraction efficiency. Text extraction is performed on the text recognition area to obtain the text content within the text recognition area. Indicative keyword extraction is performed on the text content to obtain M indicative keywords in the text content, and keyword feature information corresponding to each of the M indicative keywords is obtained. The keyword feature information includes keyword type and keyword position. A target text format is determined based on the keyword type of each indicative keyword, a text indicative position of each indicative keyword is obtained, a target position is determined based on the text indicative position, and a target text located at the target position in the text content is extracted. Each indicative keyword and the target text corresponding to each indicative keyword are output. Thus, by extracting information from the text content based on the keyword type and keyword position of the M indicative keywords and obtaining the target text corresponding to each indicative keyword, information extraction can be performed on image content of any layout in the image to be recognized, improving the applicability and accuracy of information extraction. In addition, the information extraction model can also be used to extract each indicative keyword and the target text corresponding to each indicative keyword in the image to be identified, which can improve the efficiency of image information extraction. Through this application, it is possible to extract information from image content of any layout in the image to be identified, improving the applicability and accuracy of information extraction.
[0161] See Figure 5 , Figure 5 This is a schematic diagram of the structure of a computer device provided in an embodiment of the present application. Figure 5 As shown, the above-mentioned computer device 1000 may include: a processor 1001, a network interface 1004 and a memory 1005. In addition, the above-mentioned computer device 1000 may also include: a target user interface 1003, and at least one communication bus 1002. The communication bus 1002 is used to realize the connection and communication between these components. The target user interface 1003 may include a display screen (Display), a keyboard (Keyboard), and the target user interface 1003 may optionally include a standard wired interface and a wireless interface. The network interface 1004 may optionally include a standard wired interface and a wireless interface (such as a WI-FI interface). The memory 1005 may be a high-speed RAM memory, or a non-volatile memory (non-volatile memory), such as at least one disk memory. The memory 1005 may optionally also be at least one storage device located away from the aforementioned processor 1001. As Figure 5As shown, the memory 1005 as a computer-readable storage medium may include an operating system, a network communication module, a target user interface module, and a device control application.
[0162] exist Figure 5 In the computer device 1000 shown, the network interface 1004 can provide network communication functions; the target user interface 1003 is mainly used to provide an input interface for the target user; and the processor 1001 can be used to call the device control application stored in the memory 1005 to achieve:
[0163] It should be understood that the computer device 1000 described in the embodiment of the present application can execute the above Figure 2 or Figure 3 The description of the information acquisition method in the corresponding embodiment can also be performed as described above. Figure 5 The description of the information acquisition device in the corresponding embodiment will not be repeated here.
[0164] In an embodiment of the present application, by acquiring an image to be recognized, performing image segmentation on the image to be recognized, and obtaining a text recognition area in the image to be recognized, the computational effort for subsequent text extraction can be reduced, thereby improving text extraction efficiency. Text extraction is performed on the text recognition area to obtain the text content within the text recognition area. Indicative keyword extraction is performed on the text content to obtain M indicative keywords in the text content, and keyword feature information corresponding to each of the M indicative keywords is obtained. The keyword feature information includes keyword type and keyword position. A target text format is determined based on the keyword type of each indicative keyword, a text indicative position of each indicative keyword is obtained, a target position is determined based on the text indicative position, and a target text located at the target position in the text content is extracted. Each indicative keyword and the target text corresponding to each indicative keyword are output. Thus, by extracting information from the text content based on the keyword type and keyword position of the M indicative keywords and obtaining the target text corresponding to each indicative keyword, information extraction can be performed on image content of any layout in the image to be recognized, improving the applicability and accuracy of information extraction. In addition, the information extraction model can also be used to extract each indicative keyword and the target text corresponding to each indicative keyword in the image to be identified, which can improve the efficiency of image information extraction. Through this application, it is possible to extract information from image content of any layout in the image to be identified, improving the applicability and accuracy of information extraction.
[0165] In addition, it should be noted that: the embodiment of the present application also provides a computer-readable storage medium, and the computer-readable storage medium stores a computer program executed by the aforementioned information acquisition device, and the computer program includes program instructions. When the processor executes the program instructions, it can execute the aforementioned Figure 2 or Figure 3 The description of the information acquisition method in the corresponding embodiment will not be repeated here. In addition, the description of the beneficial effects of adopting the same method will not be repeated. For technical details not disclosed in the computer-readable storage medium embodiment involved in this application, please refer to the description of the method embodiment of this application. As an example, the program instructions can be deployed on a computing device for execution, or on multiple computing devices located in one location, or on multiple computing devices distributed in multiple locations and interconnected by a communication network. Multiple computing devices distributed in multiple locations and interconnected by a communication network can constitute a blockchain system.
[0166] In addition, it should be noted that: the embodiment of the present application also provides a computer program product or computer program, which may include computer instructions, which may be stored in a computer-readable storage medium. The processor of the computer device reads the computer instructions from the computer-readable storage medium, and the processor may execute the computer instructions, so that the computer device performs the above Figure 2 or Figure 3 The description of the information acquisition method in the corresponding embodiment will therefore not be repeated here. In addition, the description of the beneficial effects of adopting the same method will not be repeated here. For technical details not disclosed in the computer program product or computer program embodiments involved in this application, please refer to the description of the method embodiments of this application.
[0167] It should be noted that for the aforementioned various method embodiments, for the sake of simplicity, they are all expressed as a series of action combinations, but those skilled in the art should be aware that this application is not limited by the order of the actions described, because according to this application, some steps can be performed in other orders or simultaneously. Secondly, those skilled in the art should also be aware that the embodiments described in the specification are all preferred embodiments, and the actions and modules involved are not necessarily required by this application.
[0168] The steps in the method of the embodiment of the present application can be adjusted in order, combined and deleted according to actual needs.
[0169] The modules in the device of the embodiment of the present application can be merged, divided and deleted according to actual needs.
[0170] Those skilled in the art will appreciate that all or part of the processes in the above-described method embodiments can be implemented by instructing related hardware through a computer program. The computer program can be stored in a computer-readable storage medium. When executed, the program can include the processes in the above-described method embodiments. The storage medium can be a magnetic disk, an optical disk, a read-only memory (ROM), or a random access memory (RAM).
[0171] The above disclosure is only a preferred embodiment of the present application, and certainly cannot be used to limit the scope of rights of the present application. Therefore, equivalent changes made according to the claims of the present application are still within the scope covered by the present application.
Claims
1. A method for obtaining information, characterized in that: include: An image to be identified is acquired, an information extraction model is called, pixel features of the image to be identified are extracted through a region segmentation layer in the information extraction model, a pixel value of each pixel in the image to be identified is obtained, a plurality of pixels near a pixel point A are acquired, pixels whose pixel values are greater than or equal to a target pixel value are acquired from the plurality of pixels near the pixel point A, pixel positions corresponding to the pixels whose pixel values are greater than or equal to the target pixel value are acquired, and pixel positions corresponding to the pixels whose pixel values are greater than or equal to the target pixel value are acquired according to the pixel position of the pixel point A and the pixel positions corresponding to the pixels whose pixel values are greater than or equal to the target pixel value. The target image is obtained by connecting the pixels of the target image with the target value, determining the probability that the target image is a text image as the probability that the pixel point A is a text pixel point, generating a pixel probability map according to the probability that each pixel point in the image to be recognized is a text pixel point, and based on the pixel probability map, segmenting the image to be recognized into an area where the probability that the pixel point is a text pixel point is greater than or equal to the target probability, and obtaining the text recognition area in the image to be recognized; the pixel probability map includes the probability that each pixel point in the image to be recognized is a text pixel point, and the pixel point A is a pixel point in the image to be recognized where the pixel value is greater than or equal to the target pixel value; Using a direction detection model, obtaining the text angles corresponding to the characters in each area of the text recognition area, correcting the text direction of the characters in each area to a target direction according to the text angles corresponding to the characters in each area, performing text extraction on the corrected text recognition area, and obtaining the text content in the text recognition area; Obtaining the confidence of each target word in the text content through the text recognition layer in the information extraction model, correcting each target word in the text content according to the confidence of each target word, extracting indicative keywords from the corrected text content, and obtaining M indicative keywords in the text content, where M is a positive integer; Obtain keyword feature information corresponding to the M indicative keywords respectively, and j The keyword type is obtained from the first corresponding relationship table. j The first correspondence relationship includes the correspondence between the keyword type and the text format, and the indicative keyword M j belongs to the M indicative keywords, j is a positive integer less than or equal to M; Obtain the indicative keyword M from the second correspondence table j The corresponding text indication position, wherein the second corresponding relationship includes a corresponding relationship between the indicative keyword and the text indication position, and the text indication position is used to reflect the position of the target text relative to the indicative keyword; According to the indicative keyword M j The keyword position, the text indication position and the target text format are used to extract information from the text content to obtain the indicative keyword M j The corresponding target text outputs each of the indicative keywords and the target text corresponding to each of the indicative keywords, and the keyword feature information includes the keyword type and the keyword position.
2. The method according to claim 1, characterized in that The step of extracting text from the corrected text recognition area to obtain text content in the text recognition area includes: Calling the information extraction model, and performing text extraction on the corrected text recognition area through the text recognition layer in the information extraction model to obtain a text sequence of the text recognition area; Performing feature prediction on the text sequence to obtain text pixel features of the text sequence; Obtain candidate text features corresponding to N candidate text contents in the text library, respectively, and obtain the matching degree between the text pixel feature and the candidate text feature of each candidate text content in the N candidate text contents, where N is a positive integer; The candidate text content with the greatest matching degree with the text pixel feature among the N candidate text contents is determined as the text content in the text recognition area.
3. The method according to claim 2, characterized in that The method further comprises: Obtaining the maximum matching degree among N matching degrees between the text pixel features and the candidate text features corresponding to the N candidate text contents respectively; Determining whether the maximum matching degree is less than or equal to the target matching degree; If the maximum matching degree is less than or equal to the target matching degree, a prompt message is output to prompt the user to re-extract text from the text recognition area.
4. The method according to claim 1, characterized in that The extracting of indicative keywords from the corrected text content to obtain M indicative keywords in the text content includes: Perform keyword extraction on the corrected text content to obtain Q initial keywords in the text content, where Q is a positive integer greater than or equal to M; Get the initial keyword Q i The initial keyword Q i belongs to the Q initial keywords, i is a positive integer less than or equal to Q; If the initial keyword Q i If there is a matching degree greater than or equal to a preset threshold among the multiple matching degrees between the multiple sample indicative keywords, the initial keyword Q i Identify as indicative keywords; M indicative keywords are determined from the Q initial keywords, and a matching degree between an indicative keyword among the M indicative keywords and a sample indicative keyword in the indicative keyword library is greater than or equal to the preset threshold.
5. The method according to claim 1, characterized in that The indicative keyword M j The keyword position, the text indication position and the target text format are used to extract information from the text content to obtain the indicative keyword M j The corresponding target text includes: According to the indicative keyword M j The target position of the target text in the text content is determined based on the keyword position and the text indication position; A target text located in the target position in the text content is extracted, and the text format of the target text is the target text format.
6. An information acquisition device, characterized in that: include: The image segmentation module is used to obtain the image to be identified, call the information extraction model, extract pixel features of the image to be identified through the regional segmentation layer in the information extraction model, and obtain the pixel value of each pixel in the image to be identified. If the pixel value of pixel point A in the image to be identified is greater than or equal to the target pixel value, multiple pixel points near the pixel point A are obtained, and pixel points whose pixel values are greater than or equal to the target pixel value are obtained from the multiple pixel points near the pixel point A, and the pixel positions corresponding to the pixel points whose pixel values are greater than or equal to the target pixel value are obtained. According to the pixel position of pixel point A and the pixel value greater than or equal to the target pixel value, the pixel position of pixel point A is obtained. The pixel positions corresponding to the pixel points of the pixel values are respectively connected by connecting the pixel point A and the pixel points whose pixel values are greater than or equal to the target pixel value to obtain the target graphic, the probability that the target graphic is a text graphic is determined as the probability that the pixel point A is a text pixel point, a pixel probability map is generated according to the probability that each pixel point in the image to be recognized is a text pixel point, and based on the pixel probability map, an area in the image to be recognized where the probability that the pixel point is a text pixel point is greater than or equal to the target probability is segmented to obtain the text recognition area in the image to be recognized; the pixel probability map includes the probability that each pixel point in the image to be recognized is a text pixel point; A text extraction module is used to use a direction detection model to obtain the text angles corresponding to the text in each area of the text recognition area, correct the text direction of each area of the text to the target direction according to the text angle corresponding to each area of the text, perform text extraction on the corrected text recognition area, and obtain the text content in the text recognition area; An indicative keyword extraction module, used to obtain the confidence of each target word in the text content through the text recognition layer in the information extraction model, correct each target word in the text content according to the confidence of each target word, extract indicative keywords from the corrected text content, and obtain M indicative keywords in the text content, where M is a positive integer; An information extraction module, used to obtain keyword feature information corresponding to the M indicative keywords respectively, the information extraction module comprising a fourth acquisition unit, a fifth acquisition unit and an information extraction unit; The fourth acquisition unit is used to obtain the indicative keyword M j The keyword type is obtained from the first corresponding relationship table. j The first correspondence relationship includes the correspondence between the keyword type and the text format, and the indicative keyword M j belongs to the M indicative keywords, j is a positive integer less than or equal to M; The fifth acquisition unit is used to acquire the indicative keyword M from the second correspondence table. j The corresponding text indication position, wherein the second corresponding relationship includes a corresponding relationship between the indicative keyword and the text indication position, and the text indication position is used to reflect the position of the target text relative to the indicative keyword; The information extraction unit is used to extract the information according to the indicative keyword M j The keyword position, the text indication position and the target text format are used to extract information from the text content to obtain the indicative keyword M j The information extraction module is further used to output each indicative keyword and the target text corresponding to each indicative keyword, and the keyword feature information includes keyword type and keyword position.
7. A computer device, characterized in that: include: Processor and memory; The processor is connected to a memory, wherein the memory is used to store a computer program, and the processor is used to call the computer program so that the computer device executes the method according to any one of claims 1 to 5.
8. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores a computer program, and the computer program is suitable for being loaded and executed by a processor, so that a computer device having the processor executes the method according to any one of claims 1 to 5.
Citation Information
Patent Citations
Text recognition method, device and equipment and storage medium
CN111582282A
Bill element extraction method and device, electronic equipment and readable storage medium
CN111914835A
Litigation decision information request processing method and device
CN113191922A
