Search method, device, electronic device and storage medium
By displaying the image information page of the client and responding to the search operation of the target image, the search result page of the target image is displayed, which solves the problem of cumbersome text image search, enables quick access to the source text of the text content in the target image, and improves user experience. Information acquisition efficiency.
Patent Information
- Application Number
- CN202110775715.4
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2021-07-09
- Publication Date
- 2024-10-15
- Estimated Expiration
- 2041-07-09
AI Technical Summary
In the existing technology, the operation of text search for text images is cumbersome and inefficient, making it difficult for users to obtain information.
By displaying the image information page of the client, in response to the search operation of the target image, the search result page corresponding to the target image is displayed, including the content description information of the source page, to achieve quick access to the source text of the text content in the target image.
It simplifies the operation of source text search for the target image, improves the efficiency of user information acquisition, and enables quick access to the source text of the text content in the target image.
Smart Images

Figure CN113821669B_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of computer technology, and in particular to a search method, device, electronic device and storage medium. Background Art
[0002] With the development of computer technology, the application scope of various social applications is becoming wider and wider. It is very common for users to share content through social applications, such as sharing text images. In some cases, the text image only presents part of the content of an article, that is, the text image may be captured from the source page corresponding to the article. If the user wants to view the complete article, the source text search of the text image is required.
[0003] In the current related technologies, the operation of performing text search on text images is relatively cumbersome, and a special text recognition tool needs to be used to perform text recognition on text images to search for corresponding text, which makes it less efficient for users to obtain information. Summary of the invention
[0004] The embodiments of the present application provide a search method, device, electronic device and storage medium, which can simplify the operation of searching for source text in a target image, realize quick access to the source text of the text content in the target image, and improve the user's information acquisition efficiency.
[0005] The present application provides a search method, including:
[0006] Displaying an image information page of a client, wherein the image information page includes a target image;
[0007] In response to a search operation for the target image, and when the target image contains text content, display a search result page corresponding to the target image, the search result page including content description information of at least one source page, the source page being a page presenting source text content, the source text content being source text content of the text content in the target image;
[0008] In response to a trigger operation on the content description information, a source page corresponding to the content description information is displayed, and the source page includes the source text content.
[0009] Accordingly, an embodiment of the present application provides a search device, including:
[0010] An image display unit, used to display an image information page of a client, wherein the image information page includes a target image;
[0011] a search result display unit, configured to display a search result page corresponding to the target image in response to a search operation for the target image, when the target image contains text content, the search result page including content description information of at least one source page, the source page being a page presenting source text content, the source text content being source text content of the text content in the target image;
[0012] The source text display unit is used to display a source page corresponding to the content description information in response to a trigger operation on the content description information, wherein the source page includes the source text content.
[0013] Optionally, in some embodiments of the present application, the source page includes associated text content in the source text content that is associated with the text content in the target image, and the text content in the target image.
[0014] Optionally, in some embodiments of the present application, the image display unit may include a page display subunit and an image display subunit, as follows:
[0015] The page display subunit is used to display the content interaction page of the client, the content interaction page includes the dynamic interaction information of the user in the client, and the dynamic interaction information includes the target image;
[0016] The image display subunit is used to display an image information page in response to a viewing operation on the target image.
[0017] Optionally, in some embodiments of the present application, the page display subunit may also be used to display a message session page of a target session in the client, the message session page including a target image sent by a member in the target session;
[0018] The image display subunit may also be configured to display an image information page in response to a viewing operation on the target image.
[0019] Optionally, in some embodiments of the present application, the search result display unit may include an operation list display subunit and a search result display subunit, as follows:
[0020] The operation list display subunit is used to display a function operation list on the image information page in response to an operation on the target image, wherein the function operation list includes a search control;
[0021] The search result display subunit is used to display a search result page corresponding to the target image in response to a trigger operation on the search control and when the target image contains text content.
[0022] Optionally, in some embodiments of the present application, the source page also includes attribute information of the business service account that publishes the source text content.
[0023] Optionally, in some embodiments of the present application, the source text display unit may further include an establishment subunit, as follows:
[0024] The establishing subunit is used to establish an association relationship between the target user account corresponding to the client and the business service account in response to an association operation on the business service account.
[0025] Optionally, in some embodiments of the present application, the content description information includes information of a business service account that publishes the source text content and summary information of the source text content.
[0026] Optionally, in some embodiments of the present application, the target image carries link information of a source page corresponding to the target image;
[0027] The search result display unit may include a parsing subunit and a first display subunit, as follows:
[0028] The parsing subunit is used to parse the target image to obtain link information of a source page corresponding to the target image;
[0029] The first display subunit is used to display the search result page corresponding to the target image based on the link information.
[0030] Optionally, in some embodiments of the present application, the search result display unit may include a feature extraction subunit, an acquisition subunit, and a second display subunit, as follows:
[0031] The feature extraction subunit is used to extract features from the target image to obtain visual feature information of the target image;
[0032] an acquisition subunit, configured to acquire link information of a source page corresponding to the target image according to the visual feature information and a preset mapping relationship set, wherein the preset mapping relationship set includes a mapping relationship between visual feature information of a preset text image and link information of a source page corresponding to the preset text image;
[0033] The second display subunit is used to display the search result page corresponding to the target image based on the link information.
[0034] Optionally, in some embodiments of the present application, the search result display unit may include a text extraction subunit, a selection subunit and a third display subunit, as follows:
[0035] The text extraction subunit is used to extract key text content from the target image;
[0036] A selection subunit, configured to select source text content from the candidate text content according to the similarity between the key text content and the candidate text content;
[0037] The third display subunit is used to display the search result page corresponding to the target image based on the source text content.
[0038] Optionally, in some embodiments of the present application, the text extraction subunit can be specifically used to perform text recognition on the target image to obtain the text content of the target image, wherein the text content includes at least one text segment; perform paragraph importance statistical analysis on the text segments to select a target text segment from the text segments; and extract key text content of the target image from the target text segment based on the weight of each text sentence in the target text segment.
[0039] Optionally, in some embodiments of the present application, the step of “performing paragraph importance statistical analysis on the text segments to select target text segments from the text segments” may include:
[0040] For each text segment, frequency analysis is performed on each text unit in the text segment to obtain importance parameters of each text unit in the text segment;
[0041] Merging the importance parameters of each text unit in the text segment to obtain a target importance parameter of the text segment;
[0042] A target text segment is selected from the text segments according to the target importance parameters of the text segments.
[0043] Optionally, in some embodiments of the present application, the step of “for each text segment, performing frequency analysis on each text unit in the text segment to obtain importance parameters of each text unit in the text segment” may include:
[0044] For each text unit in each text segment, the frequency of occurrence of the text unit in the text segment is counted to obtain the weight of the text unit in the text segment;
[0045] Counting the frequency of occurrence of the text unit in the sample text to obtain a reference weight of the text unit;
[0046] An importance parameter of the text unit is determined according to the reference weight of the text unit and the weight in the text segment.
[0047] Optionally, in some embodiments of the present application, the step of “extracting key text content of the target image from the target text segment based on the weight of each text sentence in the target text segment” may include:
[0048] For each text sentence in the target text segment, calculating the similarity between the text sentence and each reference text sentence, where the reference text sentence is other text sentences in the target text segment except the text sentence;
[0049] Setting the initial weight of each text sentence in the target text segment;
[0050] According to the similarity, iteratively calculate the initial weight of each text sentence in the target text segment to obtain the weight of each text sentence in the target text segment;
[0051] According to the weight, a target text sentence is selected from each text sentence of the target text segment as the key text content of the target image.
[0052] Optionally, in some embodiments of the present application, the selection subunit can be specifically used to perform semantic analysis on the key text content to obtain semantic feature information of the key text content; calculate the similarity between the semantic feature information of the key text content and the semantic feature information of the candidate text content; and select source text content from the candidate text content based on the similarity.
[0053] Optionally, in some embodiments of the present application, the selection subunit can be specifically used to perform quality analysis on the candidate text content to obtain content quality information of the candidate text content; and select source text content from the candidate text content based on the similarity between the key text content and the candidate text content, and the content quality information of the candidate text content.
[0054] An electronic device provided in an embodiment of the present application includes a processor and a memory, wherein the memory stores a plurality of instructions, and the processor loads the instructions to execute the steps in the search method provided in the embodiment of the present application.
[0055] In addition, an embodiment of the present application further provides a storage medium on which a computer program is stored, wherein the computer program, when executed by a processor, implements the steps in the search method provided in the embodiment of the present application.
[0056] The embodiments of the present application provide a search method, device, electronic device, and storage medium, which can display an image information page of a client, wherein the image information page includes a target image; in response to a search operation for the target image, and when the target image contains text content, display a search result page corresponding to the target image, wherein the search result page includes content description information of at least one source page, wherein the source page is a page presenting source text content, and the source text content is the source text content of the text content in the target image; in response to a trigger operation for the content description information, display a source page corresponding to the content description information, wherein the source page includes the source text content. The present application can simplify the operation of performing source text search on a target image, realize quick access to the source text of the text content in the target image, and improve the information acquisition efficiency of the user. BRIEF DESCRIPTION OF THE DRAWINGS
[0057] In order to more clearly illustrate the technical solutions in the embodiments of the present application, the drawings required for use in the description of the embodiments will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present application. For those skilled in the art, other drawings can be obtained based on these drawings without creative work.
[0058] Figure 1a is a scenario diagram of the search method provided in an embodiment of the present application;
[0059] Figure 1b is a flowchart of a search method provided in an embodiment of the present application;
[0060] Figure 1c is another flow chart of the search method provided in an embodiment of the present application;
[0061] Figure 1d is an illustration of a search method provided in an embodiment of the present application;
[0062] Figure 1e is another flow chart of the search method provided in an embodiment of the present application;
[0063] Figure 1f It is a page schematic diagram of the search method provided in the embodiment of the present application;
[0064] Figure 2 is another flow chart of the search method provided in an embodiment of the present application;
[0065] Figure 3 is a schematic diagram of the structure of a search device provided in an embodiment of the present application;
[0066] Figure 4 It is a schematic diagram of the structure of an electronic device provided in an embodiment of the present application. DETAILED DESCRIPTION
[0067] 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 only 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 those skilled in the art without creative work are within the scope of protection of this application.
[0068] The embodiments of the present application provide a search method, device, electronic device and storage medium. The search device can be integrated in an electronic device, which can be a terminal or a server.
[0069] It is understandable that the search method of this embodiment can be executed on a terminal, can be executed on a server, or can be executed by both a terminal and a server. The above examples should not be construed as limiting the present application.
[0070] like Figure 1a As shown, the terminal and the server jointly perform the search method as an example. The search system provided in the embodiment of the present application includes a terminal 10 and a server 11, etc. The terminal 10 and the server 11 are connected via a network, such as a wired or wireless network connection, etc., wherein the search device can be integrated in the terminal.
[0071] The terminal 10 can be used to: display the client's image information page, the image information page includes the target image; in response to a search operation for the target image, and when the target image contains text content, display the search result page corresponding to the target image, the search result page includes content description information of at least one source page, the source page is a page presenting source text content, and the source text content is the source text content of the text content in the target image; in response to a trigger operation for the content description information, display the source page corresponding to the content description information, the source page includes the source text content. The terminal 10 can include a mobile phone, a smart TV, a tablet computer, a laptop, a personal computer (PC), a wearable device, or a car computer, etc. A client can also be set on the terminal 10, and the client can be an application client or a browser client, etc.
[0072] The server 11 can receive the target image sent by the terminal 10 to extract key text content from the target image; select source text content from the candidate text content according to the similarity between the key text content and the candidate text content; and send the relevant content of the source text content to the terminal 10 so that the terminal 10 displays the search result page corresponding to the target image based on the source text content. The server 11 can be a single server, or a server cluster or cloud server composed of multiple servers.
[0073] The step of performing source text search by the server 11 may also be executed by the terminal 10 .
[0074] The search method provided in the embodiment of the present application relates to natural language processing in the field of artificial intelligence. The present application can simplify the operation of searching for source text of a target image, and realize quick access to the source text of the text content in the target image.
[0075] Among them, 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 obtain the best results. In other words, artificial intelligence is a comprehensive technology in computer science. It attempts to understand the essence of intelligence and produce a new intelligent machine that can respond in a similar way to human intelligence. Artificial intelligence is to study the design principles and implementation methods of various intelligent machines so that machines have the functions of perception, reasoning and decision-making. Artificial intelligence technology is a comprehensive discipline that covers a wide range of fields, including both hardware-level technology and software-level technology. Among them, artificial intelligence software technology mainly includes computer vision technology, speech processing technology, natural language processing technology, as well as machine learning / deep learning, autonomous driving, smart transportation and other major directions.
[0076] Among them, natural language processing (NLP) is an important direction in the fields of computer science and artificial intelligence. It studies various theories and methods that can achieve effective communication between people and computers using natural language. Natural language processing is a science that integrates linguistics, computer science, and mathematics. Therefore, research in this field will involve natural language, that is, the language people use in daily life, so it is closely related to the study of linguistics. Natural language processing technology usually includes text processing, semantic understanding, machine translation, robot question answering, knowledge graph and other technologies.
[0077] It should be noted that the description order of the following embodiments is not intended to limit the preferred order of the embodiments.
[0078] This embodiment will be described from the perspective of a search device, which may be integrated into an electronic device, such as a server or a terminal.
[0079] The search method of the embodiment of the present application can be applied to various scenarios where source text search is required. For example, in a message conversation page of an instant messaging application, a target image sent by a member in a target conversation can be displayed by the search method provided in this embodiment in response to a search operation on the target image, and then the source text content can be obtained. The search method of the present application simplifies the operation of searching for source text on the target image, and can realize quick access to the source text of the text content in the target image.
[0080] like Figure 1b As shown, the specific process of the search method can be as follows:
[0081] 101. Display an image information page of a client, where the image information page includes a target image.
[0082] In this embodiment, the client may be an application client or a browser client, which is not limited in this embodiment. For example, the client may be an instant messaging application.
[0083] The image information page is a page that presents the target image, which may specifically be a chat session page or an information interaction page.
[0084] Among them, the target image can be an image posted by any user in the client, and its type is not limited. In one embodiment, the target image can be obtained by taking a screenshot of a content page when a user browses an article in the content page; in a specific scenario, user a takes a screenshot of the content page corresponding to a certain article to obtain the target image, and sends it to a friend, user b, through the client. Since the amount of information that can be carried by a single captured image is relatively limited, that is, the target image captured by user a usually only contains a part of the article, and does not contain the contextual content that is not displayed on the screen, when the recipient of the target image, user b, wants to view the content in the complete screenshot source page, the target image can be operated through the search method of this application to search for the source text content in the source page corresponding to the target image, and view the complete content of the source of the screenshot (i.e., the target image).
[0085] Optionally, in this embodiment, the step of “displaying the client's image information page” may include:
[0086] Displaying a content interaction page of a client, wherein the content interaction page includes dynamic interaction information of a user in the client, and the dynamic interaction information includes the target image;
[0087] In response to a viewing operation on the target image, an image information page is displayed.
[0088] Among them, the content interaction page is a page that presents user information interaction in the client, and the dynamic interaction information may include text, voice, image, video, etc.
[0089] The viewing operation on the target image may include a click operation on the target image, which is not limited in this embodiment.
[0090] Optionally, in this embodiment, the step of “displaying the client's image information page” may include:
[0091] Displaying a message conversation page of a target conversation in a client, wherein the message conversation page includes a target image sent by a member in the target conversation;
[0092] In response to a viewing operation on the target image, an image information page is displayed.
[0093] The target conversation may be a conversation between a user and a communication partner; specifically, the target conversation may be a one-to-one communication conversation, or may be a conversation including multiple communication partners, ie, a group conversation.
[0094] The viewing operation on the target image may include a click operation on the target image, which is not limited in this embodiment.
[0095] Optionally, the target image can also be acquired by an image acquisition device on the electronic device. For example, when a shooting instruction is received from the client, the image acquisition device is turned on to capture an image, and the captured image is used as the target image. The image acquisition device can be a camera, etc.
[0096] 102. In response to a search operation for the target image, and when the target image contains text content, display a search result page corresponding to the target image, wherein the search result page includes content description information of at least one source page, wherein the source page is a page presenting source text content, and the source text content is the source text content of the text content in the target image.
[0097] The target image may contain only text content, or may contain text content and image content, etc., which is not limited in this embodiment. The search result page displays the search results obtained after searching the source text of the target image. The search result may specifically include content description information of one or more source pages. The content description information may include summary content information of the source text content, cover information, etc.
[0098] The source page is the page from which the text content in the target image comes. Specifically, the target image can be obtained by intercepting a certain article in the content page when the user browses the content page, and the source page of the target image is also the content page showing this article.
[0099] The source text content is specifically the text content in the source page of the target image that is searched, that is, the source text content is the source text of the text content in the target image.
[0100] Optionally, in this embodiment, the content description information includes information of a business service account that publishes the source text content and summary information of the source text content.
[0101] The business service account may be a public account or a personal account, which is not limited in this embodiment. The business service account information may include the name of the business service account and other related information. The summary information may be a summary of the source text content.
[0102] Optionally, in this embodiment, the source page includes associated text content in the source text content that is associated with the text content in the target image, and the text content in the target image.
[0103] The target image may be captured by the user when browsing an article in the content page, and the captured content is usually only a part of the article, but not the context of the content. Therefore, the source text content of the target image may include the text content in the target image and the context of the text content in the target image.
[0104] The associated text content may specifically be context content of the text content in the target image in the source text content.
[0105] In this embodiment, the search operation for the target image may include user's voice information, trigger operation, etc., which is not limited in this embodiment.
[0106] In some embodiments, the search method can recognize the user's voice information and match the user's voice information with preset text information corresponding to the image search in the client, so as to determine the user's operation on the target image.
[0107] Specifically, the search operation includes voice information for the target image. When voice information for the target image is detected, semantic feature information can be extracted from the acquired voice information, and the matching degree between the semantic feature information of the voice information and the preset text information can be calculated. Based on the matching degree, it is determined whether the user's operation is to search for the target image.
[0108] Optionally, in this embodiment, the step of “in response to a search operation for the target image, and when the target image contains text content, displaying a search result page corresponding to the target image” may include:
[0109] In response to an operation on the target image, displaying a function operation list on the image information page, the function operation list including a search control;
[0110] In response to a trigger operation on the search control and when the target image contains text content, a search result page corresponding to the target image is displayed.
[0111] The operation on the target image can be set according to the actual situation, and this embodiment does not limit this. For example, the operation can be a pressing operation on the target image. When it is detected that the pressing time on the target image exceeds the preset time, the function operation list can be displayed on the image information page. The function operation list may include controls corresponding to various types of operations on the target image, such as the function operation list may include a collection control, a search control, a send control, and an edit control.
[0112] The triggering operation on the search control may specifically be a click operation on the search control, etc., which is not limited in this embodiment.
[0113] Optionally, in this embodiment, the target image carries link information of a source page corresponding to the target image;
[0114] The step of “displaying the search result page corresponding to the target image” may include:
[0115] Parsing the target image to obtain link information of a source page corresponding to the target image;
[0116] Based on the link information, a search result page corresponding to the target image is displayed.
[0117] The link information is the address information of the source page.
[0118] Among them, optionally, the target image can be that when user a takes a screenshot of the content page (i.e., the source page of the target image), the link information of the content page is written into the target image in the form of a blind watermark (an invisible watermark), and the target image with the written link information is sent to user b. When user b performs a search operation on the received target image and the target image contains text content, the blind watermark therein can be parsed and extracted to obtain the link information of the source page corresponding to the target image, which is provided to user b for jumping and viewing.
[0119] Among them, based on the link information, displaying the search result page corresponding to the target image can specifically include: obtaining the text information (i.e., source text content) in the page corresponding to the link information (i.e., the source page of the target image), then summarizing the source text content to obtain summary information of the source text content, and obtaining information of the business service account that publishes the source text content, thereby obtaining content description information corresponding to the source page, and based on the content description information of the source page, displaying the search result page of the target image.
[0120] Optionally, in this embodiment, the step of “displaying the search result page corresponding to the target image” may include:
[0121] Performing feature extraction on the target image to obtain visual feature information of the target image;
[0122] Acquire link information of a source page corresponding to the target image according to the visual feature information and a preset mapping relationship set, wherein the preset mapping relationship set includes a mapping relationship between visual feature information of a preset text image and link information of a source page corresponding to the preset text image;
[0123] Based on the link information, a search result page corresponding to the target image is displayed.
[0124] The preset text image is an image containing text content. Specifically, the preset text image may contain only text content, or may contain text content and image content, etc. This embodiment does not limit this.
[0125] Among them, the target image can be feature extracted by a neural network model, which is not limited in this embodiment. For example, the neural network model can be a visual geometry group network (VGGNet, Visual Geometry Group Network), a residual network (ResNet, Residual Network) and a densely connected convolutional network (DenseNet, Dense Convolutional Network), etc., but it should be understood that the neural network model of this embodiment is not limited to the above-mentioned types.
[0126] The feature extraction of the target image may specifically be convolution processing and pooling processing of the target image.
[0127] The preset mapping relationship set may be a relationship table between the visual feature information of the preset text image and the link information of the source page corresponding to the preset text image. Based on the visual feature information of the target image, the link information of the source page of the corresponding target image is searched from the relationship table.
[0128] It should be noted that the algorithm for extracting features from the target image is the same as the feature extraction algorithm used for the visual feature information of the preset text image in the preset mapping relationship set.
[0129] Optionally, in some embodiments, when a user takes a screenshot of a content page, the visual feature vector of the screenshot (specifically a text image) and the link information of the content page can be extracted, and a mapping relationship between the two (i.e., the visual feature information of the text image and the link information of the source page (content page) corresponding to the text image) can be established to obtain a preset mapping relationship set. If other users subsequently perform a source text search on the screenshot, the same algorithm can be used to extract the visual feature vector, and the link information of the corresponding source page can be found in the originally established preset mapping relationship set, and provided to the user for jumping and viewing.
[0130] The text image specifically refers to an image including but not limited to text content.
[0131] Among them, based on the link information, displaying the search result page corresponding to the target image can specifically include: obtaining the text information (i.e., source text content) in the page corresponding to the link information (i.e., the source page of the target image), then summarizing the source text content to obtain summary information of the source text content, and obtaining information of the business service account that publishes the source text content, thereby obtaining content description information corresponding to the source page, and based on the content description information of the source page, displaying the search result page of the target image.
[0132] Optionally, in this embodiment, the step of “displaying the search result page corresponding to the target image” may include:
[0133] extracting key text content from the target image;
[0134] Selecting source text content from the candidate text content according to the similarity between the key text content and the candidate text content;
[0135] Based on the source text content, a search result page corresponding to the target image is displayed.
[0136] Among them, based on the source text content, displaying the search result page corresponding to the target image can specifically include: summarizing the source text content to obtain summary information of the source text content, and obtaining information of the business service account that publishes the source text content, so as to obtain content description information corresponding to the source page, and based on the content description information of the source page, displaying the search result page of the target image.
[0137] Optionally, in this embodiment, the step of “extracting key text content from the target image” may include:
[0138] Performing text recognition on the target image to obtain text content of the target image, wherein the text content includes at least one text segment;
[0139] Performing paragraph importance statistical analysis on the text segments to select target text segments from the text segments;
[0140] Based on the weight of each text sentence in the target text segment, key text content of the target image is extracted from the target text segment.
[0141] The target image contains content other than text information, and text recognition needs to be performed on it to extract the text content in the target image. In one embodiment, text recognition can be performed on the target image through optical character recognition (OCR) to obtain the text content of the target image.
[0142] For example, refer to Figure 1c , which is the extraction process of the key text content of the target image. First, the target image can be extracted by optical character recognition (OCR) to obtain the text content of the target image. Then, the layout analysis can be performed according to the text distribution of the text in the target image, and the text content can be segmented into paragraphs according to the spatial position of the text content on the image to obtain at least one text segment of the text content corresponding to the target image. Then, the target text segment is selected from at least one text segment as the key paragraph. Finally, the extracted key paragraph is simplified to obtain the key text content of the target image.
[0143] Optionally, in this embodiment, the step of “performing paragraph importance statistical analysis on the text segments to select target text segments from the text segments” may include:
[0144] For each text segment, frequency analysis is performed on each text unit in the text segment to obtain importance parameters of each text unit in the text segment;
[0145] Merging the importance parameters of each text unit in the text segment to obtain a target importance parameter of the text segment;
[0146] A target text segment is selected from the text segments according to the target importance parameters of the text segments.
[0147] There are many ways to fuse the importance parameters of each text unit, which are not limited in this embodiment, such as weighted fusion, average operation, etc.
[0148] The step of “merging the importance parameters of each text unit in the text segment to obtain the target importance parameter of the text segment” may include:
[0149] Determining the weight corresponding to each text unit in the text segment;
[0150] According to the weights, importance parameters of the text units in the text segment are fused to obtain a target importance parameter of the text segment.
[0151] The weight corresponding to each text unit in the text segment can be set according to actual conditions, and this embodiment does not limit this. For example, it can be determined according to its position in the text segment.
[0152] The step of “selecting a target text segment from each text segment according to the target importance parameter of each text segment” may include:
[0153] The text segment with the largest target importance parameter is taken as the target text segment.
[0154] The target text segment is also the key text segment of the text content in the target image.
[0155] In some embodiments, a text segment whose target importance parameter is greater than a preset value may also be used as a target text segment, and the preset value may be set according to actual conditions.
[0156] Optionally, in this embodiment, the step of “for each text segment, performing frequency analysis on each text unit in the text segment to obtain importance parameters of each text unit in the text segment” may include:
[0157] For each text unit in each text segment, the frequency of occurrence of the text unit in the text segment is counted to obtain the weight of the text unit in the text segment;
[0158] Counting the frequency of occurrence of the text unit in the sample text to obtain a reference weight of the text unit;
[0159] An importance parameter of the text unit is determined according to the reference weight of the text unit and the weight in the text segment.
[0160] Among them, the text segment can be firstly processed for word segmentation to obtain the various text units of the text segment. In some embodiments, the text units in the text segment can also be filtered. Specifically, the filtering process can include removing meaningless text units such as stop words, spaces, punctuation marks, etc. from the text segment after word segmentation. It can be understood that the filtered text units can also be customized and added according to the application scenario, and this embodiment does not limit this. The text unit can specifically be a character or a word.
[0161] Among them, stop words can be set according to actual conditions. It can filter the specified words and characters according to business needs. For example, some common words can be specified as stop words and these common words can be filtered.
[0162] The frequency of a text unit in a text segment is specifically the term frequency of the text unit in the text segment. Specifically, in a given document, term frequency (tf) refers to the frequency of a given word in the document. This is a normalization of the number of words to prevent it from being biased towards long files. j The word t i For example, the word frequency is calculated as shown in formula (1):
[0163]
[0164] In the formula, n i,j It is the word t i In the document d j The denominator is the number of occurrences in document d j The sum of the occurrences of all words in document d, k represents the number of occurrences of all words in document d. j The number of different words in tf i,j Expressing words t i In the document d j In this embodiment, document d j Specifically, it can be a text segment, and the word frequency tf of the text unit in the text segment can be i,j Directly used as the weight of the text unit in the text segment.
[0165] The sample text may be a text in a corpus, and the reference weight of a text unit may be specifically represented by an inverse document frequency. Inverse document frequency (idf) is a measure of the general importance of a word. The inverse document frequency of a text unit represents the frequency of its occurrence in a corpus, and its calculation method is shown in formula (2):
[0166]
[0167] The inverse text frequency of a text unit can be obtained by dividing the total number of documents in the corpus by the number of documents containing the text unit, and then taking the logarithm to the base 10 of the quotient.
[0168] Among them, |D| represents the total number of documents in the corpus used, |{j:t i ∈d j}| is the text unit t i The number of documents, idf i For text unit t i In some embodiments, each document in the corpus may be a string of text after an OCR is performed on a screenshot, and the text in the same screenshot is classified as one document.
[0169] Optionally, the step of “determining the importance parameter of the text unit according to the reference weight of the text unit and the weight in the text segment” may include:
[0170] The reference weight of the text unit and the weight in the text segment are fused to obtain the importance parameter of the text unit.
[0171] There are many ways to merge, for example, the fusion method can be multiplication, etc., which is not limited in this embodiment. Specifically, the importance parameter of a text unit can be obtained by multiplying the word frequency tf and the inverse text frequency idf of the text unit, and the importance parameter can be represented by tf-idf.
[0172] tf-idf stands for Term Frequency–Inverse Document Frequency, which is a commonly used weighting technique for information retrieval and text mining. tf-idf is a statistical method used to assess the importance of a word to a document set or one of the documents in a corpus. The importance of a word increases in direct proportion to the number of times it appears in a document, but decreases in inverse proportion to the frequency of its appearance in the corpus.
[0173] For example, for text segment d j Text unit t i , the importance parameter tf-idf is calculated as shown in formula (3):
[0174] tfidf i,j =tf i,j ×idf i (3)
[0175] Formula (3) is expressed as the frequency of the text unit in the text segment multiplied by the inverse text frequency of the text unit in the corpus. i,jIndicates the text segment d j The text unit in t i The importance parameter.
[0176] Among them, the high word frequency of a word in a specific paragraph and the low document frequency of the word in the entire document set can produce a high weight tf-idf. Therefore, tf-idf tends to filter out common words and retain important words.
[0177] In this embodiment, if the text segment d j The text unit in t i The importance parameter of tfidf i,j , then the target importance parameter of text segment j can be the sum of the tfidf of each text unit in the text segment, as shown in formula (4):
[0178] PS j =∑ L tfidf i,j (4)
[0179] Where L is the number of different text units in text segment j, PS j is the target importance parameter of text segment j.
[0180] Optionally, the text segment with the largest target importance parameter can be selected as the target text segment, as shown in formula (5):
[0181] m=argmax(PS) (5)
[0182] Where PS is the target importance parameter of each text segment, and m is the maximum value among the target importance parameters. argmax represents a function that finds a parameter (set) of a function. Specifically, argmax(f(x)) is the variable point x (or set of x) corresponding to the maximum value of f(x).
[0183] The expression of long text is usually complex and difficult for search engines to understand, thereby reducing the accuracy of source text recall. In order to reduce the noise from long text and improve the search accuracy, this application needs to further simplify the target text segment.
[0184] Specifically, the target text segment can be simplified by using the TextRank algorithm of an undirected graph. TextRank builds a network based on the relationship between text sentences, regards a text sentence as a node, and then iteratively calculates the weight of each node, sorts the text sentences according to the weight, and thus obtains the key text sentences.
[0185] Optionally, in this embodiment, the step of “extracting key text content of the target image from the target text segment based on the weight of each text sentence in the target text segment” may include:
[0186] For each text sentence in the target text segment, calculating the similarity between the text sentence and each reference text sentence, where the reference text sentence is other text sentences in the target text segment except the text sentence;
[0187] Setting the initial weight of each text sentence in the target text segment;
[0188] According to the similarity, iteratively calculate the initial weight of each text sentence in the target text segment to obtain the weight of each text sentence in the target text segment;
[0189] According to the weight, a target text sentence is selected from each text sentence of the target text segment as the key text content of the target image.
[0190] The target text segment can be divided into text sentences according to punctuation marks. Specifically, the target text segment can be divided into text sentences S = [S1, S2, ..., S ls ], where ls is the number of sentences in the target text segment, S represents the set of sentences in the target text segment, S1, S2, …, S ls Respectively represent each sentence in the target text segment.
[0191] There are many ways to calculate the similarity between the text sentence and each reference text sentence, which is not limited in this embodiment.
[0192] For example, the vector distance between the semantic feature vector of the text sentence and the semantic feature vector of the reference text sentence can be calculated, and the similarity between the text sentence and the reference text sentence can be determined based on the vector distance, where the vector distance can be a cosine distance, a Euclidean distance, etc.; the larger the vector distance, the smaller the similarity between the text sentence and the reference text sentence; conversely, the smaller the vector distance, the greater the similarity between the text sentence and the reference text sentence.
[0193] For another example, the similarity between a text sentence and a reference text sentence can be calculated by using Jaccard Similarity. The calculation method of Jaccard Similarity is shown in formula (6):
[0194]
[0195] Among them, the text sentence S i The text unit set is N i For the text sentence S i The number of text units in the text sentence Sj The text unit set is N j For the text sentence S j The number of Chinese text units, JSim(S i ,S j ) represents the text sentence S i and text sentence S j The similarity between |{w k ∣w k ∈S i &w k ∈S j}| means that it belongs to the text sentence S i and text sentence S j The number of text units, which can also be understood as the text sentence S i The text unit set and text sentence S j The number of text units in the intersection of the text unit sets of |S i | represents the text sentence S i The number of text units in the text unit set, |S j | represents the text sentence S j The number of text units in the collection of text units.
[0196] Optionally, in this embodiment, a similarity matrix E of the text sentences in the target text segment can be constructed based on the calculated similarity between each text sentence and other text sentences in the target text segment, and then a sentence graph G = (V, E) can be constructed according to the similarity matrix E, where V represents the weight of the text sentence in the target text segment, and the initial weight of each text sentence of V can be set to 1.
[0197] In the sentence graph, each sentence of the target text segment can be regarded as a node, and the similarity between sentence pairs (i.e., two text sentences) is used as the weight of the edge. The weight of a similarity of 0 is also 0, which is equivalent to the sentence pair having no edge.
[0198] The initial weight of each text sentence in the target text segment is iterated to obtain the weight of each text sentence in the target text segment. Specifically, the iteration can be performed through the following formula (7):
[0199]
[0200] Wherein, formula (7) represents iterative calculation of the weight WS of each text sentence in the target text segment until the average WS error generated by this iteration is less than a preset value, and the preset value can be set according to actual conditions, such as 0.0001.
[0201] Among them, V i represents the i-th node, V jrepresents the jth node, d represents the damping coefficient (representing the probability that a node in the graph points to any other node), In(V i ) indicates pointing to V i The node collection of nodes, Out(V j ) is from V j The node set pointed to by the node, WS(V i ) represents node V i The weight of JSim ji Represents node V i To Node V j The weight of the edge, that is, the text sentence S i and text sentence S j The similarity between .
[0202] According to the final weight of each text sentence obtained by iteration, the text sentence with the highest weight is selected as the key sentence of the target text segment, thereby simplifying the target text segment.
[0203] Optionally, the step of “selecting a target text sentence from each text sentence of the target text segment as the key text content of the target image according to the weight” may include:
[0204] The text sentence with the highest weight in the target text segment is selected as the target text sentence to obtain the key text content of the target image.
[0205] Optionally, in this embodiment, the step of “selecting source text content from the candidate text content according to the similarity between the key text content and the candidate text content” may include:
[0206] Performing semantic analysis on the key text content to obtain semantic feature information of the key text content;
[0207] Calculating the similarity between the semantic feature information of the key text content and the semantic feature information of the candidate text content;
[0208] According to the similarity, source text content is selected from the candidate text content.
[0209] Optionally, before semantic analysis is performed on the key text content, the key text content may be segmented to obtain the segmented key text content, which is recorded as query. Then, entity analysis, synonym analysis, intent analysis and other operations may be performed on the segmented key text content to fully mine semantic information and potential search intent.
[0210] Specifically, semantic analysis of key text content can identify corresponding entities, synonyms, stop words, implicit regions, and other information, and construct a syntax tree and data of various feature dimensions. The syntax tree can efficiently retrieve the source text content from the inverted index.
[0211] For example, assuming the key text content is "Apple X mobile phone recycling", and the synonym of "Apple X mobile phone" is "xphone", you can construct the following Figure 1d The syntax tree shown. Figure 1d In the example, the "and" node indicates that the recalled source text content must contain the contents of its two child nodes, and the "or" node indicates that the recalled source text content only needs to contain one of the child nodes. For example, node 4 indicates that the recalled source text content must contain the words "Apple X" and "Mobile Phone"; node 2 indicates that the recalled source text must contain either "Apple X" and "Mobile Phone" at the same time, or "xphone".
[0212] Among them, the potential intent of the query, such as medical, travel, and automobile intents, can be analyzed through pre-trained FastText, XGBoost and other models. Under each major intent category, there will be many sub-intents. For example, under the medical intent, it will be divided into sub-categories such as doctors, hospitals, diseases, drugs, medical devices, health care, and medical beauty. After obtaining the semantic intent of the key text content, the search results will be searched first from the candidate text content of the corresponding category to improve the accuracy.
[0213] Among them, X-gboost (eXtreme Gradient Boosting) is the extreme gradient boosting tree model, which is an optimized distributed gradient boosting library. It is derived from the gradient boosting framework, but is more efficient because the X-gboost algorithm can perform parallel calculations, approximate tree construction, effectively process sparse data, and optimize memory usage.
[0214] The step of “calculating the similarity between the semantic feature information of the key text content and the semantic feature information of the candidate text content” may include:
[0215] Calculating the vector distance between the semantic feature vector of the key text content and the semantic feature vector of the candidate text content;
[0216] The similarity between the key text content and the candidate text content is determined based on the vector distance.
[0217] The vector distance may be a cosine distance or a Euclidean distance, etc. The vector distance can be used to represent the similarity. The larger the vector distance, the smaller the similarity; conversely, the smaller the vector distance, the greater the similarity.
[0218] The key text content and the candidate text content may be subjected to feature extraction respectively to obtain a semantic feature vector of the key text content and a semantic feature vector of the candidate text content.
[0219] In some embodiments, after calculating the similarity between the key text content and the candidate text content, the candidate text content whose similarity to the key text content is greater than a preset similarity threshold can be selected as the source text content. The preset similarity threshold can be set according to actual conditions.
[0220] In other embodiments, the candidate text contents may be sorted based on the similarity between the key text contents and the candidate text contents, such as sorting them from large to small according to the similarity, to obtain sorted candidate text contents, and the first n candidate text contents of the sorted candidate text contents may be selected as the source text contents.
[0221] Optionally, in this embodiment, the step of “selecting source text content from the candidate text content according to the similarity between the key text content and the candidate text content” may include:
[0222] Performing quality analysis on the candidate text content to obtain content quality information of the candidate text content;
[0223] Source text content is selected from the candidate text content according to the similarity between the key text content and the candidate text content, and the content quality information of the candidate text content.
[0224] The dimensions of quality analysis may include the professionalism, originality and user attention of the candidate text content, wherein user attention represents the attractiveness of the candidate text content to users. The content quality information of the candidate text content may be obtained by synthesizing the quality analysis results of various dimensions of the candidate text content.
[0225] In some embodiments, candidate high-quality text content may be selected from the candidate text content based on content quality information of the candidate text content, and then source text content may be selected from the candidate high-quality text content based on similarity between the key text content and the candidate high-quality text content.
[0226] It is understandable that the candidate text content in the above embodiment can be content published by the business service account of the client, or it can be a third-party HTML5 (HyperText Markup Language5, the fifth generation hypertext markup language) page article, and this embodiment does not limit this.
[0227] In the present application, for the semantic feature information of the candidate text content, an online retrieval system may be used to search for the source text, or an offline analysis system may be used, which is not limited in this embodiment.
[0228] For the offline analysis system, the offline system has analyzed a large amount of article data. For each article, it will extract features at the word granularity, create an index, and calculate the article's authority score and quality score. Each article can be a candidate text content.
[0229] Specifically, the offline analysis system can perform offline analysis on each article after it is published. This process is independent of online retrieval. Offline analysis is equivalent to extracting prior knowledge, which is then transferred to the online system to improve the effect of article search. In this embodiment, two aspects of work can be performed: "offline text analysis" and "offline quality analysis".
[0230] Offline text analysis mainly involves establishing inverted and forward indexes for article data to accelerate the recall speed and accuracy of online retrieval. At the same time, it is also necessary to classify the topics to which the text belongs.
[0231] Offline quality analysis determines the authority of each article and calculates a quality score. For example, if a public account has a large number of followers and has a much higher than average reading volume every day, the articles it publishes are more likely to be judged to have a higher authority. This application can also identify advertisements and event articles and assign them a lower quality score, thereby reducing their final ranking position or even preventing them from being recalled.
[0232] Optionally, the online retrieval system adopts a hierarchical design, e.g. Figure 1e As shown in the figure, it can be abstracted into preprocessing layer, recall layer, feature adaptation layer, sorting layer, summary layer, and response layer. The functional design of each layer is as follows:
[0233] The preprocessing layer can be responsible for obtaining the semantics and intent information after analyzing the key text content, etc. The recall layer can be responsible for calling data sources from different channels and obtaining the search article results corresponding to the data sources of each channel (that is, the candidate text content of different channels).
[0234] For example, the recall layer can call data sources from three channels. The candidate text content of data source 1 can be the content published by the business service account of the client, the candidate text content of data source 2 can be a third-party HTML5 page article, and the candidate text content of data source 3 can be the content published on an official website.
[0235] The feature adaptation layer can be responsible for uniformly extracting and transforming the feature data of candidate text content from different data sources and handing it over to the sorting layer for sorting. Since the formats of candidate text content from different channels may be different, they need to be uniformly extracted and transformed to achieve a unified extraction logic.
[0236] The sorting layer can be responsible for sorting candidate text content from different data sources based on the similarity between the candidate text content and the key text content. In addition, candidate text content with good article quality and good relevance can be displayed first. The summary layer can be responsible for taking the summary (title, text, author, etc.) of the sorted candidate text content for display. The response layer can be responsible for constructing the final result and handing it over to the front end for display.
[0237] In some embodiments, for the source text content of the target image obtained by analyzing different data sources, the best source text content can be selected for display.
[0238] This application can recall candidate text content based on data from online and offline systems, and then sort them according to the degree of match between the key text content and the candidate text content, and finally obtain the source text content corresponding to the target image.
[0239] 103. In response to a triggering operation on the content description information, display a source page corresponding to the content description information, where the source page includes the source text content.
[0240] The triggering operation on the content description information may specifically be a click operation on the content description information, which is not limited in this embodiment.
[0241] Optionally, in this embodiment, the source page also includes attribute information of the business service account that publishes the source text content.
[0242] The attribute information of the business service account may include the name of the business service account, etc.
[0243] Optionally, in this embodiment, the search method may further include establishing an association relationship between the target user account corresponding to the client and the business service account in response to an association operation on the business service account.
[0244] The association operation on the business service account may be a click operation on a corresponding attention control of the business service account, etc. After the association relationship between the target user account and the business service account is established, the business service account may provide the user with corresponding business services.
[0245] In a specific embodiment, if Figure 1fAs shown, in an instant messaging client, an operation can be performed on a target image in an image information page (specifically, it can be obtained by capturing a content page of an article), such as a long press operation. In response to the operation on the target image, a function operation list of the target image can be displayed on the image information page. The function operation list includes a search control. The search control is as shown in FIG. Figure 1f In response to a trigger operation on the search control, such as a click operation, and when the target image contains text content, the search result page of the target image can be displayed. The search result page is as follows: Figure 1f As shown in page 2, the search result page displays the content description information of the source text content that accurately corresponds to the retrieved target image. The content description information may include summary information of the source text content and attribute information (such as name) of the business service account that published the source text content. In addition, the content description information may be triggered, such as by clicking on it to display the corresponding source page. The source page includes the source text content of the target image, that is, the complete article content corresponding to the text content in the target image. Figure 1f The content displayed on page 3.
[0246] As can be seen from the above, this embodiment can display the client's image information page, the image information page includes the target image; in response to a search operation for the target image, and when the target image contains text content, the search result page corresponding to the target image is displayed, the search result page includes content description information of at least one source page, the source page is a page that presents source text content, and the source text content is the source text content of the text content in the target image; in response to a trigger operation for the content description information, the source page corresponding to the content description information is displayed, and the source page includes the source text content. The present application can simplify the operation of searching for source text of the target image, realize quick access to the source text of the text content in the target image, and improve the user's information acquisition efficiency.
[0247] According to the method described in the above embodiment, the following will be further described in detail by taking the example of the search device being specifically integrated in a terminal.
[0248] The present application embodiment provides a search method, such as Figure 2 As shown, the specific process of the search method can be as follows:
[0249] 201. A terminal displays an image information page of a client, where the image information page includes a target image.
[0250] In this embodiment, the client may be an application client or a browser client, which is not limited in this embodiment. For example, the client may be an instant messaging application.
[0251] The image information page is a page that presents the target image, which may specifically be a chat session page or an information interaction page.
[0252] 202. In response to the operation on the target image, the terminal displays a function operation list on the image information page, where the function operation list includes a search control.
[0253] The operation on the target image can be set according to the actual situation, and this embodiment does not limit this. For example, the operation can be a pressing operation on the target image. When it is detected that the pressing time on the target image exceeds the preset time, the function operation list can be displayed on the image information page. The function operation list may include controls corresponding to various types of operations on the target image, such as the function operation list may include a collection control, a search control, a send control, and an edit control.
[0254] 203. When the terminal responds to a trigger operation on the search control and the target image contains text content, the terminal extracts key text content from the target image; and selects source text content from the candidate text content according to the similarity between the key text content and the candidate text content.
[0255] The triggering operation on the search control may specifically be a click operation on the search control, etc., which is not limited in this embodiment.
[0256] Optionally, in this embodiment, the step of “extracting key text content from the target image” may include:
[0257] Performing text recognition on the target image to obtain text content of the target image, wherein the text content includes at least one text segment;
[0258] Performing paragraph importance statistical analysis on the text segments to select target text segments from the text segments;
[0259] Based on the weight of each text sentence in the target text segment, key text content of the target image is extracted from the target text segment.
[0260] The target image contains content other than text information, and text recognition needs to be performed on it to extract the text content in the target image. In one embodiment, text recognition can be performed on the target image through optical character recognition (OCR) to obtain the text content of the target image.
[0261] Optionally, in this embodiment, the step of “performing paragraph importance statistical analysis on the text segments to select target text segments from the text segments” may include:
[0262] For each text segment, frequency analysis is performed on each text unit in the text segment to obtain importance parameters of each text unit in the text segment;
[0263] Merging the importance parameters of each text unit in the text segment to obtain a target importance parameter of the text segment;
[0264] A target text segment is selected from the text segments according to the target importance parameters of the text segments.
[0265] There are many ways to fuse the importance parameters of each text unit, which are not limited in this embodiment, such as weighted fusion, average operation, etc.
[0266] Optionally, in this embodiment, the step of “for each text segment, performing frequency analysis on each text unit in the text segment to obtain importance parameters of each text unit in the text segment” may include:
[0267] For each text unit in each text segment, the frequency of occurrence of the text unit in the text segment is counted to obtain the weight of the text unit in the text segment;
[0268] Counting the frequency of occurrence of the text unit in the sample text to obtain a reference weight of the text unit;
[0269] An importance parameter of the text unit is determined according to the reference weight of the text unit and the weight in the text segment.
[0270] The expression of long text is usually complex and difficult for search engines to understand, thereby reducing the accuracy of source text recall. In order to reduce the noise from long text and improve the search accuracy, this application needs to further simplify the target text segment.
[0271] Specifically, the target text segment can be simplified by using the TextRank algorithm of an undirected graph. TextRank builds a network based on the relationship between text sentences, regards a text sentence as a node, and then iteratively calculates the weight of each node, sorts the text sentences according to the weight, and thus obtains the key text sentences.
[0272] Optionally, in this embodiment, the step of “extracting key text content of the target image from the target text segment based on the weight of each text sentence in the target text segment” may include:
[0273] For each text sentence in the target text segment, calculating the similarity between the text sentence and each reference text sentence, where the reference text sentence is other text sentences in the target text segment except the text sentence;
[0274] Setting the initial weight of each text sentence in the target text segment;
[0275] According to the similarity, iteratively calculate the initial weight of each text sentence in the target text segment to obtain the weight of each text sentence in the target text segment;
[0276] According to the weight, a target text sentence is selected from each text sentence of the target text segment as the key text content of the target image.
[0277] 204. The terminal displays a search result page corresponding to the target image based on the source text content, wherein the search result page includes content description information of at least one source page, wherein the source page is a page presenting source text content, and the source text content is the source text content of the text content in the target image.
[0278] The source page is the page from which the text content in the target image comes. Specifically, the target image can be obtained by intercepting a certain article in the content page when the user browses the content page, and the source page of the target image is also the content page showing this article.
[0279] The source text content is specifically the text content in the source page of the target image that is searched, that is, the source text content is the source text of the text content in the target image.
[0280] Optionally, in this embodiment, the content description information includes information of a business service account that publishes the source text content and summary information of the source text content.
[0281] Among them, based on the source text content, displaying the search result page corresponding to the target image can specifically include: summarizing the source text content to obtain summary information of the source text content, and obtaining information of the business service account that publishes the source text content, so as to obtain content description information corresponding to the source page, and based on the content description information of the source page, displaying the search result page of the target image.
[0282] 205. In response to a triggering operation on the content description information, the terminal displays a source page corresponding to the content description information, where the source page includes the source text content.
[0283] Optionally, in this embodiment, the source page includes associated text content in the source text content that is associated with the text content in the target image, and the text content in the target image.
[0284] The target image may be captured by the user when browsing an article in the content page, and the captured content is usually only a part of the article, but not the context of the content. Therefore, the source text content of the target image may include the text content in the target image and the context of the text content in the target image.
[0285] The associated text content may specifically be context content of the text content in the target image in the source text content.
[0286] As can be seen from the above, this embodiment can display the image information page of the client through the terminal, and the image information page includes a target image; in response to the operation on the target image, a function operation list is displayed on the image information page, and the function operation list includes a search control; in response to the trigger operation on the search control, and when the target image contains text content, the key text content is extracted from the target image; according to the similarity between the key text content and the candidate text content, the source text content is selected from the candidate text content; based on the source text content, the search result page corresponding to the target image is displayed, and the search result page includes content description information of at least one source page, and the source page is a page that presents the source text content, and the source text content is the source text content of the text content in the target image; in response to the trigger operation on the content description information, the source page corresponding to the content description information is displayed, and the source page includes the source text content. The present application can simplify the operation of searching for source text on the target image, and realizes quick access to the source text of the text content in the target image.
[0287] In order to better implement the above method, the present application embodiment also provides a search device, such as Figure 3 As shown, the search device may include an image display unit 301, a search result display unit 302, and a source text display unit 303, as follows:
[0288] (1) an image display unit 301;
[0289] The image display unit 301 is used to display the image information page of the client, where the image information page includes a target image.
[0290] Optionally, in some embodiments of the present application, the image display unit may include a page display subunit and an image display subunit, as follows:
[0291] The page display subunit is used to display the content interaction page of the client, the content interaction page includes the dynamic interaction information of the user in the client, and the dynamic interaction information includes the target image;
[0292] The image display subunit is used to display an image information page in response to a viewing operation on the target image.
[0293] Optionally, in some embodiments of the present application, the page display subunit may also be used to display a message session page of a target session in the client, the message session page including a target image sent by a member in the target session;
[0294] The image display subunit may also be configured to display an image information page in response to a viewing operation on the target image.
[0295] (2) search result display unit 302;
[0296] The search result display unit 302 is used to display a search result page corresponding to the target image in response to a search operation for the target image and when the target image contains text content, the search result page includes content description information of at least one source page, the source page is a page presenting source text content, and the source text content is the source text content of the text content in the target image.
[0297] Optionally, in some embodiments of the present application, the source page includes associated text content in the source text content that is associated with the text content in the target image, and the text content in the target image.
[0298] Optionally, in some embodiments of the present application, the search result display unit may include an operation list display subunit and a search result display subunit, as follows:
[0299] The operation list display subunit is used to display a function operation list on the image information page in response to an operation on the target image, wherein the function operation list includes a search control;
[0300] The search result display subunit is used to display a search result page corresponding to the target image in response to a trigger operation on the search control and when the target image contains text content.
[0301] Optionally, in some embodiments of the present application, the content description information includes information of a business service account that publishes the source text content and summary information of the source text content.
[0302] Optionally, in some embodiments of the present application, the target image carries link information of a source page corresponding to the target image;
[0303] The search result display unit may include a parsing subunit and a first display subunit, as follows:
[0304] The parsing subunit is used to parse the target image to obtain link information of a source page corresponding to the target image;
[0305] The first display subunit is used to display the search result page corresponding to the target image based on the link information.
[0306] Optionally, in some embodiments of the present application, the search result display unit may include a feature extraction subunit, an acquisition subunit, and a second display subunit, as follows:
[0307] The feature extraction subunit is used to extract features from the target image to obtain visual feature information of the target image;
[0308] an acquisition subunit, configured to acquire link information of a source page corresponding to the target image according to the visual feature information and a preset mapping relationship set, wherein the preset mapping relationship set includes a mapping relationship between visual feature information of a preset text image and link information of a source page corresponding to the preset text image;
[0309] The second display subunit is used to display the search result page corresponding to the target image based on the link information.
[0310] Optionally, in some embodiments of the present application, the search result display unit may include a text extraction subunit, a selection subunit and a third display subunit, as follows:
[0311] The text extraction subunit is used to extract key text content from the target image;
[0312] A selection subunit, configured to select source text content from the candidate text content according to the similarity between the key text content and the candidate text content;
[0313] The third display subunit is used to display the search result page corresponding to the target image based on the source text content.
[0314] Optionally, in some embodiments of the present application, the text extraction subunit can be specifically used to perform text recognition on the target image to obtain the text content of the target image, wherein the text content includes at least one text segment; perform paragraph importance statistical analysis on the text segments to select a target text segment from the text segments; and extract key text content of the target image from the target text segment based on the weight of each text sentence in the target text segment.
[0315] Optionally, in some embodiments of the present application, the step of “performing paragraph importance statistical analysis on the text segments to select target text segments from the text segments” may include:
[0316] For each text segment, frequency analysis is performed on each text unit in the text segment to obtain importance parameters of each text unit in the text segment;
[0317] Merging the importance parameters of each text unit in the text segment to obtain a target importance parameter of the text segment;
[0318] A target text segment is selected from the text segments according to the target importance parameters of the text segments.
[0319] Optionally, in some embodiments of the present application, the step of “for each text segment, performing frequency analysis on each text unit in the text segment to obtain importance parameters of each text unit in the text segment” may include:
[0320] For each text unit in each text segment, the frequency of occurrence of the text unit in the text segment is counted to obtain the weight of the text unit in the text segment;
[0321] Counting the frequency of occurrence of the text unit in the sample text to obtain a reference weight of the text unit;
[0322] An importance parameter of the text unit is determined according to the reference weight of the text unit and the weight in the text segment.
[0323] Optionally, in some embodiments of the present application, the step of “extracting key text content of the target image from the target text segment based on the weight of each text sentence in the target text segment” may include:
[0324] For each text sentence in the target text segment, calculating the similarity between the text sentence and each reference text sentence, where the reference text sentence is other text sentences in the target text segment except the text sentence;
[0325] Setting the initial weight of each text sentence in the target text segment;
[0326] According to the similarity, iteratively calculate the initial weight of each text sentence in the target text segment to obtain the weight of each text sentence in the target text segment;
[0327] According to the weight, a target text sentence is selected from each text sentence of the target text segment as the key text content of the target image.
[0328] Optionally, in some embodiments of the present application, the selection subunit can be specifically used to perform semantic analysis on the key text content to obtain semantic feature information of the key text content; calculate the similarity between the semantic feature information of the key text content and the semantic feature information of the candidate text content; and select source text content from the candidate text content based on the similarity.
[0329] Optionally, in some embodiments of the present application, the selection subunit can be specifically used to perform quality analysis on the candidate text content to obtain content quality information of the candidate text content; and select source text content from the candidate text content based on the similarity between the key text content and the candidate text content, and the content quality information of the candidate text content.
[0330] (3) source text display unit 303;
[0331] The source text display unit 303 is used to display a source page corresponding to the content description information in response to a trigger operation on the content description information, wherein the source page includes the source text content.
[0332] Optionally, in some embodiments of the present application, the source page also includes attribute information of the business service account that publishes the source text content.
[0333] Optionally, in some embodiments of the present application, the source text display unit may further include an establishment subunit, as follows:
[0334] The establishing subunit is used to establish an association relationship between the target user account corresponding to the client and the business service account in response to an association operation on the business service account.
[0335] As can be seen from the above, in this embodiment, the image information page of the client can be displayed through the image display unit 301, and the image information page includes the target image; the search result display unit 302 responds to the search operation for the target image and the target image contains text content, and displays the search result page corresponding to the target image, and the search result page includes content description information of at least one source page, and the source page is a page that presents source text content, and the source text content is the source text content of the text content in the target image; the source text display unit 303 responds to the trigger operation for the content description information, and displays the source page corresponding to the content description information, and the source page includes the source text content. The present application can simplify the operation of searching for source text on the target image, and realizes quick access to the source text of the text content in the target image.
[0336] The present application also provides an electronic device, such as Figure 4 As shown, it shows a schematic diagram of the structure of the electronic device involved in the embodiment of the present application, specifically:
[0337] The electronic device may include components such as a processor 401 with one or more processing cores, a memory 402 with one or more computer-readable storage media, a power supply 403, and an input unit 404. Those skilled in the art will appreciate that Figure 4 The electronic device structure shown in the figure does not constitute a limitation on the electronic device, and may include more or fewer components than shown in the figure, or combine certain components, or arrange the components differently.
[0338] The processor 401 is the control center of the electronic device, and uses various interfaces and lines to connect various parts of the entire electronic device. By running or executing software programs and / or modules stored in the memory 402, and calling data stored in the memory 402, the processor 401 performs various functions of the electronic device and processes data. Optionally, the processor 401 may include one or more processing cores; preferably, the processor 401 may integrate an application processor and a modem processor, wherein the application processor mainly processes the operating system, user interface, and application programs, and the modem processor mainly processes wireless communications. It is understandable that the above-mentioned modem processor may not be integrated into the processor 401.
[0339] The memory 402 can be used to store software programs and modules. The processor 401 executes various functional applications and data processing by running the software programs and modules stored in the memory 402. The memory 402 may mainly include a program storage area and a data storage area, wherein the program storage area may store an operating system, an application required for at least one function (such as a sound playback function, an image playback function, etc.), etc.; the data storage area may store data created according to the use of the electronic device, etc. In addition, the memory 402 may include a high-speed random access memory, and may also include a non-volatile memory, such as at least one disk storage device, a flash memory device, or other volatile solid-state storage devices. Accordingly, the memory 402 may also include a memory controller to provide the processor 401 with access to the memory 402.
[0340] The electronic device also includes a power supply 403 for supplying power to each component. Preferably, the power supply 403 can be logically connected to the processor 401 through a power management system, so as to manage charging, discharging, power consumption and other functions through the power management system. The power supply 403 can also include one or more DC or AC power supplies, recharging systems, power failure detection circuits, power converters or inverters, power status indicators and other arbitrary components.
[0341] The electronic device may further include an input unit 404, which may be used to receive input digital or character information and generate keyboard, mouse, joystick, optical or trackball signal input related to user settings and function control.
[0342] Although not shown, the electronic device may also include a display unit, etc., which will not be described in detail here. Specifically in this embodiment, the processor 401 in the electronic device will load the executable files corresponding to the processes of one or more application programs into the memory 402 according to the following instructions, and the processor 401 will run the application programs stored in the memory 402 to implement various functions, as follows:
[0343] Displaying an image information page of a client, the image information page including a target image; in response to a search operation for the target image, and when the target image contains text content, displaying a search result page corresponding to the target image, the search result page including content description information of at least one source page, the source page being a page presenting source text content, the source text content being the source text content of the text content in the target image; in response to a trigger operation for the content description information, displaying a source page corresponding to the content description information, the source page including the source text content.
[0344] The specific implementation of the above operations can be found in the previous embodiments, which will not be described in detail here.
[0345] As can be seen from the above, this embodiment can display an image information page of the client, the image information page includes a target image; in response to a search operation for the target image, and when the target image contains text content, the search result page corresponding to the target image is displayed, the search result page includes content description information of at least one source page, the source page is a page presenting source text content, and the source text content is the source text content of the text content in the target image; in response to a trigger operation for the content description information, the source page corresponding to the content description information is displayed, and the source page includes the source text content. The present application can simplify the operation of performing source text search on the target image, and realizes quick access to the source text of the text content in the target image.
[0346] A person of ordinary skill in the art will appreciate that all or part of the steps in the various methods of the above embodiments may be completed by instructions, or by controlling related hardware through instructions. The instructions may be stored in a computer-readable storage medium and loaded and executed by a processor.
[0347] To this end, an embodiment of the present application provides a storage medium in which a plurality of instructions are stored, and the instructions can be loaded by a processor to execute the steps in any one of the search methods provided in the embodiments of the present application. For example, the instructions can execute the following steps:
[0348] Displaying an image information page of a client, the image information page including a target image; in response to a search operation for the target image, and when the target image contains text content, displaying a search result page corresponding to the target image, the search result page including content description information of at least one source page, the source page being a page presenting source text content, the source text content being the source text content of the text content in the target image; in response to a trigger operation for the content description information, displaying a source page corresponding to the content description information, the source page including the source text content.
[0349] The specific implementation of the above operations can be found in the previous embodiments, which will not be described in detail here.
[0350] The storage medium may include: a read-only memory (ROM), a random access memory (RAM), a magnetic disk or an optical disk, etc.
[0351] Since the instructions stored in the storage medium can execute the steps in any search method provided in the embodiments of the present application, the beneficial effects that can be achieved by any search method provided in the embodiments of the present application can be achieved. Please refer to the previous embodiments for details and will not be repeated here.
[0352] According to one aspect of the present application, a computer program product or a computer program is provided, the computer program product or the computer program comprising computer instructions, the computer instructions being stored in a computer-readable storage medium. A processor of a computer device reads the computer instructions from the computer-readable storage medium, and the processor executes the computer instructions, so that the computer device executes the method provided in various optional implementations of the above-mentioned source text search aspect.
[0353] The above is a detailed introduction to a search method, device, electronic device and storage medium provided in the embodiments of the present application. Specific examples are used in this article to illustrate the principles and implementation methods of the present application. The description of the above embodiments is only used to help understand the method of the present application and its core idea; at the same time, for technical personnel in this field, according to the ideas of the present application, there will be changes in the specific implementation methods and application scope. In summary, the content of this specification should not be understood as a limitation on the present application.
Claims
1. A search method, It is characterized in that include: Displaying an image information page of a client, wherein the image information page includes a target image; In response to a search operation for the target image, and when the target image contains text content, display a search result page corresponding to the target image, the search result page including content description information of at least one source page, the source page being a page presenting source text content, the source text content being source text content of the text content in the target image; In response to a trigger operation on the content description information, display a source page corresponding to the content description information, the source page including the source text content; The displaying of the search result page corresponding to the target image includes: Performing text recognition on the target image to obtain text content of the target image, wherein the text content includes at least one text segment; For each text segment, frequency analysis is performed on each text unit in the text segment to obtain importance parameters of each text unit in the text segment; Merging the importance parameters of each text unit in the text segment to obtain a target importance parameter of the text segment; Selecting a target text segment from each text segment according to target importance parameters of each text segment; Extracting key text content of the target image from the target text segment based on the weight of each text sentence in the target text segment; Selecting source text content from the candidate text content according to the similarity between the key text content and the candidate text content; Based on the source text content, a search result page corresponding to the target image is displayed.
2. The method according to claim 1, It is characterized in that The source page includes associated text content in the source text content that is associated with the text content in the target image, and the text content in the target image.
3. The method according to claim 1, It is characterized in that The image information page showing the client includes: Displaying a content interaction page of a client, wherein the content interaction page includes dynamic interaction information of a user in the client, and the dynamic interaction information includes the target image; In response to a viewing operation on the target image, an image information page is displayed.
4. The method according to claim 1, It is characterized in that The image information page showing the client includes: Displaying a message conversation page of a target conversation in a client, wherein the message conversation page includes a target image sent by a member in the target conversation; In response to a viewing operation on the target image, an image information page is displayed.
5. The method according to claim 1, It is characterized in that In response to a search operation for the target image, when the target image contains text content, displaying a search result page corresponding to the target image includes: In response to an operation on the target image, displaying a function operation list on the image information page, the function operation list including a search control; In response to a trigger operation on the search control and when the target image contains text content, a search result page corresponding to the target image is displayed.
6. The method according to claim 1, It is characterized in that The source page also includes attribute information of the business service account that published the source text content.
7. The method according to claim 6, It is characterized in that The method further comprises: In response to the association operation on the business service account, an association relationship between the target user account corresponding to the client and the business service account is established.
8. The method according to claim 1, It is characterized in that The content description information includes information of a business service account that publishes the source text content and summary information of the source text content.
9. The method according to claim 1, It is characterized in that The target image carries link information of a source page corresponding to the target image; The displaying of the search result page corresponding to the target image includes: Parsing the target image to obtain link information of a source page corresponding to the target image; Based on the link information, a search result page corresponding to the target image is displayed.
10. The method according to claim 1, It is characterized in that The displaying of the search result page corresponding to the target image includes: Performing feature extraction on the target image to obtain visual feature information of the target image; Acquire link information of a source page corresponding to the target image according to the visual feature information and a preset mapping relationship set, wherein the preset mapping relationship set includes a mapping relationship between visual feature information of a preset text image and link information of a source page corresponding to the preset text image; Based on the link information, a search result page corresponding to the target image is displayed.
11. The method according to claim 1, It is characterized in that For each text segment, frequency analysis is performed on each text unit in the text segment to obtain importance parameters of each text unit in the text segment, including: For each text unit in each text segment, the frequency of occurrence of the text unit in the text segment is counted to obtain the weight of the text unit in the text segment; Counting the frequency of occurrence of the text unit in the sample text to obtain a reference weight of the text unit; An importance parameter of the text unit is determined according to the reference weight of the text unit and the weight in the text segment.
12. The method according to claim 1, It is characterized in that The step of extracting key text content of the target image from the target text segment based on the weight of each text sentence in the target text segment includes: For each text sentence in the target text segment, calculating the similarity between the text sentence and each reference text sentence, where the reference text sentence is other text sentences in the target text segment except the text sentence; Setting the initial weight of each text sentence in the target text segment; According to the similarity, iteratively calculate the initial weight of each text sentence in the target text segment to obtain the weight of each text sentence in the target text segment; According to the weight, a target text sentence is selected from each text sentence of the target text segment as the key text content of the target image.
13. The method according to claim 1, It is characterized in that The selecting source text content from the candidate text content according to the similarity between the key text content and the candidate text content includes: Performing semantic analysis on the key text content to obtain semantic feature information of the key text content; Calculating the similarity between the semantic feature information of the key text content and the semantic feature information of the candidate text content; According to the similarity, source text content is selected from the candidate text content.
14. The method according to claim 1, It is characterized in that The selecting source text content from the candidate text content according to the similarity between the key text content and the candidate text content includes: Performing quality analysis on the candidate text content to obtain content quality information of the candidate text content; Source text content is selected from the candidate text content according to the similarity between the key text content and the candidate text content, and the content quality information of the candidate text content.
15. A search device, It is characterized in that include: An image display unit, used to display an image information page of a client, wherein the image information page includes a target image; A search result display unit, for displaying a search result page corresponding to the target image in response to a search operation for the target image and when the target image contains text content, the search result page includes content description information of at least one source page, the source page is a page presenting source text content, and the source text content is the source text content of the text content in the target image, wherein the display of the search result page corresponding to the target image includes: performing text recognition on the target image to obtain the text content of the target image, the text content includes at least one text segment; for each text segment, performing frequency analysis on each text unit in the text segment to obtain the importance parameter of each text unit in the text segment; fusing the importance parameters of each text unit in the text segment to obtain the target importance parameter of the text segment; selecting a target text segment from each text segment according to the target importance parameter of each text segment; extracting the key text content of the target image from the target text segment based on the weight of each text sentence in the target text segment; selecting the source text content from the candidate text content according to the similarity between the key text content and the candidate text content; and displaying the search result page corresponding to the target image based on the source text content; The source text display unit is used to display a source page corresponding to the content description information in response to a trigger operation on the content description information, wherein the source page includes the source text content.
16. An electronic device, It is characterized in that It comprises a memory and a processor; the memory stores an application program, and the processor is used to run the application program in the memory to execute the operations in the search method described in any one of claims 1 to 14.
17. A storage medium, It is characterized in that The storage medium stores a plurality of instructions, and the instructions are suitable for being loaded by a processor to execute the steps in the search method according to any one of claims 1 to 14.
