Live broadcast bullet screen real-time interaction method and device, electronic equipment and storage medium
The live barrage is processed through whitelists, blacklists and large language models, and the problems of poor interaction and low flexibility of barrage in the existing technology are solved, flexible processing of diversified barrage and accurate identification of audience intentions are achieved, and the interactiveness and audience experience of live broadcasts are improved.
Patent Information
- Application Number
- CN202510163145.1
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-02-14
- Publication Date
- 2025-05-13
AI Technical Summary
The existing live barrage interaction methods rely on RPA technology and cannot accurately identify the audience's true intentions, which have problems with poor interaction and low flexibility.
The pre-saved whitelist and blacklist match the audience barrage. The compliant barrage uses the whitelist to reply, the illegal barrage does not reply, and the unmatched barrage uses a large language model to generate the reply content.
It realizes flexible processing of diversified barrage, accurately identify audience intentions, and improves the interactivity of live broadcasts and the viewing experience of the audience.
Smart Images

Figure CN119996776A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of live broadcast technology, and in particular to a method, device, electronic device and storage medium for real-time interaction of live broadcast bullet screen. Background Art
[0002] With the rapid development of mobile Internet and the popularization of 5G networks, live broadcasting has become an important channel for brand promotion and online customer acquisition. Live broadcasting scenes are usually "one-to-many" interactive modes, that is, one anchor faces multiple viewers. This mode makes it difficult for anchors to cope with the real-time interactive needs of a large number of viewers within a limited time, so this has gradually become a major challenge for the development of the live broadcast industry.
[0003] At present, the commonly used live broadcast barrage interaction methods mostly rely on RPA (Robotic Process Automation) technology, which mainly screens and replies to audience barrages through keyword matching. However, this method cannot accurately identify the audience's true intentions, and has problems such as poor interactivity and low flexibility. Summary of the invention
[0004] In view of this, an object of the present invention is to provide a method, device, electronic device and storage medium for real-time interaction of live broadcast barrage.
[0005] In order to achieve the above purpose, the technical solution adopted by the embodiment of the present invention is as follows:
[0006] In a first aspect, the present invention provides a live broadcast barrage real-time interactive method, which is applied to an electronic device, wherein the electronic device pre-stores a whitelist and a blacklist, wherein the whitelist includes a plurality of compliant keywords and their corresponding words, and the blacklist includes a plurality of illegal keywords, and the method includes:
[0007] Obtaining the barrage sent by viewers in the live broadcast room in real time to obtain the barrage to be processed, and matching the barrage to be processed with the whitelist and the blacklist respectively;
[0008] If the barrage to be processed matches the compliant keywords in the whitelist, the barrage to be processed is determined to be a compliant barrage, and based on the words in the whitelist, the reply content corresponding to the barrage to be processed is obtained and replied;
[0009] If the barrage to be processed matches the illegal keywords in the blacklist, the barrage to be processed is determined to be an illegal barrage, and it is determined not to reply to the barrage to be processed;
[0010] If the barrage to be processed does not match the whitelist and the blacklist, a preset large language model is used to generate reply content corresponding to the barrage to be processed and a reply is made.
[0011] In an optional embodiment, the method further comprises:
[0012] According to the preset time interval, the preset promotional barrage is regularly obtained and sent in the live broadcast room.
[0013] In an optional implementation, the step of obtaining the reply content corresponding to the to-be-processed bullet screen based on the words in the whitelist and replying includes:
[0014] From all the words in the whitelist, obtain the words corresponding to the compliant keywords matching the barrage to be processed to obtain the target words;
[0015] The target words are used as the reply content corresponding to the barrage to be processed and a reply is made, or a first prompt word is constructed based on the target words and the character setting of the live broadcast assistant, and the large language model is used to generate the reply content corresponding to the barrage to be processed according to the first prompt word and a reply is made; wherein the language style of the reply content matches the character setting of the live broadcast assistant.
[0016] In an optional implementation manner, the electronic device further pre-stores an interactive knowledge base, the interactive knowledge base comprising a plurality of interactive templates, each interactive template comprising a question and an answer and a vector corresponding to the question;
[0017] The step of using a preset large language model to generate reply content corresponding to the to-be-processed bullet screen and replying includes:
[0018] Using the large language model to vectorize the barrage to be processed, to obtain a vector corresponding to the barrage to be processed;
[0019] According to the vector corresponding to the barrage to be processed and the vector corresponding to the question in each interactive template, each target interactive template matching the barrage to be processed is determined, and the answer in each target interactive template is obtained to obtain each target answer;
[0020] The large language model is used to generate reply content corresponding to the pending barrage based on all target answers and then reply is made.
[0021] In an optional implementation, the step of using the large language model to generate reply content corresponding to the to-be-processed bullet screen based on all target answers and replying includes:
[0022] Based on all target answers and the character settings of the live broadcast assistant, construct the second prompt word;
[0023] The large language model is used to generate reply content corresponding to the barrage to be processed according to the second prompt word and a reply is made; wherein the language style of the reply content matches the character setting of the live broadcast assistant.
[0024] In an optional implementation manner, the interactive knowledge base is established in the following manner:
[0025] Store the interaction strategies and product information set by users to obtain a basic knowledge base;
[0026] According to the basic knowledge base, generating multiple pairs of questions and answers;
[0027] Vectorize each question using the large language model to obtain a vector corresponding to each question;
[0028] For each question, the question, its answer and the vector corresponding to the question are used as an interaction template to obtain each interaction template;
[0029] All interaction templates are stored to obtain the interaction knowledge base.
[0030] In an optional embodiment, the method further comprises:
[0031] monitoring the interaction strategy and the product information;
[0032] When the interaction strategy and / or the product information is updated, the basic knowledge base is updated to obtain an updated basic knowledge base;
[0033] The interactive templates in the interactive knowledge base are updated according to the updated basic knowledge base.
[0034] In a second aspect, the present invention provides a live broadcast barrage real-time interactive device, which is applied to an electronic device, wherein the electronic device pre-stores a whitelist and a blacklist, wherein the whitelist includes a plurality of compliant keywords and their corresponding words, and the blacklist includes a plurality of illegal keywords, and the device includes:
[0035] A matching module, used for acquiring the bullet comments sent by the audience in the live broadcast room in real time to obtain the bullet comments to be processed, and matching the bullet comments to be processed with the white list and the black list respectively;
[0036] The first interactive module is used to determine that the barrage to be processed is a compliant barrage if the barrage to be processed matches the compliant keywords in the whitelist, and obtain the reply content corresponding to the barrage to be processed based on the words in the whitelist and reply;
[0037] If the barrage to be processed matches the illegal keywords in the blacklist, the barrage to be processed is determined to be an illegal barrage, and it is determined not to reply to the barrage to be processed;
[0038] The second interactive module is used to generate reply content corresponding to the barrage to be processed by using a preset large language model and make a reply if the barrage to be processed does not match the white list and the black list.
[0039] In a third aspect, the present invention provides an electronic device comprising a processor and a memory, wherein the memory stores a computer program, and when the processor executes the computer program, the live broadcast barrage real-time interactive method described in any one of the aforementioned embodiments is implemented.
[0040] In a fourth aspect, the present invention provides a storage medium having a computer program stored thereon. When the computer program is executed by a processor, the live broadcast barrage real-time interactive method described in any one of the aforementioned embodiments is implemented.
[0041] The method, device, electronic device and storage medium for real-time interaction of live barrage provided by the embodiment of the present invention include: obtaining the barrage sent by the audience in the live broadcast room in real time to obtain the barrage to be processed, and matching the barrage to be processed with the white list and the black list respectively; if the barrage to be processed matches the compliant keywords in the white list, the barrage to be processed is determined to be a compliant barrage, and based on the words in the white list, the reply content corresponding to the barrage to be processed is obtained and replied; if the barrage to be processed matches the illegal keywords in the black list, the barrage to be processed is determined to be an illegal barrage, and it is determined not to reply to the barrage to be processed; if the barrage to be processed does not match both the white list and the black list, the reply content corresponding to the barrage to be processed is generated by using a preset large language model and replied. The barrage sent by the audience is processed through the white list, the black list and the large language model, thereby realizing the flexible processing of diversified barrages, and being able to accurately identify the audience's intentions to make targeted replies, improving the interactivity of the live broadcast, and enhancing the audience's live viewing experience.
[0042] In order to make the above-mentioned objects, features and advantages of the present invention more obvious and easy to understand, preferred embodiments are given below and described in detail with reference to the accompanying drawings. BRIEF DESCRIPTION OF THE DRAWINGS
[0043] In order to more clearly illustrate the technical solutions of the embodiments of the present invention, the drawings required for use in the embodiments are briefly introduced below. It should be understood that the following drawings only show certain embodiments of the present invention and therefore should not be regarded as limiting the scope. For ordinary technicians in this field, other related drawings can be obtained based on these drawings without creative work.
[0044] Figure 1 A block diagram of an electronic device provided by an embodiment of the present invention is shown;
[0045] Figure 2 A schematic diagram showing the flow of a live broadcast barrage real-time interactive method provided by an embodiment of the present invention;
[0046] Figure 3 A schematic diagram of a process for establishing an interactive knowledge base provided by an embodiment of the present invention is shown;
[0047] Figure 4 A functional module diagram of a live broadcast barrage real-time interactive device provided by an embodiment of the present invention is shown.
[0048] Icons: 100 - electronic device; 110 - bus; 120 - processor; 130 - memory; 150 - I / O module; 170 - communication module; 300 - live broadcast barrage real-time interactive device; 310 - matching module; 330 - first interactive module; 350 - second interactive module; 370 - establishment module. DETAILED DESCRIPTION
[0049] The following will be combined with the accompanying drawings in the embodiments of the present invention to clearly and completely describe the technical solutions in the embodiments of the present invention. Obviously, the described embodiments are only part of the embodiments of the present invention, not all of the embodiments. Generally, the components of the embodiments of the present invention described and shown in the drawings here can be arranged and designed in various different configurations.
[0050] Therefore, the following detailed description of the embodiments of the present invention provided in the accompanying drawings is not intended to limit the scope of the invention claimed for protection, but merely represents selected embodiments of the present invention. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without making creative work are within the scope of protection of the present invention.
[0051] It should be noted that relational terms such as "first" and "second" are used only to distinguish one entity or operation from another entity or operation, and do not necessarily require or imply any such actual relationship or order between these entities or operations. Moreover, the terms "include", "comprise" or any other variants thereof are intended to cover non-exclusive inclusion, so that a process, method, article or device including a series of elements includes not only those elements, but also other elements not explicitly listed, or also includes elements inherent to such process, method, article or device. In the absence of further restrictions, the elements defined by the sentence "comprise a ..." do not exclude the existence of other identical elements in the process, method, article or device including the elements.
[0052] With the rapid development of mobile Internet and the popularization of 5G networks, live broadcasting has become an important channel for brand promotion and online customer acquisition. Live broadcasting scenes are usually "one-to-many" interactive modes, that is, one anchor faces multiple viewers. This mode makes it difficult for anchors to cope with the real-time interactive needs of a large number of viewers within a limited time, so this has gradually become a major challenge for the development of the live broadcast industry.
[0053] At present, the commonly used live broadcast barrage interaction methods mostly rely on RPA (Robotic Process Automation) technology, which mainly screens and responds to audience barrages through keyword matching. However, this method has the following problems: (1) Insufficient context understanding: The existing keyword matching method lacks the ability to understand the context, and it is difficult to accurately identify the true intentions of the audience's complex expressions, which is prone to misjudgment or omissions. For barrage information without pre-set keywords, it is impossible to make an effective response, which affects the interaction efficiency and audience satisfaction. (2) Rigid process: The existing RPA technology usually follows preset fixed rules and is difficult to adjust according to the real-time changing barrage content. When faced with a variety of barrages, this rigid response method is not flexible enough. (3) Lack of pertinence: The existing solutions mostly use general keywords and standardized response templates, and fail to combine the specific business characteristics, brand image and industry knowledge of the merchant. This results in the response content often lacking pertinence and failing to reflect the uniqueness and professional level of the merchant. Therefore, the embodiment of the present invention provides a real-time interactive method for live broadcast barrage to solve the above problems.
[0054] See also Figure 1 , is a block diagram of an electronic device provided by an embodiment of the present invention. The electronic device 100 includes a bus 110 , a processor 120 , a memory 130 , an I / O module 150 , and a communication module 170 .
[0055] The bus 110 is a circuit that connects the above elements to each other and transmits signals between the above elements.
[0056] The processor 120 can receive commands from the above-mentioned other elements (such as the memory 130, the I / O module 150, the communication module 170, etc.) through the bus 110, can interpret the received commands, and can perform calculations or data processing according to the interpreted commands. The processor 120 can be an integrated circuit chip with signal processing capabilities. The processor 120 can be a general-purpose processor, including a central processing unit (CPU), a network processor (NP), etc.; it can also be a digital signal processor (DSP), an application-specific integrated circuit (ASIC), a field-programmable gate array (FPGA) or other programmable logic devices, discrete gates or transistor logic devices, discrete hardware components.
[0057] The memory 130 may store commands or data received from the processor 120 or other components (e.g., the I / O module 150, the communication module 170, etc.) or commands or data generated by the processor 120 or other components. The memory 130 may be, but is not limited to, a random access memory (RAM), a read only memory (ROM), a programmable read-only memory (PROM), an erasable programmable read-only memory (EPROM), or an electrically erasable read-only memory (EEPROM).
[0058] The I / O module 150 may receive commands or data input from a user via input-output means (e.g., a sensor, a keyboard, a touch screen, etc.), and may transmit the received commands or data to the processor 120 or the memory 130 via the bus 110. It is also used to display various information (e.g., multimedia data, text data) received, stored, and processed from the above elements, and may display videos, images, data, etc. to the user.
[0059] The communication module 170 may be used to communicate signals or data with other devices.
[0060] Understandably, Figure 1 The structure shown is only a schematic diagram of the structure of the electronic device 100. The electronic device 100 may also include Figure 1 More or fewer components as shown, or with Figure 1 Different configurations shown. Figure 1 Each component shown in the figure can be implemented by hardware, software or a combination thereof.
[0061] The above-mentioned electronic device 100 will be used as an execution subject to execute each step in each method provided in the embodiment of the present invention and achieve corresponding technical effects.
[0062] See also Figure 2 , is a flow chart of the real-time interactive method of live broadcast barrage provided by an embodiment of the present invention.
[0063] Step S202, obtaining the barrage sent by the audience in the live broadcast room in real time to obtain the barrage to be processed, and matching the barrage to be processed with the white list and the black list respectively.
[0064] Step S204: If the barrage to be processed matches the compliant keywords in the whitelist, the barrage to be processed is determined to be a compliant barrage, and based on the words in the whitelist, the reply content corresponding to the barrage to be processed is obtained and replied.
[0065] Step S206: If the barrage to be processed matches the illegal keywords in the blacklist, the barrage to be processed is determined to be an illegal barrage, and it is determined not to reply to the barrage to be processed.
[0066] Step S208: If the barrage to be processed does not match the whitelist and the blacklist, a preset large language model is used to generate reply content corresponding to the barrage to be processed and a reply is made.
[0067] In this embodiment, the electronic device pre-stores a whitelist and a blacklist, the whitelist includes multiple compliant keywords and their corresponding words, and the blacklist includes multiple illegal keywords. Then, during the live broadcast, a pre-set bullet screen capture script can be run to obtain the bullet screens sent by viewers in the live broadcast room in real time, and these bullet screens are cleaned to ensure the accuracy of the data to obtain each bullet screen to be processed.
[0068] It is understandable that the processing method of each barrage to be processed in the embodiment of the present invention is similar. For the sake of brief description, an example of a barrage to be processed is used below for explanation. For example, the barrage to be processed is matched with the whitelist and the blacklist respectively to determine whether the barrage to be processed is compliant, and different methods are used to process it according to the judgment result. If the barrage to be processed matches the compliant keywords in the whitelist, it means that the barrage to be processed is a compliant barrage, and then the reply content corresponding to the barrage to be processed will be obtained based on the words in the whitelist.
[0069] If the pending barrage matches the illegal keywords in the blacklist, such as the pre-configured sensitive words, it means that the pending barrage is an illegal barrage, and the pending barrage will not be replied. For example, if the pending barrage is "The anchor is cheating", and the pending barrage matches the illegal keyword "cheating" in the blacklist, it is determined that the pending barrage is an illegal barrage, and the reply content corresponding to the pending barrage will not be generated, and the pending barrage will not be replied.
[0070] If the pending barrage does not match the whitelist or the blacklist, it means that the pre-configured words cannot be used to reply to the pending barrage. Then the preset large language model will be used to generate the reply content corresponding to the pending barrage.
[0071] Next, after generating the reply content corresponding to each pending bullet comment, each reply content will be stored in the queue to be sent. And from the queue to be sent, each reply content is obtained in turn and sent to the live broadcast room as a bullet comment to reply to each pending bullet comment. For example, the reply content can be sent to the live broadcast room in turn through a pre-set bullet comment reply script, such as through the web console interface of the live broadcast platform or an RPA automation script.
[0072] It can be understood that the embodiment of the present invention processes the barrage sent by the audience through a whitelist, a blacklist and a large language model, thereby achieving flexible processing of diverse barrages and being able to accurately identify the audience's intentions to make targeted replies, thereby improving the interactivity of the live broadcast and enhancing the audience's live viewing experience.
[0073] It can be seen that based on the above steps, the barrage sent by the audience in the live broadcast room is obtained in real time to obtain the barrage to be processed, and the barrage to be processed is matched with the whitelist and blacklist respectively; if the barrage to be processed matches the compliant keywords in the whitelist, the barrage to be processed is determined to be a compliant barrage, and based on the words in the whitelist, the reply content corresponding to the barrage to be processed is obtained and replied; if the barrage to be processed matches the illegal keywords in the blacklist, the barrage to be processed is determined to be an illegal barrage, and it is determined not to reply to the barrage to be processed; if the barrage to be processed does not match both the whitelist and the blacklist, the preset large language model is used to generate the reply content corresponding to the barrage to be processed and reply. The barrage sent by the audience is processed through the whitelist, blacklist and large language model, thereby realizing the flexible processing of diversified barrages, and being able to accurately identify the audience's intentions to make targeted replies, improving the interactivity of the live broadcast and enhancing the audience's live viewing experience.
[0074] Optionally, after step S208, an embodiment of the present invention provides a possible implementation manner.
[0075] Step S210, regularly obtain preset promotional barrages at preset time intervals, and send the promotional barrages in the live broadcast room.
[0076] In this embodiment, during the live broadcast, a pre-set bullet screen carousel script can be used to regularly obtain preset promotional bullet screens at preset time intervals and send these promotional bullet screens in the live broadcast room. In this way, during the live broadcast, relevant information or promotional content can be pushed to the audience at regular intervals, thereby enhancing the interactivity and promotional effect of the live broadcast.
[0077] Optionally, for the process of obtaining the reply content corresponding to the barrage to be processed and replying based on the words in the whitelist in step S204, an embodiment of the present invention provides a possible implementation method.
[0078] Step S204-1, from all the words in the whitelist, obtain the words corresponding to the compliant keywords that match the barrage to be processed, and obtain the target words;
[0079] Step S204-3, taking the target speech as the reply content corresponding to the barrage to be processed and replying.
[0080] Step S204-5, construct a first prompt word based on the target speech and the character setting of the live broadcast assistant, and use the large language model to generate reply content corresponding to the barrage to be processed according to the first prompt word and reply; wherein the language style of the reply content matches the character setting of the live broadcast assistant.
[0081] In this embodiment, if the barrage to be processed is a compliant barrage, then the words corresponding to the compliant keywords matching the barrage to be processed are obtained from all the words in the whitelist to obtain the target words.
[0082] For example, if the pending barrage is "This product looks good", and the pending barrage matches the compliant keyword "product interest" in the whitelist, then the pending barrage is determined to be a compliant barrage. Then, the corresponding words of the compliant keyword "product interest" are obtained from all the words in the whitelist, and the target words such as "Leave a message, more discounts are waiting for you" are obtained. Then the target words can be directly used as the reply content corresponding to the pending barrage for reply. That is, the target words "Leave a message, more discounts are waiting for you" are directly used as the reply content and sent to the live broadcast room in the form of a barrage to reply to the pending barrage "This product looks good".
[0083] Optionally, the embodiment of the present invention may also pre-set the character setting of the live broadcast assistant, and optimize the reply content based on the character setting, so as to reflect the brand characteristics of the merchant through the language style and interaction style of the character setting, thereby increasing the enthusiasm of the audience to participate in the live broadcast.
[0084] For example, the character setting of the live broadcast assistant can be a live broadcast assistant or a gold medal salesperson. The live broadcast assistant is set as a young and cute assistant who guides customers to keep information with cute words, which makes it difficult for people to refuse. The gold medal salesperson is set as a salesperson with the highest sales volume in the store, who has rich sales skills, can answer questions for customers, and guide customers to keep information. It is understandable that the character setting of the live broadcast assistant can be set according to the actual situation, and the embodiment of the present invention does not limit this.
[0085] For ease of understanding, the following example uses the target wording of "Leave a message, more discounts are waiting for you" and the character setting of the live assistant as an example. First, based on the target wording of "Leave a message, more discounts are waiting for you" and the character setting of the live assistant, construct the first prompt word. For example, the target wording, the introduction of the character setting, and the preset guide sentence can be spliced together to get the first prompt word; or the language requirements corresponding to the character setting can be obtained, and then spliced with the target wording and the preset guide sentence to get the first prompt word.
[0086] Then the first prompt word is input into the large language model, and the large language model is used to generate the reply content corresponding to the barrage to be processed. For example, the generated reply content is "Hi~ Dear friend, seeing that you are so interested in our products, the assistant is so happy! Leave your contact information, more surprises and discounts are waiting for you", then the reply content is sent to the live broadcast room in the form of a barrage to reply to the barrage to be processed "This product looks good". In this way, the dialogue technique is optimized to make the reply content have a specific language style, thereby improving the naturalness and intimacy of the live broadcast interaction.
[0087] Optionally, for the process of using a preset large language model to generate reply content corresponding to the barrage to be processed and replying in step S208, an embodiment of the present invention provides a possible implementation method.
[0088] Step S208-1, use the large language model to vectorize the bullet comments to be processed, and obtain a vector corresponding to the bullet comments to be processed.
[0089] Step S208-3, based on the vector corresponding to the barrage to be processed and the vector corresponding to the question in each interactive template, determine each target interactive template that matches the barrage to be processed, and obtain the answer in each target interactive template to obtain each target answer.
[0090] Step S208-5, using the large language model based on all target answers, generate the reply content corresponding to the barrage to be processed and reply.
[0091] In this embodiment, the electronic device also pre-stores an interactive knowledge base, which includes a plurality of interactive templates, each of which includes a question and an answer as well as a vector corresponding to the question.
[0092] If the barrage to be processed does not match the whitelist or the blacklist, the large language model is used to generate the corresponding reply content. That is, the large language model is used to vectorize the barrage to be processed to obtain the vector corresponding to the barrage to be processed, and the dimension of the vector is 1536.
[0093] Then, based on the vector corresponding to the barrage to be processed and the vector corresponding to the question in each interactive template, the similarity between the barrage to be processed and the question in each interactive template is calculated, and the k interactive templates with the highest similarity, such as the three questions, are used as target interactive templates, and k target interactive templates are obtained. Then, the answer in each target interactive template is obtained, and k target answers are obtained.
[0094] Then, the large language model is used to generate the reply content corresponding to the barrage to be processed based on all the target answers, and the reply content is sent to the live broadcast room in the form of barrage to reply to the barrage to be processed. It should be understood that the number of target answers obtained can be set according to the actual situation, and the embodiment of the present invention does not limit this.
[0095] Optionally, for step S208-5, an embodiment of the present invention provides a possible implementation method.
[0096] Step S208-5-1, construct a second prompt word based on all target answers and the character settings of the live broadcast assistant.
[0097] Step S208-5-3, using the large language model to generate reply content corresponding to the barrage to be processed according to the second prompt word and reply; wherein the language style of the reply content matches the character setting of the live broadcast assistant.
[0098] In this embodiment, based on all the target answers obtained, the second prompt word can be constructed in combination with the character setting of the live assistant. For example, all the target answers, the introduction of the character setting and the preset guide sentence can be spliced together to obtain the second prompt word; or the language requirements corresponding to the character setting can be obtained and spliced together with all the target answers and the preset guide sentence to obtain the second prompt word.
[0099] Then the second prompt word is input into the large language model, and the large language model is used to generate the reply content corresponding to the barrage to be processed. In this way, the target answer is integrated and optimized through the large language module, so that the reply content has a specific language style, thereby improving the naturalness and intimacy of the live interaction.
[0100] Optionally, for the above interactive knowledge base, the embodiment of the present invention also provides an implementation method for establishing an interactive knowledge base, please refer to Figure 3 , is a flow chart of establishing an interactive knowledge base provided by an embodiment of the present invention.
[0101] Step S210, storing the interaction strategy and product information set by the user to obtain a basic knowledge base.
[0102] Step S212, generating multiple pairs of questions and answers based on the basic knowledge base.
[0103] Step S214: vectorize each question using the large language model to obtain a vector corresponding to each question.
[0104] Step S216: for each question, the question, its answer and the vector corresponding to the question are taken as an interactive template to obtain each interactive template.
[0105] Step S218, storing all interactive templates to obtain an interactive knowledge base.
[0106] In this embodiment, the interaction strategy and product information set by the user can be obtained. The product information includes the price information and inventory information of the product. The interaction strategy includes service strategy, marketing strategy, etc., that is, it includes the answer strategy corresponding to multiple questions set by the user, such as: whether to send the store address when asking about the store location, whether to send the phone number when asking about the store's contact number, how to reply when asking about the store's installment policy, how to reply when asking whether there are any discount activities, how to reply when asking about product prices or inventory, etc.
[0107] The interaction strategy and product information set by the user are stored, for example, in a MySQL database, to obtain a basic knowledge base. The basic knowledge base can be understood as a corpus material library used to generate reply content. Then, based on the interaction strategy in the basic knowledge base and combined with product information, multiple pairs of questions and answers can be generated. Each question is then input into the large language model, and each question is vectorized using the large language model to obtain a vector corresponding to each question, and the dimension of the vector corresponding to each question is 1536.
[0108] Then, for each question, the question, its answer, and the vector corresponding to the question are used as an interactive template. Based on multiple questions, multiple interactive templates can be obtained. Finally, all interactive templates are stored to obtain an interactive knowledge base. It is understandable that since databases such as Elastic Search have powerful full-text search capabilities and can achieve efficient data retrieval and analysis, Elastic Search can be used as an interactive knowledge base.
[0109] Optionally, after step S218, an embodiment of the present invention provides a possible implementation method.
[0110] Step S220, monitoring interaction strategies and product information.
[0111] Step S222: when the interaction strategy and / or product information update is monitored, the basic knowledge base is updated to obtain an updated basic knowledge base.
[0112] Step S224, updating the interactive templates in the interactive knowledge base according to the updated basic knowledge base.
[0113] It is understandable that, in order to ensure the accuracy of the reply content, the embodiment of the present invention will also monitor the interactive strategy and product information to facilitate the updating of the basic knowledge base and the interactive knowledge base.
[0114] In this embodiment, the interaction strategy and product information can be monitored by a pre-set monitoring script. When the interaction strategy and / or product information is updated, the basic knowledge base is updated to obtain an updated basic knowledge base. Then, a data synchronization tool such as a CDC tool is used to update the interaction template in the interaction knowledge base based on the updated basic knowledge base.
[0115] For example, if the answer strategy corresponding to a question is modified, the answer in the corresponding interaction template is updated. If there are new questions and their corresponding answer strategies, new questions and answers are generated, and after the new questions are vectorized using the large language model, the new questions and answers are combined with the vector of the new questions to form a new interaction template and stored in the interaction knowledge base. This ensures that the interaction template is consistent with the latest interaction strategy and product information, thereby ensuring the real-time and effectiveness of the interaction.
[0116] In order to execute the corresponding steps in the above embodiments and various possible methods, a method for implementing a live broadcast barrage real-time interactive device is given below. Figure 4 , is a functional module diagram of a live broadcast barrage real-time interactive device provided by an embodiment of the present invention. It should be noted that the basic principle and technical effects of the live broadcast barrage real-time interactive device 300 provided by this embodiment are the same as those of the above embodiment. For the sake of brief description, for the parts not mentioned in this embodiment, reference can be made to the corresponding contents in the above embodiment. The live broadcast barrage real-time interactive device 300 includes:
[0117] The matching module 310 is used to obtain the barrage sent by the audience in the live broadcast room in real time to obtain the barrage to be processed, and match the barrage to be processed with the white list and the black list respectively.
[0118] The first interactive module 330 is used to determine that the barrage to be processed is a compliant barrage if it matches the compliant keywords in the whitelist, and obtain the reply content corresponding to the barrage to be processed based on the words in the whitelist and reply; if the barrage to be processed matches the illegal keywords in the blacklist, it is determined that the barrage to be processed is an illegal barrage, and it is determined not to reply to the barrage to be processed.
[0119] The second interactive module 350 is used to generate reply content corresponding to the barrage to be processed by using a preset large language model and make a reply if the barrage to be processed does not match the white list and the black list.
[0120] Optionally, the first interactive module 330 is also used to: regularly obtain preset promotional barrages at preset time intervals, and send the promotional barrages in the live broadcast room.
[0121] Optionally, the first interactive module 330 is also used to: obtain the words corresponding to the compliant keywords matching the barrage to be processed from all the words in the whitelist to obtain the target words; use the target words as the reply content corresponding to the barrage to be processed and reply, or, construct a first prompt word based on the target words and the character setting of the live broadcast assistant, and use the large language model to generate the reply content corresponding to the barrage to be processed according to the first prompt word and reply; wherein the language style of the reply content matches the character setting of the live broadcast assistant.
[0122] Optionally, the second interactive module 350 is also used to: use the large language model to vectorize the barrage to be processed to obtain the vector corresponding to the barrage to be processed; determine each target interactive template that matches the barrage to be processed based on the vector corresponding to the barrage to be processed and the vector corresponding to the question in each interactive template, and obtain the answer in each target interactive template to obtain each target answer; use the large language model to generate the reply content corresponding to the barrage to be processed based on all target answers and reply.
[0123] Optionally, the second interactive module 350 is also used to: construct a second prompt word based on all target answers and the character setting of the live broadcast assistant; use the large language model to generate reply content corresponding to the barrage to be processed according to the second prompt word and reply; wherein the language style of the reply content matches the character setting of the live broadcast assistant.
[0124] Optionally, the live broadcast barrage real-time interactive device 300 also includes an establishment module 370, which is used to: store the interactive strategies and product information set by the user to obtain a basic knowledge base; generate multiple pairs of questions and answers based on the basic knowledge base; use a large language model to vectorize each question to obtain a vector corresponding to each question; for each question, use the question and its answer and the vector corresponding to the question as an interactive template to obtain each interactive template; store all interactive templates to obtain an interactive knowledge base.
[0125] Optionally, the establishment module 370 is also used to: monitor the interactive strategy and product information; when the interactive strategy and / or product information is updated, update the basic knowledge base to obtain an updated basic knowledge base; based on the updated basic knowledge base, update the interactive template in the interactive knowledge base.
[0126] An embodiment of the present invention further provides an electronic device, including a processor and a memory, wherein the memory stores a computer program, and when the processor executes the computer program, the live broadcast barrage real-time interactive method disclosed in the embodiment of the present invention is implemented.
[0127] An embodiment of the present invention further provides a storage medium on which a computer program is stored. When the computer program is executed by a processor, the live broadcast barrage real-time interactive method disclosed in an embodiment of the present invention is implemented.
[0128] In several embodiments provided in the present application, it should be understood that the disclosed devices and methods can also be implemented in other ways. The device embodiments described above are merely schematic. For example, the flowcharts and block diagrams in the accompanying drawings show the possible architecture, functions and operations of the devices, methods and computer program products according to multiple embodiments of the present invention. In this regard, each box in the flowchart or block diagram can represent a module, a program segment or a part of a code, and the module, a program segment or a part of a code contains one or more executable instructions for implementing the specified logical function. It should also be noted that in some alternative implementations, the functions marked in the box can also occur in a different order from the order marked in the accompanying drawings. For example, two consecutive boxes can actually be executed substantially in parallel, and they can sometimes be executed in the opposite order, depending on the functions involved. It should also be noted that each box in the block diagram and / or flowchart, and the combination of boxes in the block diagram and / or flowchart can be implemented with a dedicated hardware-based system that performs a specified function or action, or can be implemented with a combination of dedicated hardware and computer instructions.
[0129] In addition, the functional modules in the various embodiments of the present invention may be integrated together to form an independent part, or each module may exist independently, or two or more modules may be integrated to form an independent part.
[0130] If the functions are implemented in the form of software function modules and sold or used as independent products, they can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of the present invention, or the part that contributes to the prior art or the part of the technical solution, can be embodied in the form of a software product. The computer software product is stored in a storage medium, including several instructions for enabling a computer device (which can be a personal computer, a server, or a network device, etc.) to perform all or part of the steps of the methods described in each embodiment of the present invention. The aforementioned storage medium includes: various media that can store program codes, such as a USB flash drive, a mobile hard disk, a read-only memory (ROM), a random access memory (RAM), a magnetic disk or an optical disk.
[0131] The above description is only a preferred embodiment of the present invention and is not intended to limit the present invention. For those skilled in the art, the present invention may have various modifications and variations. Any modification, equivalent replacement, improvement, etc. made within the spirit and principle of the present invention shall be included in the protection scope of the present invention.
Claims
1. A real-time interactive method for live broadcast barrage, characterized in that: Applied to an electronic device, the electronic device pre-stores a whitelist and a blacklist, the whitelist includes a plurality of compliant keywords and their corresponding words, the blacklist includes a plurality of illegal keywords, and the method includes: Obtaining the barrage sent by viewers in the live broadcast room in real time to obtain the barrage to be processed, and matching the barrage to be processed with the whitelist and the blacklist respectively; If the barrage to be processed matches the compliant keywords in the whitelist, the barrage to be processed is determined to be a compliant barrage, and based on the words in the whitelist, the reply content corresponding to the barrage to be processed is obtained and replied; If the barrage to be processed matches the illegal keywords in the blacklist, the barrage to be processed is determined to be an illegal barrage, and it is determined not to reply to the barrage to be processed; If the barrage to be processed does not match the whitelist and the blacklist, a preset large language model is used to generate reply content corresponding to the barrage to be processed and a reply is made.
2. The live broadcast barrage real-time interactive method according to claim 1, characterized in that: The method further comprises: According to the preset time interval, the preset promotional barrage is regularly obtained and sent in the live broadcast room.
3. The live broadcast barrage real-time interactive method according to claim 1, characterized in that: The step of obtaining the reply content corresponding to the to-be-processed bullet screen based on the words in the whitelist and replying includes: From all the words in the whitelist, obtain the words corresponding to the compliant keywords matching the barrage to be processed to obtain the target words; The target words are used as the reply content corresponding to the barrage to be processed and a reply is made, or a first prompt word is constructed based on the target words and the character setting of the live broadcast assistant, and the large language model is used to generate the reply content corresponding to the barrage to be processed according to the first prompt word and a reply is made; wherein the language style of the reply content matches the character setting of the live broadcast assistant.
4. The live broadcast barrage real-time interactive method according to claim 1, characterized in that: The electronic device also pre-stores an interactive knowledge base, which includes a plurality of interactive templates, each of which includes a question and an answer and a vector corresponding to the question; The step of using a preset large language model to generate reply content corresponding to the to-be-processed bullet screen and replying includes: Using the large language model to vectorize the barrage to be processed, to obtain a vector corresponding to the barrage to be processed; According to the vector corresponding to the barrage to be processed and the vector corresponding to the question in each interactive template, each target interactive template matching the barrage to be processed is determined, and the answer in each target interactive template is obtained to obtain each target answer; The large language model is used to generate reply content corresponding to the pending barrage based on all target answers and then reply is made.
5. The live broadcast barrage real-time interactive method according to claim 4 is characterized in that: The step of using the large language model to generate reply content corresponding to the to-be-processed bullet screen based on all target answers and replying includes: Based on all target answers and the character settings of the live broadcast assistant, construct the second prompt word; The large language model is used to generate reply content corresponding to the barrage to be processed according to the second prompt word and a reply is made; wherein the language style of the reply content matches the character setting of the live broadcast assistant.
6. The live broadcast barrage real-time interactive method according to claim 4 is characterized in that: The interactive knowledge base is established in the following manner: Store the interaction strategies and product information set by users to obtain a basic knowledge base; According to the basic knowledge base, generating multiple pairs of questions and answers; Vectorize each question using the large language model to obtain a vector corresponding to each question; For each question, the question, its answer and the vector corresponding to the question are used as an interaction template to obtain each interaction template; All interaction templates are stored to obtain the interaction knowledge base.
7. The live broadcast barrage real-time interactive method according to claim 6, characterized in that: The method further comprises: monitoring the interaction strategy and the product information; When the interaction strategy and / or the product information is updated, the basic knowledge base is updated to obtain an updated basic knowledge base; The interactive templates in the interactive knowledge base are updated according to the updated basic knowledge base.
8. A real-time interactive device for live broadcast barrage, characterized in that: Applied to an electronic device, the electronic device pre-stores a whitelist and a blacklist, the whitelist includes a plurality of compliant keywords and their corresponding words, the blacklist includes a plurality of illegal keywords, and the device includes: A matching module, used for acquiring the bullet comments sent by the audience in the live broadcast room in real time to obtain the bullet comments to be processed, and matching the bullet comments to be processed with the white list and the black list respectively; The first interactive module is used to determine that the barrage to be processed is a compliant barrage if the barrage to be processed matches the compliant keywords in the whitelist, and obtain the reply content corresponding to the barrage to be processed based on the words in the whitelist and reply; If the barrage to be processed matches the illegal keywords in the blacklist, the barrage to be processed is determined to be an illegal barrage, and it is determined not to reply to the barrage to be processed; The second interactive module is used to generate reply content corresponding to the barrage to be processed by using a preset large language model and make a reply if the barrage to be processed does not match the white list and the black list.
9. An electronic device, characterized in that: It includes a processor and a memory, the memory stores a computer program, and when the processor executes the computer program, it implements the live broadcast barrage real-time interactive method described in any one of claims 1 to 7.
10. A storage medium, characterized in that: The storage medium stores a computer program, which, when executed by a processor, implements the live broadcast barrage real-time interactive method according to any one of claims 1 to 7.
Citation Information
Cited By
Interaction method and system for real-time electronic commerce transaction
CN121262433A
An interactive method and system for real-time e-commerce transactions
CN121262433B