An intention evolution-based risk detection method, device and electronic equipment

CN122511235APending Publication Date: 2026-08-04NANJING LINGXING TECH CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
NANJING LINGXING TECH CO LTD
Filing Date
2026-04-29
Publication Date
2026-08-04

AI Technical Summary

Technical Problem

[0003]目前,网约车场景下对涉及安全问题的风险检测,主要依赖预先定义的风险关键词、句式模板及判定逻辑,但对迂回试探、渐进诱导、暗语隐喻等复杂场景适应性极差,导致漏判、误判率高

Benefits of technology

[0025] Furthermore, the technical effects of any of the implementation methods in the second to fifth aspects can be found in the technical effects of different implementation methods in the first aspect, and will not be repeated here.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN122511235A_ABST
    Figure CN122511235A_ABST
Patent Text Reader

Abstract

This application relates to the field of natural language processing technology, and in particular to a risk detection method, device, and electronic device based on intent evolution. It addresses the problems of high false negative and false positive rates in current risk detection methods for safety issues in ride-hailing scenarios. The method involves: acquiring the voice stream of in-vehicle conversations during a ride; preprocessing each acquired voice segment to obtain the dialogue text, and extracting intent features from individual sentences within the dialogue text to obtain intent features of each sentence, where the intent features characterize the degree to which the sentence involves a pre-defined risk; based on the intent features of multiple individual sentences in the trip, assessing the risk evolution of the in-vehicle conversation to obtain the probability that the in-vehicle conversation involves a pre-defined risk, and then determining if the risk probability exceeds a probability threshold, triggering an early warning for intervention; thereby achieving accurate risk identification and timely intervention.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application relates to the field of natural language processing technology, and in particular to a risk detection method, apparatus and electronic device based on intent evolution. Background Technology

[0002] With the rapid development of mobile internet, people's travel options have become more diverse, and ride-hailing services have gradually become a habit. At the same time, several problems in the operation of ride-hailing services have gradually emerged, the most important of which is safety, such as in-vehicle disturbances.

[0003] Currently, risk detection in ride-hailing scenarios primarily relies on predefined risk keywords, sentence templates, and judgment logic. However, this approach is extremely ineffective in complex scenarios involving roundabout probing, gradual inducement, and coded metaphors, leading to high rates of missed and false positives. With the rapid development of deep learning, risk detection models leveraging deep learning have gradually emerged. However, these models only perform semantic classification on single sentences or the entire dialogue, similarly exhibiting poor adaptability to complex scenarios involving roundabout probing, gradual inducement, and coded metaphors. Therefore, a risk detection method based on intent evolution is urgently needed to achieve accurate risk identification. Summary of the Invention

[0004] This application provides a risk detection method, device, and electronic device based on intent evolution, which can achieve accurate risk identification in ride-hailing scenarios, improve the accuracy of risk detection, and provide timely intervention to effectively prevent bad behavior and improve the safety of passengers.

[0005] The specific technical solutions provided in this application are as follows: In a first aspect, embodiments of this application provide a risk detection method based on intent evolution, including: Acquire the audio stream of in-vehicle conversations during the vehicle service trip; For each audio segment acquired from the audio stream, the audio segment is preprocessed to obtain dialogue text, and intent features are extracted from the single sentence text in the dialogue text to obtain the intent features of the single sentence text. The intent features characterize the degree to which the single sentence text involves a preset risk. Based on the intent features of multiple single-sentence texts in the trip, a risk assessment is performed on the intent evolution of the in-vehicle dialogue to obtain the risk probability that the in-vehicle dialogue involves the preset risk. If the probability of the risk exceeds a probability threshold, an early warning is triggered for intervention.

[0006] Using the method provided in this application, intent features are extracted from the single-sentence text corresponding to each speech segment in the speech stream of in-vehicle conversations. This extracts the speaker's potential intent that is not explicitly stated. Based on the extracted intent features and the intent features of multiple single-sentence texts during the journey, a risk analysis is performed on the temporal evolution of the potential intent of the in-vehicle conversation. This identifies the probability of whether the in-vehicle conversation involves a preset risk. When the probability of the risk exceeds a probability threshold, an early warning is triggered for intervention. This achieves accurate risk identification and intervention, effectively preventing undesirable behavior and improving the safety of passengers.

[0007] In one possible implementation, the risk assessment of the intent evolution of the in-vehicle dialogue based on the intent features of multiple single-sentence texts during the trip, to obtain the risk probability that the in-vehicle dialogue involves the preset risk, includes: Based on the intent features of the multiple single-sentence texts, the intent state features of each single-sentence text are extracted, and based on the extracted intent state features, the intent state trajectory of the in-vehicle dialogue is obtained. Based on the intent features of the single-sentence text and the intent features of the first single-sentence text, the degree of intent transfer between the single-sentence text and the first single-sentence text is analyzed to obtain the intent transfer features of the single-sentence text. The first single-sentence text is the single-sentence text that is adjacent to the single-sentence text and is obtained first. Based on the intent state trajectory, the intent transfer features of the single-sentence text, and the historical intent transfer features of the single-sentence text accumulated during the trip, a risk assessment is performed on the intent evolution of the in-vehicle dialogue to obtain the risk probability.

[0008] The above method extracts intent state features to obtain the intent state trajectory of the in-vehicle dialogue. This intent state trajectory depicts the continuous change process of the speaker's potential intent from the initial state to the subsequent state. This continuous change process can serve as the core basis for judging the progressive evolution of the pre-set risk. Based on the risk probability obtained from this intent state trajectory, it is possible to accurately assess whether the in-vehicle dialogue involves a pre-set risk, thereby improving the accuracy of risk detection.

[0009] In one possible implementation, intent features are extracted from single-sentence text in the dialogue text to obtain the intent features of the single-sentence text, including: The intent of the single-sentence text is encoded to obtain the intent features of the single-sentence text; The step of extracting the intent state features of each single sentence text based on the intent features of the multiple single sentence texts includes: By using a bidirectional long short-term memory network, based on the intent features of the multiple single-sentence texts, the intent features of any single-sentence text among the multiple single-sentence texts are encoded to obtain the intent state features of any single-sentence text.

[0010] The above method encodes intent in single-sentence texts, extracting the latent intent contained within each sentence, i.e., intent features that characterize the degree of pre-set risk involved in the single-sentence text. Through a bidirectional long short-term memory network, based on the intent features of multiple single-sentence texts and contextual temporal information, the intent state features at each moment in the in-vehicle dialogue are obtained, depicting the continuous evolution of intent as the dialogue progresses, as well as the overall level of pre-set risk involved in the current dialogue. This provides strong support for subsequent risk assessment based on the intent state trajectory formed by the intent state features.

[0011] In one possible implementation, the risk assessment of the intent evolution of the in-vehicle dialogue, based on the intent state trajectory, the intent transition features of the single-sentence text, and the historical intent transition features of the single-sentence text accumulated during the trip, to obtain the risk probability, includes: The intent transfer features of the single sentence text and the historical intent transfer features are normalized to obtain the weight sequence of the in-vehicle dialogue. Based on the weights in the weight sequence and the intention state features in the intention state trajectory, the risk probability that the in-vehicle dialogue is a dialogue involving the preset risk is obtained, and the i-th weight in the weight sequence is the weight of the (i+1)-th intention state feature in the intention state trajectory.

[0012] The above method is based on a weight sequence determined by intent transfer features, and weights the intent state features in the intent state trajectory based on the weight sequence, amplifying the intent state features with a high degree of intent transfer, so that the final risk probability can accurately reflect the potential intent of in-vehicle dialogue, achieving proactive and accurate risk identification.

[0013] In one possible implementation, after obtaining the dialogue text, the method further includes: The dialogue text is input into a trained risk detection model. The risk detection model extracts intent features from individual sentences in the dialogue text to obtain intent features of the individual sentences. Based on the intent features of multiple individual sentences in the trip, the intent evolution of the in-vehicle dialogue is assessed to obtain the risk probability. If the probability of risk exceeds the probability threshold, a detection result is generated by the risk detection model to characterize the in-vehicle dialogue as involving the preset risk. Based on the intent features of the multiple single-sentence texts and the intent state trajectory, the key intent risk information of the in-vehicle dialogue is analyzed to obtain an analysis report to explain the detection result. The analysis report and the detection result are then output as the final result of the in-vehicle dialogue.

[0014] The above method trains a risk detection model, enabling it to extract the speaker's potential intentions and track the temporal evolution of those intentions in the dialogue. This allows the model to identify whether an in-vehicle conversation involves a pre-set risk. When the detection results indicate that the in-vehicle conversation involves a pre-set risk, the method further analyzes the key intention risk information in the conversation, thereby obtaining an analysis report to explain the aforementioned detection results. This achieves accurate risk identification and key evidence localization, improving the interpretability of the model's output detection results.

[0015] In one possible implementation, the analysis of key intent risk information of the in-vehicle dialogue based on the intent features of the plurality of single-sentence texts and the intent state trajectory, to obtain an analysis report for interpreting the detection results, includes: Based on the intent features of the multiple single-sentence texts and the intent state trajectory, a score is determined for each single-sentence text, and the score represents the degree of necessity of the corresponding single-sentence text for the intent evolution of the in-vehicle dialogue. The sentence texts with scores greater than a score threshold among the plurality of sentence texts are identified as key risk texts; The analysis report is generated based on the key risk text, the score corresponding to the key risk text, and the key intent transfer sentence pairs in the in-vehicle dialogue. The key intent transfer sentence pairs include single sentence texts associated with the intent transfer feature that represents the greatest degree of intent transfer.

[0016] The above method uses the score corresponding to each sentence in the in-vehicle dialogue to represent the necessity of its evolution of intent in the dialogue. Based on the score, the sentence texts with scores greater than the score threshold among multiple sentence texts are identified as key risk texts, which can represent the overall intent of the entire dialogue. Based on intent transfer features, the sentence texts associated with the intent transfer features that represent the greatest degree of intent transfer are selected as key intent transfer sentence pairs, reflecting the speaker's significant abrupt change from normal intent to risk intent. These are key temporal features for determining the nascent / escalating of preset risks. An analysis report is generated based on the key risk texts and key intent transfer sentence pairs to explain the detection results output by the model, making the detection results interpretable. This analysis report can also serve as a basis for platform review and risk control, improving platform security monitoring and safe operation.

[0017] In one possible implementation, determining the score corresponding to each single sentence text based on the intent features of the plurality of single sentence texts and the intent state trajectory includes: The intent features of the second single-sentence text in the plurality of single-sentence texts are subjected to at least one perturbation process to obtain at least one intent feature sequence, wherein the perturbation process includes replacing them with a first intent feature, a second intent feature, or a third intent feature; Based on the intent state trajectory and the intent state trajectory of the at least one intent feature sequence, the necessity of the second single sentence text for the intent evolution of the in-vehicle dialogue is analyzed, and the score corresponding to the second single sentence text is obtained. Wherein, the first intention feature is determined based on the intention feature of the second single-sentence text and the intention feature representing a neutral intention; the second intention feature is the intention feature of other single-sentence texts among the plurality of single-sentence texts; the third intention feature is determined based on the intention feature adjacent to the intention feature of the second single-sentence text, the preceding intention feature and the following intention feature.

[0018] The above method, through at least one of the aforementioned perturbation processes, can accurately identify the single-sentence text that plays a dominant role in the overall evolution of the in-vehicle dialogue's intent. This improves the overall persuasiveness of the analysis report generated based on this, and allows for a better interpretation of the aforementioned detection results output by the model. This helps relevant personnel quickly complete platform review and carry out risk reversal.

[0019] In one possible implementation, the risk detection model is obtained by training the risk detection model to be trained on a dialogue sample set through multiple rounds. In one round of training: The dialogue samples in the dialogue sample set are input into the risk detection model to be trained to obtain the total loss. It is determined that the total loss does not meet the convergence condition, and the model parameters of the risk detection model to be trained are adjusted based on the total loss. The total loss includes a first loss, a second loss, and a third loss; the first loss represents the difference between the risk probability of the dialogue sample output by the risk detection model to be trained and the real risk label; the second loss represents the difference between the intent features of the dialogue sample output by the risk detection model to be trained and the real semantics; and the third loss represents the difference between the key risk text output by the risk detection model to be trained and the real risk text.

[0020] The above method, by determining the first loss, the second loss, and the third loss, achieves end-to-end optimization of each component of the risk detection model to be trained, improves the overall performance of the model, enhances the accuracy of risk detection, and thus improves the detection precision and accuracy of the model in the implementation phase.

[0021] Secondly, embodiments of this application provide a risk detection device based on intent evolution, comprising: The acquisition unit is used to acquire the voice stream of in-vehicle conversations during the vehicle service trip; The detection unit is configured to preprocess each audio segment acquired from the audio stream to obtain dialogue text, and extract intent features from individual sentences within the dialogue text to obtain intent features of those individual sentences, wherein the intent features characterize the degree to which the individual sentences involve a preset risk; based on the intent features of multiple individual sentences during the trip, the unit performs a risk assessment on the intent evolution of the in-vehicle dialogue to obtain the risk probability that the in-vehicle dialogue involves the preset risk; An intervention unit is used to determine if the risk probability exceeds a probability threshold and trigger an early warning to intervene.

[0022] Thirdly, embodiments of this application provide an electronic device, including: Memory is used to store computer programs or instructions; A processor for executing a computer program or instructions in the memory such that the method described in any of the first aspects is performed.

[0023] Fourthly, embodiments of this application provide a computer-readable storage medium that, when instructions in the storage medium are executed by a processor, enables the processor to perform the method described in any one of the first aspects above.

[0024] Fifthly, embodiments of this application provide a computer program product comprising: computer program code, which, when executed on a computer, causes the computer to perform the method described in any one of the first aspects.

[0025] Furthermore, the technical effects of any of the implementation methods in the second to fifth aspects can be found in the technical effects of different implementation methods in the first aspect, and will not be repeated here.

[0026] It should be understood that the above general description and the following detailed description are exemplary and explanatory only, and do not limit this application. Attached Figure Description

[0027] Figure 1 This is a schematic diagram illustrating an application scenario of an optional intention-evolution-based risk detection method in some embodiments of this application; Figure 2 This is a flowchart illustrating a risk detection method based on intent evolution in an embodiment of this application; Figure 3This is a schematic diagram of a process for assessing the risk probability of an in-vehicle conversation involving a preset risk, as described in an embodiment of this application. Figure 4 This is a schematic diagram illustrating a specific process for assessing the risk probability of an in-vehicle conversation involving a preset risk, as described in an embodiment of this application. Figure 5A This is a schematic diagram of the architecture of a risk detection model to be trained in an embodiment of this application; Figure 5B This is a schematic diagram of data flow during model training in an embodiment of this application; Figure 6 This is a flowchart illustrating another risk detection method based on intent evolution in the embodiments of this application; Figure 7 This is a schematic diagram of a process for generating an analysis report based on a risk detection model to interpret detection results, as described in an embodiment of this application. Figure 8 This is a schematic diagram of a process for evaluating the necessity of a single sentence text for intent evolution in an embodiment of this application; Figure 9 This is a schematic diagram of the logical architecture of a risk detection device based on intent evolution in an embodiment of this application; Figure 10 This is a schematic diagram of the physical architecture of an electronic device according to an embodiment of this application. Detailed Implementation

[0028] The technical solutions of the embodiments of this application will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only a part of the embodiments of this application, and not all of the embodiments. Based on the embodiments of this application, all other embodiments obtained by those of ordinary skill in the art without creative effort are within the scope of protection of this application.

[0029] It should be noted that the terms "first," "second," "third," etc., used in the specification, claims, and accompanying drawings of this application are used to distinguish similar objects and are not necessarily used to describe a specific order or sequence. It should be understood that such data can be interchanged where appropriate so that the embodiments of this application described herein can be implemented in sequences other than those illustrated or described herein.

[0030] The data collection, dissemination, and use in this application all comply with relevant national laws and regulations.

[0031] In this embodiment of the application, in order to address the problems of high false negative and false positive rates in current risk detection methods for safety issues in ride-hailing scenarios, this embodiment provides a risk detection method based on intent evolution. The method includes: acquiring the voice stream of in-vehicle dialogue during the vehicle service trip; for each voice segment acquired from the voice stream, preprocessing the voice segment to obtain dialogue text, and extracting intent features from individual sentences in the dialogue text to obtain intent features of individual sentences, wherein the intent features characterize the degree to which the individual sentences involve a preset risk; based on the intent features of multiple individual sentences in the trip, performing a risk assessment on the intent evolution of the in-vehicle dialogue to obtain the risk probability that the in-vehicle dialogue involves a preset risk, and then determining that the risk probability exceeds a probability threshold, triggering an early warning for intervention.

[0032] It should be noted that the preset risks in the embodiments of this application may refer to risks of inappropriate behaviors such as harassment and physical contact.

[0033] Using the above method, intent features are extracted from single-sentence texts corresponding to speech segments in the speech stream, thereby extracting / identifying the speaker's potential intent, i.e., the intent features of the single-sentence text. Based on the intent features of multiple single-sentence texts during the journey, a risk assessment is performed on the temporal evolution of the potential intent of the in-vehicle dialogue, thus obtaining the risk probability that the in-vehicle dialogue involves a preset risk. When the risk probability is determined to exceed the probability threshold, an early warning is triggered for intervention, achieving accurate risk identification and intervention, which can effectively prevent the occurrence of undesirable behaviors and improve the safety of passengers.

[0034] The preferred embodiments of this application will be further described in detail below with reference to the accompanying drawings. It should be understood that the preferred embodiments described herein are only for illustration and explanation of this application and are not intended to limit this application. Furthermore, the embodiments of this application and the features in the embodiments can be combined with each other without conflict.

[0035] See Figure 1 The diagram illustrates an application scenario of an optional intention-evolution-based risk detection method in some embodiments of this application. This application scenario includes an in-vehicle terminal 10 and a processing terminal 20, wherein the in-vehicle terminal 10 can be connected to the processing terminal 20 via a communication network.

[0036] In some embodiments, the processing terminal 20 may be an electronic device, such as an in-vehicle edge computing node, a cloud server, etc.

[0037] like Figure 1As shown, the voice acquisition module (such as a microphone array) in the vehicle terminal 10 collects the voice stream of the in-vehicle conversation (i.e., the in-vehicle conversation between the passenger and the driver) in real time during the vehicle service trip, and streams it to the processing terminal 20. The processing terminal 20 performs real-time preprocessing on the voice stream (such as real-time text transcription and incremental normalization processing), and dynamically extracts the intent features of single sentences in the dialogue text corresponding to the current voice segment. Then, combining the intent features of multiple single sentences in the trip, such as the intent features of single sentences associated with the current voice segment, and the intent features of single sentences associated with voice segments accumulated in the trip, the intent evolution of the in-vehicle conversation is risk-assessed, thereby obtaining the risk probability that the in-vehicle conversation involves a preset risk. When it is determined that the risk probability exceeds the probability threshold, an early warning is triggered to intervene.

[0038] For example, if it is determined that the probability of the risk exceeds the probability threshold, that is, the conversation in the car is clearly a conversation involving a preset risk, the processing terminal 20 can send a voice warning command to the vehicle terminal 10, so that the vehicle terminal 10 issues a voice warning such as "Please pay attention to your behavior" to the people in the car, and dials the relevant alarm phone number, thereby effectively preventing and alarming harassment or bad behavior in the car.

[0039] For example, if it is determined that the probability of the risk exceeds the probability threshold, that is, the conversation in the car is clearly a conversation involving a preset risk, the processing terminal 20 can call the dialing function to initiate a call request to the passenger / driver, etc., in order to achieve the purpose of intervention.

[0040] Of course, the methods provided in the embodiments of this application are not limited to those described above. Figure 1 The application scenarios shown can also be used for other possible similar applications. Figure 1 The application scenarios shown are not limited to those described herein.

[0041] After introducing the application scenarios of the embodiments of this application, the following describes a risk detection method based on intent evolution from the embodiments of this application. (See reference...) Figure 2 As shown in the figure, this application provides a risk detection method based on intent evolution. The specific process of this method is as follows: Step 200: Obtain the voice stream of in-vehicle conversations during the vehicle service trip.

[0042] In some embodiments of this application, the ride-hailing driver drives the ride-hailing vehicle to the pick-up point of the order, which can also be called the starting point of the order. After the driver clicks on the arrival at the pick-up point displayed on the terminal (in-vehicle terminal), the trip for that order is initiated. The terminal automatically starts the recording function and sends the recorded audio to the processing terminal in the form of an audio stream (subsequent embodiments of this application will use a cloud server as an example). The cloud server executes... Figure 2The method shown.

[0043] In practice, during step 200, the cloud server receives the voice stream sent by the terminal to obtain the voice stream of in-vehicle conversations during the vehicle service trip.

[0044] Step 210: For each audio segment acquired from the audio stream, preprocess the audio segment to obtain the dialogue text.

[0045] In this embodiment of the application, when the cloud server performs step 210, it specifically performs text recognition (text transcription) on the speech segment to obtain the initial text; then, it performs text processing on the initial text to obtain the above-mentioned dialogue text. The text processing can be incremental standardization processing, which can specifically include at least one of noise reduction, word segmentation, punctuation unification, and word embedding to convert the dialogue data contained in the speech segment into a standard form.

[0046] Step 220: Extract intent features from the single sentence text in the dialogue text to obtain the intent features of the single sentence text, wherein the intent features characterize the degree to which the single sentence text involves a preset risk.

[0047] In this embodiment of the application, when performing step 220, the cloud server can perform intent encoding on the single sentence text in the dialogue text, thereby obtaining the intent features of the single sentence text.

[0048] In this embodiment, the intent feature represents a speaker's potential communication tendency (intent) involving a predetermined risk, which is not explicitly stated. In a predetermined risk scenario, the potential communication tendency may include, but is not limited to, probing, inducing, controlling, or explicit tendencies. Therefore, in this embodiment, the extracted intent feature may include the intensity of potential communication tendencies across multiple dimensions, where the intensity of each dimension represents the salience of the corresponding tendency.

[0049] In this embodiment of the application, the intensity of multiple dimensions of potential communication tendency in an intent feature can coexist simultaneously, that is, the intent feature can also characterize the superposition state of multiple potential communication tendencies and the degree of intent mixing in a single sentence text.

[0050] It should be noted that the voice segment received by the cloud server may include multiple single sentences. Therefore, the resulting dialogue text also includes multiple single-sentence texts (in this embodiment, a single-sentence text corresponds to an independent statement or sentence). In step 220, each single-sentence text is specifically encoded with intent either sequentially or in parallel to obtain its corresponding intent features. For ease of explanation, subsequent embodiments of this application will use a single-sentence text as an example; the processing method for other single-sentence texts can be referred to the subsequent processing method for that single-sentence text.

[0051] Step 230: Based on the intent features of multiple single-sentence texts in the above-mentioned journey, conduct a risk assessment on the intent evolution of the in-vehicle dialogue to obtain the risk probability that the in-vehicle dialogue involves a preset risk.

[0052] In this embodiment of the application, when performing step 230, refer to... Figure 3 As shown, the cloud server can specifically execute the following process: Step 2301: Based on the intent features of the above multiple single-sentence texts, extract the intent state features of each single-sentence text.

[0053] In this embodiment of the application, when performing step 2301, the cloud server encodes the intent features of any one of the multiple single-sentence texts based on the intent features of the multiple single-sentence texts through a Bidirectional Long Short-Term Memory Network (BiLSTM) to obtain the intent state features of any one of the multiple single-sentence texts.

[0054] BiLSTM is a deep learning model that extends and improves upon the traditional Long Short-Term Memory Network (LSTM). BiLSTM consists of a forward LSTM and a backward LSTM, which process the input sequence in its forward and reverse order, respectively. Specifically, for a given input sequence, the forward LSTM reads the sequence data from left to right for encoding, while the backward LSTM reads the sequence data from right to left for encoding. Then, the hidden states from these two directions are concatenated / fused to obtain a representation containing complete contextual information.

[0055] In this embodiment of the application, the input sequence of BiLSTM is the intent feature sequence corresponding to the above-mentioned in-vehicle dialogue. This sequence is obtained by sorting the intent features of each sentence text obtained by extracting intent features from each sentence text of each acquired speech segment in chronological order.

[0056] For example, suppose the number of dialogue sentences (single-sentence text) obtained during the trip is N, and the intent features are represented in vector form, denoted as... Therefore, the above intention feature sequence can be represented as: ,in, This represents the intent feature of the a-th sentence (the a-th single sentence text).

[0057] In specific implementation, during step 2301, BiLSTM is used to target the intention feature sequence ( Each intent feature in the sequence is encoded in both forward and reverse directions to obtain two directional intent state features: a forward intent state feature and a reverse intent state feature. These two directional intent state features are then concatenated to obtain the intent state feature of the corresponding single-sentence text. The forward intent state feature represents the temporal influence of past intents on the current sentence, while the reverse intent state feature represents the semantic interpretation of the current sentence by future intents. For newly added single-sentence text in the intent feature sequence, the forward intent state feature similarly represents the temporal influence of past intents on the current sentence, while the reverse intent state feature represents the semantic interpretation of the current sentence.

[0058] Step 2302: Based on the extracted intent state features, obtain the intent state trajectory of the above in-vehicle dialogue.

[0059] In this embodiment of the application, when performing step 2302, the intent state features of the extracted multiple single-sentence texts are sorted according to the time sequence to obtain the intent state trajectory of the in-vehicle dialogue.

[0060] Step 2303: Based on the intent features of the above single-sentence text and the intent features of the first single-sentence text, analyze the degree of intent transfer between the above single-sentence text and the above first single-sentence text to obtain the intent transfer features of the above single-sentence text, wherein the first single-sentence text is the single-sentence text that is adjacent to the above single-sentence text and is obtained first.

[0061] In this embodiment of the application, a small intent transfer model can be pre-trained. This small intent transfer model can be a deep learning model used to obtain the intent transfer features of adjacent sentences based on the input adjacent sentences. The intent transfer features characterize the degree of intent transfer between adjacent sentences, wherein the greater the degree of intent transfer, the greater the difference in intent between adjacent sentences.

[0062] In specific implementation, when executing step 2303, the single sentence text that is adjacent to and precedes the single sentence text is determined as the first single sentence text. Then, the intent features of the single sentence text and the intent features of the first single sentence text are input into the intent transfer mini-model. The intent transfer mini-model is used to analyze the degree of intent transfer between the single sentence text and the first single sentence text, thereby obtaining the intent transfer features of the single sentence text.

[0063] Step 2304: Based on the above intention state trajectory, the above intention transfer characteristics of single-sentence text, and the above historical intention transfer characteristics of single-sentence text accumulated during the trip, conduct a risk assessment of the intention evolution of the in-vehicle dialogue to obtain the aforementioned risk probability.

[0064] In this embodiment of the application, when performing step 2304, refer to... Figure 4As shown, the cloud server executes the following process: Step 401: Normalize the intent transfer features of the above single-sentence text and the above historical intent transfer features to obtain the weight sequence of the aforementioned in-vehicle dialogue.

[0065] In this embodiment of the application, when performing step 401, the cloud server performs softmax normalization on the sequence composed of the intent transfer features of the above-mentioned single sentence text and the above-mentioned historical intent transfer features to obtain the weight sequence of the above-mentioned in-vehicle dialogue. The weight in the weight sequence reflects the degree of attention, and the larger the weight, the higher the degree of attention.

[0066] For example, assuming the number of dialogue sentences (single-sentence text) is N, then the length of the sequence composed of the aforementioned intent transfer features and the aforementioned historical intent transfer features is (N-1). Applying softmax normalization to the sequence of length (N-1) yields a weight sequence of length (N-1), denoted as […]. .

[0067] Step 402: Based on the weights in the above weight sequence and the intention state features in the above intention state trajectory, obtain the risk probability that the in-vehicle dialogue is a dialogue involving preset risks, wherein the i-th weight in the weight sequence is the weight of the (i+1)-th intention state feature in the above intention state trajectory.

[0068] In this embodiment of the application, when performing step 402, the cloud server assigns the i-th weight in the aforementioned weight sequence. The (i+1)th intention state feature in the above intention state trajectory Align one by one, and then align the weights. and intention state features By performing a weighted summation, we can obtain the globally weighted intent feature of the in-car conversation, denoted as . Its formula can be expressed as: .

[0069] Then, The input is processed through a multilayer perceptron (MLP), and then mapped to the interval [0, 1] using an activation function (sigmoid). This yields the risk probability that the in-vehicle dialogue involves a preset risk, denoted as [equation missing]. Its formula is expressed as follows: ) in, This represents the activation function (sigmoid).

[0070] Step 240: If the probability of the above-mentioned risk exceeds the probability threshold, trigger an early warning and intervene.

[0071] In this embodiment of the application, a probability threshold can be preset, which can be determined according to specific business needs.

[0072] So, after obtaining the risk probability in step 402, if it is determined that the risk probability exceeds the probability threshold, then step 240 is executed. If it is determined that the above risk probability exceeds the probability threshold, it means that the above in-vehicle dialogue involves a preset risk. The cloud server triggers an early warning to intervene in order to effectively avoid the occurrence of preset risks, eliminate bad behavior, and improve the safety of passengers.

[0073] In another embodiment, after obtaining the risk probability in step 402, if it is determined that the risk probability does not exceed the probability threshold, it indicates that the in-vehicle conversation is not a conversation involving a preset risk, or that the risk probability of the in-vehicle conversation involving a preset risk is low, and the cloud server can continue to monitor.

[0074] In other embodiments of this application, after obtaining the dialogue text in step 210, the above-mentioned risk detection processing flow can be implemented by a pre-trained risk detection model, which is obtained by training the risk detection model to be trained multiple times based on the dialogue sample set.

[0075] Before providing a detailed description of the specific content of this embodiment, the training process of the risk detection model will be introduced below.

[0076] Before training the risk detection model, a massive amount of raw dialogue data is first collected, with each raw dialogue consisting of several consecutive dialogue sentences. Each raw dialogue sentence is then labeled to determine its true risk label. Next, each raw dialogue sentence is preprocessed, for example, by performing text recognition to obtain the raw dialogue text, and then performing text processing on the raw dialogue text, such as noise reduction, word segmentation, punctuation standardization, and at least one of word embedding, to obtain multiple sentence texts of the original dialogue sentence.

[0077] Finally, the multiple sentence texts of each original dialogue data and its real risk label are used as a dialogue sample. This yields a training sample set, which includes a dialogue sample set, a validation set, and a test set. The dialogue sample set is used to train the risk detection model to be trained, the validation set is used to validate the trained risk detection model, and the test set is used to evaluate the model performance of the trained risk detection model.

[0078] In this embodiment of the application, the input dimension of the risk detection model to be trained is a single sentence, that is, a sentence (vector form) in the dialogue. This ensures that the model extracts and fuses intents in subsequent processing by treating the entire sentence as a unit, avoiding misjudgments caused by the model extracting and fusing intents by treating a single word as a unit.

[0079] During one round of training of the risk detection model to be trained, the dialogue samples in the above dialogue sample set are input into the risk detection model to be trained to obtain the total loss; it is determined that the total loss does not meet the convergence condition, and the model parameters of the risk detection model to be trained are adjusted based on the total loss.

[0080] In this embodiment of the application, the total loss includes a first loss, a second loss, and a third loss; wherein, the first loss represents the difference between the risk probability of the dialogue sample output by the risk detection model to be trained and the real risk label; the second loss represents the difference between the intent features of the dialogue sample output by the risk detection model to be trained and the real semantics; and the third loss represents the difference between the key risk text output by the risk detection model to be trained and the real risk text.

[0081] In specific implementation, the first loss can be determined based on the risk probability of the aforementioned dialogue sample output by the risk detection model to be trained and the true risk label of the dialogue sample; the second loss can be determined based on the semantic similarity between pairs of sentence texts in the multiple sentence texts included in the aforementioned dialogue sample, and the difference between the intent features of pairs of sentence texts; wherein, the intent feature of any sentence text is obtained by the risk detection model to be trained encoding the intent of the sentence text; the third loss is the sum of the sub-losses of each of the aforementioned multiple sentence texts; wherein, the sub-loss of any sentence text is determined based on the score and detection bias of the sentence text, and the true risk label of the aforementioned dialogue sample; the score of the sentence text represents the necessity of the sentence text for the intent evolution of the aforementioned dialogue sample; the detection bias represents the degree of impact of deleting the sentence text on the risk probability output by the risk detection model to be trained.

[0082] The following section provides a detailed explanation from the perspective of the model architecture of the risk detection model to be trained.

[0083] See Figure 5A As shown, the risk detection model to be trained may include an intent encoder, an intent sequence modeling module, a key intent node recognition module, and an intent-label alignment module, wherein, An intent encoder is used to encode a single sentence of text into a low-dimensional intent vector, which is the intent feature of the single sentence of text. This intent feature represents the degree to which the single sentence of text involves a pre-defined risk.

[0084] The intent sequence modeling module is used to model the temporal evolution of intent based on the intent feature sequence of single-sentence text, generate intent state features that incorporate contextual information, and identify key intent transitions (key intent transfer sentence pairs).

[0085] The key intent node identification module is used to identify the necessity of a single sentence text to the intent state trajectory (obtained based on the intent state features generated by the intent sequence modeling module) through perturbation processing, and quantify the necessity score of the single sentence text in the process (hereinafter referred to as the score), thereby locating the occurrence position of key risk intent based on the score.

[0086] The intent-label alignment module is designed with a multi-objective loss function to determine the total loss based on the multi-objective loss function. If the total loss does not meet the convergence condition, the model parameters of the risk detection model to be trained are adjusted based on the total loss to achieve end-to-end optimization and ensure the consistency between intent representation and real risk label.

[0087] The following section provides a detailed introduction to the model training process from the perspective of the architecture and processing flow of each module included in the risk detection model to be trained.

[0088] I. Intent Encoder

[0089] In some embodiments of this application, the intent encoder can be constructed based on a pre-trained language model (Bidirectional Encoder Representations from Transformers, BERT) based on the Transformer architecture.

[0090] In some preferred embodiments, the intent encoder may include BERT and a projection head, the projection head including a linear transform layer and a tanh activation function.

[0091] In this embodiment, the intent feature represents a speaker's potential communication tendency (intent) involving a predetermined risk, which is not explicitly stated. In a predetermined risk scenario, the potential communication tendency may include, but is not limited to, probing, inducing, controlling, or explicit tendencies. Therefore, in this embodiment, the extracted intent feature may include the intensity of potential communication tendencies across multiple dimensions, where the intensity of each dimension represents the salience of the corresponding tendency.

[0092] In this embodiment of the application, the intensity of multiple dimensions of potential communication tendency in an intent feature can coexist simultaneously, that is, the intent feature can also characterize the superposition state of multiple potential communication tendencies and the degree of intent mixing in a single sentence text.

[0093] In the specific training process, dialogue samples from the dialogue sample set are input into the intent encoder of the risk detection model to be trained. The BERT function in the intent encoder extracts the textual features of the statements in the dialogue samples, denoted as... Then, the text features are analyzed using the projection head. Perform linear transformation and activation processing to output the intent features of the statement text. The calculation formula can be:

[0094] in, Let be the projection weight matrix. For bias terms, This is the activation function.

[0095] For the aforementioned dialogue sample, the intent features of all its utterances are extracted to form the intent feature sequence of the dialogue sample, denoted as . Where n is the number of statements in the dialogue sample. For the first i The intent characteristics of a statement text. .

[0096] In this embodiment of the application, the intent feature Represented in the form of a continuous intent vector, denoted as For example, dimensions d=5-10 .

[0097] Among them, the continuous intent vector refers to: after a single sentence text is encoded by BERT and transformed by the projection head, the output is a d-dimensional floating-point vector, and the values ​​of each dimension change continuously between (-1, 1) (guaranteed by the tanh activation function), which is used to characterize the intensity of multi-dimensional potential intent; the intent feature sequence at the dialogue level is generated strictly according to the original dialogue sentence sequence without any sorting processing.

[0098] Assuming dimension d=5, the output of the intent encoder is a 5-dimensional floating-point vector, for example, [0.23, -0.45, 0.11, 0.59, -0.32]. Each dimension represents the intensity of a potential intent, and the values ​​are continuously changing rather than discrete labels.

[0099] II. Intent Sequence Modeling Module

[0100] In this embodiment of the application, the intent sequence modeling module can be built with BiLSTM as its core.

[0101] In some embodiments, the intent sequence modeling module may include a BiLSTM and an intent transition mini-model. The input to the intent sequence modeling module is the output of the aforementioned intent encoder—the intent feature sequence of the dialogue sample—and the output is the intent state trajectory and the intent transition features of adjacent sentence texts.

[0102] In the specific training process, the intent feature sequence of the aforementioned dialogue sample is input into BiLSTM and the intent transfer mini-model respectively. BiLSTM is used to obtain the intent state features corresponding to multiple sentence texts included in the dialogue sample, thereby forming the intent state trajectory of the dialogue sample. Based on the intent feature sequence of the dialogue sample, the intent transfer mini-model is used to analyze the degree of intent transfer between adjacent sentence texts in the multiple sentence texts included in the dialogue sample, and obtain the intent transfer features between adjacent sentence texts.

[0103] Specifically, BiLSTM is used to perform forward encoding and backward encoding on the intent features of each sentence text in the aforementioned intent feature sequence. Forward encoding is used to calculate the forward intent state feature, and backward encoding is used to calculate the backward intent state feature. Then, the forward intent state feature and the backward intent state feature are concatenated to obtain the intent state feature corresponding to any sentence text of the dialogue sample.

[0104] In this embodiment of the application, the forward encoding process can be represented by the following formula: , in, This represents the positive intent state feature of the i-th statement text, used to capture the temporal impact of past intents on the current context; Indicates a forward encoding operation; The intent feature representing the text of the i-th statement; This represents the intent state feature of the (i-1)th statement text.

[0105] In this embodiment, the reverse encoding process can be represented by the following formula:

[0106] in, The reverse intent state feature of the i-th statement text is used to capture the semantic interpretation of the current future intent; Indicates a reverse encoding operation; The intent feature representing the text of the i-th statement. This represents the intent state feature of the (i+1)th statement text.

[0107] In this embodiment of the application, the above two are concatenated to obtain the intent state feature for the i-th sentence text, which is represented in vector form as follows: .

[0108] For example, assuming that both the positive intent state features and the negative intent state features mentioned above are represented by 16-dimensional vectors, then the final intent state features obtained are... It can then be represented by a 32-dimensional vector.

[0109] For the aforementioned dialogue sample, the intent state features of all its sentence texts are extracted using the above method, and the intent state trajectory of the dialogue sample is formed in chronological order, denoted as... .

[0110] In this embodiment of the application, the aforementioned intention state trajectory refers to the evolution trajectory of the intention state features formed sequentially at each moment in the dialogue process corresponding to the dialogue sample. It is used to depict the continuous change process of the speaker's potential intention from the initial state to the subsequent state. This continuous change process can serve as the core basis for judging the progressive evolution involving preset risks.

[0111] Similarly, the intent transfer mini-model is used to analyze the degree of intent transfer between adjacent sentences in the dialogue sample based on the intent feature sequence in the input dialogue sample, so as to determine the intent transfer features between adjacent sentences in the dialogue sample.

[0112] In this embodiment of the application, the processing flow of the above-mentioned intent transfer small model can be represented by the following formula:

[0113] in, This represents the intent transfer feature of the (i+1)th statement text, reflecting the degree of intent transfer between the ith statement text and the (i+1)th statement text; The term represents the transfer weight matrix obtained from training the intention transfer small model. In this embodiment, the training method of the intention transfer small model is not specifically limited, and it can be obtained using existing or related methods.

[0114] Accordingly, for the aforementioned dialogue sample, by performing intent transfer degree analysis on all its sentence texts in the above manner, intent transfer features are obtained, and sorted according to time sequence, the intent transfer feature sequence of the dialogue sample can be obtained.

[0115] As can be understood from the above formula, the intent transfer feature is a scalar; the larger the value, the greater the degree of intent transfer. Therefore, by identifying abrupt peaks in the intent transfer feature sequence, the key transition node from normal intent (intent without pre-set risk) to risky intent (intent involving pre-set risk) can be located. This is a significant abrupt change in the intent state trajectory from normal intent to risky intent, manifested as a step increase in the intent transfer intensity of adjacent statements. This is a key temporal feature for determining the nascent / escalating nature of pre-set risk. The statement text associated with this key transition node is the key intent transfer sentence pair.

[0116] III. Key Intent Node Recognition Module

[0117] In this embodiment of the application, the module is mainly used to perturb the intent features of the statement text in the aforementioned dialogue sample, and to verify the necessity of each statement text to the intent state trajectory in a counterfactual manner, thereby quantifying the necessity of each statement text to the overall intent evolution, and thus accurately screening out key risk texts, that is, locating the location of key risk intents.

[0118] It should be noted that "counterfactual" refers to "what would have happened if a certain event had not occurred." This contrasts with "perturbation," which quantifies the necessity of the intended evolution of the text throughout the dialogue—the aforementioned score.

[0119] During the specific training process, the model's input consists of the intent feature sequence and intent state trajectory of the aforementioned dialogue samples. The output is the score corresponding to each statement text of the dialogue sample, as well as the key risk text of the selected dialogue sample. The perturbation process includes replacing the input with at least one of the intent features of the first sample, the intent features of the second sample, and the intent features of the third sample.

[0120] In this embodiment of the application, the perturbation processing refers to replacing the intent features of the statement text, introducing perturbation, obtaining a sequence of replaced intent features, and then, based on the replaced intent feature sequence and the original intent feature sequence, combined with the change of intent state trajectory, quantifying the necessity of each statement text included in the aforementioned dialogue text for the overall intent evolution, obtaining a score corresponding to each statement text, and then, based on these scores, accurately screening out the key risk texts in the dialogue sample.

[0121] The following section uses any sentence text included in the dialogue sample as an example to introduce the replacement methods corresponding to the intent features of the first sample, the intent features of the second sample, and the intent features of the third sample.

[0122] 1. First replacement method (corresponding to the intent feature of the first sample) – interpolation operation

[0123] In this embodiment of the application, the first sample intent feature is determined based on the intent features of the statement text and the intent features representing neutral intent.

[0124] Neutral intent, which is intent without any risk bias, can be obtained by averaging the intent features (intent vectors) of all "normal, blameless" dialogues. However, it should be noted that the intent features of neutral intent can also be obtained in other ways, which are not limited in this application.

[0125] In this embodiment of the application, the above-mentioned first sample intent feature can be represented by the following formula:

[0126] in, The first sample intent feature represents the text of the i-th statement. This is used to control the degree of modification; for example, β=0.5 means that 50% of the original intent is retained and 50% is changed to a neutral intent. These are the intentional features that characterize neutral intentions as described above.

[0127] In the specific training process, the intent features of the i-th sentence text are... Replace with the intent features of the first sample The replaced intention feature sequence is obtained, denoted as Then, the replaced intention feature sequence Inputting the aforementioned intent sequence modeling module yields the modified intent state trajectory, which can be denoted as... .

[0128] 2. Second replacement method (corresponding to the second sample intent feature) – replacement operation

[0129] In this embodiment, the second sample intent feature is the intent feature of other statement texts in the intent feature sequence of the dialogue sample. It is understood that the above substitution can be performed randomly or predefined; this application does not impose specific limitations, but it must differ from the subsequent third sample intent feature.

[0130] In some preferred embodiments, in order to avoid the second sample intent feature being identical to the third sample intent feature, and in order to reduce the amount of computation in training, intent feature replacement rules between each sentence text and other sentence texts can be predefined. For example, the intent feature of the third sentence text can be replaced with the intent feature of the fifth sentence text.

[0131] In the specific training process, the intent features of the i-th sentence text are... Replace it with the intent feature of any other statement text in this dialogue sample; for example, replace it with the first... Intent features of a statement text The replaced intention feature sequence is obtained. Then, the replaced intention feature sequence Inputting the aforementioned intent sequence modeling module yields the modified intent state trajectory, denoted as... .

[0132] 3. Third replacement method (third sample intent feature) – deletion operation

[0133] In this embodiment, the third sample intent feature is determined based on the preceding and following intent features adjacent to the intent feature of the statement text in the intent feature sequence of the dialogue sample. Specifically, if the statement text is the first statement text, the third intent feature is the second intent feature in the intent feature sequence of the dialogue sample (i.e., the intent feature of the second statement text in the dialogue sample); if the statement text is the last statement text, the third intent feature is the second-to-last intent feature in the intent feature sequence of the dialogue sample (i.e., the intent feature of the second-to-last statement text in the dialogue sample).

[0134] In the specific training process, the intent features of the i-th sentence text are... The intent feature sequence of the dialogue sample is removed, and the intent features of the preceding and following sentences are used to "fill in" the gaps to ensure that the sequence length remains unchanged. (1) If the i-th statement text is the 1st statement text (first statement text), then use the intent features of the 2nd statement text. To fill in the gap; (2) If the i-th statement text is the last statement text, then use the intent features of the second-to-last statement text. Fill in the gap; (3) If the i-th statement text is the middle sentence in the dialogue sample, then use the intent features of the previous statement text. Intent features of the following statement text The average value is supplemented, and this process can be expressed by the following formula: .

[0135] The intention feature sequence after replacement is obtained after filling in the gaps. Then, the replaced intention feature sequence Inputting the aforementioned intent sequence modeling module yields the modified intent state trajectory, denoted as:

[0136] In this embodiment of the application, after the above perturbation processing, the modified intent state trajectory can be obtained. For the modified intent state trajectory obtained after any of the above replacement methods, the difference value between the two can be determined by combining the intent state trajectory of the dialogue sample (referring to the original intent state trajectory), so as to obtain the score corresponding to the statement text based on the difference value.

[0137] In a preferred embodiment of this application, the above three replacement methods are used to perturb the statement text, and based on the three modified intent state trajectories obtained, the necessity of the statement text for the overall intent evolution of the dialogue sample is comprehensively analyzed to determine the score corresponding to the statement text.

[0138] In practice, when determining the difference between the modified intention state trajectory obtained by any replacement method and the original intention state trajectory, it can be obtained by the element-wise Euclidean distance between the original intention state trajectory and the modified intention state trajectory.

[0139] In this embodiment of the application, the text of the i-th statement is still taken as an example, and its general formula is expressed as follows:

[0140] in, This represents the difference between the modified intent state trajectory and the original intent state trajectory, with a value of [value missing]. (Corresponding to the first replacement method) (Corresponding to the second replacement method) (Corresponding to the third replacement method); This represents the intent state feature of the i-th statement text in the original intent state trajectory of the dialogue sample. This represents the intent state feature of the i-th statement text in the modified intent state trajectory (obtained after perturbation processing), with a value of [value missing]. , , .

[0141] Understandably, the larger the difference value mentioned above, the greater the impact of replacing the current intent (current statement text) on the overall intent evolution trajectory.

[0142] Then, after obtaining the difference values ​​of the overall intent evolution of the statement text under different replacement methods, a weighted fusion method can be used to obtain the score corresponding to the statement text.

[0143] In this embodiment of the application, the i-th statement text is still taken as an example, and its score is expressed by the following formula:

[0144] in, This represents the score corresponding to the i-th statement text; This indicates the weight of the first replacement method, such as a value of 0.2; This indicates the weight of the second replacement method, such as a value of 0.2; This indicates the weight of the third replacement method, such as a value of 0.6. It should be noted that the above weights are merely examples and can be adjusted according to the actual application scenario; this application does not impose specific limitations.

[0145] Understandably, the higher the score, the stronger the decisive role of the sentence in the overall trajectory of intention evolution, which is the core risk intention node.

[0146] For the aforementioned dialogue sample, by perturbing all its sentence texts in the above manner, the modified intent state trajectory of each sentence is obtained. By comparing it with the original intent state trajectory, the score corresponding to each sentence text in the dialogue sample can be obtained.

[0147] Then, the obtained score is compared with the set score threshold θ. If the score corresponding to a certain statement text is greater than θ, the statement text is determined to be a key risk intent node and recorded as a key risk text.

[0148] In this embodiment, the scoring threshold can be dynamically determined according to the actual application scenario. In some preferred embodiments, the scoring threshold can be 0.6.

[0149] IV. Intent-Label Alignment Module

[0150] In this embodiment of the application, the intent-label alignment module is pre-set with a multi-objective total loss function. This module is used to combine the real risk label y of the dialogue sample with the above-mentioned multi-objective total loss function to obtain the total loss. When it is determined that the total loss does not meet the convergence condition, the model parameters of the risk detection model to be trained are adjusted based on the total loss.

[0151] The total loss includes the aforementioned first loss, which represents the risk prediction loss and corresponds to the risk prediction loss function in the aforementioned multi-objective total loss function; the aforementioned second loss represents... Figure 1 Consistency loss, corresponding to the meaning in the above multi-objective total loss function. Figure 1 Consistency loss function; the aforementioned third loss characterizes the counterfactual loss, corresponding to the counterfactual loss function in the above multi-objective total loss function.

[0152] In some possible implementations, the above-mentioned multi-objective total loss function can be expressed by the following formula:

[0153] Where: L represents the multi-objective total loss function; This represents the risk prediction loss function; Indicates meaning Figure 1 Consistency loss function; Represents the counterfactual loss function; These are the weight coefficients, which can range from [0.1, 1]. However, it should be noted that the weight coefficients can be adaptively adjusted according to the training effect.

[0154] The following sections will discuss the predicted losses and intentions related to the aforementioned risks. Figure 1 This section introduces the concepts of detrimental loss and counterfactual loss.

[0155] 1. Risk prediction loss (first loss)

[0156] In this embodiment of the application, the risk prediction loss function can be expressed by the following formula:

[0157] Here, BCE is an abbreviation for Binary Cross Entropy, a loss function used for binary classification tasks; y represents the true risk label of the dialogue sample, with a value of 1 (risk) or 0 (normal). The sigmoid activation function is used to map the MLP output to the interval [0, 1] to obtain the risk probability that the dialogue sample is a dialogue involving a preset risk; MLP is a multilayer perceptron, whose input dimension is consistent with the global weighted intent feature (D) of the dialogue sample (e.g., 32-dimensional), and the output dimension is 1.

[0158] In the specific training process, based on the intent transfer feature sequence of the aforementioned dialogue sample, the intent transfer features in the intent transfer feature sequence are normalized to obtain the weight sequence of the dialogue sample. Then, the weights in the weight sequence are aligned with the intent state features in the intent state trajectory of the dialogue sample. Specifically, the k-th weight is... With the (k+1)th intention state feature Align each element one by one, and then sum them using a weighted method to obtain the global weighted intent feature of the dialogue sample, denoted as D. In this embodiment, the formula for D can be expressed as follows:

[0159] in, This represents the globally weighted intent features of dialogue samples in the dialogue sample set input into the risk detection model to be trained; n represents the total number of sentences in the statement text of this dialogue sample; k is the sequence number. This represents the k-th weight in the weight sequence of the dialogue sample; This represents the (k+1)th intent state feature in the intent state trajectory of the dialogue sample.

[0160] It should be noted that the intention state features of the first sentence text were not considered when determining the global weighted intention features because the intention transfer features characterize the degree of intention transfer between adjacent sentence texts. Based on this, the weight sequence is determined, and the intention state features in the intention state trajectory are weighted based on the weight sequence. By amplifying the intention state features with a high degree of intention transfer, risk can be identified proactively and accurately.

[0161] It is understood that in the embodiments of this application, the above-mentioned D can focus on the key position of intention mutation, such as the intention state corresponding to the trial → induced jump, so that the model can fully capture the evolution process involving preset risks.

[0162] Finally, by substituting the obtained D into the aforementioned risk prediction loss function and combining it with the actual risk label of the dialogue sample, we obtain the first loss of the dialogue sample.

[0163] 2. Meaning Figure 1 Injury resulting from the act (secondary loss)

[0164] In the embodiments of this application, To constrain semantically similar dialogue statements to have similar intent features, ensuring that the distribution of intent features aligns with the semantics of the statements, thereby improving the stability and discriminative power of the model's intent representation, the calculation formula can be expressed as follows:

[0165] in, This represents a set of statement pairs within the same dialogue. Let i and j represent the text of the i-th statement and the text of the j-th statement, respectively. express and The semantic similarity between the two sentences can be in the range of [0, 1], and the larger the value, the closer the two sentences are semantically; They represent Intent features (intent vector) output by the intent encoder; Intent features and The Euclidean distance between them is used to measure the degree of difference in the representation of intent features; In this embodiment of the application, the intention feature (vector) distance and semantic similarity of all semantically similar statement pairs are weighted and summed to obtain the second loss of the dialogue sample.

[0166] It should be noted that in the above loss function, by... As a weighting coefficient, for the i-th statement text With the text of the j-th statement Constrain the distance between intent features (intent vectors): For statement pairs with high semantic similarity (similarity()→1), force their intent vector distance to be greater than or equal to 1. →0, the closer to 0, the more similar the intent features are; for sentence pairs with low semantic similarity (similarity()→0), even if the intent vector distance is large, the contribution to the loss is very small.

[0167] Understandably, the constraint objective of this loss function is: the more similar the semantics of the statements, the smaller the distance between their corresponding intent vectors should be, i.e., the mapping relationship of "semantic similarity" → "intent vector similarity", thereby ensuring that the intent encoder can learn intent vectors that are strongly correlated with semantics and have a regular distribution, ensuring that the distribution of intent vectors is consistent with the semantics, improving the stability and discriminativeness of intent representation, and avoiding random and disordered mapping of intent vectors.

[0168] 3. Counterfactual loss (third loss)

[0169] In this embodiment of the application, firstly, the change in counterfactual risk is defined. , used to quantify the change in the overall risk probability of the dialogue after deleting the intent feature of the i-th statement text, can be expressed by the following formula:

[0170] in, That is, the globally weighted intent features of the aforementioned dialogue samples. The risk probability output by the classifier (MLP+Sigmoid); This represents the risk probability of the modified globally weighted intent feature output obtained after using the aforementioned third replacement method (i.e., deleting the i-th statement text and padding it). The calculation method and As mentioned above, details will not be repeated here. , The calculation method and The calculation method is the same as described above, and will not be repeated here.

[0171] It is understood that the embodiments of this application define Based solely on the intent to delete, this deletion operation directly reflects the sharp drop in risk after removing the core sentence. This not only aligns with business scenarios but also simplifies the calculation process, ensuring consistency between the necessity score and risk changes. As shown in the above formula, If it is a scalar value, This indicates that deleting the i-th statement text reduces the risk probability; this statement text is considered a critical risk text. This indicates that the text of the statement has no significant impact on risk.

[0172] Then, based on the above changes, the counterfactual loss function is defined. This is used to constrain the consistency between sample scores and changes in counterfactual risk.

[0173] In this embodiment of the application, the above-mentioned It can be expressed by the following formula:

[0174] in, y is the score corresponding to the i-th statement text, used to characterize the necessity and importance of the i-th statement text in the overall intent evolution of the dialogue sample; y is the true risk label of the dialogue sample. This represents element-wise multiplication (such as the Hadamard product); the summation range is i=1 to n, which means that each line of dialogue (sentence text) in the dialogue sample is constrained.

[0175] In this embodiment of the application, the third loss of the dialogue sample can be obtained through the above formula.

[0176] It is understood that, in the embodiments of this application, the amount of change is defined. And based on the amount of change Defining a counterfactual loss function can force the score to align with risk changes (aligning the key risk text output by the model with the actual risk text). That is, in risk dialogues, the greater the risk decreases after performing a deletion operation, the higher the score for its representation necessity should be; in normal dialogues, the smaller the impact of performing a deletion operation on the risk, the lower the score for its representation necessity should be. This ensures that the score can truly reflect the degree of contribution and necessity of the statement to the overall risk.

[0177] In this embodiment of the application, during the specific training process, the total loss of the dialogue samples input to the risk detection model to be trained can be obtained through the above-mentioned multi-objective total loss function. Then, based on the total loss, the model parameters of the risk detection model to be trained are adjusted by the gradient descent method, thus completing one round of training of the model.

[0178] In this embodiment of the application, during a training round, for samples involving preset risks (y=1), high-scoring intent nodes are marked as pseudo-positive examples, and nodes whose intent features exhibit a "preliminary-probing-crossing" transition are marked as key evidence of risk; for samples not involving preset risks (y=0), intent nodes exhibiting a "preliminary-probing-crossing" trend are forcibly marked as having a score of 0, and nodes whose intent trajectories exhibit random walks are marked as normal samples; so that the model can better identify dialogues involving preset risks, and at the same time better identify key risk intents and key risk texts (key risk statements) in the dialogue.

[0179] To facilitate better understanding, the following specific example illustrates the processing flow during one round of training of the above model.

[0180] Figure 5B This diagram illustrates the data flow during a training round. (See attached image.) Figure 5B As shown, during a training round, after inputting the dialogue samples from the dialogue sample set into the risk detection model to be trained, the aforementioned intent encoder performs intent encoding (i.e. intent feature extraction) on each sentence text in the dialogue sample, thereby obtaining the intent features of each sentence text, that is, obtaining the intent feature sequence of the dialogue sample. Then, using BiLSTM in the intent sequence modeling module, intent state features are extracted from the intent feature sequence of the dialogue sample to obtain the intent state features of each sentence text included in the dialogue sample, thereby obtaining the intent state trajectory of the dialogue sample. Furthermore, using the intent transfer mini-model in the intent sequence modeling module, the degree of intent transfer between pairs of adjacent sentence texts in the dialogue sample is analyzed based on the intent feature sequence of the dialogue sample to obtain the intent transfer features between pairs of adjacent sentence texts, thereby obtaining the intent transfer feature sequence of the dialogue sample. The intent transfer features in the intent transfer feature sequence are normalized by the intent-label alignment module to obtain the weight sequence of the dialogue sample. Based on the weight sequence and the intent state trajectory of the dialogue sample, the risk of the dialogue sample is assessed to obtain the risk probability that the dialogue sample is a dialogue involving a preset risk. Based on the intent feature sequence and intent state trajectory, the key intent node identification module perturbs the intent features of the statement text in the intent feature sequence according to the aforementioned replacement methods (see the first, second, and third replacement methods above) to obtain the replaced intent feature sequence. Then, the intent sequence modeling module determines the modified intent state trajectory corresponding to the replaced intent feature sequence. Based on the original intent state trajectory and the modified intent state trajectory, the key intent node identification module determines the score corresponding to each statement text and identifies the key risk text of the dialogue sample. Next, based on the risk probability and the true risk label of the dialogue sample, the intent-label alignment module uses the aforementioned risk prediction loss function to obtain the first loss of the dialogue sample; based on the intent feature sequence of the dialogue sample and the multiple sentence texts of the dialogue sample, the aforementioned intent-label alignment module uses the aforementioned intent prediction loss function to obtain the first loss of the dialogue sample. Figure 1The consistency loss function is used to obtain the second loss for the dialogue sample. Based on the risk probability of the dialogue sample output by the model, the risk probability output by the model after performing the aforementioned deletion operation on each sentence text (obtained through the collaboration of the key intent node identification module, intent sequence modeling module, and intent-label alignment module), and the true risk label of the dialogue sample, the counterfactual loss function is used to obtain the third loss for the dialogue sample. Then, based on the first loss, the second loss, and the third loss, as well as the aforementioned weight coefficients, the multi-objective total loss function is used to obtain the total loss for the dialogue sample. Based on the total loss, the model parameters of the risk detection model to be trained are adjusted.

[0181] When the risk detection model to be trained is trained in multiple rounds based on the dialogue sample set and the convergence condition is met, the model parameters of the risk detection model to be trained in the last round are output, and the risk detection model used in the inference stage is obtained.

[0182] In this embodiment of the application, after the model has been trained, the performance of the trained risk detection model can be evaluated on the aforementioned test set. The model accuracy and recall are statistically analyzed at different thresholds. Based on specific business needs, an appropriate probability threshold is selected for use in the inference stage.

[0183] The following describes the processing flow of the risk detection model during implementation. It should be noted that the network architecture of the risk detection model used in the inference phase is consistent with that of the risk detection model to be trained, enabling the multi-objective loss function of the intent-label alignment module. During implementation, the intent-label alignment module is only used to normalize the input intent transfer features to obtain a weight sequence, and based on the weight sequence and the input intent state trajectory, to obtain the risk probability.

[0184] In this embodiment of the application, based on steps 200 to 210, refer to... Figure 6 As shown, the method described in this application embodiment may further include the following steps 600 to 620: Step 600: Input the above dialogue text into the trained risk detection model, extract the intent features of the single sentence text in the above dialogue text through the risk detection model, obtain the intent features of the single sentence text, and based on the intent features of multiple single sentence texts in the trip, conduct a risk assessment on the intent evolution of the in-vehicle dialogue to obtain the risk probability that the above in-vehicle dialogue is a dialogue involving a preset risk.

[0185] In this embodiment of the application, when performing step 600, the cloud server inputs the above-mentioned dialogue text into the risk detection model. The dialogue text input into the risk detection model is encoded by the intent encoder to obtain the intent features of the single-sentence text. Then, through the intent sequence modeling module and the intent-label alignment module, based on the intent features of multiple single-sentence texts in the trip, that is, the intent features of the above-mentioned single-sentence texts and the intent features of the single-sentence texts accumulated in the trip, the risk evolution of the in-vehicle dialogue is assessed to obtain the aforementioned risk probability.

[0186] In specific implementation, the cloud server uses BiLSTM in the intent sequence modeling module to extract intent state features based on the intent features of the single sentence text and the intent features of the accumulated single sentence texts, i.e., bidirectional encoding, to obtain the intent state features of the single sentence text and the accumulated single sentence texts, thereby obtaining the intent state trajectory of the in-vehicle dialogue. Furthermore, the intent transfer mini-model in the intent sequence modeling module analyzes the degree of intent transfer between the single sentence text and the first single sentence text based on the intent features of the single sentence text and the intent features of the first single sentence text, to obtain the intent transfer features of the single sentence text, where the first single sentence text is the single sentence text that is adjacent to the above single sentence text and is obtained first.

[0187] Then, the cloud server, through the intent-tag alignment module, determines the weight sequence of the in-vehicle dialogue based on the aforementioned intent transfer features and the historical intent transfer features of the aforementioned historical single sentences. Then, based on the weights in the weight sequence and the intent state features in the aforementioned intent state trajectory, it obtains the risk probability that the in-vehicle dialogue involves a preset risk. Here, the i-th weight in the weight sequence is the weight of the (i+1)-th intent state feature in the aforementioned intent state trajectory. The cloud server then determines whether the in-vehicle dialogue involves a preset risk based on the comparison result between this risk probability and a probability threshold.

[0188] Step 610: Determine that the aforementioned risk probability exceeds the aforementioned probability threshold, generate a detection result through the risk detection model to characterize the aforementioned in-vehicle dialogue as a dialogue involving a preset risk, and analyze the key intent risk information of the in-vehicle dialogue based on the intent features of the aforementioned multiple single-sentence texts and the aforementioned intent state trajectory to obtain an analysis report to explain the aforementioned detection results.

[0189] In some embodiments, if the comparison result is that the risk probability exceeds the above probability threshold, then step 610 is executed.

[0190] In the embodiments of this application, see the following: Figure 7As shown, in step 610, when analyzing the key intent risk information of the in-vehicle dialogue based on the intent features of the aforementioned multiple single-sentence texts and the aforementioned intent state trajectory, and obtaining an analysis report to explain the aforementioned detection results, the cloud server can specifically execute the following process: Step 6101: Based on the intent features of the above multiple single-sentence texts and the above intent state trajectory, determine the score corresponding to each single-sentence text, wherein the score represents the degree of necessity of the corresponding single-sentence text for the intent evolution of the in-vehicle dialogue.

[0191] In the embodiments of this application, see the following: Figure 8 As shown, the specific process for executing step 6101 is as follows: Step 801: Perform at least one perturbation process on the intent features of the second single-sentence text among the above multiple single-sentence texts to obtain at least one intent feature sequence.

[0192] In this embodiment of the application, when performing step 801, the cloud server specifically inputs the intent feature sequence of the in-vehicle dialogue obtained by sorting the intent features of the above-mentioned multiple single-sentence texts in chronological order into the aforementioned key intent node recognition module. The key intent node recognition module performs at least one perturbation process on the intent features of the second single-sentence text in the intent feature sequence to obtain at least one intent feature sequence, wherein the second single-sentence text is any single-sentence text in the in-vehicle dialogue.

[0193] The perturbation process includes replacing the feature with a first intent feature, a second intent feature, or a third intent feature. Then, the key intent node identification module can obtain a new intent feature sequence corresponding to different replacement methods, i.e., obtain at least one of the aforementioned intent feature sequences.

[0194] In this embodiment, the first intent feature is determined based on the intent features of the second single-sentence text and a preset intent feature representing a neutral intent. In specific implementations, the method for determining the first intent feature is similar to the method for determining the first sample intent feature, as described above; please refer to the description of the first sample intent feature, which will not be repeated here.

[0195] In this embodiment, the second intent feature is the intent feature of other single-sentence texts among the plurality of single-sentence texts. In specific implementation, the determination method of the second intent feature is similar to the determination method of the second sample intent feature, which can be found in the foregoing description of the second sample intent feature, and will not be repeated here.

[0196] In this embodiment, the aforementioned third intent feature is determined based on the preceding and following intent features adjacent to the intent feature of the second single-sentence text among the plurality of single-sentence texts. Specifically, the determination method of the aforementioned third intent feature is similar to the determination method corresponding to the aforementioned third sample intent feature; please refer to the foregoing description of the third sample intent feature, which will not be repeated here. Furthermore, if the second single-sentence text is the first single-sentence text, then the aforementioned third intent feature is the intent feature of the second single-sentence text; if the second single-sentence text is the last single-sentence text, then the aforementioned third intent feature is the intent feature of the penultimate single-sentence text.

[0197] Step 802: Based on the above intention state trajectory and the intention state trajectory of at least one intention feature sequence, analyze the necessity of the second single sentence text for the intention evolution of the in-vehicle dialogue, and obtain the score corresponding to the second single sentence text.

[0198] In this embodiment, for ease of distinction, the intent feature sequence of the in-vehicle dialogue is designated as the first intent feature sequence, and the intent feature sequence obtained after subsequent perturbation processing is designated as the second intent feature sequence. Then, during step 802, the cloud server can input any of the second intent feature sequences into the aforementioned intent sequence modeling module. Through the BiLSTM in this module, the intent state features of each intent feature in the second intent feature sequence are extracted, thereby obtaining the intent state trajectory of the second intent feature sequence. When multiple second intent feature sequences exist, the above method is applied to each second intent feature sequence to obtain the intent state trajectory of at least one of the aforementioned second intent feature sequences.

[0199] Then, the cloud server inputs the aforementioned intent state trajectory and the intent state trajectory of at least one second intent feature sequence into the aforementioned key intent node recognition module. The key intent node recognition module uses the aforementioned general formula to determine the difference value of each intent state trajectory in the aforementioned intent state trajectory and the intent state trajectory of at least one second intent feature sequence. Based on the difference value and the weights corresponding to different replacement methods, the score corresponding to the second single sentence text is obtained.

[0200] Step 6102: Identify the single-sentence texts with scores greater than the score threshold among the above multiple single-sentence texts as key risk texts.

[0201] In this embodiment of the application, when performing step 6102, the cloud server compares the scores corresponding to each of the above-mentioned multiple single-sentence texts obtained by the aforementioned key intent node recognition module with a preset score threshold, thereby determining whether there is a single-sentence text among the above-mentioned multiple single-sentence texts that is greater than the score threshold. If so, the single-sentence text that is greater than the score threshold is identified as the key risk text of the in-vehicle dialogue.

[0202] In this embodiment of the application, by using at least one of the above-mentioned perturbation processes, the single-sentence text that plays a dominant role in the overall intention evolution of the in-vehicle dialogue can be accurately identified, thereby improving the overall persuasiveness of the analysis report generated based on this, and thus better interpreting the aforementioned detection results output by the model.

[0203] Step 6103: Based on the above key risk text, the scores corresponding to the above key risk text, and the key intent transfer sentence pairs of the above in-vehicle dialogue, generate the aforementioned analysis report, wherein the key intent transfer sentence pairs include single sentence texts associated with the intent transfer feature that represents the greatest degree of intent transfer.

[0204] In this embodiment of the application, when performing step 6103, the cloud server generates an analysis report to explain the detection results based on the aforementioned key intent node recognition module, the key risk text, the score corresponding to the key risk text, and the key intent transfer sentence pairs of the in-vehicle dialogue. The key intent transfer sentence pairs are transmitted to the key intent node recognition module by the aforementioned intent sequence modeling module. The intent sequence modeling module specifically identifies the single sentence text associated with the intent transfer feature that represents the greatest degree of intent transfer based on the determined multiple intent transfer features of the in-vehicle dialogue.

[0205] Step 620: Output the analysis report and the aforementioned test results as the final result of the in-vehicle dialogue.

[0206] In this embodiment, the cloud server outputs the analysis report used to interpret the aforementioned detection results along with the detection results. This allows relevant personnel to understand the reasons why the risk detection model outputs the detection results based on the key risk text, the scores corresponding to the key risk text, and the key intent transfer sentence pairs in the in-vehicle dialogue in the analysis report. This clarifies the key intent risk information that the model determines the in-vehicle dialogue to be a dialogue involving preset risks. At the same time, the analysis report can also serve as the basis for platform review and risk control, helping relevant personnel to quickly complete platform review and carry out risk control.

[0207] In this embodiment, by training a risk detection model, the model is equipped with the ability to extract potential intentions that the speaker has not explicitly stated and to track the temporal evolution of intentions in the dialogue. This allows for accurate identification of dialogues involving preset risks. When the identified detection results indicate that the in-vehicle dialogue involves preset risks, the model analyzes the key intention risk information in the in-vehicle dialogue to obtain an analysis report that explains the aforementioned detection results. This achieves accurate risk identification and key evidence location, effectively solving the core technical problems of traditional technologies, such as the inability to identify progressively preset risks, high rates of missed and false judgments, and lack of interpretability of detection results.

[0208] In other embodiments, after obtaining the aforementioned risk probability in step 600, if the aforementioned comparison result shows that the risk probability does not exceed the aforementioned probability threshold, the cloud server generates and outputs a detection result characterizing the in-vehicle dialogue as a dialogue that does not involve a preset risk through the aforementioned risk detection model.

[0209] Based on the same inventive concept, see [reference] Figure 9 As shown, this application provides a risk detection device based on intent evolution, comprising: Acquisition unit 910 is used to acquire the voice stream of in-vehicle conversations during the vehicle service trip; The detection unit 920 is used to preprocess each audio segment acquired from the audio stream to obtain dialogue text, and to extract intent features from individual sentences in the dialogue text to obtain intent features of the individual sentences, wherein the intent features characterize the degree to which the individual sentences involve a preset risk; based on the intent features of multiple individual sentences in the trip, the intent evolution of the in-vehicle dialogue is assessed to obtain the risk probability that the in-vehicle dialogue involves the preset risk; Intervention unit 930 is used to determine that the risk probability exceeds the probability threshold and trigger an early warning to intervene.

[0210] In one possible implementation, the detection unit 920 is specifically used for: Based on the intent features of the multiple single-sentence texts, the intent state features of each single-sentence text are extracted, and based on the extracted intent state features, the intent state trajectory of the in-vehicle dialogue is obtained. Based on the intent features of the single-sentence text and the intent features of the first single-sentence text, the degree of intent transfer between the single-sentence text and the first single-sentence text is analyzed to obtain the intent transfer features of the single-sentence text. The first single-sentence text is the single-sentence text that is adjacent to the single-sentence text and is obtained first. Based on the intent state trajectory, the intent transfer features of the single-sentence text, and the historical intent transfer features of the single-sentence text accumulated during the trip, a risk assessment is performed on the intent evolution of the in-vehicle dialogue to obtain the risk probability.

[0211] In one possible implementation, the detection unit 920 is specifically used for: The intent of the single-sentence text is encoded to obtain the intent features of the single-sentence text; The detection unit 920 is specifically used for: By using a bidirectional long short-term memory network, based on the intent features of the multiple single-sentence texts, the intent features of any single-sentence text among the multiple single-sentence texts are encoded to obtain the intent state features of any single-sentence text.

[0212] In one possible implementation, the detection unit 920 is specifically used for: The intent transfer features of the single sentence text and the historical intent transfer features are normalized to obtain the weight sequence of the in-vehicle dialogue. Based on the weights in the weight sequence and the intention state features in the intention state trajectory, the risk probability that the in-vehicle dialogue is a dialogue involving the preset risk is obtained, and the i-th weight in the weight sequence is the weight of the (i+1)-th intention state feature in the intention state trajectory.

[0213] In one possible implementation, after obtaining the dialogue text, the detection unit 920 is further configured to: The dialogue text is input into a trained risk detection model. The risk detection model extracts intent features from individual sentences in the dialogue text to obtain intent features of the individual sentences. Based on the intent features of multiple individual sentences in the trip, the intent evolution of the in-vehicle dialogue is assessed to obtain the risk probability. If the probability of risk exceeds the probability threshold, a detection result is generated by the risk detection model to characterize the in-vehicle dialogue as involving the preset risk. Based on the intent features of the multiple single-sentence texts and the intent state trajectory, the key intent risk information of the in-vehicle dialogue is analyzed to obtain an analysis report to explain the detection result. The analysis report and the detection result are then output as the final result of the in-vehicle dialogue.

[0214] In one possible implementation, the detection unit 920 is specifically used for: Based on the intent features of the multiple single-sentence texts and the intent state trajectory, a score is determined for each single-sentence text, and the score represents the degree of necessity of the corresponding single-sentence text for the intent evolution of the in-vehicle dialogue. The sentence texts with scores greater than a score threshold among the plurality of sentence texts are identified as key risk texts; The analysis report is generated based on the key risk text, the score corresponding to the key risk text, and the key intent transfer sentence pairs in the in-vehicle dialogue. The key intent transfer sentence pairs include single sentence texts associated with the intent transfer feature that represents the greatest degree of intent transfer.

[0215] In one possible implementation, the detection unit 920 is specifically used for: The intent features of the second single-sentence text in the plurality of single-sentence texts are subjected to at least one perturbation process to obtain at least one intent feature sequence, wherein the perturbation process includes replacing them with a first intent feature, a second intent feature, or a third intent feature; Based on the intent state trajectory and the intent state trajectory of the at least one intent feature sequence, the necessity of the second single sentence text for the intent evolution of the in-vehicle dialogue is analyzed, and the score corresponding to the second single sentence text is obtained. The first intention feature is determined based on the intention feature of the second single-sentence text and the intention feature representing a neutral intention; the second intention feature is the intention feature of other single-sentence texts among the plurality of single-sentence texts; the third intention feature is determined based on the intention feature of the preceding single-sentence text adjacent to the second single-sentence text and the intention feature of the following single-sentence text.

[0216] In one possible implementation, the risk detection model is obtained by training the risk detection model to be trained on a dialogue sample set through multiple rounds. In one round of training: The dialogue samples in the dialogue sample set are input into the risk detection model to be trained to obtain the total loss. It is determined that the total loss does not meet the convergence condition, and the model parameters of the risk detection model to be trained are adjusted based on the total loss. The total loss includes a first loss, a second loss, and a third loss; the first loss represents the difference between the risk probability of the dialogue sample output by the risk detection model to be trained and the real risk label; the second loss represents the difference between the intent features of the dialogue sample output by the risk detection model to be trained and the real semantics; and the third loss represents the difference between the key risk text output by the risk detection model to be trained and the real risk text.

[0217] Based on the same inventive concept, this application provides an electronic device, which is described below with reference to... Figure 10 This application describes an electronic device according to such an embodiment. Figure 10 The electronic device shown is merely an example and should not be construed as limiting the functionality and scope of the embodiments described in this application. Figure 10 As shown, electronic devices may include, but are not limited to: Memory 1001 is used to store computer programs or instructions; Processor 1002 is configured to execute computer programs or instructions in memory 1001 such that any of the methods described in the above embodiments is performed.

[0218] In some embodiments, memory 1001 may include a readable medium in the form of volatile memory, such as random access memory (RAM) and / or cache memory, and may further include read-only memory (ROM).

[0219] In some embodiments, processor 1002 may include one or more central processing units (CPUs) or digital processing units, etc., for executing computer programs or instructions in memory 1001, such that any of the methods described in the above embodiments is executed.

[0220] It should be noted that the specific connection medium between the memory 1001 and the processor 1002 is not limited in the embodiments of this application. The embodiments of this application... Figure 10 In this diagram, the memory 1001 and processor 1002 are connected via bus 1003. The connections between other components are merely illustrative and not intended to be limiting. Bus 1003 can be categorized as an address bus, data bus, control bus, etc. For ease of illustration, Figure 10 The bus is represented by a single thick line, but this does not mean that there is only one bus or one type of bus.

[0221] Based on the same inventive concept, embodiments of this application provide a computer-readable storage medium that, when executed by a processor, enables the processor to perform the method described in any of the preceding claims. Since the principle by which the computer-readable storage medium solves the problem is similar to that of the risk detection method based on intent evolution, the implementation of the computer-readable storage medium can be found in the implementation of the method, and repeated details will not be elaborated further.

[0222] Based on the same inventive concept, this application also provides a computer program product, which includes computer program code that, when run on a computer, causes the computer to execute any of the methods described above. Since the principle by which the above-described computer program product solves the problem is similar to that of the intention-evolution-based risk detection method, the implementation of the above-described computer program product can refer to the implementation of the method; repeated details will not be elaborated further.

[0223] Those skilled in the art will understand that embodiments of this application can be provided as methods, systems, or computer program products. Therefore, this application can take the form of a completely hardware embodiment, a completely software embodiment, or an embodiment combining software and hardware aspects. Furthermore, this application can take the form of a computer program product embodied 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.

[0224] This application is described with reference to flowchart illustrations and / or block diagrams of methods, apparatus (systems), and computer program products according to this application. It should be understood that each block of the flowchart illustrations and / or block diagrams, and combinations of blocks in the flowchart illustrations 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 processor, 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 one or more blocks of the flowchart illustrations and / or one or more blocks of the block diagrams.

[0225] These computer program instructions may also be stored in a computer-readable storage medium that can direct a computer or other programmable data processing device to function in a particular manner, such that the instructions stored in the computer-readable storage medium produce an article of manufacture including instruction means that implement the functions specified in one or more flows in a flowchart and / or one or more blocks in a block diagram.

[0226] These computer program instructions may 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 functions specified in one or more processes in the flowchart and / or one or more blocks in the block diagram.

[0227] Obviously, those skilled in the art can make various modifications and variations to this application without departing from the spirit and scope of this application. Therefore, if such modifications and variations fall within the scope of the claims of this application and their equivalents, this application also intends to include such modifications and variations.

Claims

1. A risk detection method based on intent evolution, characterized in that, include: Acquire the audio stream of in-vehicle conversations during the vehicle service trip; For each audio segment acquired from the audio stream, the audio segment is preprocessed to obtain dialogue text, and intent features are extracted from the single sentence text in the dialogue text to obtain the intent features of the single sentence text. The intent features characterize the degree to which the single sentence text involves a preset risk. Based on the intent features of multiple single-sentence texts in the trip, a risk assessment is performed on the intent evolution of the in-vehicle dialogue to obtain the risk probability that the in-vehicle dialogue involves the preset risk. If the probability of the risk exceeds a probability threshold, an early warning is triggered for intervention.

2. The method as described in claim 1, characterized in that, The risk assessment of the intent evolution of the in-vehicle dialogue based on the intent features of multiple single-sentence texts during the trip, to obtain the risk probability that the in-vehicle dialogue involves the preset risk, includes: Based on the intent features of the multiple single-sentence texts, the intent state features of each single-sentence text are extracted, and based on the extracted intent state features, the intent state trajectory of the in-vehicle dialogue is obtained. Based on the intent features of the single-sentence text and the intent features of the first single-sentence text, the degree of intent transfer between the single-sentence text and the first single-sentence text is analyzed to obtain the intent transfer features of the single-sentence text. The first single-sentence text is the single-sentence text that is adjacent to the single-sentence text and is obtained first. Based on the intent state trajectory, the intent transfer features of the single-sentence text, and the historical intent transfer features of the single-sentence text accumulated during the trip, a risk assessment is performed on the intent evolution of the in-vehicle dialogue to obtain the risk probability.

3. The method as described in claim 2, characterized in that, Intent features are extracted from single-sentence texts in the dialogue text to obtain intent features of the single-sentence texts, including: The intent of the single-sentence text is encoded to obtain the intent features of the single-sentence text; The step of extracting the intent state features of each single sentence text based on the intent features of the multiple single sentence texts includes: By using a bidirectional long short-term memory network, based on the intent features of the multiple single-sentence texts, the intent features of any single-sentence text among the multiple single-sentence texts are encoded to obtain the intent state features of any single-sentence text.

4. The method as described in claim 2, characterized in that, The risk assessment of the intent evolution of the in-vehicle dialogue is performed based on the intent state trajectory, the intent transition features of the single-sentence text, and the historical intent transition features of the single-sentence text accumulated during the trip, to obtain the risk probability, including: The intent transfer features of the single sentence text and the historical intent transfer features are normalized to obtain the weight sequence of the in-vehicle dialogue. Based on the weights in the weight sequence and the intention state features in the intention state trajectory, the risk probability that the in-vehicle dialogue is a dialogue involving the preset risk is obtained, and the i-th weight in the weight sequence is the weight of the (i+1)-th intention state feature in the intention state trajectory.

5. The method according to any one of claims 2-4, characterized in that, After obtaining the dialogue text, the method further includes: The dialogue text is input into a trained risk detection model. The risk detection model extracts intent features from individual sentences in the dialogue text to obtain intent features of the individual sentences. Based on the intent features of multiple individual sentences in the trip, the intent evolution of the in-vehicle dialogue is assessed to obtain the risk probability. If the probability of risk exceeds the probability threshold, a detection result is generated by the risk detection model to characterize the in-vehicle dialogue as involving the preset risk. Based on the intent features of the multiple single-sentence texts and the intent state trajectory, the key intent risk information of the in-vehicle dialogue is analyzed to obtain an analysis report to explain the detection result. The analysis report and the detection result are then output as the final result of the in-vehicle dialogue.

6. The method as described in claim 5, characterized in that, The key intent risk information of the in-vehicle dialogue is analyzed based on the intent features of the multiple single-sentence texts and the intent state trajectory, resulting in an analysis report to explain the detection results, including: Based on the intent features of the multiple single-sentence texts and the intent state trajectory, a score is determined for each single-sentence text, and the score represents the degree of necessity of the corresponding single-sentence text for the intent evolution of the in-vehicle dialogue. The sentence texts with scores greater than a score threshold among the plurality of sentence texts are identified as key risk texts; The analysis report is generated based on the key risk text, the score corresponding to the key risk text, and the key intent transfer sentence pairs in the in-vehicle dialogue. The key intent transfer sentence pairs include single sentence texts associated with the intent transfer feature that represents the greatest degree of intent transfer.

7. The method as described in claim 6, characterized in that, The determination of a score for each sentence text based on the intent features and intent state trajectory of the multiple single-sentence texts includes: The intent features of the second single-sentence text in the plurality of single-sentence texts are subjected to at least one perturbation process to obtain at least one intent feature sequence, wherein the perturbation process includes replacing them with a first intent feature, a second intent feature, or a third intent feature; Based on the intent state trajectory and the intent state trajectory of the at least one intent feature sequence, the necessity of the second single sentence text for the intent evolution of the in-vehicle dialogue is analyzed, and the score corresponding to the second single sentence text is obtained. The first intention feature is determined based on the intention feature of the second single-sentence text and the intention feature representing a neutral intention; the second intention feature is the intention feature of other single-sentence texts among the plurality of single-sentence texts; the third intention feature is determined based on the intention feature of the preceding single-sentence text adjacent to the second single-sentence text and the intention feature of the following single-sentence text.

8. The method as described in claim 5, characterized in that, The risk detection model is obtained by training the risk detection model to be trained on a dialogue sample set through multiple rounds of training. In one round of training: The dialogue samples in the dialogue sample set are input into the risk detection model to be trained to obtain the total loss. It is determined that the total loss does not meet the convergence condition, and the model parameters of the risk detection model to be trained are adjusted based on the total loss. The total loss includes a first loss, a second loss, and a third loss; the first loss represents the difference between the risk probability of the dialogue sample output by the risk detection model to be trained and the real risk label; the second loss represents the difference between the intent features of the dialogue sample output by the risk detection model to be trained and the real semantics; and the third loss represents the difference between the key risk text output by the risk detection model to be trained and the real risk text.

9. A risk detection device based on intent evolution, characterized in that, include: The acquisition unit is used to acquire the voice stream of in-vehicle conversations during the vehicle service trip; The detection unit is configured to preprocess each audio segment acquired from the audio stream to obtain dialogue text, and extract intent features from individual sentences within the dialogue text to obtain intent features of those individual sentences, wherein the intent features characterize the degree to which the individual sentences involve a preset risk; based on the intent features of multiple individual sentences during the trip, the unit performs a risk assessment on the intent evolution of the in-vehicle dialogue to obtain the risk probability that the in-vehicle dialogue involves the preset risk; An intervention unit is used to determine if the risk probability exceeds a probability threshold and trigger an early warning to intervene.

10. An electronic device, characterized in that, include: Memory is used to store computer programs or instructions; A processor for executing a computer program or instructions in the memory such that the method described in any one of claims 1-8 is performed.