Search method and device, electronic equipment and storage medium
By building a vector library in the 5G messaging platform and using a comprehensive score based on vector similarity, text matching degree, click volume, and delivery volume, more accurate search result ranking was achieved, solving the problem of inaccurate search results on the 5G messaging platform and improving user experience.
Patent Information
- Application Number
- CN202410542824.5
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-04-30
- Publication Date
- 2025-11-04
- Estimated Expiration
- 2044-04-30
AI Technical Summary
The existing 5G messaging platform does not return accurate search results during the search process, which affects the user experience.
By determining the representation vector of the search text and the entity recognition results, the target representation vector in the vector library is used to perform a comprehensive score based on text matching degree, click volume, and card message distribution volume, and then sorted in descending order to obtain more accurate search results.
It improved the accuracy of search results and enhanced the user's search experience.
Smart Images

Figure CN118260488B_ABST
Abstract
Description
Technical Field
[0001] This disclosure relates to the field of computer technology, and more particularly to a search method, apparatus, electronic device, and storage medium. Background Technology
[0002] Currently, the 5G messaging platform supports a search function. Users can enter search text into the platform, and the platform will provide corresponding search results. Ensuring the accuracy of search results is crucial for improving the user's search experience when using the 5G messaging platform. Summary of the Invention
[0003] This disclosure provides a search method, apparatus, electronic device, and storage medium.
[0004] In a first aspect, this disclosure provides a search method, the method comprising: determining a first representation vector of search text and determining an entity recognition result of the search text; obtaining N target representation vectors matching the first representation vector from a vector library, wherein the vector library is constructed by vector representation of the text content information of chatbots storing 5G messages on a 5G messaging platform, and N is a positive integer; determining a text matching score between the entity recognition result and the tag information of the chatbot corresponding to the target representation vector; determining the number of clicks and the number of card messages sent to the chatbot corresponding to the target representation vector; determining a comprehensive score of the text content information of the chatbot corresponding to the target representation vector based on the vector similarity score between the first representation vector and the target representation vector, the text matching score, the number of clicks, and the number of messages sent; and sorting the text content information of the chatbots corresponding to each target representation vector in descending order based on the comprehensive score to obtain search results.
[0005] Secondly, this disclosure provides a search device, the device comprising: a first determining module, configured to determine a first representation vector of search text and determine an entity recognition result of the search text; an acquiring module, configured to acquire N target representation vectors matching the first representation vector from a vector library, wherein the vector library is constructed by vector representation of the text content information of chatbots storing 5G messages on a 5G messaging platform, and N is a positive integer; a second determining module, configured to determine a text matching score between the entity recognition result and the tag information of the chatbot corresponding to the target representation vector; a third determining module, configured to determine the number of clicks and the number of card messages sent to the chatbot corresponding to the target representation vector; a fourth determining module, configured to determine a comprehensive score of the text content information of the chatbot corresponding to the target representation vector based on the vector similarity score between the first representation vector and the target representation vector, the text matching score, the number of clicks, and the number of messages sent; and a sorting module, configured to sort the text content information of the chatbots corresponding to each target representation vector in descending order based on the comprehensive score to obtain search results.
[0006] Thirdly, this disclosure provides an electronic device, including: a processor, and a memory communicatively connected to the processor; the memory stores computer-executable instructions; the processor executes the computer-executable instructions stored in the memory to implement the search method disclosed in the embodiments of this disclosure.
[0007] Fourthly, this disclosure provides a computer-readable storage medium storing computer-executable instructions, which, when executed by a processor, are used to implement the search method disclosed in the embodiments of this disclosure.
[0008] Fifthly, this disclosure provides a computer program product, including a computer program that, when executed by a processor, implements the search method disclosed in embodiments of this disclosure.
[0009] The technical solutions provided by the embodiments of this disclosure have at least the following beneficial effects:
[0010] After acquiring the search text, a target representation vector matching the first representation vector of the search text is obtained from the vector library. The text matching score between the entity recognition result of the search text and the tag information of the chatbot corresponding to the target representation vector is determined, along with the click volume and card message delivery volume of the chatbot corresponding to the target representation vector. Based on the vector similarity score between the first representation vector and the target representation vector, the text matching score, the click volume, and the delivery volume, a comprehensive score for the text content information of the chatbot corresponding to the target representation vector is determined. Based on the comprehensive score, the text content information of the chatbots corresponding to each target representation vector is sorted in descending order to obtain the search results. Therefore, by comprehensively scoring the text content information of the chatbots corresponding to the target representation vectors based on multiple factors, and obtaining the search results for the search text based on the comprehensive score, the accuracy of the obtained search results can be improved. Attached Figure Description
[0011] The accompanying drawings, which are incorporated in and form a part of this specification, illustrate embodiments consistent with this disclosure and, together with the description, serve to explain the principles of this disclosure.
[0012] Figure 1 This is a flowchart illustrating a search method according to an exemplary embodiment;
[0013] Figure 2 A flowchart illustrating a search method according to another exemplary embodiment;
[0014] Figure 3 This is a flowchart illustrating the construction of a vector library according to another exemplary embodiment;
[0015] Figure 4 This is a schematic diagram illustrating the structure of a search device according to an exemplary embodiment;
[0016] Figure 5 This is a structural block diagram of an electronic device according to an exemplary embodiment.
[0017] The accompanying drawings have illustrated specific embodiments of this disclosure, which will be described in more detail below. These drawings and descriptions are not intended to limit the scope of the concept in any way, but rather to illustrate the concepts of this disclosure to those skilled in the art through reference to particular embodiments. Detailed Implementation
[0018] Exemplary embodiments will now be described in detail, examples of which are illustrated in the accompanying drawings. When the following description relates to the drawings, unless otherwise indicated, the same numerals in different drawings denote the same or similar elements. The embodiments described in the following exemplary embodiments do not represent all embodiments consistent with this disclosure. Rather, they are merely examples of apparatuses and methods consistent with some aspects of this disclosure as detailed in the appended claims.
[0019] The technical solutions of this disclosure and how they solve the aforementioned technical problems will be described in detail below with specific embodiments. These specific embodiments can be combined with each other, and the same or similar concepts or processes may not be repeated in some embodiments. The embodiments of this disclosure will now be described with reference to the accompanying drawings.
[0020] First, combine Figure 1 The search method provided in the embodiments of this disclosure will be described by way of example.
[0021] Figure 1 This is a flowchart illustrating a search method according to an exemplary embodiment.
[0022] It should be noted that the search method provided in this embodiment can be executed by a search device, which can be implemented by software and / or hardware. The search device can be a 5G messaging platform, or configured within a 5G messaging platform. The 5G messaging platform can be configured in an electronic device.
[0023] The electronic device can be any device with computing capabilities, such as a terminal device or a server. It should be noted that this embodiment uses an electronic device as the executing entity of the search method for illustrative purposes.
[0024] like Figure 1 As shown, the search method includes the following steps:
[0025] Step 101: Determine the first representation vector of the search text and determine the entity recognition result of the search text.
[0026] In one embodiment of this disclosure, the search text may be entered by the user in the interactive interface of the 5G messaging platform. For example, the search text may be entered in the conversation input box provided by the interactive interface, or the search text may be entered in the search box provided by the interactive interface.
[0027] In one embodiment of this disclosure, search text input by voice can also be received. For example, voice information input by the user can be obtained and the voice information can be converted into text to obtain search text. This embodiment does not specifically limit the method of obtaining search text.
[0028] In one embodiment of this disclosure, in order to better represent the search text as a vector, in some examples, the word segmentation result of the search text can be determined by vectorizing the word segmentation result of the search text according to a pre-trained semantic representation model to obtain a first representation vector of the search text.
[0029] In one embodiment of this disclosure, in order to accurately obtain the word segmentation results of the search text, one possible implementation of determining the word segmentation results of the search text is: using a preset word segmenter to segment the search text to obtain the word segmentation results of the search text.
[0030] The preset word segmenter is a pre-set one. For example, the preset word segmenter can be the jieba word segmenter or other word segmenters that can perform word segmentation. This embodiment does not specifically limit the preset word segmenter.
[0031] The semantic representation model can be a Bidirectional Encoder Representations from Transformers (BERT) model, or other models capable of vector representation. This embodiment does not specifically limit the semantic representation model.
[0032] In one embodiment of this disclosure, in order to accurately obtain the entity recognition result of the search text, a first representation vector can be input into a pre-trained entity recognition model to obtain the entity recognition result of the search text. Thus, by analyzing the first representation vector through the entity recognition model, the entity recognition result of the search text can be accurately obtained.
[0033] The entity recognition model mentioned above can be a Conditional Random Field (CRF) model used for entity recognition, or other models capable of entity recognition. This embodiment does not specifically limit the entity recognition model.
[0034] Step 102: Obtain N target representation vectors that match the first representation vector from the vector library. The vector library is constructed by representing the text content information of the chatbot storing 5G messages on the 5G messaging platform using vectors, and N is a positive integer.
[0035] In one embodiment of this disclosure, to improve matching accuracy, the aforementioned semantic representation model can be used to vectorize the text content information of the chatbot storing 5G messages on the 5G messaging platform. That is, the semantic representation model used when vectorizing the search text is the same as the semantic representation model used when vectorizing the text content information of the chatbot storing 5G messages on the 5G messaging platform.
[0036] In one embodiment of this disclosure, the same word segmenter can also be used to segment the text content information and the search text.
[0037] As an example, the aforementioned preset word segmenter can be used to segment the text content information of the chatbot storing 5G messages on the 5G messaging platform to obtain the word segmentation result of the text content information. The aforementioned semantic representation model can then be used to vectorize the word segmentation result of the text content information to obtain the representation vector of the text content information.
[0038] In one embodiment of this disclosure, in order to improve the accuracy of the subsequent search results, one possible implementation of obtaining N target representation vectors that match the first representation vector from the vector library is as follows: determining the vector similarity score between the first representation vector and each second representation vector in the vector library; sorting each second representation vector in the vector library in descending order according to the vector similarity score to obtain the vector sorting result; and taking the top N second representation vectors in the vector sorting result as the target representation vectors.
[0039] In one example, for each second representation vector, a vector similarity score between the first representation vector and the second representation vector can be determined based on the vector similarity between the first representation vector and the second representation vector.
[0040] As an example, to accurately determine the vector similarity between the first and second representation vectors, a cosine similarity calculation can be performed on them to obtain the cosine similarity. Based on this cosine similarity, the vector similarity between the first and second representation vectors can be determined. For instance, the cosine similarity can be used as the vector similarity between the first and second representation vectors.
[0041] It is understandable that the higher the vector similarity, the higher the corresponding vector similarity score, and vice versa.
[0042] In one embodiment of this disclosure, another possible implementation of obtaining N target representation vectors that match the first representation vector from the vector library is as follows: determine the vector similarity score between the first representation vector and each second representation vector in the vector library, and select the second representation vector whose vector similarity score is greater than a preset similarity score threshold from the vector library as the target representation vector.
[0043] The aforementioned preset similarity scoring threshold is a vector similarity scoring threshold set in advance according to actual needs. This embodiment does not specifically limit the value of the preset similarity scoring threshold.
[0044] In this embodiment, the text content information may include: text content from basic information and / or card information.
[0045] The basic information of a chatbot may include, but is not limited to, the chatbot identifier (ChatbotId), the chatbot name, the chatbot description, and the chatbot address.
[0046] The text content in the card message may include at least one of the following: the subject, body, and text on the button.
[0047] Step 103: Determine the text matching score between the entity recognition result and the chatbot's tag information corresponding to the target representation vector.
[0048] In one embodiment of this disclosure, a text matching degree can be calculated between the entity recognition result and the tag information of the chatbot corresponding to the target representation vector to obtain the text matching degree between the entity recognition result and the tag information of the chatbot corresponding to the target representation vector, and a text matching degree score between the entity recognition result and the tag information of the chatbot corresponding to the target representation vector can be determined based on the text matching degree.
[0049] As an example, the BM25 algorithm can be used to calculate the text matching score between the entity recognition result and the chatbot's tag information corresponding to the target representation vector, so as to obtain the text matching score between the two.
[0050] Step 104: Determine the number of clicks and the number of card messages sent by the chat machine corresponding to the target representation vector.
[0051] In one embodiment of this disclosure, the click count of the chatbot corresponding to the target representation vector can be obtained based on the correspondence between the chatbot and the click count.
[0052] In one embodiment of this disclosure, the number of card messages sent by the chatbot corresponding to the target representation vector can be obtained based on the correspondence between the card messages of the chatbot and their corresponding sending volume.
[0053] Step 105: Determine the comprehensive score of the text content information of the chatbot corresponding to the target representation vector based on the vector similarity score, text matching score, click volume, and distribution volume between the first representation vector and the target representation vector.
[0054] In one embodiment of this disclosure, the vector similarity score between the first representation vector and the target representation vector can be obtained by: determining the vector similarity between the first representation vector and the target representation vector; and determining the vector similarity score between the first representation vector and the target representation vector based on the vector similarity.
[0055] In one embodiment of this disclosure, to accurately obtain the vector similarity between the first representation vector and the target representation vector, one possible implementation for determining the vector similarity between the first representation vector and the target representation vector is as follows: calculate the cosine similarity between the first representation vector and the target representation vector to obtain the cosine similarity between them; determine the vector similarity between the first representation vector and the target representation vector based on the cosine similarity. Thus, based on the cosine similarity between the two, the vector similarity between them is accurately determined.
[0056] In different application scenarios, the implementation methods for determining the comprehensive score of the chatbot's text content information corresponding to the target representation vector based on the vector similarity score, text matching score, click volume, and distribution volume are different. Examples are illustrated below:
[0057] As an example, the corresponding comprehensive score can be obtained based on the correspondence between vector similarity score, text matching score, click volume, distribution volume and comprehensive score.
[0058] As another example, the vector similarity score, text matching score, click volume, and distribution volume between the first representation vector and the target representation vector can be input into the calculation formula for calculating the comprehensive score to obtain the comprehensive score of the text content information of the chatbot corresponding to the target representation vector.
[0059] The formula for calculating the overall score is as follows:
[0060]
[0061] Among them, in the formula The overall score represents the text content information of the chatbot corresponding to the target representation vector; This represents the vector similarity score between the first representation vector and the target representation vector. The text matching score is represented by D; the number of clicks is represented by E; the number of distributions is represented by x; and the second preset weight is represented by y.
[0062] Among them, in the above formula The sigmoid saturation function represents the number of clicks received by a chatbot. The sigmoid saturation function represents the amount of card messages sent by a chatbot.
[0063] The first preset weight and the second preset weight are preset. For example, the first preset weight can be 0.5 and the second preset weight can be 1.5.
[0064] Step 106: Based on the comprehensive score, sort the text content information of the chatbot corresponding to each target representation vector in descending order to obtain the search results.
[0065] In this embodiment, the text content information of the chatbot corresponding to the target representation vector can be obtained from a vector library.
[0066] In this embodiment, the text content information of the chatbot corresponding to each target representation vector can be sorted according to the comprehensive score from high to low, and the sorting result obtained by the sorting process can be used as the search result of the search text.
[0067] The search method provided in this embodiment, after acquiring the search text, retrieves a target representation vector from a vector library that matches the first representation vector of the search text. It then determines the text matching score between the entity recognition result of the search text and the tag information of the chatbot corresponding to the target representation vector, as well as the click volume and card message delivery volume of the chatbot corresponding to the target representation vector. Based on the vector similarity score, text matching score, click volume, and delivery volume between the first and target representation vectors, a comprehensive score is determined for the text content information of the chatbot corresponding to the target representation vector. Based on the comprehensive score, the text content information of the chatbots corresponding to each target representation vector is sorted in descending order to obtain the search results. Therefore, by comprehensively scoring the text content information of the chatbots corresponding to the target representation vectors based on multiple factors, and obtaining the search results for the search text based on the comprehensive score, the accuracy of the obtained search results can be improved.
[0068] To facilitate a clear understanding of this disclosure, the following will be combined with... Figure 2The search method of this embodiment is described by way of example. It should be noted that this embodiment uses the BERT model as the semantic representation model and the CRF model for entity recognition as the entity recognition model for example.
[0069] Figure 2 This is a flowchart illustrating a search method according to another exemplary embodiment.
[0070] like Figure 2 As shown, the method may include:
[0071] Step 201: Obtain the input search text.
[0072] For details on the specific implementation of obtaining the search text, please refer to the relevant descriptions in other embodiments of this disclosure, which will not be repeated here.
[0073] Step 202: Perform word segmentation on the search file according to the preset word segmenter to obtain the word segmentation result of the search text.
[0074] It should be noted that for a detailed description of the preset word segmenter, please refer to the relevant descriptions in other embodiments, which will not be repeated here.
[0075] The word segmentation results include multiple word groups obtained by segmenting the search text.
[0076] Step 203: Input the word segmentation results of the search text into the pre-trained BERT model to obtain the first representation vector of the search text through the BERT model.
[0077] Step 204: Input the first representation vector into the pre-trained CRF model to obtain the entity recognition result of the search text.
[0078] The entity recognition results include entity information for each phrase in the search text.
[0079] Step 205: Calculate the vector similarity score between the first representation vector and each second representation vector in the pre-built vector library, and obtain the top N target representation vectors with the highest vector similarity scores from the vector library based on the vector similarity score calculation results, and obtain the vector similarity score B between the target representation vector and the first representation vector.
[0080] In one embodiment of this disclosure, the most similar target representation vector with a vector similarity score greater than a preset similarity score threshold k can be obtained from a pre-built vector library based on the Approximate Nearest Neighbor Search algorithm.
[0081] In one embodiment of this disclosure, for each second representation vector, a vector similarity score can be calculated between the first representation vector and the second representation vector to obtain a vector similarity score between them. Then, the second representation vectors in the vector library are sorted in descending order of vector similarity score to obtain a vector sorting result. The second representation vector ranked in the top N positions in the vector sorting result is taken as the target representation vector.
[0082] In this embodiment, the target representation vector may include one or more, and the number of target representation vectors is not specifically limited in this embodiment.
[0083] Step 206: Obtain the text content information of the chatbot corresponding to the target vector from the vector library.
[0084] The text content information may include: the text content in the basic information of the chatbot and / or the card information.
[0085] In other words, the vector library in this embodiment not only stores the second representation vector, but also stores the text content information of the chatbot corresponding to the second representation vector.
[0086] Step 207: Obtain the number of clicks (D) for the chatbot.
[0087] In this example, the number of clicks D for the chatbot can be obtained from the statistics module of the 5G messaging platform.
[0088] Step 208: Perform text matching between the entity recognition result and the tag information of the chatbot to obtain the text matching score C between the two.
[0089] In this example, the BM25 algorithm is used to calculate the text matching score between the entity recognition result and the chatbot's tag information, so as to obtain the text matching score C between the two.
[0090] In one embodiment of this disclosure, when the text content information is the text content in the basic information of the chatbot, steps 207 and 208 can be performed.
[0091] Step 209: Obtain the number of card messages sent by the chatbot, E.
[0092] In this example, the number of card messages sent by the chatbot can be obtained from the statistics module of the 5G messaging platform.
[0093] In one embodiment of this disclosure, step 209 may be performed when the text content information is the text content of a chatbot's card message.
[0094] In another embodiment of this disclosure, when the above-mentioned text content information is the basic information of the chatbot and the text content in the card message, steps 207 to 209 can be performed.
[0095] Step 210: Determine the comprehensive score of the text content information of the chatbot corresponding to the target representation vector based on B, D, C, and E.
[0096] The formula for calculating the overall score of the text content information is as follows:
[0097]
[0098] Among them, in the formula This represents the overall score of the text content information of the chatbot corresponding to the target representation vector. This represents the vector similarity score between the first representation vector and the target representation vector. The text matching score is represented by D, the number of clicks is represented by E, and the number of distributions is represented by x, which represents the first preset weight and y, which represents the second preset weight.
[0099] Among them, in the above formula The sigmoid saturation function represents the number of clicks received by a chatbot. The sigmoid saturation function represents the amount of card messages sent by a chatbot.
[0100] The first preset weight and the second preset weight are preset. For example, the first preset weight can be 0.5 and the second preset weight can be 1.5.
[0101] As an example, if the text content information only includes the basic information of the chatbot, then the value of E is zero. If the text content information only includes the text content of the chatbot's card messages, then the values of C and D can be zero.
[0102] Step 211: Based on the comprehensive score, sort the text content information of the chatbot corresponding to each target representation vector in descending order to obtain the search results.
[0103] For details on the specific implementation of step 211, please refer to the relevant descriptions in other embodiments of this disclosure, which will not be repeated here.
[0104] Based on the above description, it can be seen that the search results obtained in this embodiment may include the basic information of the chatbot and / or the card information of the chatbot, thereby facilitating users to perform subsequent processing based on the basic information and / or card information, providing users with better search content, and improving the user's search experience.
[0105] To clearly understand the process of building a vector library, the following will combine... Figure 3 An exemplary description is provided of the process of building a vector library.
[0106] Figure 3 This is a flowchart illustrating the construction of a vector library according to another exemplary embodiment.
[0107] like Figure 3 As shown, the process of building this vector library can be as follows:
[0108] Step 301: The 5G messaging platform's search system stores the basic information of all 5G messaging chatbots and / or their card messages.
[0109] The basic information may include, but is not limited to, ChatbotId, Chatbot name, Chatbot description, Chatbot address, etc.
[0110] Step 302: Concatenate the text content in the basic information into a single text string to obtain the first text string.
[0111] As an example, the first text string could be Chatbot name + Chatbot description + Chatbot address.
[0112] Step 303: Concatenate the text content in the Chatbot's card messages into a single text string to obtain the second text string.
[0113] As an example, the second text string could be the title of the card message + the content of the card message + the button name of the card message.
[0114] Step 304: Merge the first text string and the second text string to obtain an array containing each text string.
[0115] Step 305: Segment each text string in the array using a preset word segmenter to obtain word groups after segmentation of each text string.
[0116] It should be noted that for a detailed description of the preset word segmenter, please refer to the relevant descriptions in other embodiments, which will not be repeated here.
[0117] Step 306: Input the word groups after segmentation of each text string into the pre-trained BERT model to obtain the vector information of each text string.
[0118] Step 307: Construct a vector library and store all vector information, as well as the basic information of the corresponding Chatbot and / or the card messages of the Chatbot in the vector library.
[0119] Figure 4 This is a schematic diagram illustrating the structure of a search device according to an exemplary embodiment.
[0120] It should be noted that the search device can be implemented by software and / or hardware. The search device can be a 5G messaging platform, or configured within a 5G messaging platform. The 5G messaging platform can be configured in an electronic device.
[0121] Among them, electronic devices can be any device with computing capabilities, such as terminal devices, servers, etc.
[0122] like Figure 4 As shown, the search device 400 includes:
[0123] The first determining module 401 is used to determine the first representation vector of the search text and determine the entity recognition result of the search text.
[0124] The acquisition module 402 is used to acquire N target representation vectors that match the first representation vector from the vector library. The vector library is constructed by representing the text content information of the chatbot of 5G messages stored on the 5G messaging platform using vectors, and N is a positive integer.
[0125] The second determining module 403 is used to determine the text matching score between the entity recognition result and the tag information of the chatbot corresponding to the target representation vector.
[0126] The third determining module 404 is used to determine the number of clicks and the number of card messages sent by the chat machine corresponding to the target representation vector.
[0127] The fourth determining module 405 is used to determine the comprehensive score of the text content information of the chatbot corresponding to the target representation vector based on the vector similarity score, text matching score, click volume, and distribution volume between the first representation vector and the target representation vector.
[0128] The sorting module 406 is used to sort the text content information of the chatbot corresponding to each target representation vector in descending order according to the comprehensive score in order to obtain the search results.
[0129] In one embodiment of this disclosure, the acquisition module 402 is specifically used to: determine the vector similarity score between the first representation vector and each of the second representation vectors in the vector library; sort each of the second representation vectors in the vector library in descending order according to the vector similarity score to obtain the vector sorting result; and take the top N second representation vectors in the vector sorting result as the target representation vector.
[0130] In one embodiment of this disclosure, determining a first representation vector of the search text includes: determining the word segmentation result of the search text;
[0131] The word segmentation results are vectorized based on a pre-trained semantic representation model to obtain the first representation vector of the search text.
[0132] In one embodiment of this disclosure, determining the word segmentation result of the search text includes: using a preset word segmenter to segment the search text to obtain the word segmentation result of the search text.
[0133] In one embodiment of this disclosure, a semantic representation model is used to vectorize the text content information of the chatbot storing 5G messages on the 5G messaging platform.
[0134] In one embodiment of this disclosure, determining the entity recognition result of the search text includes: inputting a first representation vector into a pre-trained entity recognition model to obtain the entity recognition result of the search text.
[0135] In one embodiment of this disclosure, the comprehensive score is obtained according to the following formula:
[0136]
[0137] in, The overall score is represented by: B for vector similarity score; C for text matching score; D for clicks; E for distribution volume; x for the first preset weight; and y for the second preset weight.
[0138] In one embodiment of this disclosure, the second determining module 403 is specifically used to: calculate the text matching degree of the entity recognition result and the tag information of the chatbot corresponding to the target representation vector, so as to obtain the text matching degree between the entity recognition result and the tag information; and determine the text matching degree score between the entity recognition result and the tag information based on the text matching degree.
[0139] In one embodiment of this disclosure, the vector similarity score between the first representation vector and the target representation vector is obtained by: determining the vector similarity between the first representation vector and the target representation vector; and determining the vector similarity score between the first representation vector and the target representation vector based on the vector similarity.
[0140] In one embodiment of this disclosure, determining the vector similarity between a first representation vector and a target representation vector includes: performing a cosine similarity calculation on the first representation vector and the target representation vector to obtain a cosine similarity between the first representation vector and the target representation vector; and determining the vector similarity between the first representation vector and the target representation vector based on the cosine similarity.
[0141] In one embodiment of this disclosure, the text content information includes: text content in basic information and / or card information.
[0142] It should be noted that the foregoing description of the search method embodiments also applies to the search device of this embodiment, and will not be repeated here.
[0143] The search device provided in this embodiment, after acquiring search text, retrieves a target representation vector from a vector library that matches the first representation vector of the search text. It then determines the text matching score between the entity recognition result of the search text and the tag information of the chatbot corresponding to the target representation vector, as well as the click volume and card message delivery volume of the chatbot corresponding to the target representation vector. Based on the vector similarity score, text matching score, click volume, and delivery volume between the first and target representation vectors, it determines a comprehensive score for the text content information of the chatbot corresponding to the target representation vector. Based on the comprehensive score, it sorts the text content information of the chatbots corresponding to each target representation vector in descending order to obtain search results. Therefore, by comprehensively scoring the text content information of the chatbots corresponding to the target representation vectors based on multiple factors, and obtaining search results for the search text based on the comprehensive score, the accuracy of the obtained search results can be improved.
[0144] According to embodiments of this disclosure, an electronic device is also provided, including: a processor; and a memory for storing processor-executable instructions, wherein the processor is configured to: implement the search method disclosed in embodiments of this disclosure.
[0145] To implement the above embodiments, this disclosure also proposes a storage medium.
[0146] When the instructions in the storage medium are executed by the processor, the processor is able to execute the search method disclosed in the embodiments of this disclosure.
[0147] To implement the above embodiments, this disclosure also provides a computer program product.
[0148] When the computer program product is executed by the processor of an electronic device, it enables the electronic device to perform the search method disclosed in the embodiments of this disclosure.
[0149] Figure 5 This is a structural block diagram of an electronic device according to an exemplary embodiment. Figure 5 The electronic device shown is merely an example and should not be construed as limiting the functionality and scope of the embodiments disclosed herein.
[0150] like Figure 5 As shown, the electronic device 100 includes a processor 111, which can perform various appropriate actions and processes according to a program stored in read-only memory (ROM) 112 or a program loaded from memory 116 into random access memory (RAM) 113. The RAM 113 also stores various programs and data required for the operation of the electronic device 100. The processor 111, ROM 112, and RAM 113 are interconnected via a bus 114. An input / output (I / O) interface 115 is also connected to the bus 114.
[0151] The following components are connected to I / O interface 115: memory 116 including hard disks, etc.; and communication section 117 including network interface cards such as local area network (LAN) cards, modems, etc., communication section 117 performs communication processing via a network such as the Internet; and driver 118 is also connected to I / O interface 115 as needed.
[0152] In particular, according to embodiments of this disclosure, the processes described above with reference to the flowcharts can be implemented as computer software programs. For example, embodiments of this disclosure include a computer program carried on a computer-readable medium, the computer program containing program code for performing the methods shown in the flowcharts. In such embodiments, the computer program can be downloaded and installed from a network via communication section 117. When the computer program is executed by processor 111, it performs the functions defined in the methods of this disclosure.
[0153] In an exemplary embodiment, a storage medium including instructions is also provided, such as a memory including instructions, which can be executed by the processor 111 of the electronic device 100 to perform the above-described method. Optionally, the storage medium may be a non-transitory computer-readable storage medium, such as a ROM, random access memory (RAM), CD-ROM, magnetic tape, floppy disk, and optical data storage device.
[0154] In this disclosure, a computer-readable storage medium can be any tangible medium containing or storing a program that can be used by or in connection with an instruction execution system, apparatus, or device. In this disclosure, a computer-readable signal medium can include a data signal propagated in baseband or as part of a carrier wave, carrying computer-readable program code. Such propagated data signals can take various forms, including but not limited to electromagnetic signals, optical signals, or any suitable combination thereof. A computer-readable signal medium can also be any computer-readable medium other than a computer-readable storage medium, which can transmit, propagate, or transfer a program for use by or in connection with an instruction execution system, apparatus, or device. The program code contained on the computer-readable medium can be transmitted using any suitable medium, including but not limited to: wireless, wireline, optical fiber, RF, etc., or any suitable combination thereof.
[0155] Other embodiments of this disclosure will readily occur to those skilled in the art upon consideration of the specification and practice of the invention disclosed herein. This disclosure is intended to cover any variations, uses, or adaptations of this disclosure that follow the general principles of this disclosure and include common knowledge or customary techniques in the art not disclosed herein. The specification and examples are to be considered exemplary only, and the true scope and spirit of this disclosure are indicated by the following claims.
[0156] It should be understood that this disclosure is not limited to the precise structures described above and shown in the accompanying drawings, and various modifications and changes can be made without departing from its scope. The scope of this disclosure is limited only by the appended claims.
Claims
1. A search method, characterized in that, The method includes: Determine the first representation vector of the search text, and determine the entity recognition result of the search text; Obtain N target representation vectors that match the first representation vector from the vector library, wherein the vector library is constructed by vectorizing the text content information of the chatbot storing 5G messages on the 5G messaging platform, and N is a positive integer; Determine the text matching score between the entity recognition result and the tag information of the chatbot corresponding to the target representation vector; Determine the number of clicks and the number of card messages sent to the chatbot corresponding to the target representation vector, wherein the number of clicks of the chatbot corresponding to the target representation vector is obtained based on the correspondence between the chatbot and the number of clicks; Based on the vector similarity score between the first representation vector and the target representation vector, the text matching score, the number of clicks, and the number of distributions, a comprehensive score for the text content information of the chatbot corresponding to the target representation vector is determined. Based on the comprehensive score, the text content information of the chatbot corresponding to each target representation vector is sorted in descending order to obtain the search results.
2. The method as described in claim 1, characterized in that, The step of obtaining N target representation vectors that match the first representation vector from the vector library includes: Determine the vector similarity score between the first representation vector and each of the second representation vectors in the vector library; Based on the vector similarity score, the second representation vectors in the vector library are sorted in descending order to obtain the vector sorting result; The top N second representation vectors in the vector sorting result are taken as the target representation vector.
3. The method as described in claim 1, characterized in that, The determination of the first representation vector of the search text includes: Determine the word segmentation results of the search text; The word segmentation results are vectorized based on a pre-trained semantic representation model to obtain the first representation vector of the search text.
4. The method as described in claim 3, characterized in that, Determining the word segmentation result of the search text includes: The search text is segmented using a preset word segmenter to obtain the word segmentation results of the search text.
5. The method as described in claim 3, characterized in that, The semantic representation model is used to represent the text content information of the chatbot storing 5G messages on the 5G messaging platform using vectors.
6. The method as described in claim 3, characterized in that, Determining the entity recognition result of the search text includes: The first representation vector is input into a pre-trained entity recognition model to obtain the entity recognition result of the search text.
7. A search device, characterized in that, The device includes: The first determining module is used to determine the first representation vector of the search text and determine the entity recognition result of the search text; The acquisition module is used to acquire N target representation vectors that match the first representation vector from the vector library, wherein the vector library is constructed by vectorizing the text content information of the chatbot of 5G messages stored on the 5G messaging platform, and N is a positive integer; The second determining module is used to determine the text matching score between the entity recognition result and the tag information of the chatbot corresponding to the target representation vector; The third determining module is used to determine the number of clicks and the number of card messages sent by the chatbot corresponding to the target representation vector, wherein the number of clicks of the chatbot corresponding to the target representation vector is obtained based on the correspondence between the chatbot and the number of clicks. The fourth determining module is used to determine a comprehensive score of the text content information of the chatbot corresponding to the target representation vector based on the vector similarity score between the first representation vector and the target representation vector, the text matching score, the number of clicks, and the number of distributions. The sorting module is used to sort the text content information of the chatbot corresponding to each of the target representation vectors in descending order according to the comprehensive score, so as to obtain the search results.
8. An electronic device, characterized in that, include: A memory, a processor, and a computer program stored in the memory and executable on the processor, characterized in that the processor, when executing the computer program, implements the method as described in any one of claims 1-6.
9. A computer-readable storage medium having a computer program stored thereon, characterized in that, When the computer program is executed by a processor, it implements the method as described in any one of claims 1-6.
10. A computer program product, characterized in that, Includes a computer program that, when executed by a processor, implements the method as described in any one of claims 1-6.
Citation Information
Patent Citations
Chatboot searching method and device and storage medium
CN114168837A
Search statement-based search method and device, equipment and storage medium
CN114329225A