Data interaction method and device, equipment, storage medium and computer program product
By detecting the target object in the input data during the data interaction process and performing fuzzy matching processing, outputting candidate topic words and performing knowledge recall, the problems of low accuracy and insufficient convenience in query content in the prior art are solved, and more efficient and accurate data interaction is achieved.
Patent Information
- Application Number
- CN202411647352.6
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-11-18
- Publication Date
- 2025-02-25
AI Technical Summary
In the prior art, the accuracy of querying content during data interaction is not high and the query is not convenient enough. Especially when entering a special term or special product name, it is easy to cause inaccurate output due to input errors or incompleteness.
By detecting whether the input data contains the target object during the data input process, if detected, a fuzzy matching process is performed, a candidate topic word matching the input data is output, and a knowledge recall is performed in the constructed knowledge base to obtain the reply data corresponding to the input data.
It improves the accuracy and convenience of query content, helps users quickly obtain accurate target topic words, avoids input errors or incompleteness, and ensures the accuracy of knowledge recall.
Smart Images

Figure CN119513260A_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of computer application technology. Specifically, the present application relates to a data interaction method, device, electronic device, storage medium and computer program product. Background Art
[0002] With the rapid development of computer application technology, the demand for data management and data query in various fields is constantly increasing, which has led to the rapid development and widespread application of data interaction.
[0003] For example, in some enterprises, users expect to be able to query the relevant content of some special terms / special products conveniently and quickly through data interaction in the form of question and answer, that is, input the name of the special term / special product and output the relevant content of the special term / special product. However, the input of the name of the special term / special product may cause interaction barriers for users, such as input errors or incomplete input, which may easily cause the output of the relevant content of the special term / special product to be inaccurate.
[0004] From the above, we can see that how to improve the convenience and accuracy of query content remains to be solved. Summary of the invention
[0005] The present application provides a data interaction method, device, electronic device, storage medium and computer program product, which can solve the problems of low accuracy of query content and inconvenient query in related technologies. The technical solution is as follows:
[0006] According to one aspect of the present application, a data interaction method includes: during the data input process, if it is detected that the input data contains a target object, outputting at least one candidate subject word matching the input data; the candidate subject word is obtained based on fuzzy matching processing of the input data; in response to a selection operation for a target subject word among the candidate subject words, outputting reply data corresponding to the input data; the reply data is obtained by recalling knowledge in a constructed knowledge base for the selected target subject word.
[0007] According to one aspect of the present application, a data interaction method includes: obtaining input data; the input data is used to indicate the target knowledge content of the requested query; if it is detected that the input data contains a target object, fuzzy matching is performed on the input data to obtain at least one candidate subject word that matches the input data to indicate the selection of a target subject word for at least one of the candidate subject words; and knowledge recall is performed in a constructed knowledge base for the selected target subject word to obtain response data corresponding to the input data.
[0008] According to one aspect of the present application, a data interaction device includes: a subject word output module, which is used to output at least one candidate subject word matching the input data if it is detected that the input data contains a target object during the data input process; the candidate subject word is obtained by fuzzy matching the input data; a data output module is used to output reply data corresponding to the input data in response to a selection operation for a target subject word among the candidate subject words; the reply data is obtained by recalling knowledge in a constructed knowledge base for the selected target subject word.
[0009] In an exemplary embodiment, the keyword output module is also used to obtain input operations in the data input area and display the input data that has been entered in the data input area; when the input data contains the target object, fuzzy matching processing is performed on the input data to obtain at least one candidate keyword that matches the input data, and at least one candidate keyword is displayed.
[0010] In an exemplary embodiment, the device also includes an operation module, which is used to display a target operation item in a data input area; the target operation item is used to trigger fuzzy matching processing of the input data; and obtain a trigger operation for the target operation item so that the input data includes the target object.
[0011] In an exemplary embodiment, the operation module is further configured to, in response to a trigger operation on the target operation item, input the target object in the data input area to determine the target object as the input data.
[0012] In an exemplary embodiment, the keyword output module is also used to, when the input data contains the target object, perform fuzzy matching processing on the input data to obtain at least one candidate keyword matching the input data, and display at least one candidate keyword.
[0013] In an exemplary embodiment, the keyword output module is also used to, when the input data contains the target object, perform keyword extraction on the input data to obtain the target keyword; based on a keyword search for the target keyword in the knowledge base, obtain at least one candidate keyword similar to the target keyword, and display at least one candidate keyword.
[0014] In an exemplary embodiment, the keyword output module is also used to display a keyword candidate area; based on the similarity between the target keyword and each of the candidate keywords, a first batch of candidate keywords is displayed in the keyword candidate area; the first batch of candidate keywords includes several candidate keywords; in response to a viewing completion operation triggered on the first batch of candidate keywords, a second batch of candidate keywords is displayed in the keyword candidate area; the second batch of candidate keywords includes several other candidate keywords that are different from the first batch of candidate keywords.
[0015] In an exemplary embodiment, the device includes a conversation module, which is used to display a conversation page; the conversation page includes a data input area and a conversation content display area; the data input area is used to display the input data, and the conversation content display area is used to display the conversation content; the data display module is also used to, in response to a selection operation on a target subject word among the candidate subjects, display the target subject word as input data in the data input area; in response to a sending operation on the input data, use reply data corresponding to the input data as conversation content, and display the reply data on the conversation page.
[0016] According to one aspect of the present application, a data interaction device includes: a data acquisition module for acquiring input data; the input data is used to indicate the target knowledge content of the requested query; a fuzzy matching module for performing fuzzy matching processing on the input data if it is detected that the input data contains a target object, so as to obtain at least one candidate subject word that matches the input data, so as to indicate the selection of a target subject word for at least one of the candidate subject words; and a knowledge recall module for performing knowledge recall in a constructed knowledge base for the selected target subject word, so as to obtain response data corresponding to the input data.
[0017] In an exemplary embodiment, the fuzzy matching module is also used to extract keywords based on input data before the target object and / or input data after the target object to obtain target keywords; perform a subject word search for the target keyword in the knowledge base to obtain at least one candidate subject word; and the knowledge base is constructed based on known knowledge content.
[0018] In an exemplary embodiment, the fuzzy matching module is also used to obtain user preference data; the preference data includes at least one of the user's historical query records and interests and hobbies; and recommend at least one candidate keyword matching the input data from the preference data.
[0019] In an exemplary embodiment, the knowledge recall module is also used to search for knowledge content blocks with associated relationships in the knowledge base based on the target subject words and knowledge content blocks with associated relationships, and use the searched knowledge content blocks as the context of the input data; based on the constructed context environment for the input data and the reply data, obtain the reply data corresponding to the input data from the input data and its context.
[0020] In an exemplary embodiment, the knowledge recall module is also used to use a knowledge question and answer model as a context environment for input data and reply data; the knowledge question and answer model is a trained machine learning model that has the ability to generate the reply data based on the input data and its context; the input data and its context are input into the knowledge question and answer model for context retrieval and knowledge content query, and reply data corresponding to the input data is output.
[0021] In an exemplary embodiment, the apparatus comprises a knowledge base construction module, and the knowledge base construction module is used to construct the knowledge base based on known knowledge content.
[0022] In an exemplary embodiment, the knowledge base construction module is also used to obtain known knowledge content; perform keyword extraction on the knowledge content to obtain at least one keyword; each keyword is respectively associated with a different knowledge content block in the knowledge content; based on at least one of each keyword, each knowledge content block associated with each keyword, and an association relationship between the keyword and the knowledge content, the knowledge base is stored.
[0023] According to one aspect of the present application, an electronic device includes at least one processor and at least one memory, wherein the memory stores a computer program, and when the computer program is executed by the processor, the data interaction method as described above is implemented.
[0024] According to one aspect of the present application, a storage medium stores a computer program thereon, and when the computer program is executed by one or more processors, the data interaction method as described above is implemented.
[0025] According to one aspect of the present application, a computer program product includes a computer program, and when the computer program is executed by one or more processors, the data interaction method as described above is implemented.
[0026] The beneficial effects of the technical solution provided by this application are:
[0027] In the above technical scheme, as the input data requesting the query of knowledge content is input, if it is detected that the input data contains a target object, at least one candidate subject word matching the input data can be obtained by fuzzy matching the input data, and these candidate subject words are displayed to the user, and then in response to the selection operation of the target subject word among these candidate subject words, knowledge related to the target subject word is recalled in the constructed knowledge base to obtain reply data corresponding to the input data, and finally the reply data is displayed to the user. Thus, based on the target object contained in the input data, the fuzzy matching processing of the input data can be actively triggered, which can not only help users quickly obtain candidate subject words, improve the query efficiency of knowledge content and the user's query experience, and improve the convenience of query, but also help users obtain accurate target subject words, effectively avoid user input errors or incomplete input, so as to provide accurate data basis for subsequent knowledge recall, and is more conducive to obtaining accurate reply data, improving the accuracy of the query, thereby effectively solving the problems of low accuracy of query content and inconvenient query in related technologies. BRIEF DESCRIPTION OF THE DRAWINGS
[0028] In order to more clearly illustrate the technical solutions in the embodiments of the present application, the following briefly introduces the drawings required for use in the description of the embodiments of the present application. Obviously, the drawings described below are only some embodiments of the present application, and those skilled in the art can obtain other drawings based on these drawings without creative work.
[0029] Figure 1a It is a schematic diagram of the implementation environment involved in this application;
[0030] Figure 1b yes Figure 1a A timing diagram of a data interaction method involved in the implementation environment shown;
[0031] Figure 2 is a hardware structure diagram of a computer device according to an exemplary embodiment;
[0032] Figure 3 is a flow chart of a data interaction method according to an exemplary embodiment;
[0033] Figure 4a yes Figure 3 A flowchart of step 310 in one embodiment of the corresponding embodiment;
[0034] Figure 4b is a schematic diagram of a data input area according to an exemplary embodiment;
[0035] Figure 5ais a flow chart of another data interaction method according to an exemplary embodiment;
[0036] Figure 5b is a schematic diagram of a target operation item according to an exemplary embodiment;
[0037] Figure 6a yes Figure 5a A flowchart of step 450 in one embodiment corresponding to the embodiment;
[0038] Figure 6b is a schematic diagram showing a topic word candidate area according to an exemplary embodiment;
[0039] Figure 7a is a flow chart of another data interaction method according to an exemplary embodiment;
[0040] Figure 7b is a schematic diagram showing a conversation page displaying reply data according to an exemplary embodiment;
[0041] Figure 8 is a flow chart of another data interaction method according to an exemplary embodiment;
[0042] Fig. 9 It is a schematic diagram of a specific implementation of a data interaction method in an application scenario;
[0043] Fig.10 is a structural block diagram of a data interaction device according to an exemplary embodiment;
[0044] Fig.11 is a structural block diagram of another data interaction device according to an exemplary embodiment;
[0045] Fig.12 The present invention is a structural block diagram of an electronic device according to an exemplary embodiment. DETAILED DESCRIPTION
[0046] The embodiments of the present application are described in detail below, and examples of the embodiments are shown in the accompanying drawings, wherein the same or similar reference numerals throughout represent the same or similar elements or elements having the same or similar functions. The embodiments described below with reference to the accompanying drawings are exemplary and are only used to explain the present application, and cannot be interpreted as limiting the present application.
[0047] It will be understood by those skilled in the art that, unless expressly stated, the singular forms "one", "said", and "the" used herein may also include plural forms. It should be further understood that the term "comprising" used in the specification of the present disclosure refers to the presence of the features, integers, steps, operations, elements, and / or components, but does not exclude the presence or addition of one or more other features, integers, steps, operations, elements, components, and / or groups thereof. It should be understood that when we refer to an element as being "connected" or "coupled" to another element, it may be directly connected or coupled to the other element, or there may be intermediate elements. In addition, the "connection" or "coupling" used herein may include wireless connection or wireless coupling. The term "and / or" used herein includes all or any unit and all combinations of one or more associated listed items.
[0048] As mentioned earlier, although data interaction has been rapidly developed and widely used in different fields, represented by the input-output question-answering format, users can easily and quickly query relevant content by inputting data, but the accuracy of the queried relevant content is not accurate enough.
[0049] On the one hand, the traditional data interaction method is mainly based on rules and template matching, which can only cover a part of the question and answer needs with fixed input formats, but cannot meet the other part of the question and answer needs with less fixed input formats, resulting in low accuracy. Moreover, because a large number of rules and templates need to be manually written and maintained, the labor cost is huge, and the scalability and adaptability are very poor.
[0050] On the other hand, in some enterprises, since what needs to be queried is the relevant content of special products / special terms, there may be interaction barriers for users with special products / special terms. For example, the special product name is incompletely entered, or the special term is entered incorrectly, etc. This may easily lead to inaccurate query content due to inaccurate input.
[0051] As can be seen from the above, the related technology still has the defect that the accuracy of the query content is not high.
[0052] To this end, the data interaction method provided by the present application can help users quickly obtain accurate input, thereby effectively improving the accuracy of the query content. Accordingly, the data interaction method is suitable for a data interaction device, which can be deployed on an electronic device. The electronic device can be a computer device configured with a von Neumann architecture, for example, the computer device includes a desktop computer, a laptop computer, a server, etc.; the electronic device can also refer to a portable and mobile electronic device, for example, the electronic device includes a smart phone, a tablet computer, etc.
[0053] In order to make the objectives, technical solutions and advantages of the present application clearer, the implementation methods of the present application will be further described in detail below with reference to the accompanying drawings.
[0054] Figure 1a It is a schematic diagram of an implementation environment involved in a data interaction method. It should be noted that this implementation environment is only an example adapted to the present invention and cannot be considered as providing any limitation on the scope of use of the present invention.
[0055] like Figure 1a As shown, the implementation environment includes a user terminal 110 and a server 130 .
[0056] Specifically, the user terminal 110 can also be considered as an input data acquisition device, including but not limited to electronic devices with shooting functions such as cameras, cameras, and camcorders, electronic devices with sound pickup functions such as microphones, radios, and speakers, and electronic devices configured with input components (such as mice, keyboards, touch screens, etc.). For example, the user terminal 110 can be a camera for collecting input data in the form of images; the user terminal 110 can be a speaker for collecting input data in the form of voices; the user terminal 110 can also be a desktop computer for collecting input data in the form of texts.
[0057] The server 130 may be a computer cluster composed of multiple servers, or even a cloud computing center composed of multiple servers, so as to provide background services to a large number of users. For example, the background services include but are not limited to data interaction services, etc.
[0058] The server 130 and the user terminal 110 establish a network communication connection in advance through wired or wireless means, and data transmission between the server 130 and the user terminal 110 is realized through the network communication connection. The transmitted data includes but is not limited to: input data, reply data, etc.
[0059] In an application scenario, through the interaction between the user terminal 110 and the server 130, the user terminal 110 provides the user with input data collection services. Taking a speaker as an example, the speaker can capture a passage spoken by the user as collected input data, indicating the knowledge content requested by the user. After the user terminal 110 collects the input data containing the target object, the user can also upload the input data to the server 130 with the help of the user terminal 110 to request the server 130 to provide data interaction services.
[0060] For the server 130, after receiving the input data uploaded by the user terminal 110, it calls the data interaction service to help the user quickly obtain the response data corresponding to the input data through the data transmission between the user terminal 110 and the server 130. Specifically, Figure 1b As shown, when the input data contains the target object, the server 130 performs fuzzy matching processing on the input data to obtain at least one candidate subject word matching the input data, and returns the candidate subject words to the user terminal 110 .
[0061] At this time, the user terminal 110 will receive the candidate keywords returned by the server 130. The user terminal 110 can output these candidate keywords to the user in the form of voice broadcast, so that the user can select a target keyword from these candidate keywords. Accordingly, the user terminal 110 can continue to capture a sentence from the user about the target keyword and upload it to the server 130.
[0062] Then, the server 130 can perform knowledge recall in the constructed knowledge base based on the received target keyword, and finally obtain the reply data corresponding to the input data, and return it to the user terminal 110. Similarly, the user terminal 110 can output the received reply data to the user in the form of voice broadcast.
[0063] Of course, in other application scenarios, the entire data interaction process can also be completed independently by the user terminal 110, which does not constitute a specific limitation here. For example, the user terminal 110 is a desktop computer equipped with a mouse and a display screen, so the user can use the mouse to input the knowledge content requested for query, and accordingly, the desktop computer can obtain the input data containing the target object, thereby actively triggering the fuzzy matching process of the input data, obtaining at least one candidate subject word matching the input data, and displaying these candidate subject words on the display screen for user selection, and then based on the target subject word selected by the user, knowledge recall is performed in the constructed knowledge base to obtain the reply data corresponding to the input data, and the reply data is displayed to the user on the display screen.
[0064] In the above process, based on the active triggering of fuzzy matching processing, users can quickly and accurately obtain target keywords for querying knowledge content; based on the knowledge recall of target keywords in the knowledge base, users can also accurately obtain target knowledge content, thereby effectively solving the problem of low accuracy of query content existing in related technologies.
[0065] See also Figure 2 , Figure 2 The figure is a hardware structure diagram of a computer device according to an exemplary embodiment.
[0066] It should be noted that the computer device is only an example adapted for the present application and cannot be considered to provide any limitation on the scope of use of the present application. The computer device cannot be interpreted as requiring dependence on or having Figure 2One or more components of exemplary computer device 200 are shown.
[0067] The hardware structure of the computer device 200 may vary greatly due to differences in configuration or performance, such as Figure 2 As shown, the computer device 200 includes: a power supply 210 , an interface 230 , at least one memory 250 , and at least one central processing unit (CPU) 270 .
[0068] Specifically, the power supply 210 is used to provide operating voltage for each hardware device on the computer device 200 .
[0069] The interface 230 includes at least one wired or wireless network interface 231 for interacting with external devices. Figure 1a The interaction between the user terminal 110 and the server 130 in the implementation environment is shown.
[0070] Of course, in other examples adapted by the present application, the interface 230 may further include at least one serial-to-parallel conversion interface 233, at least one input-output interface 235, and at least one USB interface 237, etc. Figure 2 As shown, this is not intended to be a specific limitation.
[0071] The memory 250 is a carrier for storing resources, which may be a read-only memory, a random access memory, a disk or an optical disk, etc. The resources stored thereon include an operating system 251, an application 253 and data 255, etc. The storage method may be temporary storage or permanent storage.
[0072] Among them, the operating system 251 is used to manage and control the hardware devices and application programs 253 on the computer device 200 to enable the central processor 270 to calculate and process the massive data 255 in the memory 250. It can be WindowsServerTM, Mac OS XTM, UnixTM, LinuxTM, FreeBSDTM, etc.
[0073] The application program 253 is a computer program formed by computer-readable instructions based on the operating system 251 to complete at least one specific task, and may include at least one module ( Figure 2 (not shown), each module may include corresponding computer-readable instructions. For example, the data interaction device may be regarded as an application 253 deployed on the computer device 200.
[0074] Data 255 may be photos, pictures, etc. stored in a disk, or may be input data, knowledge base, response data, etc. stored in memory 250 .
[0075] The central processor 270 may include one or more processors and is configured to communicate with the memory 250 through at least one communication bus to read the computer program stored in the memory 250, thereby realizing the operation and processing of the mass data 255 in the memory 250. For example, the data interaction method is completed in the form of the central processor 270 reading the application program 253 stored in the memory 250.
[0076] In addition, the present application can also be implemented through hardware circuits or hardware circuits combined with software. Therefore, the implementation of the present application is not limited to any specific hardware circuits, software, or a combination of the two.
[0077] See also Figure 3 The present application embodiment provides a data interaction method, which is applicable to an electronic device, for example, the electronic device may be Figure 1a The user terminal 110 in the illustrated implementation environment may also be Figure 1a The server 130 in the implementation environment is shown, and the hardware structure of the electronic device can be as follows Figure 2 shown.
[0078] In the following method embodiments, for ease of description, the execution subject of each step of the method is taken as an electronic device as an example for illustration, but this does not constitute a specific limitation.
[0079] like Figure 3 As shown, the method may include the following steps:
[0080] Step 310: During the data input process, if it is detected that the input data contains a target object, at least one candidate keyword matching the input data is output.
[0081] First of all, it should be noted that the input data is used to indicate the target knowledge content requested by the user, and it can also be understood that the input data is data used to indicate the target knowledge content requested by the user. With the input of the input data, the electronic device can determine the target knowledge content requested by the user, and then provide the target knowledge content to the user. In other words, if the user requests to query the target knowledge content, the electronic device can input data with the help of the electronic device, so that the electronic device can return the target knowledge content requested by the user based on the data input.
[0082] In different application scenarios, input data may have different data types. For example, in a smart home scenario, input data may be collected by a smart camera deployed in the home, and the data type of the input data may be an image type. Alternatively, in a smart office scenario, input data may be collected by a mouse configured on a desktop computer, and the data type of the input data may be a text type.
[0083] Secondly, the target object refers to the data in the input data that is used to trigger the fuzzy matching processing of the input data. As the data type of the input data is different, the data type of the target object may also be different. For example, if the data type of the input data is an image type, the target object may refer to a target graphic; if the data type of the input data is a text type, the target object may refer to a target character. In other words, the data interaction method provided in this embodiment can be applied to different application scenarios. For example, in a smart home scenario, users can use the data interaction method to understand the various smart devices deployed in the home. In a smart office scenario, users can use the data interaction method to understand the internal knowledge of the enterprise. This embodiment does not constitute a specific limitation on this.
[0084] Based on target objects of different data types, during the data input process, the target recognition technology used by the electronic device to detect whether the input data contains the target object will be different. The target recognition technology can be an image recognition technology for identifying target graphics, or a text recognition technology for identifying target characters. In other words, the target recognition technology used to identify the target object depends on the data type of the input data. Specifically, the data type of the input data is determined, and a matching target recognition technology is determined based on the determined data type; the matching target recognition technology is used to identify whether the input data contains the target object, and the target object includes at least one of a target character and a target graphic.
[0085] For electronic devices, after detecting that the input data contains the target object, it will actively trigger the fuzzy matching process of the input data to obtain at least one candidate subject word that matches the input data. Among them, the candidate subject word refers to the data that may be associated with the target knowledge content requested by the user. Then, by obtaining the candidate subject word, it can help the user obtain the target knowledge content related to it.
[0086] In a possible implementation, fuzzy matching processing refers to the process of searching candidate subject terms in a knowledge base using input data, wherein the knowledge base is a database constructed based on known knowledge content and at least stores the association relationship between knowledge content and subject terms.
[0087] In a possible implementation, fuzzy matching processing refers to the process of recommending candidate keywords by using at least one of the user's historical query records and hobbies, wherein the historical query records refer to target knowledge content that the user has requested to query.
[0088] After obtaining at least one candidate subject word that matches the input data, the electronic device will output these candidate subject words. It should be understood that the output method of the candidate subject words will be different depending on the output components configured in the electronic device. For example, for a desktop computer configured with a display screen, at least one candidate subject word that matches the input data can be displayed to the user through the display screen; or, for a speaker configured with a speaker, at least one candidate subject word that matches the input data can be broadcast to the user through the speaker, and this embodiment does not limit this.
[0089] Step 330, in response to the selection operation of the target keyword among the candidate keywords, outputting reply data corresponding to the input data.
[0090] The response data refers to the target knowledge content requested by the user.
[0091] As mentioned above, each candidate subject word that matches the input data may be associated with the target knowledge content requested by the user. Based on this, the answer data output by different candidate subject words may also be different. In order to obtain the most accurate answer data, the electronic device will provide the user with a selection entry, which is used to select a target subject word from at least one candidate subject word that matches the input data, so that the most accurate target knowledge content can be queried for the user based on the target subject word. That is, the target subject word is the data most relevant to the target knowledge content requested by the user.
[0092] After selecting the target subject word, the most accurate reply data can be output based on the selected target subject word. In this embodiment, the reply data is obtained by performing knowledge recall in the constructed knowledge base for the selected target subject word. The knowledge base is a database constructed based on known knowledge content and at least stores the association relationship between knowledge content and subject words. In other words, knowledge recall refers to searching the constructed knowledge base for knowledge content that has an association relationship with the target subject word to obtain reply data corresponding to the input data.
[0093] It should be understood that the output method of the reply data will be different depending on the output components configured in the electronic device. For example, for a desktop computer configured with a display screen, the reply data corresponding to the input data can be displayed to the user through the display screen; or, for a speaker configured with a speaker, the reply data corresponding to the input data can be broadcast to the user through the speaker, and this embodiment does not specifically limit this.
[0094] Through the above process, fuzzy matching processing of the input data can be actively triggered based on the target object contained in the input data, which can not only help users quickly obtain candidate keywords and improve the query efficiency of knowledge content and the user's query experience, but also help users obtain accurate target keywords and effectively avoid user input errors or incomplete input, so as to provide accurate data basis for subsequent knowledge recall, and is more conducive to obtaining accurate response data, thereby effectively solving the problem of low accuracy of query content in related technologies.
[0095] See also Figure 4a In an exemplary embodiment, step 310 may include the following steps:
[0096] Step 311, obtaining the input operation in the data input area, and displaying the input data that has been entered in the data input area.
[0097] In this embodiment, the data input area refers to an entry provided by the electronic device for the user to input and display input data. If the user requests to query the target knowledge content, the electronic device can detect the operation and obtain the input data by triggering the relevant operation at the entry, and display the input data to the user based on the entry during the data input process.
[0098] Figure 4b A schematic diagram showing a data input area in one embodiment is shown. Figure 4b As shown, the data input area 301 is an input dialog box, which displays at least a cursor "|" and a "close" icon. The cursor "|" indicates the current input position, and the "close" icon is used to close the input dialog box. As the user enters relevant data in the data input area 301, the electronic device can detect the input operation in the data input area 301, thereby obtaining the input data 302 that has been entered, and display the input data 302 that has been entered in the data input area 301. For example, in Figure 4b , the input data entered is "I would like to know".
[0099] As the user continues to input data, the input data displayed in the data input area changes accordingly. When the user actively inputs a target object during the data input process, the electronic device can detect that the input data contains the target object and display the input data containing the target object in the data input area. For example, Figure 4bIn the example, the input data containing the target object is "I want to know about @", where "@" represents the target object. Of course, in other embodiments, the target object is not limited to the @ character form, and the target object can also be other characters (such as numbers, letters, symbols, etc.) or any graphics (such as circles, etc.), and this embodiment does not constitute a specific limitation on this.
[0100] Step 313: When the input data contains the target object, fuzzy matching is performed on the input data to obtain at least one candidate subject word that matches the input data, and the at least one candidate subject word is displayed.
[0101] As mentioned above, after the electronic device detects that the input data contains the target object, it will actively trigger the fuzzy matching process of the input data to obtain at least one candidate subject word that matches the input data.
[0102] In a possible implementation, fuzzy matching processing refers to the process of searching candidate subject terms in a knowledge base using input data, wherein the knowledge base is a database constructed based on known knowledge content and at least stores the association relationship between knowledge content and subject terms.
[0103] In a possible implementation, fuzzy matching processing refers to the process of recommending candidate keywords by using at least one of the user's historical query records and hobbies, wherein the historical query records refer to target knowledge content that the user has requested to query.
[0104] After obtaining at least one candidate subject word that matches the input data, the electronic device will output these candidate subject words. In this embodiment, the output of the candidate subject words is realized through a display screen configured by the electronic device. Specifically, these candidate subject words are displayed on the display screen.
[0105] In a possible implementation, all candidate keywords are displayed on the display screen at once.
[0106] In a possible implementation, all candidate keywords are displayed in batches on the display screen through lazy loading.
[0107] Under the effect of the above-mentioned embodiment, on the one hand, using the data input area, the user can actively input the target object to wake up the fuzzy matching processing of the input data, so that the user can quickly and accurately obtain the subject words and provide accurate data basis for subsequent knowledge recall; on the other hand, a user-friendly interaction method is implemented, allowing users to easily input data and select subject words.
[0108] See also Figure 5a In another exemplary embodiment, step 310 may include the following steps:
[0109] Step 410: Display the target operation item in the data input area.
[0110] The target operation item is used to trigger fuzzy matching processing on the input data.
[0111] As mentioned above, when the input data contains the target object, the target object detected by the electronic device triggers the fuzzy matching process of the input data, and then outputs at least one candidate keyword matching the input data. To this end, the electronic device provides a target operation item for the user, so that the user can determine the target object as part of the input data through the target operation item.
[0112] In this embodiment, the target operation item is set in the data input area. Of course, the target operation item can be set at any position in the data input area. Figure 5b A schematic diagram of a target operation item in an embodiment is shown. Figure 5b In the example, the target operation item 401 is located at the left end of the data input area 402. The target operation item may be a control, which may be displayed in at least one form or a combination of several forms such as text, graphics, and characters, which is not limited here.
[0113] Step 430: Obtain a trigger operation for the target operation item so that the input data includes the target object.
[0114] Based on the data input area, if the user expects to trigger fuzzy matching processing on the input data, he can not only actively input the target object during the data input process, but also trigger related operations on the target operation item so that the input data contains the target object.
[0115] In a possible implementation, in response to a trigger operation for a target operation item, a target object is input in a data input area to determine the target object as input data. The trigger operation refers to a user operation triggered for the target operation item in order to include the target object in the input data so as to facilitate fuzzy matching of the input data.
[0116] For example, continue to see Figure 5b, in the data input area 402, the user first inputs "I want to know", and at this time, the input data displayed in the data input area 402 is "I want to know". In order to trigger the fuzzy matching processing of the input data in the subsequent data input process, the user clicks the target operation item 401, and the click operation is regarded as a trigger operation for the target operation item 401. Then, the electronic device can detect the click operation on the target operation item 401, and then in response to the click operation on the target operation item 401, the target object 403 is input in the data input area 402 to determine the target object 403 as the input data. At this time, the input data displayed in the data input area 402 is "I want to know@".
[0117] In this way, the triggering method of fuzzy matching processing of input data is fully expanded, the flexibility of data interaction is enhanced, and it is beneficial to improve the user experience.
[0118] Step 450: When the input data contains the target object, fuzzy matching is performed on the input data to obtain at least one candidate subject word that matches the input data, and the at least one candidate subject word is displayed.
[0119] As mentioned above, after the electronic device detects that the input data contains the target object, it will actively trigger fuzzy matching processing on the input data to obtain at least one candidate subject word matching the input data, and these candidate subject words can be displayed on the display screen configured by the electronic device.
[0120] In a possible implementation, all candidate keywords are displayed on the display screen at once.
[0121] In a possible implementation, all candidate keywords are displayed in batches on the display screen through lazy loading.
[0122] Under the effect of the above-mentioned embodiment, on the one hand, by utilizing the target operation item set in the data input area, the user does not have to manually input the target object, but can use the target operation item to directly wake up the fuzzy matching processing of the input data, so that the user can quickly and accurately obtain the subject words, and provide accurate data basis for subsequent knowledge recall; on the other hand, a user-friendly interaction method is implemented, so that the user can easily input data and select subject words.
[0123] See also Figure 6a In an exemplary embodiment, step 313 or step 450 may include the following steps:
[0124] Step 451: When the input data contains the target object, keyword extraction is performed on the input data to obtain the target keyword.
[0125] In this embodiment, when the input data contains the target object, the fuzzy matching process is the process of searching for candidate subject terms in the knowledge base using the target keywords in the input data. The target keywords refer to the key data in the input data that are used to indicate the target knowledge content that the user requests to query. For example, if the input data is "I want to know about XX product", then it can be considered that "XX product" in the input data is the target keyword, while "I want to know about" in the input data does not belong to the target keyword.
[0126] In a possible implementation, keyword extraction can be performed based on input data before the target object, based on input data after the target object, or based on all input data including the target object. In this way, not only can the subject word extraction be performed on the input data that has been input in real time, but also the subject word extraction can be performed continuously on the input data that has been input historically, which is conducive to improving the accuracy of subject word extraction.
[0127] In one possible implementation, keyword extraction can be implemented using a natural language processing algorithm, or using a subject word extraction model built based on a natural language algorithm, wherein the natural language processing algorithm includes but is not limited to: word frequency statistics, TF-IDF (term frequency-inverse document frequency), text clustering and other algorithms.
[0128] It should be noted that the knowledge base is a database constructed based on known knowledge content and at least stores the association relationship between knowledge content and subject words.
[0129] Step 453: Based on the subject word search for the target keyword in the knowledge base, at least one candidate subject word similar to the target keyword is obtained, and the at least one candidate subject word is displayed.
[0130] As mentioned above, knowledge recall is to search the knowledge base for knowledge content blocks that are associated with candidate keywords. Therefore, after extracting the target keywords from the input data, the electronic device first needs to help the user quickly obtain the candidate keywords based on the target keywords to avoid user input errors or incomplete input, so as to facilitate subsequent knowledge recall.
[0131] In this embodiment, the candidate subject words are implemented based on the subject word search performed in the knowledge base. Specifically, the subject word search process may include the following steps: based on each subject word stored in the knowledge base, respectively calculating the similarity between the target keyword and each subject word; screening each subject word in the knowledge base according to the calculated similarity to obtain at least one candidate subject word similar to the target keyword. Among them, screening refers to selecting several subject words that are most similar to the target keyword as candidate subject words. Of course, in other embodiments, the subject word search process is not limited to the calculation of similarity, and different search methods can also be used according to different target keywords. For example, the search method can be word segmentation query, fuzzy query, wildcard query, etc., and this embodiment does not constitute a specific limitation on this.
[0132] After obtaining at least one candidate keyword, the electronic device can display these candidate keywords on the display screen configured therein. In a possible implementation, each candidate keyword can be displayed in batches through lazy loading based on their similarity with the target keyword. Accordingly, in other embodiments, the display method of each candidate keyword can also be implemented based on the search score, pre-set priority and weight, or other indicators, which are not specifically limited here.
[0133] Specifically, the step of displaying at least one candidate subject word in step 453 may include the following steps: displaying a subject word candidate area; displaying a first batch of candidate subject words in the subject word candidate area based on the similarity between the target keyword and each candidate subject word; and displaying a second batch of candidate subject words in the subject word candidate area in response to a viewing completion operation triggered on the first batch of candidate subject words. The viewing completion operation is a user operation for prompting the user that the first batch of candidate subject words have been viewed.
[0134] The first batch of candidate subject words includes several candidate subject words; the second batch of candidate subject words includes several other candidate subject words different from the first batch of candidate subject words.
[0135] Among them, the keyword candidate area is used to display candidate keywords. The keyword candidate area is different from the data input area, so that during the data input process, the input data that has been entered can be displayed in the data input area, and at the same time, several candidate keywords obtained by fuzzy matching the input data that has been entered can be displayed in the keyword candidate area.
[0136] Figure 6b A schematic diagram of a keyword candidate region in an embodiment is shown, Figure 6bAs shown, the subject word candidate area 501 is located above the data input area 502. In the data input area 502, the input data "@FP" that has been entered is displayed. In the subject word candidate area 501, two candidate subject words "human scene sensor FP1" and "human scene sensor FP2" in the first batch of candidate subject words obtained by fuzzy matching of the target keyword "FP" in the input data are displayed. If these two candidate subject words are not what the user expects, the user can further click on the change icon 503 so that the electronic device can confirm that the user has viewed the first batch of candidate subject words and display the second batch of candidate subject words in the subject word candidate area 501. Among them, the click operation can be considered as a viewing completion operation triggered for the first batch of candidate subject words. It is worth mentioning that the subject word candidate area 501 here only displays two candidate subject words. If the number of candidate subject words contained in different batches of candidate subject words is more than two, the user can also quickly view other candidate subject words in the current batch by triggering operations such as sliding up and down, turning pages left and right, etc. 504, which does not constitute a specific limitation here.
[0137] Through the cooperation of the above embodiments, users can not only clearly view the candidate keywords obtained by fuzzy matching while inputting data, but also quickly view all candidate keywords through lazy loading to facilitate rapid selection of target keywords, which greatly improves query efficiency and user experience.
[0138] In an exemplary embodiment, the method may further include the following steps: displaying a conversation page, wherein the conversation page includes a data input area and a conversation content display area; the data input area is used to display input data, and the conversation content display area is used to display conversation content.
[0139] Accordingly, see Figure 7a In an exemplary embodiment, step 330 may include the following steps:
[0140] Step 510: In response to a selection operation on a target topic word among candidate topics, the target topic word is displayed as input data in a data input area.
[0141] Step 530, in response to the sending operation for the input data, the reply data corresponding to the input data is used as the conversation content, and the reply data is displayed on the conversation page.
[0142] Figure 7b A schematic diagram showing an embodiment of displaying reply data on a conversation page is shown. Figure 7bIn the example, if the user clicks "Human Scene Sensor FP2" in the keyword candidate area 601, the electronic device can detect the click operation, and then determine that the user has selected "Human Scene Sensor FP2" as the target keyword, and display the input data "@FP Human Scene Sensor FP2" in the data input area 602, so that the user can clearly view the target keyword that matches the input data. The click operation is regarded as a selection operation for the target keyword among the candidate keywords.
[0143] At this time, continue to refer to Figure 7b If the user clicks the send icon 603, the electronic device can detect the click operation again, and then determine that the user expects to recall knowledge based on the currently input input data "@FP human scene sensor FP2", and display the reply data corresponding to the input data in the data input area 603, so that the user can clearly view the target knowledge content requested by the user. Among them, the click operation is regarded as a send operation for the input data.
[0144] In the above process, based on the conversation mode provided by the conversation page, the user can quickly and clearly view the input data, the target keywords matching the input data, and the response data corresponding to the input data, so that the user can get clear and easy-to-understand answers, which is further conducive to improving query efficiency and user experience.
[0145] See also Figure 8 The present application embodiment provides a data interaction method, which is applicable to an electronic device, for example, the electronic device may be Figure 1a The server 130 in the implementation environment is shown, and the hardware structure of the electronic device can be as follows Figure 2 shown.
[0146] In the following method embodiments, for ease of description, the execution subject of each step of the method is taken as an electronic device as an example for illustration, but this does not constitute a specific limitation.
[0147] like Figure 8 As shown, the method may include the following steps:
[0148] Step 610, obtaining input data.
[0149] The input data is used to indicate the target knowledge content requested for query.
[0150] As the input data is input, the electronic device can determine the target knowledge content requested by the user, and then provide the target knowledge content to the user. In other words, if the user requests to query the target knowledge content, the electronic device can input data so that the electronic device can return the target knowledge content requested by the user based on the data input. In different application scenarios, the input data can have different data types. For example, in a smart home scenario, the input data can be collected by a smart camera deployed in the home, then the data type of the input data can be an image type; or, in a smart office scenario, the input data can be collected by a mouse configured on a desktop computer, at which time the data type of the input data can be a text type.
[0151] Step 630: If it is detected that the input data contains the target object, fuzzy matching is performed on the input data to obtain at least one candidate subject word that matches the input data, so as to indicate selection of a target subject word for the at least one candidate subject word.
[0152] First of all, it should be noted that the target object refers to the data in the input data that is used to trigger the fuzzy matching process of the input data. As the data type of the input data is different, the data type of the target object may also be different. For example, if the data type of the input data is an image type, the target object may refer to a target graphic; if the data type of the input data is a text type, the target object may refer to a target character.
[0153] Based on the target objects of different data types, during the data input process, the target recognition technology used by the electronic device to detect whether the input data contains the target object will be different. The target recognition technology can be an image recognition technology for recognizing target graphics, or a text recognition technology for recognizing target characters.
[0154] For the electronic device, after detecting that the input data contains the target object, it will actively trigger the fuzzy matching process of the input data to obtain at least one candidate subject word matching the input data.
[0155] In a possible implementation, fuzzy matching processing refers to the process of searching candidate subject terms in a knowledge base using input data. Specifically, the fuzzy matching processing may include the following steps:
[0156] In the first step, keyword extraction is performed based on input data before the target object and / or input data after the target object to obtain target keywords.
[0157] Among them, keyword extraction can be implemented using a natural language processing algorithm, and can also be implemented using a subject word extraction model built based on a natural language algorithm. Among them, the natural language processing algorithm includes but is not limited to: word frequency statistics, TF-IDF (term frequency-inverse document frequency), text clustering and other algorithms.
[0158] The second step is to conduct a subject word search for the target keyword in the knowledge base to obtain at least one candidate subject word; the knowledge base is constructed based on known knowledge content.
[0159] The subject word search process may include the following steps: based on each subject word stored in the knowledge base, respectively calculating the similarity between the target keyword and each subject word; screening each subject word in the knowledge base according to the calculated similarity to obtain at least one candidate subject word similar to the target keyword. Screening refers to selecting several subject words that are most similar to the target keyword as candidate subject words. In this way, not only can the subject word extraction be performed on the input data that has been input in real time, but also the subject word extraction can be performed on the input data that has been input historically continuously, which is conducive to improving the accuracy of subject word extraction.
[0160] In addition, based on keyword search, electronic devices can provide users with more accurate keywords, and then provide users with more accurate knowledge content, allowing users to input at will. They do not need to enter data according to a fixed input format, nor do they have to worry about incomplete or incorrect input, which is further beneficial to improving users' query efficiency and experience.
[0161] In a possible implementation, fuzzy matching processing refers to the process of recommending candidate keywords by using at least one of the user's historical query records and interests. Specifically, the fuzzy matching processing may include the following steps: obtaining the user's preference data; searching for at least one candidate keyword matching the input data from the preference data. The preference data includes at least one of the user's historical query records and interests, and the historical query records refer to the target knowledge content that the user has requested to query.
[0162] In this way, personalized recommendations are introduced in the fuzzy matching process, that is, based on the user's historical query records or personalized information such as interests and hobbies, candidate keywords that are more in line with the user's needs and preferences are recommended to the user, thereby enabling the user to query knowledge content that is more in line with his or her needs and preferences, which is conducive to improving the user's query experience.
[0163] After obtaining at least one candidate subject word that matches the input data, the electronic device can provide these candidate subject words to the user for subsequent knowledge recall. Figure 1aThe implementation environment shown is used for illustration. It is assumed that the electronic device is the server 130. After the server 130 sends these candidate keywords to the user terminal 110, the user terminal 110 can display these candidate keywords to the user based on its configured output component, so that the user can select a target keyword that is most relevant to the target knowledge content requested by the user from the displayed candidate keywords, and return the target keyword to the server 130, so that the server 130 can query the most accurate target knowledge content for the user based on the target keyword.
[0164] Step 650, recall knowledge in the constructed knowledge base for the selected target keyword to obtain response data corresponding to the input data.
[0165] exist Figure 1a In the illustrated implementation environment, after the user terminal 110 returns the target keyword to the server 130, the server 130 can receive the target keyword and then perform knowledge recall for the target knowledge content based on the target keyword. In this embodiment, knowledge recall refers to searching for knowledge content blocks associated with the target keyword in the constructed knowledge base to obtain response data corresponding to the input data.
[0166] It should be noted that the knowledge base is a database constructed based on known knowledge content and at least stores the association relationship between knowledge content and subject words. Specifically, the construction process of the knowledge base may include the following steps:
[0167] The first step is to acquire known knowledge content.
[0168] Among them, knowledge content can be obtained according to the actual needs of the application scenario. For example, in the smart home scenario, the device name and device attributes of each smart device that can be deployed in the home are obtained as knowledge content, or in the smart office scenario, internal enterprise data including but not limited to the name of professional products, professional terms, FAQs, etc. are obtained as knowledge content. This is not limited here. Accordingly, the way to obtain knowledge content can also be different according to the actual needs of the application scenario. Knowledge content can come from the Internet, and can also come from various knowledge resources within the enterprise, including but not limited to product documents, technical manuals, FAQs, etc.
[0169] Optionally, after obtaining known knowledge contents, these knowledge contents may be preprocessed to facilitate subsequent accurate subject word extraction and knowledge recall. Preprocessing includes but is not limited to: data cleaning, denoising, segmentation, word segmentation, etc.
[0170] The second step is to extract subject words from the knowledge content to obtain at least one subject word, wherein each subject word is associated with a different knowledge content block in the knowledge content.
[0171] In one possible implementation, keyword extraction can be implemented using a natural language processing algorithm, or using a keyword extraction model built based on a natural language algorithm, wherein the natural language processing algorithm includes but is not limited to: word frequency statistics, TF-IDF (term frequency-inverse document frequency), text clustering and other algorithms.
[0172] In a possible implementation, the extraction of subject words can be realized by triggering related operations by the user. For example, the electronic device provides a subject word entry for the user. If the user wants to extract subject words from the knowledge content or edit the extracted subject words, the user can trigger related operations at the subject word entry, so that the electronic device detects the related operations triggered for the subject word entry and obtains the corresponding subject words.
[0173] In this way, through preliminary subject word extraction, the most representative subject words can be extracted from the known knowledge content, which not only ensures the accuracy and reliability of the subject words, but also provides an accurate and reliable basis for subsequent knowledge recall and fuzzy matching processing of input data.
[0174] The third step is to store and form a knowledge base based on at least one of the subject words, the knowledge content blocks associated with the subject words, and the association relationship between the subject words and the knowledge content.
[0175] In addition, in a possible implementation, the constructed knowledge base can be updated based on relevant operations triggered by users, or can be updated automatically periodically. The update includes but is not limited to: adjusting the knowledge content blocks associated with the subject words, deleting the no longer needed subject words and their associated knowledge content blocks, etc.
[0176] For example, the electronic device provides a designated entrance for the user. If the user wishes to adjust the knowledge content block B associated with the subject word A, the designated operation can be triggered at the designated entrance, so that the electronic device detects the designated operation triggered at the designated entrance and obtains the adjusted knowledge content block C, and then updates the knowledge base based on the subject word A and the adjusted knowledge content block C, so that the knowledge content block stored in the knowledge base that is associated with the subject word A is updated from knowledge content block B to knowledge content block C.
[0177] Therefore, the knowledge base not only stores known knowledge content, but also stores various keywords associated with the known knowledge content. It can also be understood that the knowledge base at least indicates the association between each keyword and each knowledge content block. Then, in the subsequent candidate keyword acquisition and knowledge recall, it can help users quickly obtain candidate keywords, and search for knowledge content blocks with associated relationships in the knowledge base based on the candidate keywords quickly obtained by the user.
[0178] In some embodiments, the knowledge content block associated with the target keyword can be directly used as the answer data corresponding to the input data. In other embodiments, in order to further improve the accuracy of the query content, the knowledge content block associated with the target keyword is used as the context of the input data, and the knowledge question and answer model is introduced as the context environment in the knowledge recall process to provide users with more accurate and natural answer data in combination with the context environment.
[0179] The following describes the knowledge recall process in conjunction with the knowledge question answering model. Specifically, the knowledge recall process may include the following steps:
[0180] In the first step, based on the related subject words and knowledge content blocks in the knowledge base, the knowledge content blocks with related relationships are searched in the knowledge base according to the target subject words, and the searched knowledge content blocks are used as the context of the input data.
[0181] The context of input data refers to the data used to describe the semantics or context of the input data. Based on the context of the input data, the focus of the target knowledge content that the user expects to query can be accurately reflected, which is conducive to obtaining more accurate response data in the future.
[0182] As mentioned above, the knowledge base at least indicates the association between each subject word and each knowledge content block. Therefore, based on the subject words and knowledge content blocks with association in the knowledge base, by searching for knowledge content blocks with association with the target subject word, it is possible to determine the knowledge content blocks with association with the target subject word, and use this as the upper and lower sides of the input data to improve the accuracy of the query content.
[0183] In the second step, based on the constructed context environment for the input data and the response data, the response data corresponding to the input data is obtained from the input data and its context.
[0184] In this embodiment, the knowledge question and answer model is used as the context environment for input data and answer data. The knowledge question and answer model is a trained machine learning model that has the ability to generate answer data based on input data and its context. In a possible implementation, the machine learning model can be a RAG (Retrieval Augmented Generation) large model built based on intelligent question and answer technology.
[0185] After determining that the knowledge question and answer model is the context environment, the electronic device can obtain the reply data corresponding to the input data based on the knowledge question and answer model. Specifically, the input data and its context are input into the knowledge question and answer model for context retrieval and knowledge content query, and the reply data corresponding to the input data is output.
[0186] Among them, contextual retrieval refers to querying the target knowledge content contained in the knowledge base based on the context of the input data; knowledge content query refers to querying the target knowledge content contained in the knowledge base based on the input data itself. In this way, on the one hand, combining contextual retrieval and knowledge content query can more accurately understand the focus of the target knowledge content that users expect to query, and can generate natural language text that is closer to user needs, which is conducive to improving the accuracy of content query. On the other hand, the retrieval and generation technology based on the knowledge question and answer model is conducive to improving query efficiency.
[0187] As a result, it is achieved that the response data is generated according to the context and / or input data formed by the knowledge content block of knowledge recall, which is not only more conducive to meeting user needs and improving user experience, but also conducive to improving the accuracy of query content.
[0188] Through the above process, fuzzy matching processing of the input data can be actively triggered based on the target object contained in the input data, which can not only help users quickly obtain candidate keywords and improve the query efficiency of knowledge content and the user's query experience, but also help users obtain accurate target keywords and effectively avoid user input errors or incomplete input, so as to provide accurate data basis for subsequent knowledge recall, and is more conducive to obtaining accurate response data, thereby effectively solving the problem of low accuracy of query content in related technologies.
[0189] Fig. 9This is a schematic diagram of a specific implementation of a data interaction method in an application scenario. The application scenario is a smart office scenario, which provides fast and accurate knowledge search and question-and-answer services for enterprise employees, and is applicable to various tasks and fields within the enterprise, including but not limited to technical support, customer service, human resources, product information query, etc. In this smart office scenario, the hardware environment can be a desktop computer, a server, a cloud platform, etc. The data interaction method can be configured as a knowledge question-and-answer system, which can run as a client in the above hardware environment to provide the data interaction method for enterprise employees.
[0190] Specifically, Fig. 9 As shown, as the knowledge question and answer system runs, the knowledge question and answer system will display a question and answer interface for data interaction to the user. The user can enter the target knowledge content requested for query in the question and answer interface, and the knowledge question and answer system will process and parse the input data to detect whether the target object @ is contained in the input data.
[0191] On the one hand, if the input data contains the target object @, the @ function is awakened, that is, the fuzzy matching processing of the input data is triggered. Specifically, the target keyword is extracted from the input data, and the target keyword is fuzzy matched and associated based on the constructed knowledge base, so as to provide the user with several candidate subject words with high similarity to the target keyword. After the user selects the target subject word, the knowledge question and answer system recalls knowledge in the knowledge base based on the target subject word and / or the input data, and uses the obtained knowledge content block as the context of the input data.
[0192] On the other hand, if the input data does not contain the target object @, the input data is not subjected to fuzzy matching processing. Instead, the input data is directly used to perform knowledge recall in the knowledge base, and the obtained knowledge content block is used as the context of the input data.
[0193] After obtaining the context of the input data, the knowledge question answering system further uses the knowledge question answering model as the context environment, inputs the input data and its context into the knowledge question answering model, and thus generates accurate and natural response data.
[0194] In this application scenario, the tediousness of user input is reduced. The fuzzy matching processing function of the input data, namely the @ function, is used to quickly input keywords, improve the accuracy of the system response, and quickly match keywords by recalling knowledge content blocks related to the keywords as context to avoid input errors or incompleteness. Overall, the data interaction method provided by this application scenario aims to improve the user experience and efficiency of enterprise knowledge question and answer services in an intelligent way. Of course, the above data interaction method can also be extended to other application scenarios, such as online education platforms, intelligent customer service systems, etc., to improve the efficiency of users in obtaining information and seeking answers in different application scenarios through automatic fuzzy matching and quick keyword input.
[0195] Compared with the existing technology, (1) the user input efficiency is improved and the tediousness of user input is reduced: by introducing the @ function, users can trigger the fuzzy matching and association functions by inputting the @ symbol and following the keyword, so that the system can provide the subject words with high similarity to the keyword for users to choose, thereby allowing users to quickly obtain the subject words and avoid the problem of inputting tedious professional terms or long sentences. Users only need to enter a small number of keywords to complete the input. They do not need to worry about whether the input keywords meet the fixed input format, nor do they need to worry about the input keywords being wrong or incomplete, which improves the user's input efficiency; (2) improve the accuracy and relevance of the system response: by optimizing knowledge recall, the system will prioritize recalling knowledge blocks related to the user's selected subject words from the knowledge base as the context of the large model. This improves the accuracy and relevance of the system's responses, ensuring that users receive accurate answers related to key topics; (3) Reduces incorrect and incomplete responses: Since users select the target subject terms that are most relevant to the target knowledge content from a number of candidate subject terms through the @ function, the system can more accurately answer users' questions or meet their needs, avoiding incorrect or incomplete responses; (4) Improves user experience and satisfaction: By improving user input efficiency, accurately responding to questions, and avoiding incorrect and incomplete responses, the solution significantly improves user experience and satisfaction. Users can obtain the required knowledge and answers more quickly and accurately, improving work efficiency and the overall user experience; (5) Reduces the maintenance cost of the knowledge question-and-answer system: Through the automated @ function and knowledge recall, the manual writing and maintenance of rules and templates is reduced. The system can intelligently recall knowledge and generate answers based on the subject terms selected by the user, reducing the maintenance cost of the system.
[0196] It should be understood that, although the steps in the flowchart of the accompanying drawings are displayed in sequence as indicated by the arrows, these steps are not necessarily executed in sequence in the order indicated by the arrows. Unless otherwise specified herein, there is no strict order restriction on the execution of these steps, and they can be executed in other orders. Moreover, at least a part of the steps in the flowchart of the accompanying drawings may include multiple sub-steps or multiple stages, and these sub-steps or stages are not necessarily executed at the same time, but can be executed at different times, and their execution order is not necessarily sequential, but can be executed in turn or alternately with other steps or at least a part of the sub-steps or stages of other steps.
[0197] The following is an embodiment of the device of the present application, which can be used to execute the data interaction method involved in the present application. For details not disclosed in the embodiment of the device of the present application, please refer to the method embodiment of the data interaction method involved in the present application.
[0198] See also Fig.10 In an embodiment of the present application, a data interaction device 900 is provided, including but not limited to: a keyword output module 910 and a data output module 930.
[0199] The keyword output module 910 is used to display at least one candidate keyword matching the input data if it is detected that the input data contains a target object during the data input process; the candidate keyword is obtained by fuzzy matching the input data.
[0200] The data output module 930 is used to display reply data corresponding to the input data in response to the selection operation of the target keyword among the candidate keywords; the reply data is obtained by recalling the knowledge in the constructed knowledge base for the selected target keyword.
[0201] In an exemplary embodiment, the keyword output module 910 is also used to obtain input operations in the data input area and display the input data that has been entered in the data input area; when the input data contains a target object, fuzzy matching is performed on the input data to obtain at least one candidate keyword that matches the input data, and at least one candidate keyword is displayed.
[0202] In an exemplary embodiment, the device 900 also includes an operation module, which is used to display a target operation item in the data input area; the target operation item is used to trigger fuzzy matching processing of the input data; and obtain a trigger operation for the target operation item so that the input data contains a target object.
[0203] In an exemplary embodiment, the operation module is further configured to, in response to a trigger operation on the target operation item, input a target object in the data input area to determine the target object as input data.
[0204] In an exemplary embodiment, the keyword output module 910 is further used to, when the input data contains the target object, perform fuzzy matching processing on the input data to obtain at least one candidate keyword matching the input data, and display the at least one candidate keyword.
[0205] In an exemplary embodiment, the keyword output module 910 is also used to, when the input data contains a target object, perform keyword extraction on the input data to obtain a target keyword; based on a keyword search for the target keyword in the knowledge base, obtain at least one candidate keyword similar to the target keyword, and display at least one candidate keyword.
[0206] In an exemplary embodiment, the keyword output module 910 is also used to display a keyword candidate area; based on the similarity between the target keyword and each candidate keyword, a first batch of candidate keywords is displayed in the keyword candidate area; the first batch of candidate keywords includes several candidate keywords; in response to a viewing completion operation triggered on the first batch of candidate keywords, a second batch of candidate keywords is displayed in the keyword candidate area; the second batch of candidate keywords includes several other candidate keywords different from the first batch of candidate keywords.
[0207] In an exemplary embodiment, the device 900 also includes a conversation module, which is used to display a conversation page; the conversation page includes a data input area and a conversation content display area; the data input area is used to display input data, and the conversation content display area is used to display conversation content; the data display module is also used to, in response to a selection operation on a target subject word among candidate subjects, display the target subject word as input data in the data input area; in response to a sending operation on the input data, use reply data corresponding to the input data as conversation content and display the reply data on the conversation page.
[0208] See also Fig.11 In an embodiment of the present application, a data interaction device 1000 is provided, including but not limited to: a data acquisition module 1010, a fuzzy matching module 1030, and a knowledge recall module 1050.
[0209] The data acquisition module 1010 is used to acquire input data; the input data is used to indicate the target knowledge content requested for query.
[0210] The fuzzy matching module 1030 is used to perform fuzzy matching processing on the input data if it is detected that the input data contains a target object, and obtain at least one candidate subject word matching the input data to indicate the selection of a target subject word for the at least one candidate subject word.
[0211] The knowledge recall module 1050 is used to perform knowledge recall in the constructed knowledge base for the selected target keywords to obtain response data corresponding to the input data.
[0212] In an exemplary embodiment, the fuzzy matching module 1030 is also used to extract keywords based on input data before the target object and / or input data after the target object to obtain target keywords; perform a subject word search for the target keyword in the knowledge base to obtain at least one candidate subject word; the knowledge base is constructed based on known knowledge content.
[0213] In an exemplary embodiment, the fuzzy matching module 1030 is also used to obtain user preference data; the preference data includes at least one of the user's historical query records and interests and hobbies; and recommend at least one candidate keyword matching the input data from the preference data.
[0214] In an exemplary embodiment, the knowledge recall module 1050 is also used to search for knowledge content blocks with associated relationships in the knowledge base according to target keywords based on associated keywords and knowledge content blocks in the knowledge base, and use the searched knowledge content blocks as the context of the input data; based on the constructed context environment for the input data and the reply data, obtain reply data corresponding to the input data from the input data and its context.
[0215] In an exemplary embodiment, the knowledge recall module 1050 is also used to use a knowledge question and answer model as a context environment for input data and reply data; the knowledge question and answer model is a trained machine learning model that has the ability to generate reply data based on input data and its context; the input data and its context are input into the knowledge question and answer model for context retrieval and knowledge content query, and reply data corresponding to the input data is output.
[0216] In an exemplary embodiment, the apparatus 1000 further includes a knowledge base construction module, and the knowledge base construction module is used to construct a knowledge base based on known knowledge content.
[0217] In an exemplary embodiment, the knowledge base construction module is also used to obtain known knowledge content; extract keywords from the knowledge content to obtain at least one keyword; each keyword is associated with a different knowledge content block in the knowledge content; based on each keyword, each knowledge content block associated with each keyword, and at least one of the associations between the keyword and the knowledge content, store to form a knowledge base.
[0218] It should be noted that the data interaction device provided in the above embodiment only uses the division of the above-mentioned functional modules as an example when performing data interaction. In actual applications, the above-mentioned functions can be assigned to different functional modules as needed, that is, the internal structure of the data interaction device will be divided into different functional modules to complete all or part of the functions described above.
[0219] In addition, the data interaction device and data interaction method provided in the above embodiments belong to the same concept, wherein the specific manner in which each module performs operations has been described in detail in the method embodiments and will not be repeated here.
[0220] See also Fig.12 In an embodiment of the present application, an electronic device 4000 is provided, and the electronic device 4000 may include: a desktop computer, a laptop computer, a server, a smart phone, a tablet computer, etc.
[0221] exist Fig.12 In the embodiment, the electronic device 4000 includes at least one processor 4001 and at least one memory 4003.
[0222] The data interaction between the processor 4001 and the memory 4003 can be realized through at least one communication bus 4002. The communication bus 4002 may include a path for transmitting data between the processor 4001 and the memory 4003. The communication bus 4002 may be a PCI (Peripheral Component Interconnect) bus or an EISA (Extended Industry Standard Architecture) bus, etc. The communication bus 4002 may be divided into an address bus, a data bus, a control bus, etc. For ease of representation, only one thick line is used in the figure, but it does not mean that there is only one bus or one type of bus.
[0223] Optionally, the electronic device 4000 may further include a transceiver 4004, which may be used for data interaction between the electronic device and other electronic devices, such as data transmission and / or data reception. It should be noted that in actual applications, the transceiver 4004 is not limited to one, and the structure of the electronic device 4000 does not constitute a limitation on the embodiments of the present application.
[0224] Processor 4001 may be a CPU (Central Processing Unit), a general-purpose processor, a DSP (Digital Signal Processor), an ASIC (Application Specific Integrated Circuit), an FPGA (Field Programmable Gate Array) or other programmable logic devices, transistor logic devices, hardware components or any combination thereof. It may implement or execute various exemplary logic blocks, modules and circuits described in conjunction with the disclosure of this application. Processor 4001 may also be a combination that implements computing functions, such as a combination of one or more microprocessors, a combination of a DSP and a microprocessor, etc.
[0225] The memory 4003 can be a ROM (Read Only Memory) or other types of static storage devices that can store static information and instructions, a RAM (Random Access Memory) or other types of dynamic storage devices that can store information and instructions, or an EEPROM (Electrically Erasable Programmable Read Only Memory), a CD-ROM (Compact Disc Read Only Memory) or other optical disk storage, optical disk storage (including compressed optical disk, laser disk, optical disk, digital versatile disk, Blu-ray disk, etc.), a magnetic disk storage medium or other magnetic storage device, or any other medium that can be used to carry or store a computer program in the form of instructions or data structures and can be accessed by the electronic device 400, but is not limited to this.
[0226] The memory 4003 stores a computer program, and the processor 4001 can read the computer program stored in the memory 4003 through the communication bus 4002 .
[0227] The computer program is executed by one or more processors 4001 to implement the data interaction method in the above-mentioned embodiments.
[0228] In addition, a storage medium is provided in an embodiment of the present application, on which a computer program is stored. The computer program is executed by one or more processors to implement the above data interaction method.
[0229] A computer program product is provided in an embodiment of the present application, including a computer program, which is executed by one or more processors to implement the above data interaction method.
[0230] The above description is only a partial implementation method of the present application. It should be pointed out that for ordinary technicians in this technical field, several improvements and modifications can be made without departing from the principles of the present application. These improvements and modifications should also be regarded as the scope of protection of the present application.
Claims
1. A data interaction method, characterized in that: The method comprises: During the data input process, if it is detected that the input data contains a target object, at least one candidate subject word matching the input data is displayed; the candidate subject word is obtained based on fuzzy matching processing of the input data; In response to a selection operation for a target subject word among the candidate subject words, reply data corresponding to the input data is displayed; the reply data is obtained by recalling knowledge in a constructed knowledge base for the selected target subject word.
2. The method according to claim 1, characterized in that In the data input process, if it is detected that the input data contains a target object, at least one candidate subject word matching the input data is output, including: Acquire an input operation in a data input area, and display the input data that has been entered in the data input area; In the case that the input data includes the target object, fuzzy matching is performed on the input data to obtain at least one candidate subject word matching the input data, and at least one candidate subject word is displayed.
3. The method according to claim 1, characterized in that During the data input process, if it is detected that the input data contains a target object, before outputting at least one candidate subject word matching the input data, the method further includes: Displaying a target operation item in the data input area; the target operation item is used to trigger fuzzy matching processing of the input data; A trigger operation for the target operation item is obtained so that the input data includes the target object.
4. The method according to claim 3, characterized in that The acquiring of a trigger operation for the target operation item so that the input data includes the target object includes: In response to a trigger operation on the target operation item, inputting the target object in the data input area to determine the target object as the input data; In the data input process, if it is detected that the input data contains a target object, at least one candidate subject word matching the input data is output, including: In the case that the input data includes the target object, fuzzy matching is performed on the input data to obtain at least one candidate subject word matching the input data, and at least one candidate subject word is displayed.
5. The method according to claim 2 or 4, characterized in that In the case where the input data includes the target object, performing fuzzy matching processing on the input data to obtain at least one candidate subject word matching the input data, and displaying at least one candidate subject word, comprises: When the input data contains the target object, extracting keywords from the input data to obtain target keywords; Based on the subject word search for the target keyword in the knowledge base, at least one candidate subject word similar to the target keyword is obtained, and at least one candidate subject word is displayed.
6. The method according to claim 5, characterized in that The displaying of at least one candidate keyword comprises: Display the candidate area of the subject word; Based on the similarity between the target keyword and each of the candidate subject words, a first batch of candidate subject words is displayed in the subject word candidate area; the first batch of candidate subject words includes a plurality of the candidate subject words; In response to a viewing completion operation triggered on the first batch of candidate subject words, a second batch of candidate subject words is displayed in the subject word candidate area; the second batch of candidate subject words includes a plurality of other candidate subject words different from the first batch of candidate subject words.
7. The method according to claim 1, characterized in that The method further comprises: Displaying a conversation page; the conversation page includes a data input area and a conversation content display area; the data input area is used to display the input data, and the conversation content display area is used to display the conversation content; The step of displaying reply data corresponding to the input data in response to a selection operation of a target subject word among the candidate subject words comprises: In response to a selection operation on a target subject word among the candidate subject words, displaying the target subject word as input data in the data input area; In response to a sending operation for the input data, reply data corresponding to the input data is used as a conversation content, and the reply data is displayed on the conversation page.
8. A data interaction method, characterized in that: The method comprises: Acquire input data; the input data is used to indicate the target knowledge content requested for query; If it is detected that the input data contains a target object, fuzzy matching is performed on the input data to obtain at least one candidate subject word that matches the input data, so as to indicate selection of a target subject word for at least one candidate subject word; Knowledge recall is performed on the selected target keyword in the constructed knowledge base to obtain response data corresponding to the input data.
9. The method according to claim 8, characterized in that The step of performing fuzzy matching on the input data to obtain at least one candidate subject word matching the input data includes: Extracting keywords based on input data before the target object and / or input data after the target object to obtain target keywords; A subject word search for the target keyword is performed in the knowledge base to obtain at least one candidate subject word; the knowledge base is constructed based on known knowledge content.
10. The method according to claim 8, characterized in that The step of performing fuzzy matching on the input data to obtain at least one candidate subject word matching the input data includes: Obtaining user preference data; the preference data includes at least one of the user's historical query records and hobbies; At least one of the candidate keywords matching the input data is recommended from the preference data.
11. The method according to claim 8, characterized in that The step of performing knowledge recall in the constructed knowledge base for the selected target keyword to obtain response data corresponding to the input data includes: Based on the subject words and knowledge content blocks with associated relationships in the knowledge base, searching the knowledge base for knowledge content blocks with associated relationships according to the target subject words, and using the searched knowledge content blocks as the context of the input data; Based on the constructed context environment for the input data and the response data, the response data corresponding to the input data is obtained from the input data and its context.
12. The method according to claim 11, characterized in that The step of obtaining the reply data corresponding to the input data from the input data and its context based on the constructed context environment for the input data and the reply data includes: A knowledge question answering model is used as a context environment for input data and answer data; the knowledge question answering model is a trained machine learning model capable of generating the answer data based on the input data and its context; The input data and its context are input into the knowledge question answering model for context retrieval and knowledge content query, and answer data corresponding to the input data is output.
13. The method according to any one of claims 8 to 12, characterized in that The method further comprises: constructing the knowledge base based on known knowledge content; The step of constructing the knowledge base based on known knowledge content includes: Acquire known knowledge content; Extracting subject words from the knowledge content to obtain at least one subject word; each subject word is respectively associated with a different knowledge content block in the knowledge content; The knowledge base is stored based on at least one of the subject words, the knowledge content blocks respectively associated with the subject words, and the association relationship between the subject words and the knowledge content.
14. An electronic device comprising at least one processor and at least one memory, wherein: The memory stores a computer program, wherein the computer program, when executed by the processor, implements the data interaction method according to any one of claims 1 to 13.
15. A storage medium having a computer program stored thereon, characterized in that: When the computer program is executed by one or more processors, the data interaction method according to any one of claims 1 to 13 is implemented.
16. A computer program product comprising a computer program, characterized in that When the computer program is executed by one or more processors, the data interaction method according to any one of claims 1 to 13 is implemented.