A keyword labeling method and device, a storage medium, and an electronic device

By using word segmentation and sentence generation models, keywords are determined based on the importance of word segmentation and semantic matching, which solves the problem of inaccurate keyword extraction in existing technologies and improves the accuracy and efficiency of risk identification.

CN116089577BActive Publication Date: 2025-12-19ALIPAY (HANGZHOU) INFORMATION TECH CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202211567262.7
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2022-12-07
Publication Date
2025-12-19
Estimated Expiration
2042-12-07

AI Technical Summary

Technical Problem

Existing keyword extraction methods cannot accurately reflect the semantics of dialogue statements, resulting in low accuracy and inefficiency in risk identification.

Method used

Keywords are determined by word segmentation, determining the importance of each segment, selecting candidate words and inputting them into a pre-trained sentence generation model, and then determining the semantic matching degree between the reconstructed dialogue and the original dialogue.

Benefits of technology

It improves the semantic matching degree between keywords and dialogue statements, accurately summarizes the dialogue content, and enhances the accuracy and efficiency of risk identification.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN116089577B_ABST
    Figure CN116089577B_ABST
Patent Text Reader

Abstract

The specification discloses a keyword labeling method and device, a storage medium and an electronic device. The keyword labeling method comprises: obtaining a dialogue sentence of a user, performing word segmentation processing on the dialogue sentence, determining each word segment contained in the dialogue sentence, for each word segment, determining an importance degree corresponding to the word segment according to a frequency of occurrence of the word segment in the dialogue sentence, selecting a preset number of word segments as candidate words according to the importance degree corresponding to each word segment, inputting each determined candidate word group into a pre-trained sentence generation model to determine a reconstructed dialogue sentence corresponding to each candidate word group, a candidate word group contains at least one candidate word, and determining each keyword in the dialogue sentence according to a semantic matching degree between each reconstructed dialogue sentence and the dialogue sentence and labeling each keyword.
Need to check novelty before this filing date? Find Prior Art

Description

TECHNICAL FIELD

[0001] The present specification relates to the technical field of computer, and particularly relates to a keyword labeling method and device, a storage medium and an electronic device. BACKGROUND

[0002] With the development of science and technology, people's work and life are becoming more and more convenient, but at the same time, the privacy and property safety of users are also facing great challenges. In order to protect the property safety of users, it is usually necessary to analyze and evaluate the interaction data of users, so as to identify possible risks and timely remind users, so as to effectively control the risks. In this process, in order to improve the efficiency of risk identification, it is usually necessary to extract the keywords in the interaction data of users by using natural language processing algorithm, so as to further judge the risks according to the keywords.

[0003] However, the current keyword extraction method usually determines the keywords according to the frequency of different words appearing in the text or dialogue, but the keywords extracted by this method do not match the semantic information of the original dialogue, and cannot accurately summarize the meaning expressed by the original dialogue, so as to cause the accuracy of subsequent risk identification to be low, and even mislead the process of risk identification, resulting in incorrect risk identification results.

[0004] Therefore, how to accurately determine the keywords that match the semantic information of the dialogue sentence and can accurately summarize the content of the dialogue, so as to improve the accuracy and efficiency of the subsequent risk identification process, is a problem to be solved. SUMMARY

[0005] The present specification provides a keyword labeling method, device, storage medium and electronic device. The keywords that match the semantic information of the dialogue sentence and can accurately summarize the content of the dialogue are accurately determined.

[0006] The present specification adopts the following technical solutions:

[0007] The present specification provides a keyword labeling method, which comprises:

[0008] Obtaining the dialogue sentence of the user, and performing word segmentation processing on the dialogue sentence to determine each word in the dialogue sentence;

[0009] For each word, according to the frequency of the word appearing in the dialogue sentence, determining the importance degree corresponding to the word;

[0010] According to the importance degree corresponding to each word, selecting a preset number of words as candidate words;

[0011] inputting each candidate word group into a pre-trained sentence generation model to determine a reconstructed dialogue sentence corresponding to each candidate word group, wherein each candidate word group contains at least one candidate word;

[0012] determining each keyword in the dialogue sentence according to a semantic matching degree between each reconstructed dialogue sentence and the dialogue sentence, and labeling the keywords.

[0013] Optionally, for each word segmentation, the importance degree corresponding to the word segmentation is determined according to a frequency of occurrence of the word segmentation in the dialogue sentence, specifically including:

[0014] For each word segmentation, the importance degree corresponding to the word segmentation is determined according to a frequency of occurrence of the word segmentation in the dialogue sentence and a frequency of occurrence of the word segmentation in other dialogue sentences contained in the preset sentence library.

[0015] Optionally, the importance degree is positively correlated with the frequency of occurrence of the word segmentation in the dialogue sentence and is negatively correlated with the frequency of occurrence of the word segmentation in other dialogue sentences contained in the preset sentence library.

[0016] Optionally, according to the importance degree corresponding to each word segmentation, a preset number of word segmentations are selected as candidate words, specifically including:

[0017] The word segmentations are sorted according to the importance degree from large to small, and each word segmentation located before a preset position is determined.

[0018] The word segmentations located before the preset position are randomly deleted, and the remaining word segmentations located before the preset position are used as the candidate words.

[0019] Optionally, each candidate word group is inputted into a pre-trained sentence generation model to determine a reconstructed dialogue sentence corresponding to each candidate word group, specifically including:

[0020] For any one of the determined candidate word groups, the candidate word group is inputted into a pre-trained sentence generation model to determine a reconstructed dialogue sentence corresponding to the candidate word group.

[0021] If a matching degree between the reconstructed dialogue sentence corresponding to the candidate word group and the dialogue sentence is greater than a matching degree threshold value corresponding to the candidate word group, a candidate word is added to the candidate word group to obtain a newly determined candidate word group, and the newly determined candidate word group is inputted into the sentence generation model to generate a reconstructed dialogue sentence corresponding to the newly determined candidate word group, wherein the greater the number of candidate words contained in the candidate word group, the greater the matching degree threshold value corresponding to the candidate word group.

[0022] Optionally, the method further includes:

[0023] According to the annotated keywords, risk identification is performed on the service performed by the user.

[0024] Optionally, the sentence generation model is trained, specifically including:

[0025] Obtain historical dialogue sentences;

[0026] Perform word segmentation processing on the historical dialogue sentences to determine each word segment contained in the historical dialogue sentences.

[0027] For each word segment in the historical dialogue sentences, determine the historical importance degree corresponding to the word segment according to the frequency of the word segment appearing in the historical dialogue sentences.

[0028] According to the historical importance degree corresponding to each word segment in the historical dialogue sentences, select a preset number of word segments as historical candidate words.

[0029] Input each historical candidate word into the sentence generation model to determine a historical reconstructed sentence.

[0030] Minimize the deviation between the historical dialogue sentences and the historical reconstructed sentence as the optimization target to train the sentence generation model.

[0031] The specification provides a keyword annotation device, including:

[0032] An acquisition module acquires dialogue sentences of a user, performs word segmentation processing on the dialogue sentences, and determines each word segment contained in the dialogue sentences.

[0033] A determination module determines, for each word segment, the importance degree corresponding to the word segment according to the frequency of the word segment appearing in the dialogue sentences.

[0034] A selection module selects, according to the importance degree corresponding to each word segment, a preset number of word segments as candidate words.

[0035] An input module inputs each determined candidate word group into a pre-trained sentence generation model to determine a reconstructed dialogue sentence corresponding to each candidate word group, and each candidate word group contains at least one candidate word.

[0036] An annotation module determines each keyword in the dialogue sentences according to the semantic matching degree between each reconstructed dialogue sentence and the dialogue sentences, and annotates the keywords.

[0037] Optionally, the determination module is configured to determine, for each word segment, the importance degree corresponding to the word segment according to the frequency of the word segment appearing in the dialogue sentences and the frequency of the word segment appearing in other dialogue sentences contained in a preset sentence library.

[0038] Optionally, the importance degree is positively correlated with a frequency of the word in the dialogue sentence and negatively correlated with a frequency of the word in other dialogue sentences included in a preset sentence library.

[0039] Optionally, the selection module is specifically configured to sort the words according to the importance degree from large to small, and determine the words before a preset position; randomly delete the words before the preset position, and take the remaining words before the preset position as the candidate words.

[0040] Optionally, the input module is specifically configured to input any one of the determined candidate word groups into a pre-trained sentence generation model to determine a reconstructed dialogue sentence corresponding to the candidate word group; if a matching degree between the reconstructed dialogue sentence corresponding to the candidate word group and the dialogue sentence is greater than a matching degree threshold corresponding to the candidate word group, add a candidate word in the candidate word group to obtain a redetermined candidate word group, and input the redetermined candidate word group into the sentence generation model to generate a reconstructed dialogue sentence corresponding to the redetermined candidate word group, wherein the greater the number of candidate words in the candidate word group, the greater the matching degree threshold corresponding to the candidate word group.

[0041] Optionally, the apparatus further comprises:

[0042] The training module is configured to obtain a historical dialogue sentence, perform word segmentation on the historical dialogue sentence to determine words included in the historical dialogue sentence, determine a historical importance degree corresponding to each word in the historical dialogue sentence according to a frequency of the word in the historical dialogue sentence, select a preset number of words as historical candidate words according to the historical importance degree corresponding to each word in the historical dialogue sentence, input the historical candidate words into the sentence generation model to determine a historical reconstructed sentence, and train the sentence generation model with a minimum deviation between the historical dialogue sentence and the historical reconstructed sentence as an optimization target.

[0043] The present specification provides a computer readable storage medium, which stores a computer program, and the computer program is executed by a processor to implement the above-mentioned keyword annotation method.

[0044] The present specification provides an electronic device, which includes a memory, a processor, and a computer program stored in the memory and executable on the processor, and the processor implements the above-mentioned keyword annotation method when executing the program.

[0045] The above-mentioned at least one technical solution adopted by the present specification can achieve the following beneficial effects:

[0046] In the keyword labeling method provided in the specification, the server obtains a dialogue sentence of a user, performs word segmentation processing on the dialogue sentence, determines each word segment contained in the dialogue sentence, for each word segment, determines the importance degree corresponding to the word segment according to the frequency of the word segment appearing in the dialogue sentence, selects a preset number of word segments as candidate words according to the importance degree corresponding to each word segment, inputs each candidate word group determined into a pre-trained sentence generation model to determine the reconstructed dialogue sentence corresponding to each candidate word group, and a candidate word group contains at least one candidate word. According to the semantic matching degree between each reconstructed dialogue sentence and the dialogue sentence, the keywords in the dialogue sentence are determined, and each keyword is labeled.

[0047] As can be seen from the above method, when determining the keywords in the dialogue sentence, the frequency of each word segment appearing in the dialogue sentence and the semantic matching degree between the reconstructed dialogue sentence reconstructed by each candidate word and the dialogue sentence are determined. Compared with the method of determining keywords only according to the word frequency at present, the keywords determined by the present scheme are more matched with the semantic information of the dialogue sentence, and the dialogue content can be accurately summarized, so as to further improve the accuracy and efficiency of the subsequent risk judgment process. BRIEF DESCRIPTION OF DRAWINGS

[0048] The drawings described herein are used to provide further understanding of the specification, constitute a part of the specification, the illustrative embodiments of the specification and the description thereof are used to explain the specification, and do not constitute improper limitation on the specification. In the drawings

[0049] In the drawings:

[0050] Figure 1 It is a flowchart of the keyword labeling method provided in the specification;

[0051] Figure 2 It is a keyword determination process schematic diagram provided in the specification;

[0052] Figure 3 It is a schematic diagram of the keyword labeling device provided in the specification;

[0053] Figure 4 It is a schematic diagram of the electronic device corresponding to Figure 1 provided in the specification. DETAILED DESCRIPTION

[0054] In order to make the purpose, technical solutions and advantages of the present specification clearer, the technical solutions of the present specification will be described clearly and completely in the following with specific embodiments of the present specification and corresponding drawings. Obviously, the described embodiments are only part of the embodiments of the present specification, not all. Based on the embodiments in the present specification, all other embodiments obtained by those skilled in the art without creative labor fall within the scope of protection of the present specification.

[0055] The technical solutions provided by the embodiments of the present specification will be described in detail below with reference to the drawings.

[0056] Figure 1 For the flowchart of the keyword labeling method provided in the present specification, the following steps are included:

[0057] S100: Obtain the dialogue sentence of the user, and perform word segmentation processing on the dialogue sentence to determine each word in the dialogue sentence.

[0058] In fields such as intelligent customer service, interactive risk control, etc., when the user performs some business related to his own privacy and property, in order to fully protect the safety of the user, the business platform will usually distinguish the user's dialogue through intelligent customer service or manual customer service, and timely discover abnormal business that threatens the safety of the user and remind the user, so as to avoid the user's privacy and property safety from being infringed.

[0059] In the process of distinguishing abnormal business, it is often necessary to obtain the text of all dialogue sentences between the user and other objects, so as to evaluate and judge the possible risks according to the text. However, whether it is intelligent customer service or manual customer service, analyzing the text of all dialogue sentences requires a lot of time, greatly reducing the efficiency of risk judgment, and even causing the user's privacy or property loss due to untimely risk reminder.

[0060] Based on this, the present specification provides a keyword labeling method to determine and label the keywords in the user's dialogue sentence that match the semantic information thereof and can accurately summarize the dialogue content, and then perform risk identification according to the labeled keywords to improve the efficiency and accuracy of risk identification.

[0061] In the present specification, the execution subject for implementing the keyword labeling method can refer to a server or other specified device set in the business platform. For the convenience of description, the present specification only takes the server as the execution subject as an example to describe the keyword labeling method provided in the present specification.

[0062] The server needs to obtain a dialogue sentence of a user. The dialogue sentence can be dialogue text extracted by the server from a voice dialogue between the current user and other objects, can be dialogue text corresponding to a text dialogue between the current user and other objects, or can be a voice dialogue sentence. In addition, the other objects can be a merchant, a business platform customer service, or other users, or can be an intelligent dialogue robot. The present specification does not make a specific limitation.

[0063] After obtaining the dialogue sentence, the server can perform word segmentation processing on the text of the dialogue sentence to determine each word segment contained in the dialogue sentence. For example, for the dialogue sentence “Please tell me your occupation or industry”, after performing word segmentation processing, the obtained word segments can be “please”, “your”, “occupation”, and “what”.

[0064] S102: For each word segment, determine the importance degree corresponding to the word segment according to the frequency of occurrence of the word segment.

[0065] In actual application, the higher the frequency of occurrence of a word segment in the current text, the greater the importance of the word segment in the current text. At the same time, if the frequency of occurrence of the word segment in other texts is low, it can further indicate the importance of the word segment to the current text. Therefore, for each extracted word segment, the server can determine the importance degree corresponding to each word segment according to the frequency of occurrence of the word segment in the dialogue sentence and the frequency of occurrence of the word segment in other dialogue sentences contained in a preset sentence library. The dialogue sentences in the preset sentence library can be historical dialogue sentences collected by the server in historical business, or can be other dialogue sentences. The present specification does not make a specific limitation.

[0066] Specifically, the higher the frequency of occurrence of the word segment in the current dialogue sentence and the lower the frequency of occurrence of the word segment in other dialogue sentences contained in the preset sentence library, the greater the importance of the word segment to the dialogue sentence. The lower the frequency of occurrence of the word segment in the current dialogue sentence and the greater the frequency of occurrence of the word segment in other dialogue sentences contained in the preset sentence library, the smaller the importance of the word segment to the dialogue sentence. In other words, the importance degree of a word segment can be positively correlated with the frequency of occurrence of the word segment in a dialogue sentence and negatively correlated with the frequency of occurrence of the word segment in other dialogue sentences.

[0067] S104: According to the importance degree corresponding to each word segment, select a preset number of word segments as candidate words.

[0068] Specifically, the server can sort the word pieces in descending order of importance, and determine the word pieces before a preset rank. In order to prevent the final result from falling into a local optimal solution, the server can randomly delete a preset number of word pieces before the preset rank according to a preset probability, and take the remaining word pieces before the preset rank as candidate words. The preset rank and the preset number can be set according to actual conditions, and the specification does not make specific limitations. It should be noted that the probability of deletion of each word piece can be the same.

[0069] For example, the server can select the top ten word pieces in importance ranking, and randomly delete two of them, taking the remaining eight word pieces as candidate words.

[0070] S106: input each candidate word group determined into a pre-trained sentence generation model to determine the reconstructed dialogue sentence corresponding to each candidate word group, and each candidate word group contains at least one candidate word.

[0071] S108: according to the semantic matching degree between each reconstructed dialogue sentence and the dialogue sentence, determine each keyword in the dialogue sentence and label the keywords.

[0072] After determining the candidate words, the server can input each candidate word into a pre-trained sentence generation model to determine the reconstructed dialogue sentence generated by each candidate word.

[0073] Specifically, the server can first input one of the candidate words into the above-mentioned sentence generation model, and the sentence generation model can reconstruct the dialogue sentence according to the candidate word to obtain the reconstructed dialogue sentence corresponding to the candidate word. The candidate word input into the sentence generation model for the first time can be a candidate word group containing only one candidate word.

[0074] For any determined candidate word group, the server can determine the semantic matching degree between the reconstructed dialogue sentence and the dialogue sentence according to the similarity between the reconstructed dialogue sentence and the dialogue sentence. If the semantic matching degree between the reconstructed dialogue sentence and the dialogue sentence is greater than a preset semantic matching degree, a candidate word can be added to the candidate word group to obtain a newly determined candidate word group, until all determined candidate words are traversed. It should be noted that the candidate word added in the candidate word group can be a candidate word not in the candidate word group.

[0075] Then the server can input the re-determined candidate word group into the sentence generation model to generate a reconstructed dialogue sentence corresponding to the re-determined candidate word group. Since the similarity between the determined reconstructed dialogue sentence and the dialogue sentence of the user increases with the increase in the number of candidate words in the candidate word group, the matching threshold corresponding to the candidate word group also increases with the increase in the number of candidate words contained in the candidate word group.

[0076] For each candidate word group, if the matching degree between the reconstructed dialogue sentence determined by the candidate word group and the dialogue sentence of the user is greater than the matching threshold corresponding to the candidate word group, the server can take each candidate word in the candidate word group as a keyword.

[0077] In this specification, there can be various ways to mark keywords, such as highlighting, bolding, setting a different color from other text, or setting a different font from other text, and the like, which are not specifically limited in this specification. In order to facilitate understanding, this specification provides a process diagram of determining a keyword, as shown in Figure 2 .

[0078] Figure 2 A process diagram of determining a keyword provided in this specification.

[0079] The server can input the determined candidate words into the sentence generation model, determine the keywords through the random initialization encoding layer, the pre-training encoding layer, and the pre-training decoding layer of the sentence generation model. For the candidate word A input into the pre-training decoding layer, if A is determined to be a keyword according to the semantic matching degree between the corresponding reconstructed dialogue sentence and the dialogue sentence, A and the next candidate word B can be input into the pre-training decoding layer together. If the semantic matching degree between the determined reconstructed dialogue sentence and the dialogue sentence still meets the requirements, B can be determined to be a keyword, and A, B, and the next candidate word C can be input into the model to determine whether C is a keyword. If B is not determined to be a keyword, A and the next candidate word C can be input into the model. This process is repeated until all candidate words are traversed.

[0080] After marking the keywords, the server can perform risk identification on the current business executed by the user according to the marked keywords. Of course, the marked keywords can also be identified by an auditor.

[0081] In addition, before using the above-mentioned sentence generation model, the server also needs to train the sentence generation model. The server needs to obtain a training sample, which can include historical dialogue sentences collected by the server. Then the server can perform word segmentation on the historical dialogue sentences contained in the training sample to determine the words contained in the historical dialogue sentences.

[0082] For each word in the historical dialogue sentence, the server can determine the historical importance of the word according to the frequency of occurrence of the word, and select a preset number of words as historical candidate words according to the historical importance of each word in the historical dialogue sentence, and then input each historical candidate word into the sentence generation model to determine a historical reconstruction sentence.

[0083] The server can train the sentence generation model with the optimization goal of minimizing the deviation between the historical dialogue sentence and the historical reconstruction sentence until the training goal is met. The training goal can be that the sentence generation model converges within a preset range or reaches a preset number of training times, so that the same or similar reconstruction dialogue sentence as the original dialogue sentence can be accurately reconstructed. The above-mentioned preset range and preset training times can be set according to actual conditions, and the present specification does not make specific limitations.

[0084] As can be seen from the above method, when determining the keywords in the dialogue sentence, the frequency of occurrence of each word in the dialogue sentence and the semantic matching degree between the reconstruction dialogue sentence reconstructed by each candidate word and the dialogue sentence are determined. Compared with the method of determining keywords only according to the word frequency, the keywords determined by the present scheme are more matched with the semantic information of the dialogue sentence, and the dialogue content can be accurately summarized, thereby further improving the accuracy and efficiency of the subsequent risk judgment process.

[0085] Through testing, it is found that for the dialogue sentence "Is there a customer service or order taker in the group to guide you to place an order on the platform?", the keywords detected by the existing method are "platform", "group", and "is not", while the keywords determined by the present scheme are "customer service", "order", and "guide". Obviously, the keywords determined by the present scheme are more consistent with the semantics of the dialogue sentence and can accurately summarize the meaning expressed by the dialogue sentence.

[0086] The above is a keyword labeling method of one or more embodiments of the present specification. Based on the same idea, the present specification also provides a corresponding keyword labeling device, as shown in Figure 3 .

[0087] Figure 3 A schematic diagram of a keyword labeling device provided by the present specification includes:

[0088] The acquisition module 300 is configured to acquire a dialogue sentence of a user, perform word segmentation processing on the dialogue sentence, and determine each word included in the dialogue sentence.

[0089] The determination module 302 is configured to, for each word, determine the importance of the word according to the frequency of occurrence of the word in the dialogue sentence.

[0090] The selection module 304 is configured to select a preset number of words as candidate words according to the importance of each word.

[0091] The input module 306 is configured to input each candidate word group into a pre-trained sentence generation model to determine a reconstructed dialogue sentence corresponding to each candidate word group, and each candidate word group includes at least one candidate word.

[0092] The labeling module 308 is configured to determine each keyword in the dialogue sentence according to the semantic matching degree between the reconstructed dialogue sentence and the dialogue sentence, and label the keywords.

[0093] Optionally, the determination module 302 is specifically configured to determine, for each word, the importance of the word according to the frequency of the word in the dialogue sentence and the frequency of the word in other dialogue sentences included in the preset sentence library.

[0094] Optionally, the importance of the word is positively correlated with the frequency of the word in the dialogue sentence and negatively correlated with the frequency of the word in other dialogue sentences included in the preset sentence library.

[0095] Optionally, the selection module 304 is specifically configured to sort each word according to the importance of the word from large to small, and determine each word before a preset position; randomly delete the words before the preset position, and take the remaining words before the preset position as the candidate words.

[0096] Optionally, the input module 306 is specifically configured to input any determined candidate word group into a pre-trained sentence generation model to determine a reconstructed dialogue sentence corresponding to the candidate word group; if the matching degree between the reconstructed dialogue sentence corresponding to the candidate word group and the dialogue sentence is greater than a matching degree threshold corresponding to the candidate word group, add a candidate word to the candidate word group to obtain a newly determined candidate word group, and input the newly determined candidate word group into the sentence generation model to generate a reconstructed dialogue sentence corresponding to the newly determined candidate word group, wherein the greater the number of candidate words included in the candidate word group, the greater the matching degree threshold corresponding to the candidate word group.

[0097] Optionally, the labeling module 308 is further configured to perform risk identification on a service performed by the user according to the labeled keywords.

[0098] Optionally, the apparatus further comprises:

[0099] The training module 310 is configured to: acquire historical dialogue sentences; perform word segmentation processing on the historical dialogue sentences to determine respective words segmented from the historical dialogue sentences; for each word segmented from the historical dialogue sentences, determine a historical importance degree of the word according to a frequency of occurrence of the word in the historical dialogue sentences; select a preset number of words as historical candidate words according to the historical importance degrees of the words segmented from the historical dialogue sentences; input the historical candidate words into the sentence generation model to determine a historical reconstructed sentence; and train the sentence generation model by taking minimizing a deviation between the historical dialogue sentences and the historical reconstructed sentence as an optimization objective.

[0100] The present specification also provides a computer-readable storage medium storing a computer program, and the computer program is configured to execute the above Figure 1 The present specification also provides a keyword labeling method.

[0101] The present specification also provides a computer-readable storage medium storing a computer program, and the computer program is configured to execute the above Figure 4 The present specification also provides a computer-readable storage medium storing a computer program, and the computer program is configured to execute the above Figure 1 The present specification also provides a computer-readable storage medium storing a computer program, and the computer program is configured to execute the above Figure 4 The present specification also provides a computer-readable storage medium storing a computer program, and the computer program is configured to execute the above Figure 1 The present specification also provides a computer-readable storage medium storing a computer program, and the computer program is configured to execute the above

[0102] In the 1990s, it was quite obvious to distinguish whether an improvement in a technology was in hardware (e.g., improvement in circuit structures of diodes, transistors, switches, etc.) or in software (improvement in method flow). However, as technology has evolved, many improvements in method flow today can be considered as direct improvements in hardware circuit structures. Designers almost always obtain the corresponding hardware circuit structures by programming the improved method flow into hardware circuits. Therefore, it cannot be said that an improvement in a method flow cannot be implemented by hardware entity modules. For example, a programmable logic device (PLD) (e.g., a field programmable gate array (FPGA)) is an integrated circuit whose logic function is determined by user programming of the device. A digital system is "integrated" on a PLD by the designer programming it, rather than by asking a chip manufacturer to design and fabricate a custom integrated circuit chip. Moreover, instead of manually fabricating integrated circuit chips, this programming is now mostly implemented by "logic compiler" software, which is similar to software compilers used in program development, and the original code to be compiled is written in a specific programming language, which is called a hardware description language (HDL), and there are many such languages, such as ABEL (Advanced Boolean Expression Language), AHDL (Altera Hardware Description Language), Confluence, CUPL (Cornell University Programming Language), HDCal, JHDL (Java Hardware Description Language), Lava, Lola, MyHDL, PALASM, RHDL (Ruby Hardware Description Language), etc., and the most commonly used are VHDL (Very-High-Speed Integrated Circuit Hardware Description Language) and Verilog. Those skilled in the art should be aware that, as long as the method flow is logically programmed in the above-mentioned hardware description languages and programmed into an integrated circuit, a hardware circuit implementing the logical method flow can be easily obtained.

[0103] The controller can be implemented in any suitable way, e.g. the controller can take the form of a microprocessor or processor and a computer readable medium storing computer readable program code, e.g. software or firmware, executable by the (micro)processor, logic gates, switches, an application specific integrated circuit (ASIC), a programmable logic controller and an embedded microcontroller, examples of controllers include but are not limited to the following microcontrollers: ARC625D, Atmel AT91SAM, Microchip PIC18F26K20 and Silicone Labs C8051F320, the memory controller can also be implemented as part of the control logic of the memory. Those skilled in the art will also know that in addition to being implemented in pure computer readable program code form, the controller can perfectly well be implemented to perform the same functions using logic gates, switches, an application specific integrated circuit, a programmable logic controller and an embedded microcontroller, etc. by means of a logical programming of the method steps. The controller can thus be considered as a hardware component, and the means comprised therein for performing the various functions can be considered as structures within the hardware component. Alternatively, the means for performing the various functions can even be considered as both a software module implementing the method and a structure within a hardware component.

[0104] The systems, apparatuses, modules or units illustrated by the above embodiments can be implemented by computer chips or entities, or products with certain functions. A typical implementation device is a computer. Specifically, the computer can be a personal computer, a laptop computer, a cellular phone, a camera phone, a smart phone, a personal digital assistant, a media player, a navigation device, an email device, a game console, a tablet computer, a wearable device, or a combination of any of these devices.

[0105] For the sake of description, the above apparatuses are described in various units by functions respectively. Of course, the functions of each unit can be implemented in the same or multiple software and / or hardware in implementing the present specification.

[0106] Those skilled in the art will understand that the embodiments of the present specification can be provided as a method, a system, or a computer program product. Therefore, the present specification can take the form of a complete hardware embodiment, a complete software embodiment, or an embodiment combining software and hardware aspects. Moreover, the present specification can take the form of a computer program product implemented on one or more computer-usable storage media (including but not limited to disk storage, CD-ROM, optical storage, etc.) containing computer-usable program code.

[0107] The specification is presented with reference to flow diagrams and / or block diagrams of methods, apparatus (systems) and computer program products according to embodiments of the specification. It will be understood that each block of the flow diagrams and / or block diagrams, and combinations of blocks in the flow diagrams and / or block diagrams, can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general purpose computer, special purpose computer, embedded processing element or other programmable data processing apparatus to produce a machine, such that the instructions, which execute via the processor of the computer or other programmable data processing apparatus, create means for implementing the functions specified in the flow diagrams and / or block diagrams block or blocks. Figure 1 The flow diagrams and / or block diagrams in the specification can present a method, apparatus or computer program product according to embodiments of the specification. Flow diagrams and / or block diagrams can also present a method, apparatus or computer program product to achieve functions specified in flow diagrams and / or block diagrams block or blocks. Figure 1 The flow diagrams and / or block diagrams in the specification can present a method, apparatus or computer program product according to embodiments of the specification. Flow diagrams and / or block diagrams can also present a method, apparatus or computer program product to achieve functions specified in flow diagrams and / or block diagrams block or blocks.

[0108] These computer program instructions can also be stored in a computer-readable memory that can direct a computer or other programmable data processing apparatus to function in a particular manner, such that the instructions stored in the computer-readable memory produce an article of manufacture including instructions which implement the flow diagrams and / or block diagrams block or blocks. Figure 1 The flow diagrams and / or block diagrams in the specification can present a method, apparatus or computer program product according to embodiments of the specification. Flow diagrams and / or block diagrams can also present a method, apparatus or computer program product to achieve functions specified in flow diagrams and / or block diagrams block or blocks. Figure 1 The flow diagrams and / or block diagrams in the specification can present a method, apparatus or computer program product according to embodiments of the specification. Flow diagrams and / or block diagrams can also present a method, apparatus or computer program product to achieve functions specified in flow diagrams and / or block diagrams block or blocks.

[0109] These computer program instructions can also be loaded onto a computer or other programmable data processing apparatus to cause a series of operational steps to be performed on the computer or other programmable apparatus to produce a computer implemented process such that the instructions which execute on the computer or other programmable apparatus provide steps for implementing the flow diagrams and / or block diagrams block or blocks. Figure 1 The flow diagrams and / or block diagrams in the specification can present a method, apparatus or computer program product according to embodiments of the specification. Flow diagrams and / or block diagrams can also present a method, apparatus or computer program product to achieve functions specified in flow diagrams and / or block diagrams block or blocks. ​ The flow diagrams and / or block diagrams in the specification can present a method, apparatus or computer program product according to embodiments of the specification. Flow diagrams and / or block diagrams can also present a method, apparatus or computer program product to achieve functions specified in flow diagrams and / or block diagrams block or blocks.

[0110] In a typical configuration, a computing device includes one or more processors (CPUs), input / output interfaces, network interfaces, and memory.

[0111] The memory can include non-persistent memory and / or persistent memory, such as flash memory, read-only memory (ROM), and / or volatile / non-volatile random access memory (RAM), among others. The memory is an example of computer-readable media.

[0112] Computer-readable media includes permanent and non-permanent, movable and non-movable media that can be implemented by any method or technology to store information. The information can be computer-readable instructions, data structures, program modules or other data. Examples of computer storage media include, but are not limited to, phase change memory (PRAM), static random access memory (SRAM), dynamic random access memory (DRAM), other types of random access memory (RAM), read-only memory (ROM), electrically erasable programmable read-only memory (EEPROM), flash memory or other memory technologies, compact disc read-only memory (CD-ROM), digital versatile disc (DVD) or other optical storage, magnetic cassette, magnetic tape, magnetic disk storage or other magnetic storage devices, or any other non-transmission medium that can be used to store information accessible to a computing device. According to the definition herein, computer-readable media does not include transitory media such as modulated data signals and carriers.

[0113] It should also be noted that the terms "comprising", "containing", or any other variant thereof are intended to cover non-exclusive inclusion, such that a process, method, article or apparatus that comprises a list of elements does not only include those elements, but can also include other elements not expressly listed or inherent to such process, method, article or apparatus. Without more limitations, the element defined by the statement "comprising a" does not exclude the presence of additional identical elements in the process, method, article or apparatus that includes the element.

[0114] Those skilled in the art will appreciate that embodiments of the present specification can be provided as methods, systems or computer program products. Therefore, the present specification can take the form of an entirely hardware embodiment, an entirely software embodiment or an embodiment combining software and hardware aspects. Moreover, the present specification can take the form of a computer program product implemented on one or more computer-usable storage media (including, but not limited to, magnetic disk storage, CD-ROM, optical storage, etc.) containing computer-usable program code.

[0115] The present specification can be described in the general context of computer-executable instructions, such as program modules, executed by computers. Generally, program modules include routines, programs, objects, components, data structures, etc. that perform particular tasks or implement particular abstract data types. The present specification can also be practiced in distributed computing environments where tasks are performed by remote processing devices connected through a communication network. In a distributed computing environment, program modules can be located in both local and remote computer storage media including storage devices.

[0116] The various embodiments described in this specification are described using a numbering of embodiments approach: these are each individually integrated contributions pertaining to different aspects of the description. For each embodiment, the description focuses on the differences from the other embodiments. In particular, the description of the system embodiments is relatively brief, as the system embodiments are largely analogous to the method embodiments. The relevant parts of the description of the method embodiments are referred to.

[0117] The above only describes the embodiments of the present specification and is not intended to limit the present specification. The present specification can have various modifications and changes for those skilled in the art. Any modification, equivalent replacement, improvement, etc. made within the spirit and principle of the present specification shall be included in the scope of claims of the present specification.

Claims

1. A keyword labeling method, comprising: obtaining a dialogue sentence of a user, and performing word segmentation on the dialogue sentence to determine each word segment contained in the dialogue sentence; for each word segment, determining an importance degree corresponding to the word segment according to a frequency of the word segment appearing in the dialogue sentence; selecting a preset number of word segments as candidate words according to the importance degree corresponding to each word segment; inputting each candidate word group determined into a pre-trained sentence generation model to determine a reconstructed dialogue sentence corresponding to each candidate word group, wherein each candidate word group contains at least one candidate word; determining each keyword in the dialogue sentence according to a semantic matching degree between each reconstructed dialogue sentence and the dialogue sentence, and labeling the keywords; wherein for each candidate word group, if the matching degree between the reconstructed dialogue sentence corresponding to the candidate word group and the dialogue sentence is greater than a matching degree threshold corresponding to the candidate word group, a candidate word is added in the candidate word group to obtain an updated candidate word group, and the candidate word is continuously added until all candidate words are traversed in the case that the reconstructed dialogue sentence corresponding to the updated candidate word group is greater than the matching degree threshold corresponding to the updated candidate word group; and the matching degree threshold corresponding to any candidate word group is positively correlated with the number of candidate words contained in the candidate word group. 2.The method of claim 1, wherein for each word segment, the importance degree corresponding to the word segment is determined according to a frequency of the word segment appearing in the dialogue sentence, specifically comprising: for each word segment, the importance degree corresponding to the word segment is determined according to a frequency of the word segment appearing in the dialogue sentence and a frequency of the word segment appearing in other dialogue sentences contained in a preset sentence library. 3.The method of claim 2, wherein the importance degree is positively correlated with the frequency of the word segment appearing in the dialogue sentence, and negatively correlated with the frequency of the word segment appearing in other dialogue sentences contained in the preset sentence library. 4.The method of claim 1, wherein the preset number of word segments are selected as candidate words according to the importance degree corresponding to each word segment, specifically comprising: sorting each word segment according to the importance degree from large to small, and determining each word segment located before a preset position; randomly deleting the word segments located before the preset position, and taking the remaining word segments located before the preset position as the candidate words. 5.The method of claim 1, further comprising: performing risk identification on a service performed by the user according to the labeled keywords. 6.The method of claim 1, wherein the sentence generation model is trained, specifically comprising: obtaining historical dialogue sentences; performing word segmentation on the historical dialogue sentences to determine each word segment contained in the historical dialogue sentences; for each word segment in the historical dialogue sentences, determining a historical importance degree corresponding to the word segment according to a frequency of the word segment appearing in the historical dialogue sentences; selecting a preset number of word segments as historical candidate words according to the historical importance degree corresponding to each word segment in the historical dialogue sentences; inputting each historical candidate word into the sentence generation model to determine a historical reconstructed dialogue sentence; and The sentence generation model is trained with an optimization objective of minimizing deviation between the historical dialogue sentence and the historical reconstructed sentence.

7. A keyword labeling apparatus, comprising: an acquisition module configured to acquire a dialogue sentence of a user, and perform word segmentation processing on the dialogue sentence to determine each word segment contained in the dialogue sentence; a determination module configured to, for each word segment, determine an importance degree corresponding to the word segment according to a frequency of occurrence of the word segment in the dialogue sentence; a selection module configured to select a preset number of word segments as candidate words according to the importance degrees corresponding to the word segments; an input module configured to input each candidate word group determined into a pre-trained sentence generation model to determine a reconstructed dialogue sentence corresponding to each candidate word group, the candidate word group containing at least one candidate word; a labeling module configured to determine each keyword in the dialogue sentence according to a semantic matching degree between each reconstructed dialogue sentence and the dialogue sentence, and label the keywords; wherein, for each candidate word group, if the matching degree between the reconstructed dialogue sentence corresponding to the candidate word group and the dialogue sentence is greater than a matching degree threshold corresponding to the candidate word group, a candidate word is added in the candidate word group to obtain an updated candidate word group, and the candidate word is continuously added until all candidate words are traversed in a case where the reconstructed dialogue sentence corresponding to the updated candidate word group is greater than the matching degree threshold corresponding to the updated candidate word group; the matching degree threshold corresponding to any candidate word group is positively correlated with a number of candidate words contained in the candidate word group.

8. The apparatus of claim 7, wherein the determination module is configured to, for each word segment, determine an importance degree corresponding to the word segment according to a frequency of occurrence of the word segment in the dialogue sentence and a frequency of occurrence of the word segment in other dialogue sentences contained in a preset sentence library.

9. The apparatus of claim 8, wherein the importance degree is positively correlated with the frequency of occurrence of the word segment in the dialogue sentence and negatively correlated with the frequency of occurrence of the word segment in the other dialogue sentences contained in the preset sentence library.

10. The apparatus of claim 7, wherein the selection module is specifically configured to sort each word segment according to the importance degrees from large to small, and determine each word segment before a preset position; randomly delete the word segments before the preset position, and take the remaining word segments before the preset position as the candidate words.

11. The apparatus of claim 7, further comprising: a training module configured to acquire a historical dialogue sentence; perform word segmentation processing on the historical dialogue sentence to determine each word segment contained in the historical dialogue sentence; for each word segment in the historical dialogue sentence, determine a historical importance degree corresponding to the word segment according to a frequency of occurrence of the word segment in the historical dialogue sentence; According to a historical importance degree corresponding to each word segment in the historical dialogue sentence, a preset number of word segments are selected as historical candidate words; each historical candidate word is input into the sentence generation model to determine a historical reconstruction sentence; and the sentence generation model is trained with an optimization target of minimizing a deviation between the historical dialogue sentence and the historical reconstruction sentence. 12.A computer readable storage medium, storing a computer program, wherein the computer program is executed by a processor to implement the method of any one of claims 1-6. 13.An electronic device, comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor implements the method of any one of claims 1-6 when executing the program.

Citation Information

Patent Citations

  • Method, device and equipment for generating dialogue statement, medium and program product

    CN114118100A

  • training data construction method for automatically generating training data for artificial intelligence model for counseling intention classification

    KR102280490B1