Question and answer method and device and storage medium

By receiving and processing voice data in the intelligent retail sales system, and utilizing offline speech recognition and a large question-and-answer model, the problem of low user interaction efficiency has been solved, enabling more convenient and natural human-computer interaction and improving the question-and-answer efficiency and user experience in retail sales.

CN120998191APending Publication Date: 2025-11-21TRAVELSKY TECHNOLOGY LIMITED
View PDF 6 Cites 0 Cited by

Patent Information

Application Number
CN202511119621.6
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-08-11
Publication Date
2025-11-21

AI Technical Summary

Technical Problem

In existing intelligent retail sales systems, users interacting via text input suffer from low efficiency, lack of convenience, and insufficient interactive immersion, especially when users have difficulty using their hands, which negatively impacts the user experience.

Method used

By receiving voice data from target users, converting it into text data using an offline speech recognition model, and outputting response results using a large retail sales question-and-answer model, the speech recognition results are corrected and style matched by a preset correction lexicon and syntactic style identifier, and finally the response results are displayed on the front-end page.

Benefits of technology

It improves the convenience of user interaction, shortens the interaction time, enhances the efficiency of retail sales Q&A and user experience, and makes human-computer interaction closer to natural conversation.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120998191A_ABST
    Figure CN120998191A_ABST
Patent Text Reader

Abstract

The invention discloses a question and answer method and device and a storage medium. The method comprises the following steps: receiving voice data input from a front-end page by a target user; determining corresponding text data according to the voice data; inputting the text data into a retail sales question and answer large model, and outputting a reply result corresponding to the text data by utilizing the retail sales question and answer large model; and sending the reply result to the front-end page, and displaying the reply result on the front-end page. Through the method and the device, the problem of relatively low question-answering efficiency of retail sales in related technologies is solved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application relates to the field of artificial intelligence, and more specifically, to a question-answering method, apparatus, and storage medium. Background Technology

[0002] Intelligent retail sales systems have become a crucial bridge connecting consumers and goods. They integrate advanced natural language processing technology and the convenience of e-commerce, offering a completely new shopping experience. Through intelligent dialogue, users can express their needs in a more natural and intuitive way, and the system can quickly understand these needs and provide personalized purchase suggestions and product information. Existing intelligent retail sales systems already support user interaction via natural language text, such as entering commands or queries in text input boxes to complete tasks like flight searches and product inquiries. This interaction method represents a significant improvement over traditional fixed menus or form-based interactions.

[0003] However, existing technologies relying solely on text input still have limitations in retail sales scenarios. Firstly, there are limitations in input efficiency: for users who are not proficient in keyboard input or operating on mobile devices, typing text word by word is inefficient and cumbersome. Secondly, there is a lack of convenience: in certain situations, such as when users are carrying luggage, manual input is inconvenient, and pure text input negatively impacts the user's retail experience. Thirdly, pure text input lacks smoothness and immersive interaction.

[0004] There is currently no effective solution to the problem of low efficiency in question-and-answer processes for retail sales in related technologies. Summary of the Invention

[0005] The main objective of this application is to provide a question-and-answer method, apparatus, and storage medium to solve the problem of low question-and-answer efficiency in retail sales in related technologies.

[0006] To achieve the above objectives, according to one aspect of this application, a question-and-answer method is provided, applied to a retail sales system. The method includes: receiving voice data entered by a target user from a front-end page; determining corresponding text data based on the voice data; inputting the text data into a retail sales question-and-answer model to output a response result corresponding to the text data using the retail sales question-and-answer model; sending the response result to the front-end page and displaying the response result on the front-end page.

[0007] Furthermore, determining the corresponding text data based on the voice data includes: sending the voice data to the intelligent agent backend of the retail sales system, wherein the intelligent agent backend is equipped with an offline speech recognition model; and determining the text data corresponding to the voice data based on the offline speech recognition model.

[0008] Furthermore, determining the text data corresponding to the speech data based on the offline speech recognition model includes: inputting the speech data into the offline speech recognition model in the backend of the intelligent agent to obtain the speech recognition result corresponding to the speech data; obtaining a preset correction lexicon for the retail sales field and the ID of the target user, wherein the preset correction lexicon includes multiple sub-lexicons, different sub-lexicons correspond to different user IDs, and each sub-lexicon includes speech recognition words and corresponding domain-specific words; correcting the speech recognition result based on the preset correction lexicon to correct the speech recognition words in the speech recognition result to the corresponding domain-specific words, and determining the text data based on the correction result.

[0009] Furthermore, the sub-lexicon also includes corresponding syntactic style identifiers. Determining text data based on the correction results includes: matching the target user's ID in the sub-lexicon to obtain the target syntactic style identifier corresponding to the target user's ID. The types of target syntactic style identifiers include at least: inverted sentence style identifier, interrogative sentence style identifier, and idiom style identifier; determining the corresponding syntactic style prompt words based on the target syntactic style identifiers; and determining the text data based on the syntactic style prompt words and the correction results.

[0010] Furthermore, inputting the voice data into the offline speech recognition model in the backend of the intelligent agent to obtain the speech recognition result corresponding to the voice data includes: reading the Uniform Resource Locator (URL) corresponding to the offline speech recognition model through the offline service configuration file; obtaining the ID of the target user and encapsulating it according to the voice data to obtain request header information; and sending a request to the URL through the asynchronous server gateway interface framework according to the request header information to obtain the speech recognition result.

[0011] Furthermore, sending voice data to the intelligent agent backend for retail sales includes: using a front-end scripting language to convert the voice data into a file of a preset format, encapsulating the file of the preset format into a form to obtain the form result; and using the Hypertext Transfer Protocol to send the form result to the intelligent agent backend.

[0012] Furthermore, inputting text data into the retail sales Q&A model includes: sending the Q&A request corresponding to the text data to the request interface of the retail sales Q&A model through the intelligent agent backend, and returning the text data to the front-end page through the intelligent agent backend.

[0013] To achieve the above objectives, according to another aspect of this application, a question-and-answer device is provided, applied to a retail sales system. The device includes: a voice acquisition unit for receiving voice data input by a target user from a front-end page; a voice recognition unit for determining corresponding text data based on the voice data; a question-and-answer response unit for inputting the text data into a large-scale retail sales question-and-answer model to output a response result corresponding to the text data using the large-scale retail sales question-and-answer model; and a response display unit for sending the response result to the front-end page and displaying the response result on the front-end page.

[0014] Furthermore, the speech recognition unit includes: a data transmission module for sending speech data to the intelligent agent backend of the retail sales system, wherein the intelligent agent backend is equipped with an offline speech recognition model; and an offline recognition module for determining the text data corresponding to the speech data based on the offline speech recognition model.

[0015] Furthermore, the offline recognition module includes: a first recognition submodule, used to input voice data into the offline speech recognition model in the backend of the intelligent agent to obtain the speech recognition result corresponding to the voice data; a second recognition submodule, used to obtain a preset correction lexicon for the retail sales field and the ID of the target user, wherein the preset correction lexicon includes multiple sub-lexicons, different sub-lexicons correspond to different user IDs, and each sub-lexicon includes speech recognition words and corresponding domain-specific words; and a third recognition submodule, used to correct the speech recognition result according to the preset correction lexicon, so as to correct the speech recognition words in the speech recognition result to the corresponding domain-specific words, and determine the text data according to the correction result.

[0016] Furthermore, the sub-lexicon also includes corresponding syntactic style identifiers. The third identification sub-module includes: a syntactic matching component, used to match the target user's ID in the sub-lexicon to obtain the target syntactic style identifier corresponding to the target user's ID, wherein the types of target syntactic style identifiers include at least: inverted sentence style identifier, interrogative sentence style identifier, and idiom style identifier; a syntactic suggestion component, used to determine the corresponding syntactic style suggestion words based on the target syntactic style identifiers; and a syntactic correction component, used to determine the text data based on the syntactic style suggestion words and the correction results.

[0017] Furthermore, the first recognition submodule includes: a path selection component, used to read the Uniform Resource Locator (URL) corresponding to the offline speech recognition model through the offline service configuration file; a data encapsulation component, used to obtain the target user's ID and encapsulate it according to the speech data to obtain request header information; and an asynchronous recognition component, used to send a request to the URL through the asynchronous server gateway interface framework according to the request header information to obtain the speech recognition result.

[0018] Furthermore, the data transmission module includes: a form encapsulation submodule, which uses a front-end scripting language to convert voice data into a file of a preset format, and encapsulates the file of the preset format into a form to obtain a form result; and a protocol transmission submodule, which uses the Hypertext Transfer Protocol to send the form result to the intelligent agent backend.

[0019] Furthermore, the question-and-answer response unit includes: an agent processing module, which is used to send the question-and-answer request corresponding to the text data to the request interface of the retail sales question-and-answer big model through the agent backend, and return the text data to the front-end page through the agent backend.

[0020] According to another aspect of this application, a computer-readable storage medium is provided, which includes a stored program, wherein, when the program is executed, it controls the device on which the computer-readable storage medium is located to perform any question-and-answer method.

[0021] According to another aspect of this application, an electronic device is provided, comprising: one or more processors, a memory, and one or more programs, wherein the one or more programs are stored in the memory and configured to be executed by the one or more processors, and the one or more programs include methods for performing any kind of question-and-answer method.

[0022] In this embodiment, by receiving voice data input by the target user from the front-end page; determining the corresponding text data based on the voice data; inputting the text data into the retail sales Q&A model to output the corresponding response result using the retail sales Q&A model; and sending the response result to the front-end page and displaying the response result on the front-end page, the technical problem of low Q&A efficiency in the prior art is solved.

[0023] By inputting user voice data in the retail sales system through speech recognition, users can interact directly with the system via voice, eliminating the need for manual typing. This significantly improves user convenience, shortens interaction time, and increases task completion efficiency. Simultaneously, by processing text data based on a large-scale retail sales Q&A model and accurately and quickly outputting responses, the human-computer interaction becomes closer to natural conversation, achieving automated retail sales Q&A services and enhancing user experience. Therefore, this application improves the efficiency of Q&A in retail sales. Attached Figure Description

[0024] The accompanying drawings, which form part of this application, are used to provide a further understanding of this application. The illustrative embodiments and descriptions of this application are used to explain this application and do not constitute an undue limitation of this application. In the drawings:

[0025] Figure 1 A hardware structure block diagram of a computer terminal for implementing a question-and-answer method is shown.

[0026] Figure 2 This is a flowchart of a question-and-answer method provided according to an embodiment of this application;

[0027] Figure 3 This is a schematic diagram of a question-and-answer device provided according to an embodiment of this application;

[0028] Figure 4 This is a structural block diagram of an electronic device according to an embodiment of this application. Detailed Implementation

[0029] To enable those skilled in the art to better understand the present application, the technical solutions in the embodiments of the present application will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of the present application, and not all embodiments. Based on the embodiments in the present application, all other embodiments obtained by those of ordinary skill in the art without creative effort should fall within the scope of protection of the present application.

[0030] It should be noted that the terms "first," "second," etc., in the specification, claims, and accompanying drawings of this application are used to distinguish similar objects and are not necessarily used to describe a specific order or sequence. It should be understood that such data can be interchanged where appropriate so that the embodiments of this application described herein can be implemented in orders other than those illustrated or described herein. Furthermore, the terms "comprising" and "having," and any variations thereof, are intended to cover non-exclusive inclusion; for example, a process, method, system, product, or apparatus that comprises a series of steps or units is not necessarily limited to those steps or units explicitly listed, but may include other steps or units not explicitly listed or inherent to such processes, methods, products, or apparatus.

[0031] First, some nouns or terms that appear in the description of the embodiments of this application shall be interpreted as follows:

[0032] It should be noted that the information collected in this application (including but not limited to user device information, user personal information, etc.) and data (including but not limited to data used for display, data used for analysis, etc.) are information and data authorized by the user or fully authorized by all parties. Furthermore, the collection, storage, use, processing, transmission, provision, disclosure, and application of this data all comply with relevant laws, regulations, and standards, necessary confidentiality measures have been taken, and they do not violate public order and good morals. Corresponding access points are provided for users to choose to authorize or refuse. For example, interfaces are set up between this system and relevant users or organizations, providing users with corresponding access points to choose to agree to or refuse automated decision-making results; if the user chooses to refuse, the process proceeds to the expert decision-making stage.

[0033] Example 1

[0034] According to an embodiment of this application, a question-and-answer method embodiment is also provided. It should be noted that the steps shown in the flowchart in the accompanying drawings can be executed in a computer system such as a set of computer-executable instructions. Although a logical order is shown in the flowchart, in some cases, the steps shown or described may be executed in a different order than that shown here.

[0035] The method embodiment provided in Embodiment 1 of this application can be executed on a mobile terminal, computer terminal, or similar computing device. Figure 1 A hardware block diagram of a computer terminal (or mobile device) for implementing a question-and-answer method is shown. Figure 1 As shown, the computer terminal 10 (or mobile device) may include one or more processors 102 (shown as 102a, 102b, ..., 102n in the figure) 102 (processor 102 may include, but is not limited to, a microprocessor MCU or a programmable logic device FPGA, etc.), a memory 104 for storing data, and a transmission device 106 for communication functions. In addition, it may also include: a display, an input / output interface (I / O interface), a universal serial bus (USB) port (which may be included as one of the ports of a BUS bus), a network interface, a power supply, and / or a camera. Those skilled in the art will understand that... Figure 1 The structure shown is for illustrative purposes only and does not limit the structure of the aforementioned electronic device. For example, computer terminal 10 may also include... Figure 1 The more or fewer components shown, or having the same Figure 1 The different configurations shown.

[0036] It should be noted that the aforementioned one or more processors 102 and / or other data processing circuits are generally referred to herein as "data processing circuits". These data processing circuits may be embodied, in whole or in part, in software, hardware, firmware, or any other combination thereof. Furthermore, the data processing circuits may be a single, independent processing module, or may be integrated, in whole or in part, into any other element within the computer terminal 10 (or mobile device). As involved in the embodiments of this application, the data processing circuits serve as a processor control mechanism (e.g., selection of a variable resistor termination path connected to an interface).

[0037] The memory 104 can be used to store software programs and modules of application software, such as the program instructions / data storage device corresponding to the question-and-answer method in the embodiments of this application. The processor 102 executes various functional applications and data processing by running the software programs and modules stored in the memory 104, thereby realizing the above-mentioned question-and-answer method. The memory 104 may include high-speed random access memory, and may also include non-volatile memory, such as one or more magnetic storage devices, flash memory, or other non-volatile solid-state memory. In some instances, the memory 104 may further include memory remotely located relative to the processor 102, and these remote memories can be connected to the computer terminal 10 via a network. Examples of the above-mentioned networks include, but are not limited to, the Internet, corporate intranets, local area networks, mobile communication networks, and combinations thereof.

[0038] The transmission device 106 is used to receive or send data via a network. Specific examples of the network described above may include a wireless network provided by the communication provider of the computer terminal 10. In one example, the transmission device 106 includes a Network Interface Controller (NIC), which can connect to other network devices via a base station to communicate with the Internet. In another example, the transmission device 106 may be a Radio Frequency (RF) module, used for wireless communication with the Internet.

[0039] The display can be, for example, a touchscreen liquid crystal display (LCD) that allows the user to interact with the user interface of the computer terminal 10 (or mobile device).

[0040] Under the aforementioned operating environment, this application provides the following: Figure 2 The question-and-answer method shown. Figure 2 This is a flowchart of the question-and-answer method according to Embodiment 1 of this application.

[0041] Step S201: Receive voice data entered by the target user from the front-end page.

[0042] It should be noted that the question-and-answer method in this application is applied to retail sales systems, such as intelligent retail sales systems. Intelligent retail sales systems can use intelligent technologies to interact with passengers through multiple rounds of natural language, ultimately providing passengers with valid travel flights and completing sales functions such as booking, payment, and ticketing.

[0043] Optionally, the front-end page is the interface used for interaction with users in the intelligent retail sales system. The front-end page typically runs on the user's browser, mobile application, or other device. It provides user interface elements, such as a microphone icon button for recording. Users click this button to start audio capture, and click it again or when a preset recording duration is reached to stop audio capture, obtaining the recorded voice data.

[0044] Step S202: Determine the corresponding text data based on the voice data.

[0045] Optionally, determining the corresponding text data based on the voice data can be achieved by inputting the voice data into a speech recognition model to obtain the corresponding text data. The speech recognition model can either send voice data via an API interface and call a cloud speech recognition service to perform speech recognition to obtain the corresponding text data, or it can call a locally deployed speech recognition model to perform speech recognition. By obtaining the text data corresponding to the voice recognition data through the speech recognition model, target users can directly input their retail sales inquiries by recording voice data, reducing the interaction time spent typing.

[0046] Step S203: Input the text data into the retail sales Q&A model, so as to use the retail sales Q&A model to output the response results corresponding to the text data.

[0047] Optionally, retail sales-related dialogue data, such as product information, user needs, common questions and answers, can be collected to construct a retail sales Q&A dataset. The pre-set large model can be fine-tuned and trained using the retail sales Q&A dataset to obtain a large retail Q&A model. This model can understand and answer complex questions about products, prices, inventory, promotions, and other retail sales-related issues.

[0048] Optionally, before inputting the text data into the retail sales question-and-answer model, the dialogue intent of the text data can be determined based on the retail sales dialogue management model. The dialogue intent and text data are then input into the retail sales question-and-answer model to output the response. The dialogue management model can be a model built based on the LangGraph framework (a state machine-driven intelligent agent orchestration framework). Before inputting into the large model, the dialogue management model can clarify the target user's dialogue intent, which helps improve the accuracy of question-and-answering in multi-turn dialogues in complex scenarios.

[0049] Step S204: Send the reply result to the front-end page and display the reply result on the front-end page.

[0050] Optionally, the response can be sent back to the front-end via an HTTP (Hypertext Transfer Protocol) response. The front-end listens for a specific HTTP endpoint, receives the data, parses it, and displays it on the front-end page. The response can be an answer to a question about text data; for example, if the text data is "How many flights are there to a certain city tomorrow morning?", the response would be "There are 10 flights in total, each with a specific time and flight number." Alternatively, the response can be a pop-up dialog box in response to a text data request; for example, if the text data is "I want to book a flight to a certain city tomorrow morning," the response would be a pop-up dialog box on the front-end page to book a flight ticket.

[0051] In summary, by using speech recognition to input user voice data in the retail sales system, users can interact directly with the system via voice, eliminating the need for manual typing. This significantly improves user interaction convenience, shortens interaction time, and increases task completion efficiency. Simultaneously, by processing text data based on a large-scale retail sales Q&A model and accurately and quickly outputting responses, the human-computer interaction becomes closer to natural conversation, achieving automated retail sales Q&A services and enhancing the user experience. Therefore, this application improves the efficiency of Q&A in retail sales.

[0052] To improve the stability of question-and-answer interactions in retail sales, optionally, determining the corresponding text data based on the voice data includes: sending the voice data to the intelligent agent backend of the retail sales system, wherein the intelligent agent backend is equipped with an offline speech recognition model; and determining the text data corresponding to the voice data based on the offline speech recognition model.

[0053] Optionally, the question-answering method in this application uses a three-layer architecture of "user front-end - intelligent agent back-end - private speech recognition service" to efficiently integrate the question-answering method into the retail sales system during application. In the above three-layer architecture, the intelligent agent back-end serves as a unified entry point and data relay station, facilitating unified management and control of data flow, business logic, and security authentication by enterprises. The offline speech recognition model deployed in the intelligent agent back-end is a privately deployed speech recognition service. This speech recognition service approach is beneficial for enhancing data privacy protection, reducing long-term operating costs, and is easy to optimize flexibly according to needs (e.g., iterating the offline speech recognition model using retail sales data samples on a periodic basis). Sending voice data to the intelligent agent back-end with the deployed offline speech recognition model can avoid the impact of network fluctuations on speech recognition during voice data transmission and speech recognition service invocation.

[0054] For example, the FunASR (an open-source speech processing toolkit) model can be selected as the offline speech recognition model. The FunASR model can be deployed on the backend of the intelligent agent, the runtime environment can be configured, the model files and necessary libraries can be installed, and the corresponding API interface can be set up so that the model can receive speech data and return text data, thus completing the deployment of the offline speech recognition model.

[0055] In summary, by deploying an offline speech recognition model on the backend of the intelligent agent, a private speech recognition service was achieved, avoiding the impact of network fluctuations and enhancing the security and stability of retail sales Q&A.

[0056] To improve the accuracy of question-and-answer sessions in retail sales, optionally, determining the text data corresponding to the voice data based on the offline voice recognition model includes: inputting the voice data into the offline voice recognition model in the backend of the intelligent agent to obtain the voice recognition result corresponding to the voice data; obtaining a preset correction lexicon for the retail sales domain and the ID of the target user, wherein the preset correction lexicon includes multiple sub-lexicons, different sub-lexicons correspond to different user IDs, and each sub-lexicon includes voice recognition words and corresponding domain-specific words; correcting the voice recognition result based on the preset correction lexicon to correct the voice recognition words in the voice recognition result to the corresponding domain-specific words, and determining the text data based on the correction result.

[0057] Optionally, determining the text data corresponding to the speech data based on the offline speech recognition model can involve first generating preliminary text results (i.e., speech recognition results) using the offline speech recognition model, and then personalizing the speech recognition results based on the target user's ID. The target user's ID can be extracted from the received speech data request, and the corresponding sub-vocabulary can be located from a pre-defined modified lexicon based on the user ID. This sub-vocabulary is customized according to the target user's preferences or records, conforms to the target user's word usage habits, and includes proprietary vocabulary in the retail field, such as specific product names, brands, and promotional terms.

[0058] For example, when a user inputs "I want to check CA1234 flight from Shanghai to Beijing tomorrow" via voice, the voice recognition result may become "I want to check CA1234 flight from Shanghai to Beijing tomorrow" due to accent, noise, etc. Based on the target user ID (e.g., user4567), the agent backend loads the corresponding sub-lexicon from the preset correction lexicon. This sub-lexicon contains the target user's commonly used aviation terms and their correction items. For example, "Shanghai" is corrected to "Shanghai", and "Beijing" is corrected to "Beijing". The agent backend uses a text replacement algorithm to correct the misidentified words in the initial text result, and the corrected result is "I want to check CA1234 flight from Shanghai to Beijing tomorrow".

[0059] In summary, by correcting the speech recognition results based on the target user's ID, not only is the accuracy of speech recognition improved, but the corrected text data can also be directly applied to the specific business processes of the civil aviation retail sales system.

[0060] To improve the accuracy of question-and-answer sessions in retail sales, the sub-lexicon may optionally include corresponding syntactic style identifiers. Determining text data based on the correction results includes: matching the target user's ID within the sub-lexicon to obtain the target syntactic style identifier corresponding to the target user's ID. The types of target syntactic style identifiers include at least: inverted sentence style identifiers, interrogative sentence style identifiers, and idiom style identifiers; determining corresponding syntactic style prompts based on the target syntactic style identifiers; and determining the text data based on the syntactic style prompts and the correction results.

[0061] Optionally, by learning and analyzing voice communication data logs, the syntactic styles of different users can be obtained. For example, the syntactic style could be a tendency to use inverted sentences, interrogative sentences, or frequent use of idioms. The syntactic style identifiers are stored in a sub-lexicon associated with the user's ID. After obtaining the correction results, the corresponding syntactic style identifiers are matched in the sub-lexicon. Syntactic style prompt words are obtained based on the syntactic style identifiers. The syntactic style prompt words are then concatenated with the correction results to obtain the text data.

[0062] For example, if a user inputs voice data, the corrected result after recognition and correction is "Are there any tickets left? Flight CA100 departs from Beijing tomorrow," the user actually means "Are there any tickets left for flight CA100 departing from Beijing tomorrow?". The syntactic style cue can be determined through the sub-lexicon as "The user's commonly used syntactic style is inverted sentences, and the specific requirements are as follows." The syntactic style cue and the corrected result are then concatenated to obtain the text data.

[0063] In summary, by matching and identifying the user's syntactic style identifier, the generated text data provides richer sentence information, including not only sentence content but also syntactic style information. This is beneficial for the retail sales big data model to accurately understand the text data, thereby enhancing the accuracy of question and answer in retail sales.

[0064] To improve the stability of question-and-answer interactions in retail sales, optionally, the voice data can be input into an offline speech recognition model in the backend of the intelligent agent to obtain the speech recognition result corresponding to the voice data. This includes: reading the Uniform Resource Locator (URL) corresponding to the offline speech recognition model through the offline service configuration file; obtaining the target user's ID and encapsulating it according to the voice data to obtain request header information; and sending a request to the URL through the asynchronous server gateway interface framework based on the request header information to obtain the speech recognition result.

[0065] For example, FastAPI (an open-source interface framework) can be chosen as the asynchronous server gateway interface framework. Based on the offline service configuration file, the URL (Uniform Resource Locator) corresponding to the speech recognition model can be dynamically obtained, the target user's ID can be extracted, and this ID can be placed in the X-User-ID header information of the request forwarded to the speech recognition service. httpx.AsyncClient (a tool for implementing asynchronous communication) can be used to implement asynchronous speech recognition requests, forwarding speech data to the offline speech recognition model to obtain the corresponding speech recognition results. Furthermore, an error handling mechanism can be established in the returned data of the offline speech recognition model, such as speech recognition service not configured, speech recognition service call error, speech recognition timeout, and speech recognition response failure. Error messages and status codes can be returned when recognition fails.

[0066] In summary, by combining the asynchronous server gateway interface framework with the offline speech recognition model, the agent backend can process voice data more stably and efficiently, maintaining a good user experience and question-and-answer stability even under poor network conditions.

[0067] To improve the efficiency of question and answering in retail sales, optionally, sending voice data to the intelligent agent backend of retail sales includes: using a front-end scripting language to convert the voice data into a file of a preset format, encapsulating the file of the preset format into a form to obtain the form result; and using the Hypertext Transfer Protocol to send the form result to the intelligent agent backend.

[0068] Optionally, all voice and text data transmissions between the user frontend (i.e., the frontend page) and the intelligent agent backend, and between the intelligent agent backend and the private speech recognition service, shall use the Hypertext Transfer Protocol (HTTP). When voice data is sent from the user frontend to the intelligent agent backend, and when it is forwarded from the intelligent agent backend to the private speech recognition service, it is encapsulated in a preset format (the preset format can be multipart or form-data) to obtain form results, with the voice data serving as a field in the form results. The recognition results returned by the private speech recognition service to the intelligent agent backend, and by the intelligent agent backend to the frontend, can be in JSON format.

[0069] In summary, by converting voice data into preset formats and encapsulating it into forms using front-end scripting languages, data transmission speed and efficiency can be effectively improved, thereby enhancing the overall efficiency of Q&A in retail sales.

[0070] To improve the efficiency of Q&A in retail sales, optionally, inputting text data into the retail sales Q&A model includes: sending a Q&A request corresponding to the text data to the request interface of the retail sales Q&A model through the intelligent agent backend, and returning the text data to the front-end page through the intelligent agent backend.

[0071] Optionally, in existing technologies, the front-end is typically responsible for receiving text data input by the user, and then transmitting this data back to the back-end service, which in turn sends a request to the large model. However, in the question-answering method of this application embodiment, since the question-answering method of this application has a three-layer architecture—that is, the intelligent agent back-end acts as a data relay station for receiving voice data and calling the offline speech recognition model, and for receiving text data and accessing the retail sales question-answering large model interface—it possesses the aforementioned improved conditions. The intelligent agent back-end can simultaneously send data to the retail sales question-answering large model while receiving text data, and simultaneously return this text data to the front-end page. For example, the front-end page includes at least a text input area and a text send button. Simultaneously with sending the question-answering request, text data is sent to the front-end page through the intelligent agent back-end, and text data is filled in the text input area and the text send button is triggered to display the sent text data on the front-end page.

[0072] In summary, after obtaining the text data, simultaneously sending a request to the retail sales Q&A model and returning the text data to the front-end page through the intelligent agent backend can reduce the flow of text data, shorten the user's waiting time for the retail sales Q&A model to respond, and improve user experience and Q&A efficiency.

[0073] It should be noted that the steps shown in the flowchart in the accompanying drawings can be executed in a computer system such as a set of computer-executable instructions, and although a logical order is shown in the flowchart, in some cases the steps shown or described may be executed in a different order than that shown here.

[0074] Example 2

[0075] This application also provides a question-and-answer device. It should be noted that the question-and-answer device of this application can be used to execute the question-and-answer method provided in this application. The question-and-answer device provided in this application is described below.

[0076] According to an embodiment of this application, an apparatus for implementing the above-described question-and-answer method is also provided, applied to a retail sales system, such as... Figure 3 As shown, the device includes:

[0077] The voice acquisition unit 301 is used to receive voice data entered by the target user from the front-end page.

[0078] The speech recognition unit 302 is used to determine the corresponding text data based on the speech data.

[0079] The question-and-answer response unit 303 is used to input text data into the retail sales question-and-answer model, so as to use the retail sales question-and-answer model to output the response results corresponding to the text data.

[0080] The reply display unit 304 is used to send the reply result to the front-end page and display the reply result on the front-end page.

[0081] The question-and-answer device provided in this application embodiment receives voice data entered by a target user from a front-end page through a voice acquisition unit 301, determines the corresponding text data based on the voice data through a voice recognition unit 302, inputs the text data into a large-scale retail sales question-and-answer model through a question-and-answer response unit 303, outputs the response result corresponding to the text data using the large-scale retail sales question-and-answer model, and sends the response result to the front-end page through a response display unit 304, displaying the response result on the front-end page. This solves the problem of low question-and-answer efficiency in retail sales in related technologies, thereby improving the efficiency of question-and-answer in retail sales.

[0082] Optionally, in the question-and-answer device provided in this application embodiment, the voice recognition unit 302 includes: a data transmission module for sending voice data to the intelligent agent backend of the retail sales system, wherein the intelligent agent backend is deployed with an offline voice recognition model; and an offline recognition module for determining the text data corresponding to the voice data based on the offline voice recognition model.

[0083] Optionally, in the question-answering device provided in this application embodiment, the offline recognition module includes: a first recognition submodule, used to input voice data into an offline voice recognition model in the backend of the intelligent agent to obtain a voice recognition result corresponding to the voice data; a second recognition submodule, used to obtain a preset correction lexicon in the retail sales field and the ID of the target user, wherein the preset correction lexicon includes multiple sub-lexicons, different sub-lexicons correspond to different user IDs, and each sub-lexicon includes voice recognition words and corresponding domain-specific words; and a third recognition submodule, used to correct the voice recognition result according to the preset correction lexicon, so as to correct the voice recognition words in the voice recognition result to the corresponding domain-specific words, and determine the text data according to the correction result.

[0084] Optionally, in the question-answering device provided in this application embodiment, the sub-vocabulary further includes corresponding syntactic style identifiers, and the third identification sub-module includes: a syntactic matching component, used to perform matching in the sub-vocabulary based on the target user's ID to obtain the target syntactic style identifier corresponding to the target user's ID, wherein the types of the target syntactic style identifier include at least: inverted sentence style identifier, interrogative sentence style identifier, and idiom style identifier; a syntactic prompting component, used to determine the corresponding syntactic style prompt words based on the target syntactic style identifier; and a syntactic correction component, used to determine the text data based on the syntactic style prompt words and the correction results.

[0085] Optionally, in the question-answering device provided in this application embodiment, the first recognition submodule includes: a path selection component, used to read the Uniform Resource Locator corresponding to the offline speech recognition model through the offline service configuration file; a data encapsulation component, used to obtain the ID of the target user and encapsulate it according to the speech data to obtain request header information; and an asynchronous recognition component, used to send a request to the Uniform Resource Locator through the asynchronous server gateway interface framework according to the request header information to obtain the speech recognition result.

[0086] Optionally, in the question-and-answer device provided in this application embodiment, the data transmission module includes: a form encapsulation submodule, used to convert voice data into a file of a preset format using a front-end scripting language, and encapsulate the file of the preset format into a form to obtain a form result; and a protocol transmission submodule, used to send the form result to the intelligent agent backend using the Hypertext Transfer Protocol.

[0087] Optionally, in the question-and-answer device provided in this application embodiment, the question-and-answer response unit 303 includes: an intelligent agent processing module, used to send a question-and-answer request corresponding to text data to the request interface of the retail sales question-and-answer big model through the intelligent agent backend, and return the text data to the front-end page through the intelligent agent backend.

[0088] It should be noted that the aforementioned voice acquisition unit 301, voice recognition unit 302, question-and-answer response unit 303, and response display unit 304 correspond to steps S201 to S204 in Embodiment 1. The instances and application scenarios implemented by the units and corresponding steps are the same, but are not limited to the content disclosed in Embodiment 1. It should be noted that the aforementioned modules or units may be hardware or software components stored in a memory (e.g., memory 104) and processed by one or more processors (e.g., processors 102a, 102b, ..., 102n). The aforementioned modules may also be part of a device and can run in the computer terminal 10 provided in Embodiment 1.

[0089] Example 3

[0090] Embodiments of this application may provide an electronic device. Figure 4 This is a structural block diagram of an electronic device according to an embodiment of this application. Figure 4 As shown, the electronic device may include: one or more ( Figure 4 (Only one is shown) processor 1002, memory 1004, memory controller, and peripheral interface, wherein the peripheral interface is connected to the radio frequency module, audio module and display.

[0091] The memory can be used to store software programs and modules, such as the program instructions / modules corresponding to the methods and apparatus in the embodiments of this application. The processor executes various functional applications and data processing by running the software programs and modules stored in the memory, thereby implementing the above-described methods. The memory may include high-speed random access memory, and may also include non-volatile memory, such as one or more magnetic storage devices, flash memory, or other non-volatile solid-state memory. In some instances, the memory may further include memory remotely located relative to the processor, and these remote memories can be connected to the terminal via a network. Examples of such networks include, but are not limited to, the Internet, corporate intranets, local area networks, mobile communication networks, and combinations thereof.

[0092] The processor can access information and applications stored in the memory via a transmission device to perform the following steps: receiving voice data input by the target user from the front-end page; determining the corresponding text data based on the voice data; inputting the text data into a large-scale retail sales Q&A model to output the corresponding response results using the large-scale retail sales Q&A model; sending the response results to the front-end page and displaying the response results on the front-end page.

[0093] The processor can also call the information and application stored in the memory through the transmission device to perform the following steps: sending voice data to the intelligent agent backend of the retail sales system, wherein the intelligent agent backend is equipped with an offline speech recognition model; and determining the text data corresponding to the voice data based on the offline speech recognition model.

[0094] The processor can also access information and applications stored in the memory via a transmission device to perform the following steps: inputting voice data into the offline speech recognition model in the backend of the intelligent agent to obtain the speech recognition result corresponding to the voice data; obtaining a preset correction lexicon for the retail sales field and the ID of the target user, wherein the preset correction lexicon includes multiple sub-lexicons, different sub-lexicons correspond to different user IDs, and each sub-lexicon includes speech recognition words and corresponding domain-specific words; correcting the speech recognition result according to the preset correction lexicon to correct the speech recognition words in the speech recognition result to the corresponding domain-specific words, and determining the text data based on the correction result.

[0095] The processor can also call the information and application stored in the memory through the transmission device to perform the following steps: matching in the sub-lexicon according to the target user's ID to obtain the target syntactic style identifier corresponding to the target user's ID, wherein the types of target syntactic style identifiers include at least: inverted sentence style identifier, interrogative sentence style identifier, and idiom style identifier; determining the corresponding syntactic style prompt words according to the target syntactic style identifiers; and determining the text data according to the syntactic style prompt words and the correction results.

[0096] The processor can also access information and applications stored in memory via a transmission device to perform the following steps: read the Uniform Resource Locator (URL) corresponding to the offline speech recognition model through the offline service configuration file; obtain the target user's ID and encapsulate it according to the speech data to obtain request header information; send a request to the URL through the asynchronous server gateway interface framework based on the request header information to obtain the speech recognition result.

[0097] The processor can also call the information and application stored in the memory through the transmission device to perform the following steps: convert the voice data into a file of preset format using a front-end scripting language, encapsulate the file of preset format into a form to obtain the form result; and send the form result to the intelligent agent backend using the Hypertext Transfer Protocol.

[0098] The processor can also call the information and application stored in the memory through the transmission device to perform the following steps: send the question and answer request corresponding to the text data to the request interface of the retail sales question and answer model through the intelligent agent backend, and return the text data to the front-end page through the intelligent agent backend.

[0099] This application provides a question-and-answer solution. It receives voice data input from a target user on a front-end page; determines corresponding text data based on the voice data; inputs the text data into a large-scale retail sales question-and-answer model to output a response corresponding to the text data; and sends the response to the front-end page for display. This solves the technical problem of low efficiency in question-and-answer processes in retail sales in existing technologies.

[0100] Those skilled in the art will understand that Figure 4 The structure shown is for illustrative purposes only. Electronic devices can also be smartphones, tablets, handheld computers, mobile internet devices (MIDs), PADs, and other terminal devices. Figure 4 This does not limit the structure of the aforementioned electronic device. For example, electronic devices may also include components that are more... Figure 4 The more or fewer components shown (such as network interfaces, display devices, etc.), or having the same Figure 4 The different configurations shown.

[0101] Those skilled in the art will understand that all or part of the steps in the various methods of the above embodiments can be implemented by a program instructing the hardware related to the terminal device. The program can be stored in a computer-readable storage medium, which may include: flash drive, read-only memory (ROM), random access memory (RAM), disk or optical disk, etc.

[0102] Example 4

[0103] Embodiments of this application also provide a storage medium. Optionally, in this embodiment, the storage medium can be used to store the program code executed by the question-and-answer method provided in Embodiment 1.

[0104] Optionally, in this embodiment, the storage medium may be located in any computer terminal in a group of computer terminals in a computer network, or in any mobile terminal in a group of mobile terminals.

[0105] Optionally, in this embodiment, the computer-readable storage medium is configured to store program code for performing the following steps: receiving voice data input by the target user from the front-end page; determining the corresponding text data based on the voice data; inputting the text data into the retail sales Q&A model to output the response result corresponding to the text data using the retail sales Q&A model; sending the response result to the front-end page and displaying the response result on the front-end page.

[0106] Optionally, in this embodiment, the computer-readable storage medium is further configured to store program code for performing the following steps: sending voice data to the intelligent agent backend of the retail sales system, wherein the intelligent agent backend is equipped with an offline speech recognition model; and determining the text data corresponding to the voice data based on the offline speech recognition model.

[0107] Optionally, in this embodiment, the computer-readable storage medium is further configured to store program code for performing the following steps: inputting voice data into an offline speech recognition model in the backend of the intelligent agent to obtain a speech recognition result corresponding to the voice data; obtaining a preset correction lexicon and the ID of the target user in the retail sales field, wherein the preset correction lexicon includes multiple sub-lexicons, different sub-lexicons correspond to different user IDs, and each sub-lexicon includes a speech recognition word and a corresponding domain-specific word; correcting the speech recognition result according to the preset correction lexicon to correct the speech recognition words in the speech recognition result to the corresponding domain-specific words, and determining the text data according to the correction result.

[0108] Optionally, in this embodiment, the computer-readable storage medium is further configured to store program code for performing the following steps: matching in a sub-lexicon based on the target user's ID to obtain the target syntactic style identifier corresponding to the target user's ID, wherein the type of the target syntactic style identifier includes at least: inverted sentence style identifier, interrogative sentence style identifier, and idiom style identifier; determining the corresponding syntactic style prompt word based on the target syntactic style identifier; and determining the text data based on the syntactic style prompt word and the correction result.

[0109] Optionally, in this embodiment, the computer-readable storage medium is further configured to store program code for performing the following steps: reading the Uniform Resource Locator (URL) corresponding to the offline speech recognition model through the offline service configuration file; obtaining the ID of the target user and encapsulating it according to the speech data to obtain request header information; and sending a request to the URL through the asynchronous server gateway interface framework according to the request header information to obtain the speech recognition result.

[0110] Optionally, in this embodiment, the computer-readable storage medium is further configured to store program code for performing the following steps: converting voice data into a file of a preset format using a front-end scripting language, encapsulating the file of the preset format into a form to obtain a form result; and sending the form result to the intelligent agent backend using a hypertext transfer protocol.

[0111] Optionally, in this embodiment, the computer-readable storage medium is further configured to store program code for performing the following steps: sending a question-and-answer request corresponding to the text data to the request interface of the retail sales question-and-answer big model through the intelligent agent backend, and returning the text data to the front-end page through the intelligent agent backend.

[0112] The sequence numbers of the embodiments in this application are for descriptive purposes only and do not represent the superiority or inferiority of the embodiments.

[0113] In the above embodiments of this application, the descriptions of each embodiment have different focuses. For parts not described in detail in a certain embodiment, please refer to the relevant descriptions of other embodiments.

[0114] In the several embodiments provided in this application, it should be understood that the disclosed technical content can be implemented in other ways. The device embodiments described above are merely illustrative; for example, the division of units is only a logical functional division, and in actual implementation, there may be other division methods. For example, multiple units or components may be combined or integrated into another system, or some features may be ignored or not executed. Furthermore, the displayed or discussed mutual coupling, direct coupling, or communication connection may be through some interfaces; the indirect coupling or communication connection between units or modules may be electrical or other forms.

[0115] The units described as separate components may or may not be physically separate. The components shown as units may or may not be physical units; that is, they may be located in one place or distributed across multiple network units. Some or all of the units can be selected to achieve the purpose of this embodiment according to actual needs.

[0116] Furthermore, the functional units in the various embodiments of this application can be integrated into one processing unit, or each unit can exist physically separately, or two or more units can be integrated into one unit. The integrated unit can be implemented in hardware or as a software functional unit.

[0117] If the integrated unit is implemented as a software functional unit and sold or used as an independent product, it can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of this application, in essence, or the part that contributes to the prior art, or all or part of the technical solution, can be embodied in the form of a software product. This computer software product is stored in a storage medium and includes several instructions to cause a computer device (which may be a personal computer, server, or network device, etc.) to execute all or part of the steps of the methods described in the various embodiments of this application. The aforementioned storage medium includes various media capable of storing program code, such as USB flash drives, read-only memory (ROM), random access memory (RAM), portable hard drives, magnetic disks, or optical disks.

[0118] The above description is only a preferred embodiment of this application. It should be noted that for those skilled in the art, several improvements and modifications can be made without departing from the principle of this application, and these improvements and modifications should also be considered within the scope of protection of this application.

Claims

1. A question-and-answer method, characterized in that, Applied to a retail sales system, the method includes: Receive voice data recorded by the target user from the front-end page; The corresponding text data is determined based on the voice data; The text data is input into the retail sales Q&A model to output the corresponding response results. The response result is sent to the front-end page and displayed on the front-end page.

2. The method according to claim 1, characterized in that, Determining the corresponding text data based on the voice data includes: The voice data is sent to the intelligent agent backend of the retail sales system, wherein the intelligent agent backend is equipped with an offline voice recognition model; The text data corresponding to the speech data is determined based on the offline speech recognition model.

3. The method according to claim 2, characterized in that, The text data corresponding to the speech data determined based on the offline speech recognition model includes: The voice data is input into the offline voice recognition model in the backend of the intelligent agent to obtain the voice recognition result corresponding to the voice data. Obtain a preset modified word library for the retail sales field and the ID of the target user. The preset modified word library includes multiple sub-word libraries, and different sub-word libraries correspond to different user IDs. Each sub-word library includes speech recognition words and corresponding domain-specific words. The speech recognition result is corrected according to the preset correction lexicon to correct the speech recognition words in the speech recognition result to the corresponding domain-specific words, and the text data is determined according to the correction result.

4. The method according to claim 3, characterized in that, The sub-lexicon also includes corresponding syntactic style identifiers, and the text data determined based on the correction results includes: The target user's ID is matched in the sub-lexicon to obtain the target syntax style identifier corresponding to the target user's ID. The types of the target syntax style identifier include at least: inverted sentence style identifier, interrogative sentence style identifier, and idiom style identifier. Determine the corresponding syntax style cue words based on the target syntax style identifier; The text data is determined based on the syntactic style cue words and the correction results.

5. The method according to claim 3, characterized in that, The speech data is input into the offline speech recognition model in the backend of the intelligent agent to obtain the speech recognition result corresponding to the speech data, including: Read the Uniform Resource Locator (URL) corresponding to the offline speech recognition model through the offline service configuration file; Obtain the ID of the target user and encapsulate it according to the voice data to obtain request header information; Based on the request header information, a request is sent to the Uniform Resource Locator through the asynchronous server gateway interface framework to obtain the speech recognition result.

6. The method according to claim 2, characterized in that, Sending the voice data to the intelligent agent backend for retail sales includes: The voice data is converted into a file of a preset format using a front-end scripting language, and the file of the preset format is encapsulated into a form to obtain the form result; The form results are sent to the backend of the intelligent agent using the Hypertext Transfer Protocol.

7. The method according to claim 2, characterized in that, Inputting the text data into the retail sales Q&A model includes: The intelligent agent backend sends the question and answer request corresponding to the text data to the request interface of the retail sales question and answer model, and then returns the text data to the front-end page through the intelligent agent backend.

8. A question-and-answer device, characterized in that, The device, used in a retail sales system, includes: The voice acquisition unit is used to receive voice data entered by the target user from the front-end page; A speech recognition unit is used to determine the corresponding text data based on the speech data; The question-and-answer response unit is used to input the text data into the retail sales question-and-answer model, and to use the retail sales question-and-answer model to output the response result corresponding to the text data. The reply display unit is used to send the reply result to the front-end page and display the reply result on the front-end page.

9. A computer-readable storage medium, characterized in that, The computer-readable storage medium includes a stored executable program, wherein, when the executable program is executed, it controls the device on which the computer-readable storage medium is located to perform the question-and-answer method according to any one of claims 1 to 7.

10. An electronic device, characterized in that, include: Memory, which stores executable programs; A processor for running the program, wherein the program, when running, performs the question-and-answer method according to any one of claims 1 to 7.

Citation Information

Patent Citations

  • Intelligent voice interaction implementation methods and devices, computer equipment, and storage medium

    CN108711423A

  • Voice conversation method and device, and computer readable storage medium

    CN111986675A

  • Processing equipment and processing method for ASR result replacement in natural language processing

    CN113674743A

  • Response method and device for voice problem, electronic equipment and storage medium

    CN117037795A

  • Retail customer service response method and retail customer service system

    CN119397070A