Method, device and equipment for extracting experience in interaction, medium and product
By constructing a global behavioral graph of interactive sequence events and performing causal window analysis, the problems of automation and interpretability in the discovery of causal relationships during interaction are solved, improving the efficiency and quality of interactive experience extraction and supporting interpretable decision optimization.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-12-18
- Publication Date
- 2026-03-27
AI Technical Summary
Existing interactive process analysis techniques are difficult to automate and scale up in discovering deep causal relationships, resulting in decision bias, low efficiency in experience extraction, and poor interpretability and reasonability.
By acquiring the interaction sequences in the task interaction records, an event cluster set is generated and a global behavior graph is constructed. A target sample set is constructed using local causal windows and high-frequency common sequences. Data scores are performed on the experimental group and the control group to discover causal effects and extract interaction experience.
It enables the automated and scalable discovery of deep causal experiences that are interpretable and inferable from interaction records, improving the efficiency and quality of experience extraction and providing interpretable decision support.
Smart Images

Figure CN121743471A_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of data processing technology, and in particular to a method, apparatus, device, medium and product for extracting experience in an interactive process. Background Technology
[0002] In the digital age, digital systems across various industries generate massive amounts of historical data during their use. These records, in diverse forms such as logs, text, and charts, document the results of human-computer interaction behaviors, containing valuable practical experience. The key to optimizing business processes and improving decision-making efficiency lies in extracting the factors that led to success or failure from this complex and often unstructured interaction data, and understanding the underlying causal logic.
[0003] Current techniques for analyzing interaction processes include process mining, which can discover, monitor, and improve actual processes from event logs. However, traditional process mining methods focus more on "what" the process is (e.g., discovering process models, detecting compliance) and struggle to answer the "why" question. While they can discover correlations in behavioral patterns, they are limited in revealing causal relationships between behaviors and outcomes, easily misinterpreting "correlation" as "causation," leading to decision-making biases. Causal inference methods provide a framework for discovering causal relationships from observational data, but their application typically relies on domain experts manually designing research protocols and screening confounding variables.
[0004] How to automatically and scalably discover deep experiential knowledge from massive amounts of interaction records, and realize the processing of data into interpretable and inferable causal experience, has become a problem to be solved. Summary of the Invention
[0005] This application provides a method, apparatus, device, medium, and product for extracting experience in interactions, so as to realize the interpretability and reasonability of interactive experience and improve the efficiency and scale of knowledge discovery.
[0006] According to one aspect of this application, a method for extracting experience in an interaction is provided, comprising:
[0007] Obtain the interaction sequence from the task interaction record, wherein the interaction sequence includes interaction sequence events;
[0008] Each of the aforementioned interactive sequence events is processed to generate an event cluster set; event relationships are identified based on the event cluster set, and a global behavior graph is generated accordingly;
[0009] A high-frequency common sequence set is determined based on the global behavioral graph, and a target sample set is constructed based on a pre-set local causal window and the high-frequency common sequence set.
[0010] Based on the target sample set, experimental group data and control group data are constructed, the experimental group data and control group data are scored, and sample pairs are generated based on the scoring results; causal effect discovery is performed on each sample pair, and interaction experience is extracted.
[0011] According to another aspect of this application, an experience extraction device in an interaction is provided, comprising:
[0012] An interaction sequence acquisition module is used to acquire the interaction sequence in the task interaction record, wherein the interaction sequence includes interaction sequence events;
[0013] The graph generation module is used to process each of the interaction sequence events to generate an event cluster set; to identify event relationships based on the event cluster set, and to generate a global behavior graph.
[0014] The target sample construction module is used to determine the high-frequency common sequence set based on the global behavioral graph, and construct the target sample set based on the pre-set local causal window and the high-frequency common sequence set.
[0015] The sample pair generation module is used to construct experimental group data and control group data based on the target sample set, score the experimental group data and control group data, and generate sample pairs based on the scoring results; perform causal effect discovery on each sample pair, and extract interaction experience.
[0016] According to another aspect of this application, an electronic device is provided, the electronic device comprising:
[0017] At least one processor, and a memory communicatively connected to said at least one processor;
[0018] The memory stores a computer program that can be executed by the at least one processor, which enables the at least one processor to perform the experience extraction method in the interaction described in any embodiment of this application.
[0019] According to another aspect of this application, a computer-readable storage medium is provided, the computer-readable storage medium storing computer instructions for causing a processor to execute and implement the experience extraction method in the interaction described in any embodiment of this application.
[0020] According to another aspect of this application, a computer program product is provided, the computer program product comprising a computer program that, when executed by a processor, implements the experience extraction method in the interaction described in any embodiment of this application.
[0021] The technical solution of this application embodiment obtains the interaction sequence in the task interaction record, the interaction sequence including interaction sequence events; processes each interaction sequence event to generate an event cluster set; identifies event relationships based on the event cluster set and generates a global behavior graph; determines a high-frequency common sequence set based on the global behavior graph, constructs a target sample set based on a pre-set local causal window and the high-frequency common sequence set; constructs experimental group data and control group data based on the target sample set, scores the experimental group data and control group data, and generates sample pairs based on the scoring results; discovers causal effects in each sample pair and extracts interaction experience; solves the problems of low experience extraction efficiency and poor interpretability and inferability of the extracted experience; and improves the efficiency of task interaction. The recorded interactive sequence events are processed to generate event cluster sets. Based on these event cluster sets, event relationships are identified, and a global behavioral graph is constructed. The global behavioral graph reflects the semantic associations and entity participation relationships between events, providing basic data support for subsequent data processing. By analyzing the global behavioral graph, a set of high-frequency common sequences is determined. Then, a target sample set is constructed by combining it with local causal windows. This transforms the abstract graph data into a target sample set containing potential causal analysis scenarios, enabling more accurate removal of confounding factors and improving the effectiveness and robustness of causal effect estimation. Based on the target sample set, experimental group data and control group data are constructed and scored accordingly. High-quality sample pairs are generated based on the scoring results. Causal effects are discovered in each sample pair, and interpretable and inferable interactive experiences are extracted.
[0022] It should be understood that the description in this section is not intended to identify key or essential features of the embodiments of this application, nor is it intended to limit the scope of this application. Other features of this application will become readily apparent from the following description. Attached Figure Description
[0023] To more clearly illustrate the technical solutions in the embodiments of this application, the accompanying drawings used in the description of the embodiments will be briefly introduced below. Obviously, the accompanying drawings described below are only some embodiments of this application. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.
[0024] Figure 1 This is a flowchart of an experience extraction method in an interaction provided according to Embodiment 1 of this application;
[0025] Figure 2 This is a flowchart of an experience extraction method in an interactive process provided according to Embodiment 2 of this application;
[0026] Figure 3 This is an example diagram illustrating the implementation of real-time experience extraction during an interaction process, according to Embodiment 2 of this application.
[0027] Figure 4 This is a schematic diagram of the structure of an experience extraction device in an interactive process according to Embodiment 3 of this application;
[0028] Figure 5 This is a schematic diagram of the structure of an electronic device that implements the experience extraction method in the interaction of the embodiments of this application. Detailed Implementation
[0029] To enable those skilled in the art to better understand the present application, the technical solutions in the embodiments of the present application will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of the present application, and not all embodiments. Based on the embodiments in the present application, all other embodiments obtained by those of ordinary skill in the art without creative effort should fall within the scope of protection of the present application.
[0030] It should be noted that the terms "first," "second," etc., in the specification, claims, and accompanying drawings of this application are used to distinguish similar objects and are not necessarily used to describe a specific order or sequence. It should be understood that such data can be interchanged where appropriate so that the embodiments of this application described herein can be implemented in orders other than those illustrated or described herein. Furthermore, the terms "comprising" and "having," and any variations thereof, are intended to cover non-exclusive inclusion; for example, a process, method, system, product, or apparatus that comprises a series of steps or units is not necessarily limited to those steps or units explicitly listed, but may include other steps or units not explicitly listed or inherent to such processes, methods, products, or apparatus.
[0031] Example 1
[0032] Figure 1 This is a flowchart illustrating an experience extraction method in an interaction, as provided in Embodiment 1 of this application. This embodiment is applicable to situations where experience is extracted from interactive data. The method can be executed by an experience extraction device in the interaction, which can be implemented in hardware and / or software and can be configured in an electronic device. Figure 1 As shown, the method includes:
[0033] S101. Obtain the interaction sequence from the task interaction record, which includes interaction sequence events.
[0034] In this embodiment, task interaction record can be understood as information that records all interactive behaviors generated during the completion of a task; interaction sequence can be understood as a sequence composed of different interactive behaviors; interaction sequence event can be understood as event information describing an interactive behavior.
[0035] The completion of a task often requires a series of collaborative processes, and the records of these processes constitute historical interactions. Successful historical interactions produce correct task results, and these interactions consist of a sequence of actions with temporal dependencies. Task interaction records for different tasks are collected in advance and stored in a historical interaction library. When needed, the historical interaction library can be directly accessed to retrieve the task interaction records. This application embodiment can obtain task interaction records for one or more tasks. The task interaction records can be in the form of structured or unstructured data storage, such as text, charts, or symbols. The task interaction records are parsed to determine the interaction sequences contained within them. Each task interaction record can contain one or more interaction sequences, and may also include the sequential dependencies between these sequences. An interaction sequence consists of one or more interaction sequence events.
[0036] For example, a task interaction record in the historical interaction library can be recorded as follows: ,in This is a sequence of interactions recorded in the task interaction log. This refers to the sequential dependencies between interaction sequences. The construction of the historical interaction library, such as organizing task records, splitting task interaction sequences, sorting out the interaction relationships between sequences, and defining or storing the structure of sequences and dependency graphs, can typically be done manually, through classification and extraction, or through model-based automated methods, etc. This application does not limit the specific construction operations in this regard. and It can be any structural form; for example, in the embodiments of this application... and Defined in the following form: ,in: This represents the k-th original interaction record in a certain interaction sequence, i.e., the interaction sequence event. Its content can be natural language text, structured log fragments, multimodal attachments, etc. The order of different interaction records in the same interaction sequence is only a temporal dependency, and there is no multi-branch situation. Indicates the timestamp of the event. , The dependencies between different interaction sequences are described and ultimately combined into a dependency graph, where V is the set of nodes, each node corresponding to a SEQ; and E is the set of edges, each edge... express The completion is The execution prerequisite sequence, A, is the set of attributes of the edge, including information such as dependency type, data transmission content, and triggering conditions. In this embodiment, after collecting all interaction sequence events for a task, the interaction sequence events can be divided according to different levels and rules to obtain one or more interaction sequences. Each interaction sequence constitutes the task's interaction record, providing a clear description of the entire interaction process of the task.
[0037] S102. Process each interactive sequence event to generate an event cluster set; identify event relationships based on the event cluster set, and generate a global behavior graph.
[0038] In this embodiment, the event cluster set can be understood as a set of similar events; the global behavior graph can be understood as a graph formed by the interaction sequences of different tasks. Each interaction sequence event is processed separately, and the interaction sequence events are processed into data of a uniform form according to the set standard format requirements. The processed data is then clustered, and similar interaction sequence events are clustered together to obtain the event cluster set. The relationships between the interaction sequence events in the event cluster set are identified. The relationships between the interaction sequence events can be one or more relationships such as sequential relationships, dependency relationships, and co-occurrence relationships. A global behavior graph is constructed based on the relationships between the interaction sequence events. For example, the interaction sequence events are used as nodes, and the relationships between the interaction sequence events are used as edges to establish the global behavior graph.
[0039] S103. Determine the high-frequency common sequence set based on the global behavior graph, and construct the target sample set based on the pre-set local causal window and the high-frequency common sequence set.
[0040] In this embodiment, the high-frequency common sequence set can be understood as a dataset composed of high-frequency common sequences, which can be understood as sequences that occur frequently and are composed of interactive sequence events. The local causal window can be understood as a time window used to describe the causal relationship of events; in this embodiment, the local causal window can be the size of the window. The target sample set can be understood as a dataset composed of target samples, which can be understood as data samples composed of interactive sequence events.
[0041] The system queries each interaction sequence event in the global behavior graph, selects a local subgraph composed of some interaction sequence events from the global behavior graph, obtains different sequences, and obtains a set of high-frequency common sequences based on the occurrence frequency of different sequences. A local causal window is pre-set, and events that have a causal relationship with the high-frequency common sequences in the high-frequency common sequence set are determined based on the local causal window, forming a target sample set.
[0042] S104. Construct experimental group data and control group data based on the target sample set, score the experimental group data and control group data, and generate sample pairs based on the scoring results; conduct causal effect discovery on each sample pair and extract interaction experience.
[0043] In this embodiment, experimental group data and control group data can be understood as two sets of data used for experimentation and control; the sample pair in this embodiment is a pair of data consisting of one experimental data and one control data. The target sample set typically includes multiple target samples. These target samples are divided into experimental group data and control group data, or the target samples are used as experimental group data, and then data is re-extracted from the global behavioral graph to serve as control group data; or the target samples are used as control group data, and then data is re-extracted from the global behavioral graph to serve as experimental group data, and so on. The experimental group data and control group data are scored separately to determine the score of each record in both sets. Based on the scores, records in the experimental group data and control group data are matched, and sample pairs are generated based on the matching results. Causal effect discovery is performed on each sample pair, and interaction experiences are extracted from the sample pairs.
[0044] The embodiments of this application can discover causal effects in the interaction process through the above-described method, transform the discovered causal effects into interaction experience, obtain standard experience expressions, and construct a reusable experience knowledge base. These structured causal experiences can be directly applied to scenarios such as real-time decision optimization and interaction strategy iteration, providing the system with strong logical and interpretable decision support, and forming a complete closed loop from data analysis to business empowerment.
[0045] This application provides a method for extracting experience from interactions, addressing the problems of low efficiency and poor interpretability and inferability of extracted experience. By processing interaction sequence events in task interaction records, an event cluster set is generated. Based on the event cluster set, event relationships are identified and a global behavior graph is constructed. The global behavior graph reflects the semantic associations and entity participation relationships between events, providing basic data support for subsequent data processing. By analyzing the global behavior graph, a high-frequency common sequence set is determined, and then a target sample set is constructed by combining it with a local causal window. This transforms the abstract graph data into a target sample set containing potential causal analysis scenarios, enabling more accurate removal of confounding factors and improving the effectiveness and robustness of causal effect estimation. Based on the target sample set, experimental group data and control group data are constructed and scored accordingly. High-quality sample pairs are generated based on the scoring results. By performing causal effect discovery on each sample pair, interpretable and inferable interaction experiences are extracted.
[0046] Example 2
[0047] Figure 2 This is a flowchart illustrating an experience extraction method in an interactive process, as provided in Embodiment 2 of this application. This embodiment is a refinement based on the above embodiments. Figure 2 As shown, the method includes:
[0048] S201. Obtain the interaction sequence from the task interaction record. The interaction sequence includes interaction sequence events.
[0049] S202. Process each interactive sequence event to generate an event cluster set.
[0050] Optionally, each interaction sequence event is processed to generate an event cluster set, including: performing structured parsing on each interaction sequence event to generate structured event information; and performing semantic matching and clustering on the structured event information to generate an event cluster set.
[0051] In this embodiment, structured information can be understood as information that represents interactive sequence events in a structured way. Behavioral analysis is performed on each interactive sequence event, analyzing the event-related behavioral themes, key actions, states, preconditions, effects, etc., converting the interactive sequence events into structured information. Semantic matching and clustering are then performed on the structured information of each interactive sequence event, connecting semantically similar scattered events into event clusters, resulting in a set of event clusters.
[0052] For example, structured parsing of interactive sequence events can be achieved by describing each event in the SEQ using a semantic parsing module. Semantic parsing is performed, specifically including trigger word parsing, argument parsing, and argument role recognition. The result of this processing is denoted as... In this context, the trigger word indicates the core word or phrase that indicates the occurrence of an event, the argument is the participating entity (person, organization, place, time, object, etc.) related to the trigger word, and the role of the argument is the semantic role of each argument in the event, such as: Agent, Patient, Time, Place, Instrument, Cause, etc. The specific technical implementation methods typically include: trigger word recognition is achieved through deep learning-based sequence labeling methods (such as BiLSTM-CRF, BERT+ classifier) or methods combining trigger word dictionaries and dependency rules, thereby locating the core words indicating the occurrence of the event; argument recognition processing can utilize dependency syntax relations to find subjects, objects, and prepositional phrases related to the trigger word, or use models such as BERT / SpanBERT for sequence labeling and boundary extraction, or use graph neural networks to model syntactic and semantic dependencies to improve performance; argument role classification processing determines the semantic role of (trigger word, argument) pairs by classifying them, methods include rule-based template matching and classifiers based on pre-trained models, common roles include agent, patient, time, place, tool, cause, etc., thus forming a complete structured representation of the event, which is an existing method and will not be elaborated further. Next, As input to the cross-round semantic entity association module, it is responsible for event clustering to support subsequent behavior graph construction and cross-event behavior dependency analysis. The specific processing steps are as follows: first, semantic matching and aggregation are performed on different events, connecting scattered events into event clusters to generate an event cluster set. Each event cluster set... Recorded as The sequence number of the event cluster set can be denoted as Id. The core event in the event cluster set, Other events in the event cluster set.
[0053] S203. Relationship identification is performed on the events in the event cluster set to obtain event relationship edges. Event relationship edges include at least one of the following: time relationship edge, behavior dependency relationship edge, and co-occurrence relationship edge.
[0054] In this embodiment, event relationship edges can be understood as information representing the relationships between interactive sequence events. Temporal relationship edges can be understood as edges representing temporal order; behavioral dependency relationship edges can be understood as edges representing behavioral dependency; and co-occurrence relationship edges can be understood as edges representing co-occurrence.
[0055] Relationship identification is performed on interactive sequence events in an event cluster set using one or more methods to determine whether there is a relationship between each interactive sequence event, and to identify event relationship edges between interactive sequences when a relationship exists. Different relationships can be identified in different ways, such as determining time relationship edges by time extraction, determining behavior dependency relationship edges by semantic dependency analysis, and identifying co-occurrence relationship edges by entity co-occurrence, semantic similarity calculation, etc.
[0056] S204. Construct a global behavior graph based on event relationship edges.
[0057] By treating each interaction sequence event as a node and the event relationship edges between the identified interaction sequence events as edges between nodes, a global behavior graph is constructed. For example, when constructing the global behavior graph, each interaction sequence event can be treated as a node individually, or a subset of interaction sequence events can be selected as nodes; for instance, an interaction sequence event can be selected as a node from similar interaction sequence events.
[0058] Optionally, perform relation identification on the events in the event cluster set to obtain event relation edges, including at least one of the following steps A1 and A3:
[0059] A1. Perform time extraction and normalization on the events in the event cluster set to determine the temporal order of each event, determine the temporal order of the core events in each event cluster set, and construct temporal relationship edges between each event based on the temporal order of each event and the core events.
[0060] The time information of interactive sequence events in the event cluster set is extracted using time representation recognition tools (such as TimeML or HeidelTime) and standardized into a unified timestamp. For example, expressions such as "yesterday" and "March 2021" are extracted and standardized into a unified timestamp. Sub-events (where sub-events can be core events or other events in the event cluster set) within the same event cluster set are sorted chronologically to determine the temporal order between events, and the temporal order between core events is determined across clusters. Based on the temporal order between each event and each core event, temporal relationship edges are constructed between each event. The temporal order between events is used as the temporal relationship edges between events, and the result is denoted as... .
[0061] A2. Based on the preset recognition algorithm, identify the temporal dependency relationship of events in the event cluster set, and construct the temporal dependency relationship edge between events based on the temporal dependency relationship of each event. The recognition algorithm includes at least one of the following: behavior triggering pattern matching, semantic and dependency analysis, and dependency relationship recognition model.
[0062] In this embodiment, the identification algorithm can be understood as an algorithm for dependency identification. The identification algorithm can be pre-set and can be one or more algorithms. The identification algorithm includes at least one of the following: behavior trigger pattern matching, semantic and dependency analysis, and dependency identification model. The dependency identification model can be understood as a model used for dependency identification, which can be a neural network model, a large language model, etc. A large language model refers to a model with a massive number of parameters.
[0063] A pre-defined identification algorithm (one or more algorithms) is used to identify temporal dependencies among events in an event cluster. These temporal dependencies are then used as edges between events. When using multiple algorithms, one algorithm can be used first to identify temporal dependencies. If no dependency is found, another algorithm is selected and the process continues until a dependency is found or all algorithms fail to identify one. If all algorithms fail to identify a dependency, it can be determined that no temporal dependency exists between the two events.
[0064] For example, embodiments of this application can determine temporal dependencies through behavior trigger pattern matching, such as identifying behavior trigger patterns like "because," "cause," and "trigger" through rules or trigger words; determine temporal dependencies through semantic dependency analysis, such as determining the master-slave relationship of behaviors through dependency syntax and semantic role labeling (SRL); and determine temporal dependencies through a dependency relationship identification model, which can be a BERT or Prompt-based model. The BERT or Prompt-based model takes event pairs and context as input and outputs behavior labels {Cause, Effect, None} for the event pairs. After identification, the event pairs with behavioral dependencies are recorded as follows: .
[0065] A3. Based on the entity dictionary, the co-occurrence relationship of events in the event cluster set is identified and the co-occurrence relationship edges between each event are constructed. The entity dictionary is generated by normalizing and disambiguating the events contained in each event cluster set.
[0066] In this embodiment, the entity dictionary can be understood as a dictionary composed of events, which stores a unified expression for different events.
[0067] After generating an event cluster set, the events contained in the event cluster set are normalized and disambiguated to generate an entity dictionary. For example, entities mentioned in multiple original events that may have ambiguity or variations (such as names of people, organizations, locations, products, etc.) are normalized and disambiguated to form a unified, consistent, and reusable standardized entity dictionary. Entity Dictionary Here, `canonical_name` is a standardized unique identifier for entities, which can be used to construct event cluster sets and a global behavior graph. This standardized unique identifier uniquely identifies entities, specifically events, i.e., interaction sequence events. `aliases` contains all semantically equivalent or highly related alternative expressions, covering pronouns, abbreviations, and colloquial expressions appearing in the conversation. Based on the entity dictionary, standardized expressions for events are determined. Based on these standardized expressions, co-occurrence relationships are identified among events in the event cluster set, and the identified co-occurrence relationships are used as co-occurrence relationship edges between events.
[0068] Optionally, based on the entity dictionary, co-occurrence relationships of events in the event cluster set are identified, and co-occurrence relationship edges between events are constructed, including steps B1-B3:
[0069] B1. Determine the standardized unique identifier and / or semantically equivalent representation of each event based on the entity dictionary.
[0070] The entity dictionary stores standardized unique identifiers for entities and semantic equivalent expressions for events. By querying the entity dictionary, each interaction sequence event in the event cluster set is matched with the standardized unique identifier of the entity stored in the entity dictionary to determine the standardized unique identifier of the entity corresponding to the interaction sequence event. After determining the standardized unique identifier of the entity, the semantic equivalent expression can be determined accordingly.
[0071] B2. Match the standardized unique identifiers and / or semantically equivalent expressions of the entities for each event, and establish co-occurrence relationships for the successfully matched events.
[0072] The entity standardized unique identifier and / or semantic equivalent expression of each event are matched to determine whether the entity standardized unique identifier of each event is the same or whether the semantic equivalent expression is matched. In this embodiment, if at least one of the entity standardized unique identifier and semantic equivalent expression is matched, the event is considered to be successfully matched; and a co-occurrence relationship is established for the successfully matched events.
[0073] B3. For events that have a co-occurrence relationship, calculate the semantic similarity between the events. If the semantic similarity is higher than the set threshold, then establish a co-occurrence relationship edge between the events.
[0074] For each pair of events with a co-occurrence relationship, the semantic similarity between the events is calculated using a semantic similarity calculation method, such as using an event text embedding model (SBERT or SimCSE). A pre-set threshold is used to compare the semantic similarity with the threshold. If the semantic similarity is higher than the threshold, a co-occurrence relationship is determined between the events, and a co-occurrence relationship edge is established. In this embodiment, the events can also be mapped to external knowledge bases (such as Wikidata / Freebase). If the event entities can be mapped to external knowledge bases, additional co-occurrence links are introduced. The co-occurrence relationship identification result is denoted as... .
[0075] For example, embodiments of this application provide a method based on temporal relation edges (Torder), behavioral dependency relation edges (CausalE), co-occurrence relation edges (CorelE), event cluster sets, and entity dictionaries. This involves unifying chronological order, behavioral dependencies, and co-occurrence patterns into a global behavioral graph. A specific implementation could be: integrating the core events of each event cluster set... As a node, and through The `canonical_name` property enables unified cross-event referencing; a multi-type graph is constructed, including edges representing temporal relationships (Before / After / Simultaneous), behavioral dependencies (Cause->Effect), and co-occurrence relationships (Related); this graph is stored using a graph database such as Neo4j, and causal chain queries and inferences are implemented using Cypher or Gremlin. The result is denoted as the global behavioral graph. .
[0076] This application's embodiments can systematically construct a behavior graph from event clusters, specifically including several key processes such as temporal modeling, behavior dependency identification, co-occurrence pattern identification, and behavior graph construction. Temporal modeling involves extracting event information from event clusters and their sub-events, performing semantic dependency analysis, and identifying cross-event dependencies to obtain explicit behavior chains. Co-occurrence pattern identification is achieved through an entity dictionary. The system unifies entity references with different expressions and combines entity co-occurrence, semantic similarity calculation, and external knowledge base mapping to identify co-occurrence patterns and correlations between events. Finally, event clusters are used as nodes in the graph, and temporal order, causal relationship, and co-occurrence relationship are used as different types of edges. These are then integrated into a behavior graph and stored in a graph database to support querying and reasoning.
[0077] S205. Traverse the paths and subgraph structures in the global behavior graph to determine the event sequence.
[0078] In this embodiment, an event sequence can be understood as a sequence of events. The paths and subgraph structures in the global behavior graph are traversed on an event-by-event basis. A subgraph is a connected or disconnected local graph structure composed of selected nodes (events) and edges (causal / temporal / correlational relationships) from the global behavior graph. Subgraphs can be dynamically generated and evaluated through enumeration, sampling, or constraint search. For example, subgraphs can be determined based on event type or entity constraints, or by frequent subgraph mining algorithms (such as gSpan, FSG). By traversing the paths and subgraph structures in the global behavior graph, the events that form the paths and subgraph structures are identified, and an event sequence is formed based on these events.
[0079] S206. Statistically determine the frequency of each event sequence, identify high-frequency common sequences based on the frequency of each event sequence, and generate a set of high-frequency common sequences based on each high-frequency common sequence.
[0080] The frequency of each event sequence is statistically analyzed, and the frequencies of each sequence are compared. Event sequences with higher frequencies are selected as high-frequency common sequences. For example, event sequences with frequencies above a set threshold, or those in the top 70% of the total frequency, can be selected as high-frequency common sequences. A set of high-frequency common sequences is then generated based on these sequences. This refers to a stable behavior sequence. In this embodiment, a high-frequency common sequence can also be called a stable behavior sequence. Here, Nodes is the set of event nodes in the sequence, Edges represents the dependencies between nodes, and Freq is the frequency of occurrence of the sequence in historical interaction events. The high-frequency common sequence output in this embodiment is not a simple linear structure; it can also be a subgraph structure based on edge connections. The path traversal method for events in this step can be a depth-first or breadth-first search traversal method; this embodiment does not limit this approach. High-frequency stable sequence set Each of them Each comes with its complete structural definition and statistical properties.
[0081] S207. Perform a context connection query on each high-frequency common sequence in the high-frequency common sequence set based on a pre-set local causal window, and generate a candidate sample set based on the query results.
[0082] In this embodiment, the candidate sample set can be understood as a dataset composed of candidate samples, and the candidate samples can be understood as samples that can be used for empirical mining.
[0083] The depth of the context query is determined based on a pre-set local causal window. Based on this depth, the context connection relationship is queried for each high-frequency common sequence in the high-frequency common sequence set to determine the events connected in the preceding context and the events connected in the following context of the high-frequency common sequence. The events connected by the high-frequency common sequence and the queried context are concatenated to form candidate samples to generate a candidate sample set.
[0084] S208. Filter the candidate samples in the candidate sample set to generate the target sample set.
[0085] In this embodiment, the target sample set can be understood as a dataset composed of target samples, and the target samples can be understood as the samples ultimately selected for experience mining.
[0086] Candidate samples in the candidate sample set are filtered according to defined filtering rules to select those that meet the requirements. These qualified candidate samples are then used as target samples, forming a target sample set. For example, the filtering rules could be based on the attributes of the event to filter candidate samples.
[0087] S209. Construct experimental group data and control group data based on the target sample set, score the experimental group data and control group data, and generate sample pairs based on the scoring results; conduct causal effect discovery on each sample pair and extract interaction experience.
[0088] Optionally, a context connectivity query is performed on each high-frequency common sequence in the high-frequency common sequence set based on a pre-set local causal window, and a candidate sample set is generated based on the query results, including steps C1-C3:
[0089] C1. For each high-frequency common sequence in the high-frequency common sequence set, using the structure of the high-frequency common sequence as the core template, query the global behavioral graph to determine all subgraph instances that match the high-frequency common sequence.
[0090] In this embodiment, a subgraph instance can be understood as a subgraph composed of events. For each high-frequency common sequence in the high-frequency common sequence set, using the structure of the high-frequency common sequence as the core template, the global behavior graph is queried to determine the subgraph structure in the global behavior graph. It is then determined whether each subgraph structure matches the high-frequency common sequence. Matching the high-frequency common sequence can mean... A perfect match is achieved in terms of topology, node type, and edge type. All subgraph structures that match the high-frequency common sequence are identified as subgraph instances.
[0091] C2. For each subgraph instance, query the context connection relationship of the subgraph instance based on the local causal window to determine the predecessor window event and successor window event corresponding to the subgraph instance; generate candidate samples based on the predecessor window event and successor window event corresponding to the subgraph instance.
[0092] In this embodiment, the preceding window event can be understood as the event of the preceding connection of the subgraph instance; the succeeding window event can be understood as the event of the following connection of the subgraph instance.
[0093] For each successfully matched subgraph instance, the depth of the preceding query and the depth of the following query are determined based on the local causal window. The preceding join relationship of the subgraph instance is retrieved based on the preceding query depth to determine the predecessor window event corresponding to the subgraph instance. The following join relationship of the subgraph instance is retrieved based on the following query depth to determine the successor window event corresponding to the subgraph instance. Candidate samples are generated based on the subgraph instance, its predecessor window event, and its successor window event.
[0094] C3. Form a candidate sample set based on each candidate sample.
[0095] Optionally, the local causal window includes a predecessor window and a successor window; based on the local causal window, the context connection relationship of the subgraph instance is queried to determine the predecessor window event and successor window event corresponding to the subgraph instance, including steps D1-D2:
[0096] D1. Query the context connections of the subgraph instance to determine if the subgraph instance has a first event with a connection depth equal to the size of the predecessor window and a timestamp earlier than the start time of the subgraph instance. If so, use the first event as the predecessor window event.
[0097] In this embodiment, the preceding window is used to perform contextual connection queries, and its size is the depth used for these queries; the succeeding window is used to perform contextual connection queries, and its size is the depth used for these queries. The first event can be understood as an interactive sequence event.
[0098] The predecessor window is determined based on the local causal window, and its size is obtained accordingly. The context connections of subgraph instances are queried to determine if any subgraph instances have events with a connection depth equal to the predecessor window size. For example, if the predecessor window size is 1, it checks if any subgraph instances are connected by an edge of degree 1. If so, it checks if the timestamp of this event is earlier than the start time of the subgraph instance. If so, the event is recorded as the first event and used as the predecessor window event. The number of first events can be one or more.
[0099] D2. Query the following connection relationships of the subgraph instance to determine whether the subgraph instance has a second event with a connection depth equal to the successor window size and a timestamp later than the end time of the subgraph instance. If so, treat the second event as the successor window event.
[0100] In this embodiment, the second event can be understood as an interactive sequence event. The successor window is determined based on the local causal window, and its size is obtained accordingly. The connection relationships of the subgraph instances are queried to determine whether there are events with a connection depth equal to the successor window size. For example, if the successor window size is 1, it means determining whether there are events where the subgraph instances are connected by an edge of degree 1. If so, it is determined whether the timestamp of this part of the event is later than the end time of the subgraph instance. If so, the event is recorded as the second event and used as the successor window event. The number of second events can be one or more.
[0101] To precisely define the context of causal analysis, this application's embodiments first focus on each high-frequency common sequence. Define a local causal window, Local_Causal_Window, whose size is measured by the degree of the graph, representing the relationship between the graph and the graph. The proximity range in the graph structure. To facilitate the explanation of the core idea of this application, the size of both the predecessor window and the successor window is limited to 1 degree, and only one node and one edge object are placed in the window. However, the principle and processing flow of the method provided in the embodiments of this application are also applicable to extensions with multiple degrees, multiple nodes, and multiple edges. In the embodiments of this application, the predecessor window (Wpre) is formed by the proximity range of the graph structure. The starting nodes are directly connected (i.e., the distance is 1 degree) and are time-prior to the starting nodes. The event space is composed of all event nodes, denoted as Wpre={Node_pre}, where Node_pre and its attribute set constitute the potential "cause" space. Events in the predecessor window are the predecessor window events. The successor window (Wpost) is composed of events in the predecessor window. The window structure is composed of all event nodes directly connected to the end node and sequentially following CSi, denoted as Wpost = {Node_post}. Node_post and its attribute set constitute the potential "result" space, and events in subsequent windows are the subsequent window events. This is based on the window structure defined above. The system will execute a systematic graph pattern matching process to construct an initial candidate sample pool. This process begins with stable sequences... Using the structure as the core template, queries are performed in the global behavioral graph Gcausal to locate all [elements related to / related to / from / etc.]. A subgraph instance that is completely matched in terms of topology, node type, and edge type. Then, for each matched subgraph... For example, the system will further examine its contextual connectivity: checking upstream to see if there exists a connection via a 1-degree edge with a timestamp earlier than [previous value]. The node indicating the instance's start time is used to confirm the existence of Wpre; simultaneously, it checks downstream whether there exists a node connected by a 1-degree edge whose timestamp is later than [previous time]. The instance end time node is used to confirm the existence of Wpost. Only when a... An instance is considered a successful match only when it simultaneously satisfies the structural and temporal constraints of both the predecessor and successor windows. The output of this process is an initial set of candidate samples, which is formally defined as InitialCandidatePool in this embodiment. Its data structure is a set of records: InitialCandidatePool=[candidate_1, candidate_2, ... ] where each candidate record represents a successful pattern match, and its specific format is: { "task_id": string, "wpre_instance": { node_id: string,attributes: {...}}, "csi_instance": { nodes: [...], edges: [...],attributes: {...}}, "wpost_instance": { node_id: string, attributes: {...}}}, where task_id is defined as the sequence number that uniquely identifies the original task interaction record (Task-SEQ) to which the matching instance belongs. `wpre_instance` is defined as storing the ID of the specific `Node_pre` instance in this match and its complete attribute set. `csi_instance` is defined as storing the ID of the specific `Node_pre` instance in this match and its complete attribute set. A subgraph instance is an object comprising all nodes, edges, and their respective attributes that constitute that instance. `wpost_instance` is defined as an object storing the ID of the specific `Node_post` instance in this match and its complete set of attributes. Through this step, the system transforms the abstract graph data into a structured `InitialCandidatePool` collection containing all potential causal analysis scenarios, providing standardized input for subsequent homogeneous filtering.
[0102] Optionally, the candidate samples in the candidate sample set are filtered to generate a target sample set, including at least one of E1 and E2:
[0103] E1. Based on the pre-set attribute matching rules, the candidate samples in the candidate sample set are filtered to generate the target sample set; the attribute matching rules include at least one of the following: the key attributes of each event in the candidate samples are the same, and the numerical attributes of each event in the candidate samples are within the preset error range.
[0104] In this embodiment, attribute matching rules can be understood as rules for filtering candidate samples based on attributes. Attribute matching rules can be preset and include at least one of the following: the key attributes of each event in the candidate samples are the same; the numerical attributes of each event in the candidate samples are within a preset error range. The key attributes can be one or more classification attributes such as core event type or participating entity role; the numerical attributes can be one or more such as event duration or number of parameters. By presetting attribute matching rules, the attributes of candidate samples in the candidate sample set are judged based on these rules, candidate samples that do not meet the attribute matching rules are filtered out, and the remaining candidate samples are used as target samples to generate a target sample set.
[0105] E2. Determine the attribute difference values of each candidate sample, input each attribute difference value into the first propensity score model for scoring, and obtain the score of each candidate sample; based on the score of each candidate sample, filter each candidate sample to generate the target sample set.
[0106] In this embodiment, the first propensity score model can be understood as a propensity score model that can be pre-generated. The propensity score model is a statistical method used to control for confounding factors. The attribute difference value can be understood as the difference between the attribute value of the candidate sample and the standard value. The standard value can be the average value of the sample, which can be obtained through statistics.
[0107] The first propensity score model can be pre-generated. For each candidate sample, the attribute difference value is determined based on the candidate sample's attributes and standard values. The attribute difference values of each candidate sample are input into the first propensity score model for scoring, resulting in a score for each candidate sample. The scores of each candidate sample are compared, and the candidate samples with higher scores are selected as target samples to generate a target sample set. For example, candidate samples with scores higher than a set scoring threshold can be selected as target samples, or candidate samples with scores in the top 60% can be selected as target samples, and so on.
[0108] After constructing the initial candidate sample set, to ensure the effectiveness and accuracy of subsequent causal analysis, it is necessary to ensure that the core behavioral patterns serving as the comparison benchmark are used when comparing different Task-SEQ sequences. They are highly similar, thus maximizing the exclusion of possibilities. Differences in internal attributes have a confounding effect on the subsequent Wpost result. This application can achieve this goal through two complementary implementation methods: the first method is hard screening, which sets a strict set of attribute matching rules to deterministically filter the candidate sample pool. For example, it can be specified that only those... Only task sequences whose key internal attributes, such as core event type and participating entity roles, are completely consistent, and whose numerical attributes, such as event duration and number of parameters, are within a preset, minimal error range, are retained. Any sample that does not meet these rigid constraints will be directly removed from the candidate sample set. The second method is more flexible, employing soft screening and weighting, and is suitable for... This approach addresses scenarios where attributes cannot be perfectly identical, or where hard screening would result in a severely insufficient sample size. The specific solution is to not directly discard samples with subtle attribute differences, but rather identify these differences (e.g., minor variations in duration) and treat them as covariates in the subsequent matching process. Specifically, during propensity score matching (PSM), these... The attribute differences will be incorporated as additional input features into the propensity score model. In this way, the model can learn and quantify the potential impact of these differences when calculating the matching score, and statistically adjust for and offset these impacts when matching sample pairs. By combining these two methods, this step ultimately yields a more consistent and comparable target sample set, denoted as AlignedTaskCohort = [record_1, record_2, ... ], where each record has the following format: { "task_id": string, "precursor_window": { attr_1: value, ...}, "sequence_instance": { attr_1: value, ...}, "successor_window": { attr_1:value, ...}}, where task_id is a unique string identifier used to trace the original task; predecessor_window stores all attributes of the predecessor window Wpre, which is the source of potential "cause" factors; and sequence_instance stores the common sequence. The specific attributes in this task, and the differences in those attributes, are important control variables; successor_window stores all the attributes of the successor window Wpost, and is the source of observation of the "outcome" or effect.
[0109] Optionally, experimental and control group data are constructed based on the target sample set, including at least one of F1 and F2:
[0110] F1. For each target sample in the target sample set, determine the causal factor of the target sample based on the preceding window event of the target sample, determine the effect factor of the target sample based on the subsequent window event of the target sample, and generate the observation sample based on the causal factor and effect factor of the target sample; cluster each observation sample based on the causal factor of each observation sample to generate sample group subsets; select two sample group subsets from each sample group subset as experimental group data and control group data, respectively.
[0111] In this embodiment, the causal factor refers to the cause to be studied, and the causal component refers to the effect to be observed; the sample to be observed can be understood as a sample composed of events. The sample group subset can be understood as a dataset composed of similar samples.
[0112] For each target sample in the target sample set, select one or more preceding window events from the preceding window events corresponding to the target sample as the causal factor, and select one or more successor window events from the successor window events corresponding to the target sample as the effect factor. Generate an observation sample based on one causal factor, one effect factor, and the target sample. If there are multiple causal factors and / or multiple effect factors, generate an observation sample each time based on one causal factor, one effect factor, and the target sample, resulting in multiple observation samples. Cluster the observation samples based on their causal factors, and cluster the observation samples with the same causal factor values to generate a sample group subset, resulting in one or more sample group subsets. Select two sample group subsets from each sample group subset, using one sample group subset as the experimental group data and the other sample group subset as the control group data.
[0113] This application, based on the target sample set, clarifies causal and effect factors. A causal factor is selected from the attribute set of the preceding window Wpre as the "cause" to be studied, while an effect factor is selected from the attribute set of the succeeding window Wpost as the "effect" to be observed. This selection process can be pre-specified by the business task (e.g., analyzing the impact of "whether the user provides a clear example" on "the system's first SQL generation accuracy"), or it can be achieved by exhaustively traversing all attributes in Wpre to explore all potential causal relationships. To ensure the clarity of causal identification, this application can determine only one "cause" object and one "effect" object at a time. After clarifying the causal factors, all records in the target sample set AlignedTaskCohort are clustered and grouped using the causal factors as objects. This operation essentially involves traversing each record in AlignedTaskCohort and assigning the record to different subset groups based on the specific value of the attribute corresponding to the "cause" factor in its predictor_window field. After this processing, the AlignedTaskCohort is completely divided into several disjoint subsets, where all records within each subset have the same value for the "cause" factor. This ultimately forms a stratified sample grouping subset based on the cause factor, denoted as StratifiedCohort = { value_A: [ record_1, record_2, ... ], value_B: [ record_3, record_4, ... ], ...}. Here, value_A and value_B are specific and unique observations of the cause factor, and the cause factor values of the members in the corresponding record set are all either value_A or value_B, etc. This cohort is crucial for constructing control sample pairs, clearly isolating sample groups with different "treatments" (i.e., different "cause" factor values), allowing any two groups to be designated as the experimental and control groups for precise causal effect comparisons.
[0114] F2. Use the target sample set as the experimental group data; determine the target common sequence set, filter the global behavior graph based on the target common sequence set to obtain control sequences, query the contextual connectivity of each control sequence, and determine the preceding window event and the succeeding window event of each control sequence; form control group data based on each control sequence and its corresponding preceding window event and succeeding window event. Each control sequence is an interaction sequence that does not contain the target common sequence in the target common sequence set and is similar to the experimental group data. Similarity to the experimental group data includes at least one of the following: temporal similarity, semantic similarity, and contextual feature similarity.
[0115] In this embodiment, the target common sequence set can be understood as a data set storing target common sequences, and the target common sequence can be understood as a sequence composed of events. The reference sequence can be understood as an event sequence serving as reference data.
[0116] The target samples in the target sample set are directly used as the experimental group data. The target common sequence set can be determined based on the high-frequency common sequence set, the target sample set, or specified by the user, etc.; for example, high-frequency common sequences in the high-frequency common sequence set can be used as target common sequences, or a portion of high-frequency common sequences can be selected from the high-frequency common sequence set as target common sequences, etc., forming a target common sequence set based on the target common sequences; alternatively, the user can specify target common sequences based on experience or pre-set conditions, forming a target common sequence set based on the target common sequences. The target common sequence set in this application embodiment may include one or more target common sequences. The global behavior graph is filtered based on the target common sequences in the target common sequence set, and interaction sequences that do not contain target common sequences and are similar to the experimental group data are selected. These interaction sequences are used as control sequences. The context connection relationship of each control sequence is queried to determine the predecessor window event and successor window event of each control sequence. The method for determining the predecessor window event and successor window event of the control sequence is the same as the method for determining the predecessor window event and successor window event of the subgraph instance described above, and will not be repeated here. Each control sequence and its corresponding preceding and succeeding window events are concatenated to generate a corresponding sequence, which is used as the control group data. Similarity to the experimental group data includes at least one of the following: temporal similarity, semantic similarity, and contextual feature similarity. Similarity to the experimental group data can be similar to a single record in the experimental group data, or it can be similar to multiple records in the experimental group data simultaneously, etc.
[0117] Optionally, the experimental and control group data are scored, and sample pairs, including G1-G2, are generated based on the scoring results:
[0118] G1. For each record in the experimental group data and the control group data, extract the covariate vector of the record, input the extracted covariate vector into the second propensity score model, and determine the score of each record based on the output of the second propensity score model.
[0119] In this embodiment, the second propensity score model can be understood as a propensity score model that can be pre-generated. The first propensity score model and the second propensity score model can be the same model or different models. Each sequence in the experimental group data and the control group data is recorded as a separate record. Covariate vectors are extracted from these records. The covariate vectors can be a set of feature vectors containing all background information that may affect the results, such as user attributes and behavioral patterns. The extracted covariate vectors are input into the second propensity score model, which scores the data based on the input data and outputs the corresponding scores.
[0120] G2. Based on the principle of closest scoring, the records in the experimental group data and the records in the control group data are matched, and sample pairs are generated according to the matching results.
[0121] The scores of records in the experimental group data and the control group data are determined. Based on the principle of closest scores, records with the closest scores are found between the experimental group data and the control group data for pairing, for example, using nearest neighbor matching. A successfully matched record from the experimental group data and a record from the control group data are considered as a sample pair. In this embodiment, there can be one or more sample pairs. This method ensures that successfully matched sample pairs are highly balanced across all background covariates.
[0122] It should be noted that the events in the embodiments of this application refer to interactive sequence events.
[0123] For example, embodiments of this application provide two methods for generating sample pairs, which are respectively designed to address different causal analysis objectives.
[0124] Method 1: Constructing counterfactual sample pairs based on differences in predecessor conditions. This method aims to accurately quantify the differences in the same stable sequence. In this context, the impact of changes in specific "cause" factors in the predecessor window Wpre on the successor window Wpost.
[0125] 1. Designation of Experimental and Control Groups: Select any two groups from StratifiedCohort as the Treatment Group and Control Group for this analysis. For example, use the array of records with key value_A as the experimental group and the array of records with key value_B as the control group.
[0126] 2. Propensity Score Calculation and Matching: To ensure comparability between the two groups—that is, besides the specified "cause" factor being different, all other confounding factors that may affect the results should be as similar as possible—this invention employs the propensity score matching (PSM) method. First, for each record in both the experimental and control groups, its pre-extracted covariate vector is directly used as input to the propensity score model. This vector already contains all the confounding variables that need to be controlled, eliminating the need for repeated feature engineering. Then, a propensity score model (such as logistic regression) is used to calculate the propensity score for each record, denoted as Propensity_Score. Finally, based on the calculated propensity scores, the records with the closest scores between the experimental and control groups are matched (e.g., using nearest neighbor matching). This process ensures that successfully matched sample pairs are highly balanced across all background covariates.
[0127] 3. Sample Generation and Augmentation: This step constructs a high-quality counterfactual sample pair based on each successfully matched record (one from the experimental group and one from the control group), denoted as {(X,Y),(X',Y')}. This sample pair accurately reflects two cases where only the "cause" factor differs while other conditions are similar, and their respective consequences. Simultaneously, the successfully matched sample pairs are used as input to the quality assessment and augmentation module to evaluate the quality of the generated sample pairs (e.g., calculating the standardized mean difference of covariates). If the matching success rate is low or the sample size is insufficient, a generative model (such as GAN or VAE) can be activated to generate new, high-quality synthetic counterfactual samples while satisfying covariate distribution constraints, thereby expanding the dataset and enhancing the robustness of causal inference.
[0128] Method 2: Construction of treatment effect sample pairs based on the existence of stable sequences. This method aims to evaluate stable sequences. The causal effect of the "treatment" as a whole is to verify whether the presence or absence of the behavioral pattern has a significant impact on the outcome.
[0129] 1. Definition of experimental and control groups: This step involves the entire AlignedTaskCohort set (where all records contain stable sequences). The experimental group is defined as T=1. From the global behavioral graph Gcausal, groups that do not contain the target common sequence are selected. However, task interaction records that are similar to the experimental group samples in terms of time, semantics, or other contextual features are also included. For these records, the corresponding predecessor and successor window information is extracted, and a control group with the same form as the experimental group is constructed, denoted as T=0.
[0130] 2. Cross-group propensity score matching: Using the same propensity score matching method as Method 1, matching was performed between the experimental group (T=1) and the control group (T=0) to find... The preceding window Wpre is a pair of highly similar samples. If the matching is successful and the quality assessment meets the criteria, a pair of treatment effect samples is generated, denoted as . Each pair of samples contains two records from the experimental and control groups, along with a treatment indicator variable T, clearly demonstrating that under similar preconditions, there exists... and non-existence The different outcomes corresponding to the two situations.
[0131] Causal effects are identified in the sample pairs obtained above, and these identified causal effects are transformed into reusable experience. In this embodiment, the causal effects of the two types of control sample pairs output above are expressed in the following forms:
[0132] 1. Based on The causal effect found in the control sample of the form is as follows: That is, in Under the premise that ΔX is the cause, the resulting effect is ΔY;
[0133] 2. Based on The control sample found the following causal effect: with X as the subject, at T (i.e., Under the influence of (T as the cause), the resulting effect is ΔY;
[0134] The results of the aforementioned causal effect findings can be easily transformed into a standard, symbolically inferable empirical expression: {A->B|C}, meaning that A can lead to B given C. According to this empirical form, based on the two types of causal findings mentioned above, the experiences extracted from the final interaction process are as follows: , .
[0135] The methods for calculating ΔX and ΔY in the above process can be differences in category probability distributions, numerical differences, vector distances, pairwise interval differences, or object descriptions based on LLM induction.
[0136] Ultimately, the application's embodiments output a series of interactive experiences capable of symbolic reasoning. Based on these experiences, strong logical and interpretable decision support can be provided to the decision-making system. Furthermore, causal experiences can be combined to form pre-defined rules, which can be widely applied to the following scenarios: 1. Real-time decision optimization: Dynamically adjust system recommendations, prompts, or operational strategies according to causal rules to improve user interaction efficiency and effectiveness. 2. Interactive experience iteration: Integrate newly generated causal experiences into the system knowledge base to support adaptive optimization of subsequent interactions, achieving continuous learning and strategy improvement. 3. Strategy feedback loop: Experience extraction results not only guide real-time decision-making but can also serve as input for the next round of causal evaluation, forming a complete closed-loop interactive optimization process. Through the above steps, this application achieves a complete closed loop from causal effect discovery to experience strategy generation and online interactive optimization, providing the system with verifiable and reusable intelligent decision-making capabilities.
[0137] Figure 3 An implementation example diagram of real-time experience extraction during interaction is provided. The experience extraction is divided into three stages: the first stage constructs a global behavior graph based on historical interactions; the second stage implements sample pair matching and construction; and the third stage performs causal effect discovery and experience extraction.
[0138] This application provides a method for extracting experience from interactions, addressing the problems of low efficiency and poor interpretability and inferability of extracted experience. It systematically integrates five modules: event structured analysis, behavior graph construction, stable sequence discovery, control sample generation, and causal effect discovery. This achieves automated transformation from raw data to interpretable and inferable causal experience, significantly reducing reliance on domain expert experience and improving the efficiency and scale of knowledge discovery. This application mines high-frequency, stable behavior sequences from historical interaction behavior graphs as analytical primitives and proposes the concept of a "local causal window." Through window alignment and matching mechanisms, it automatically generates high-quality, comparable counterfactual sample pairs and treatment effect sample pairs, providing a solid data foundation for accurate causal effect assessment. It achieves quantitative assessment of the overall causal effect of complex behavior sequences (patterns). This application can not only analyze the impact of changes in individual antecedent conditions (causes) on the results, but also treat a stable behavior sequence as a whole "treatment," assessing the causal effect of its presence or absence on subsequent results. This ability to analyze the causal patterns of behavior more closely resembles complex decision-making scenarios in the real world, enabling the discovery of deeper patterns with greater business value and guiding significance. Ultimately, it produces structured experience that can be used for symbolic reasoning, forming a closed loop for decision optimization. This application can transform the discovered causal effects into standard empirical expressions, constructing a reusable empirical knowledge base. These structured causal experiences can be directly applied to scenarios such as real-time decision optimization and interactive strategy iteration, providing the system with strong logical and interpretable decision support, and forming a complete closed loop from data analysis to business empowerment. The embodiments of this application can discover stable behavioral patterns implicit in the global behavioral graph, and construct high-quality experimental and control group sample pairs based on these patterns. Sample pairs constructed based on the global behavioral graph can more accurately eliminate confounding factors, improving the effectiveness and robustness of causal effect estimation. This application constructs experimental and control sample pairs that can be used to discover potential causal relationships. Based on the local causal window alignment mechanism of stable sequences and the control construction strategy of treatment effect, through methods such as local window truncation on behavioral graph, feature mapping and difference constraint, it can ensure the consistency of sample pairs in non-target features, while maintaining observable differences in target features, so as to improve the quality and quantity of counterfactual sample pairs.
[0139] This application embodiment can also introduce incremental graph construction and online learning mechanisms to improve real-time performance. To extend the capabilities of this invention from offline analysis to real-time interactive scenarios, incremental graph construction and online causal learning mechanisms can be introduced. Specifically, the behavior graph generation module in stage one can be modified into a dynamic system supporting streaming data processing. When new interaction records are generated, the system does not need to periodically reconstruct the entire graph, but instead performs structured parsing of the new data in real time and dynamically integrates the corresponding event nodes and relation edges into the existing global behavior graph (Gcausal). Correspondingly, the causal effect discovery module in stage three can integrate an online learning framework, treating the newly generated control sample pairs in stage two as a continuous data stream and inputting them in real time into a continuously updated causal effect estimation model. By employing online learning algorithms such as Bayesian updates, the system can dynamically adjust the estimated value and confidence level of the causal effect based on each new piece of evidence. This architectural shift from batch processing to incremental learning can greatly reduce the latency of knowledge updates, enabling the system to learn and extract experience from the latest interactions in near real-time, thereby providing strong support for immediate decision optimization and significantly improving the scalability of the system in processing high-throughput data streams.
[0140] This application embodiment can also employ approximate graph pattern mining and local hash indexing to optimize discovery performance. To address the challenge of potentially enormous behavioral graph sizes in industrial applications and significantly improve the execution efficiency of the core algorithm, this invention introduces approximate computation and efficient indexing techniques. In the stable sequence discovery step of Phase Two, an approximate graph pattern mining algorithm can replace the traditional exact subgraph matching algorithm. Through graph sampling, random walks, and other techniques, the system can quickly discover "sufficiently frequent" common behavioral sequences with a complexity far lower than exact computation, within an acceptable range of precision loss, thereby reducing the computational bottleneck of this step from exponential to polynomial level. Simultaneously, in the matching and generation steps of control sample pairs, a Local Sensitive Hash (LSH) index can be established for the attribute vectors of the predecessor and successor windows within the "local causal window." This index can quickly retrieve candidate sets highly similar to the target sample in terms of covariates from a massive candidate sample pool with sublinear time complexity, greatly accelerating the nearest neighbor search efficiency in processes such as propensity score matching. The combination of these two performance optimization strategies enables the present invention to efficiently process ultra-large-scale behavioral graphs containing hundreds of millions of nodes and edges, ensuring its scalability and practicality under stringent performance requirements.
[0141] This application embodiment can also introduce adaptive causal windows and multi-scale analysis to enhance robustness. To improve the adaptability and robustness of causal discovery to interaction scenarios of varying complexity, this invention can improve the definition of "local causal window," extending it from a fixed size to an adaptive mechanism and introducing multi-scale analysis. Specifically, the system no longer presets a fixed graph neighborhood degree (e.g., 1 degree) as the window size, but treats it as an optimizable hyperparameter. By trying multiple different window sizes and using model selection methods such as cross-validation and information criteria (e.g., AIC / BIC), the significance and explanatory power of the causal relationships discovered at different scales are evaluated. The system can then provide causal information for different types of stable behavioral sequences (…). The system automatically determines an optimal causal analysis context. Furthermore, it can perform causal analysis simultaneously at multiple key scales and integrate the results. This multi-scale analysis method enables the invention to simultaneously capture immediate, micro-level causal effects triggered by nearby events (small window), as well as long-term, macro-level causal patterns influenced by more distant nodes (large window), thus forming a hierarchical system of empirical knowledge. This greatly enhances the model's ability to discover complex causal chains and its explanatory power for the final results.
[0142] For example, taking a large data warehouse environment as an application scenario, in which data analysts write and execute SQL queries through a database client to complete data analysis tasks. The system's interaction history is recorded in the form of database query logs. The goal of this application is to automatically discover and extract causal experiences related to data analysis that can guide analysts to improve query efficiency and success rate from these massive, text-based query logs.
[0143] like Figure 3 As shown, the system used to implement the method of this application in this embodiment can be deployed on a set of servers. This system environment integrates an SQL parsing engine, a distributed computing framework (such as Spark), and a graph database (such as Neo4j). The system receives database query history logs (i.e., the historical interaction library TaskProcessRecord_Base) as input, and after processing by the method of this application, outputs a structured causal experience knowledge base. This experience knowledge base can be used to build an enhanced intelligent analysis and query assistant.
[0144] In this application scenario, the core fields included in the query log (TaskProcessRecord) are: session_id, user_id, timestamp, sql_text, execution_time, and status. The objective of this application is to discover and extract interaction experiences related to "reducing execution_time". In this embodiment, after the system receives the analysis task of "extracting interaction experiences related to improving the performance of complex analytical queries," the specific implementation steps are as follows:
[0145] Phase 1: Construction of Behavioral Graph Based on Historical Interactions
[0146] Step 101: Structured parsing of interactive sequence events.
[0147] The input for this step is the raw database query history log stream. For example, the system receives the following log records from different sessions:
[0148] Record 1: {session_id: "S135", user_id: "U007", timestamp: 1680000001, sql_text: "DESCRIBE sales;", execution_time: 0.5, status: "success"};
[0149] Record 2: {session_id: "S135", user_id: "U007", timestamp: 1680000005, sql_text: "SELECT * FROM sales LIMIT 10;", execution_time: 1.2, status: "success"};
[0150] Record 3: {session_id: "S208", user_id: "U015", timestamp: 1680001230, sql_text: "SELECT region, COUNT(DISTINCT user_id) FROM sales GROUP BYregion;", execution_time: 55.7, status: "success"};
[0151] The semantic parsing module receives these inputs and uses the SQL syntax parser to break down each record into structured events SEF(e). For example, the processing result for three records is: SEF(e1) = {Trigger: "DESCRIBE", Arguments:[("sales", "SourceTable")]}, SEF(e2) = {Trigger: "SELECT", Arguments: [("sales", "SourceTable"), ("10", "LimitValue")]}, SEF(e3) = {Trigger: "SELECT",Arguments: [("sales", "SourceTable"), ("COUNT", "AggregateFunction"), ("region", "GroupByColumn")]}.
[0152] Meanwhile, the cross-round semantic entity association module processes all queries within the same session (e.g., "S135"), and uniformly maps the table name "sales" appearing in the logs to the standard entity E_SalesTable through the entity dictionary Dent. For example, One entry is: {"Ent001": {"canonical_name": "E_SalesTable", "aliases":["sales", "dbo.sales"]}};
[0153] The system aggregates a logically consecutive set of query operations (such as all operations in session "S135") into a set of event clusters. .
[0154] The final output of this step is a series of structured event clusters and a standardized entity dictionary, which constitute the foundational data for subsequent graph construction. The entity dictionary... is { "Ent001": { "canonical_name": "E_SalesTable", "aliases": ["sales", "dbo.sales"]}}.
[0155] Step 102: Generate a historical interaction behavior map.
[0156] The input for this step is the set of event clusters generated in step 101. and entity dictionary . The system creates the core events of each event cluster set as nodes in the graph database (Neo4j), and establishes different types of edges according to the relationships between events.
[0157] For example, for two events e1 (DESCRIBE sales) and e2 (SELECT * FROM sales LIMIT 10) in session S135, the system will perform the following three operations:
[0158] 1. Temporal modeling (Torder): Based on timestamp (1680000001 <1680000>005), establish a time relationship edge of [:BEFORE] between the nodes of e1 and e2.
[0159] 2. Causal relationship recognition (CausalE): If analysis finds that the e2 query is performed after the e1 table structure exploration, which conforms to a exploration-preview behavior pattern, a behavior dependence edge of [:CAUSE->EFFECT] may be established from e1 to e2.
[0160] 3. Co-occurrence pattern recognition (CorelE): For events e2 (from S135) and e3 (from S208) from different sessions, since they both operate on the standard entity E_SalesTable, the system will establish a co-occurrence relationship edge of [:RELATED_TO {entity: "E_SalesTable"}] between their nodes.
[0161] By integrating all nodes and these multi-type edges, this step finally outputs a complete global behavior graph Gcausal stored in the Neo4j graph database.
[0162] Phase II: Control sample matching and construction
[0163] Step 201: Discovery of stable sequences based on the behavior graph.
[0164] The input of this step is the global behavior graph Gcausal generated in step 102. The system traverses this graph using a graph pattern mining algorithm to discover frequently occurring query construction patterns.
[0165] For example, the algorithm discovers a large number of paths similar to S135 in the graph, thereby identifying a frequently occurring stable sequence CS1, whose pattern is: ("Execute DESCRIBE table query") -> ("Execute SELECT * FROM table LIMIT 10 query") -> ("Execute complex aggregation query with JOIN and GROUP BY");
[0166] The final output of this step is a stable set of high-frequency common sequences. .For example: = { CS1: {Nodes: [EventType:DESCRIBE, EventType:SELECT_LIMIT, EventType:COMPLEX_AGG],Edges: [(:DESCRIBE)-[:BEFORE]->(:SELECT_LIMIT), ...], Freq: 0.18}, CS2:{...}} where CS1 represents the above rigorous workflow pattern and records its frequency of occurrence in historical data as 18%.
[0167] Step 202.1: Definition of local causal window and construction of candidate sample pool.
[0168] The input for this step is the global behavioral graph Gcausal and the stable sequence CS1 discovered in step 201. The system first defines a local causal window Local_Causal_Window={Wpre, CS1, Wpost} around CS1, where Wpre is the event one degree before the starting node of CS1 (DESCRIBE query), and Wpost is the event one degree after the ending node of CS1 (complex aggregation query). In this example, Wpost is simplified to the result attribute of the complex aggregation query itself.
[0169] Subsequently, the system uses this window structure as a template to perform graph pattern matching in Gcausal, searching for all subgraph instances that match this structure. For example, the system matched session S135, which fully displays this pattern.
[0170] The final output of this step is a candidate sample set InitialCandidatePool. This is a list where each element is a matching record.
[0171] Step 202.2: Based on the high-frequency common sequence set Target sample filtering based on attributes.
[0172] The input for this step is InitialCandidatePool. To ensure fairness in subsequent comparisons, the system needs to homogenize the samples. In this embodiment, a hard screening method is used, with the rule that only samples in the CS1 instance whose tables ultimately joined by the complex aggregation query contain both "sales" and "customers" are retained.
[0173] When processing the InitialCandidatePool from the previous step, the record with task_id: "S135" is retained (assuming its final query involves sales and customers), while the record with task_id: "S188" is filtered out because it probes the products table, and its subsequent complex queries are likely to be unsuitable.
[0174] The final output of this step is a more consistent and comparable set of target samples, AlignedTaskCohort, with cleaner content.
[0175] Step 202.3: Selection of causal factors and sample grouping.
[0176] The input for this step is the target sample set, AlignedTaskCohort. In this step, the causal relationships of the study are explicitly defined:
[0177] "Cause Factor": Whether the DESCRIBE table action exists in the preceding window Wpre. Its values are divided into two categories: value_A (executed) and value_B (not executed).
[0178] "Outcome Factor": The execution_time attribute of the final aggregate query in the subsequent window Wpost.
[0179] Subsequently, the system iterates through all records in AlignedTaskCohort and assigns the records to different subsets based on the specific value of the "cause" factor in its wpre_instance.
[0180] The final output of this step is a StratifiedCohort, a collection of samples stratified by the "cause" factor.
[0181] Step 202.4.1: Method 1: Constructing Counterfactual Sample Pairs Based on Predecessor Condition Differences
[0182] This step aims to precisely quantify the impact of changes in precursor conditions on subsequent results.
[0183] Step 202.4.1.1: Designation of the experimental group and the control group
[0184] The input for this step is the StratifiedCohort set generated in step 202.3. The system formally assigns groups based on the preset analysis objectives. Specifically, the list of records in StratifiedCohort with the key "DESCRIBE_executed" is designated as the Treatment Group, i.e., the group that received the "treatment"; the list of records with the key "DESCRIBE_not_executed" is designated as the Control Group. The output of this step is two clearly defined sample sets: the Treatment Group and the Control Group, providing clear targets for subsequent matching operations.
[0185] Step 202.4.1.2: Propensity Score Calculation and Matching
[0186] The input for this step is the experimental group and control group specified in the previous step. To ensure comparability between the two groups, the system uses propensity score matching (PSM) to control for confounding factors (such as user_avg_queries in covariates, representing user experience). The system uses a logistic regression model to predict the probability that each sample belongs to the experimental group based on the covariate {"user_avg_queries": ...}, which is the propensity score. For example, for S135 (user_avg_queries: 150) in the experimental group and S208 (user_avg_queries: 155) in the control group, their propensity scores will also be very similar because their covariates are very close. The system uses the nearest neighbor matching algorithm to find the samples with the closest propensity scores between the two groups for pairing. Therefore, S135 and S208 are successfully matched as a pair. Similarly, S162 (210) and S211 (212) are also successfully matched. The output of this step is a list of successfully matched sample pairs (records), for example: [ (record_S135, record_S208), (record_S162, record_S211) ].
[0187] Step 202.4.1.3: Sample Generation and Enhancement
[0188] The input for this step is the list of matching sample pairs generated in step 202.4.1.2. The system converts each matching record into a standard counterfactual sample pair. For the first pair of matches (record_S135, record_S208), the generated sample pairs are:
[0189] The system performs a quality assessment on the generated sample pairs (e.g., calculating the standardized mean difference of covariates) to ensure that the two matched groups are balanced on features such as user_avg_queries. If the quality meets the standard, the sample pairs are retained. The output of this step is a high-quality counterfactual sample pair dataset that can be directly used for causal effect calculations.
[0190] Phase Three: Discovery of Causal Effects and Extraction of Experience
[0191] The input for this stage is the final counterfactual sample pair dataset generated in step 202.4.1.3. The system first performs causal effect discovery, specifically by calculating the average treatment effect (ATE) for all sample pairs. For the first sample pair, the treatment effect is... = 55.7 - 30.2 = 25.5 seconds. For the second pair of samples, the treatment effect is 45.1 - 28.5 = 16.6 seconds. Assume that the average treatment effect ATE for all sample pairs in the dataset is (25.5 + 16.6 + ...) / N = 12.5 seconds, and that the results are statistically significant using methods such as t-tests. This indicates that the action of "pre-executing DESCRIBE" (compared to not executing it) leads to a causal effect of "reducing the final query execution time by 12.5 seconds" on average. Next, the system performs experience extraction, transforming this quantified result into a structured empirical expression form {A->B|C} that can be used for symbolic reasoning. Here, A (cause) corresponds to ΔX, i.e., the change from "not executing DESCRIBE" to "executing DESCRIBE", which is expressed as "DESCRIBE_table_first". B (effect) corresponds to ΔY, i.e., the observed effect, which is expressed as "execution_time_decrease_by_12.5s". C (condition / context) corresponds to a stable sequence The background, i.e., the context in which this causal relationship was discovered, is denoted as "building_complex_aggregate_query". The final output of this stage is one or more structured causal experiences, which are stored in the experience knowledge base.
[0192] This experience can be used for real-time optimization decisions. For example, in an intelligent query editor, when it detects that a user is about to write a complex query involving multiple table joins and aggregations, the system can proactively display a prompt based on this experience: "It is recommended to use the DESCRIBE command to view the table structure first, which may significantly improve query performance."
[0193] Of course, this application can have many other embodiments. For example, the application scenarios of this application are not limited to business intelligence platforms or traditional database queries, but can also be extended to any field that records sequential behaviors and results, such as code commit logs in software development, student learning paths in online education platforms, or work order processing records in customer service systems. In addition, in the construction of behavioral graphs, more advanced natural language processing or multimodal analysis techniques can be introduced to handle more complex unstructured interactive data; in the construction of control samples, other causal inference models such as difference-in-differences (DID) and instrumental variable (IV) methods can also be used to address different types of data and confounding challenges.
[0194] Example 3
[0195] Figure 4 This is a schematic diagram of the structure of an interactive experience extraction device provided in Embodiment 3 of this application. Figure 4 As shown, the device includes: an interactive sequence acquisition module 31, a map generation module 32, a target sample construction module 33, and a sample pair generation module 34.
[0196] The interaction sequence acquisition module 31 is used to acquire the interaction sequence in the task interaction record, wherein the interaction sequence includes interaction sequence events;
[0197] The graph generation module 32 is used to process each of the interaction sequence events to generate an event cluster set; to identify event relationships based on the event cluster set; and to generate a global behavior graph.
[0198] The target sample construction module 33 is used to determine the high-frequency common sequence set based on the global behavior map, and construct the target sample set based on the pre-set local causal window and the high-frequency common sequence set;
[0199] The sample pair generation module 34 is used to construct experimental group data and control group data based on the target sample set, score the experimental group data and control group data, and generate sample pairs based on the scoring results; perform causal effect discovery on each sample pair, and extract interaction experience.
[0200] This application provides an experience extraction device for interactive scenarios, solving the problems of low efficiency and poor interpretability and inferability of extracted experience. By processing interactive sequence events in task interaction records, an event cluster set is generated. Based on the event cluster set, event relationships are identified and a global behavior graph is constructed. The global behavior graph reflects the semantic associations and entity participation relationships between events, providing basic data support for subsequent data processing. By analyzing the global behavior graph, a high-frequency common sequence set is determined, and then a target sample set is constructed by combining it with a local causal window. This transforms the abstract graph data into a target sample set containing potential causal analysis scenarios, enabling more accurate removal of confounding factors and improving the effectiveness and robustness of causal effect estimation. Based on the target sample set, experimental group data and control group data are constructed and scored accordingly. High-quality sample pairs are generated based on the scoring results. By performing causal effect discovery on each sample pair, interpretable and inferable interactive experiences are extracted.
[0201] Optionally, the map generation module 32 includes:
[0202] The structured unit is used to perform structured parsing on each of the interactive sequence events and generate structured information about the events;
[0203] The event cluster generation unit is used to perform semantic matching and clustering on the structured information of the events to generate an event cluster set.
[0204] Optionally, the map generation module 32 includes:
[0205] An event relationship identification unit is used to identify the relationships between events in the event cluster set and obtain event relationship edges, wherein the event relationship edges include at least one of the following: time relationship edges, behavior dependency relationship edges, and co-occurrence relationship edges;
[0206] The graph construction unit is used to construct a global behavior graph based on the event relationship edges.
[0207] Optionally, the event relationship identification unit is configured to perform at least one of the following:
[0208] The events in the event cluster set are subjected to time extraction and normalization processing to determine the temporal order of each event, the temporal order of the core events of each event cluster set is determined, and the temporal relationship edge between each event is constructed based on the temporal order of each event and the temporal order of each core event.
[0209] The event cluster set is subjected to temporal dependency identification according to a preset identification algorithm, and temporal dependency edges between the events are constructed according to the temporal dependency of each event. The identification algorithm includes at least one of the following: behavior triggering pattern matching, semantic and dependency analysis, and dependency identification model.
[0210] Based on the entity dictionary, co-occurrence relationships of events in the event cluster set are identified and co-occurrence relationship edges between the events are constructed. The entity dictionary is generated by normalizing and disambiguating the events contained in each event cluster set.
[0211] Optionally, the step of identifying co-occurrence relationships of events in the event cluster set based on an entity dictionary and constructing co-occurrence relationship edges between the events includes:
[0212] Based on the entity dictionary, determine the entity-standardized unique identifier and / or semantically equivalent representation of each event;
[0213] The entities of each event are matched with standardized unique identifiers and / or semantically equivalent expressions, and co-occurrence relationships are established for the successfully matched events;
[0214] For events that co-occur, calculate the semantic similarity between the events. If the semantic similarity is higher than a set threshold, then establish a co-occurrence relationship edge between the events.
[0215] Optionally, the target sample construction module 33 includes:
[0216] An event sequence determination unit is used to traverse the paths and subgraph structures in the global behavior graph to determine the event sequence;
[0217] A high-frequency sequence generation unit is used to count the frequency of each event sequence, determine a high-frequency common sequence based on the frequency of each event sequence, and generate a high-frequency common sequence set based on each high-frequency common sequence.
[0218] Optionally, the target sample construction module 33 includes:
[0219] The candidate sample set generation unit is used to perform a context connection relationship query on each high-frequency common sequence in the high-frequency common sequence set based on a pre-set local causal window, and generate a candidate sample set based on the query results.
[0220] The target sample set generation unit is used to filter the candidate samples in the candidate sample set and generate a target sample set.
[0221] Optionally, the candidate sample set generation unit is specifically used for: for each high-frequency common sequence in the high-frequency common sequence set, using the structure of the high-frequency common sequence as the core template, querying the global behavior graph to determine all subgraph instances that match the high-frequency common sequence; for each subgraph instance, querying the context connection relationship of the subgraph instance based on the local causal window to determine the predecessor window event and successor window event corresponding to the subgraph instance; generating candidate samples based on the predecessor window event and successor window event corresponding to the subgraph instance; and forming a candidate sample set based on each candidate sample.
[0222] Optionally, the local causal window includes a predecessor window and a successor window; the step of querying the context connectivity of the subgraph instance based on the local causal window to determine the predecessor window event and successor window event corresponding to the subgraph instance includes:
[0223] Query the context connections of the subgraph instance to determine if the subgraph instance has a first event with a connection depth equal to the size of the predecessor window and a timestamp earlier than the start time of the subgraph instance. If so, use the first event as the predecessor window event.
[0224] Query the following connection relationships of the subgraph instance to determine whether the subgraph instance has a second event with a connection depth equal to the successor window size and a timestamp later than the end time of the subgraph instance. If so, use the second event as the successor window event.
[0225] Optionally, the target sample set generation unit is specifically used to perform at least one of the following:
[0226] The candidate samples in the candidate sample set are filtered based on the pre-set attribute matching rules to generate the target sample set; the attribute matching rules include at least one of the following: the key attributes of each event in the candidate samples are the same, and the numerical attributes of each event in the candidate samples are within the preset error range.
[0227] The attribute difference values of each candidate sample are determined, and the attribute difference values are input into a first propensity score model for scoring to obtain the scores of each candidate sample; the candidate samples are then filtered based on their scores to generate a target sample set.
[0228] Optionally, the sample pair generation module 34 includes at least one of the following:
[0229] The first data group generation unit is configured to, for each target sample in the target sample set, determine the causal factor of the target sample based on the preceding window event of the target sample, determine the effect factor of the target sample based on the subsequent window event of the target sample, generate an observation sample based on the causal factor and effect factor of the target sample; cluster each observation sample based on the causal factor of each observation sample to generate sample group subsets; and select two sample group subsets from each sample group subset as experimental group data and control group data, respectively.
[0230] The second data group generation unit is used to take the target sample set as experimental group data; determine the target common sequence set; filter the global behavior graph based on the target common sequence set to obtain control sequences; query the context connection relationship of each control sequence to determine the predecessor window event and successor window event of each control sequence; and form control group data according to each control sequence and its corresponding predecessor window event and successor window event. Each control sequence is an interaction sequence that does not contain the target common sequence in the target common sequence set and is similar to the experimental group data. Similarity to the experimental group data includes at least one of the following: temporal similarity, semantic similarity, and contextual feature similarity.
[0231] Optionally, the sample pair generation module 34 includes:
[0232] The scoring unit is used to extract covariate vectors for each record in the experimental group data and the control group data, input the extracted covariate vectors into the second propensity score model, and determine the score of each record based on the output of the second propensity score model.
[0233] The sample pair generation unit is used to match the records in the experimental group data and the records in the control group data based on the nearest score principle, and generate sample pairs according to the matching results.
[0234] The experience extraction device in the interaction provided in the embodiments of this application can execute the experience extraction method in the interaction provided in any embodiment of this application, and has the corresponding functional modules and beneficial effects of the method execution.
[0235] Example 4
[0236] Figure 5A schematic diagram of an electronic device 40 that can be used to implement embodiments of this application is shown. The electronic device is intended to represent various forms of digital computers, such as laptop computers, desktop computers, workstations, personal digital assistants, servers, blade servers, mainframe computers, and other suitable computers. The electronic device can also represent various forms of mobile devices, such as personal digital assistants, cellular phones, smartphones, wearable devices (e.g., helmets, glasses, watches, etc.), and other similar computing devices. The components shown herein, their connections and relationships, and their functions are merely illustrative and are not intended to limit the implementation of the application described and / or claimed herein.
[0237] like Figure 5 As shown, the electronic device 40 includes at least one processor 41 and a memory, such as a read-only memory (ROM) 42 or a random access memory (RAM) 43, communicatively connected to the at least one processor 41. The memory stores computer programs executable by the at least one processor. The processor 41 can perform various appropriate actions and processes based on the computer program stored in the ROM 42 or loaded from storage unit 48 into the RAM 43. The RAM 43 may also store various programs and data required for the operation of the electronic device 40. The processor 41, ROM 42, and RAM 43 are interconnected via a bus 44. An input / output (I / O) interface 45 is also connected to the bus 44.
[0238] Multiple components in electronic device 40 are connected to I / O interface 45, including: input unit 46, such as keyboard, mouse, etc.; output unit 47, such as various types of monitors, speakers, etc.; storage unit 48, such as disk, optical disk, etc.; and communication unit 49, such as network card, modem, wireless transceiver, etc. Communication unit 49 allows electronic device 40 to exchange information / data with other devices through computer networks such as the Internet and / or various telecommunications networks.
[0239] Processor 41 can be a variety of general-purpose and / or special-purpose processing components with processing and computing capabilities. Some examples of processor 41 include, but are not limited to, a central processing unit (CPU), a graphics processing unit (GPU), various special-purpose artificial intelligence (AI) computing chips, various processors running machine learning model algorithms, a digital signal processor (DSP), and any suitable processor, controller, microcontroller, etc. Processor 41 performs the various methods and processes described above, such as experience extraction methods in interactions.
[0240] In some embodiments, the experience extraction method in the interaction may be implemented as a computer program tangibly contained in a computer-readable storage medium, such as storage unit 48. In some embodiments, part or all of the computer program may be loaded and / or mounted on electronic device 40 via ROM 42 and / or communication unit 49. When the computer program is loaded into RAM 43 and executed by processor 41, one or more steps of the experience extraction method in the interaction described above may be performed. Alternatively, in other embodiments, processor 41 may be configured to perform the experience extraction method in the interaction by any other suitable means (e.g., by means of firmware).
[0241] Various embodiments of the systems and techniques described above herein can be implemented in digital electronic circuit systems, integrated circuit systems, field-programmable gate arrays (FPGAs), application-specific integrated circuits (ASICs), application-specific standard products (ASSPs), systems-on-a-chip (SoCs), payload-programmable logic devices (CPLDs), computer hardware, firmware, software, and / or combinations thereof. These various embodiments may include implementations in one or more computer programs that can be executed and / or interpreted on a programmable system including at least one programmable processor, which may be a dedicated or general-purpose programmable processor, capable of receiving data and instructions from a storage system, at least one input device, and at least one output device, and transmitting data and instructions to the storage system, the at least one input device, and the at least one output device.
[0242] Computer programs used to implement the methods of this application may be written in any combination of one or more programming languages. These computer programs may be provided to a processor of a general-purpose computer, a special-purpose computer, or other programmable data processing device, such that when executed by the processor, the computer programs cause the functions / operations specified in the flowcharts and / or block diagrams to be performed. The computer programs may be executed entirely on a machine, partially on a machine, or as a standalone software package, partially on a machine and partially on a remote machine, or entirely on a remote machine or server.
[0243] This application provides a computer program product, which includes a computer program that, when executed by a processor, implements the experience extraction method in the interaction described in any embodiment of this application.
[0244] In the context of this application, a computer-readable storage medium can be a tangible medium that may contain or store a computer program for use by or in conjunction with an instruction execution system, apparatus, or device. A computer-readable storage medium can be, but is not limited to, electronic, magnetic, optical, electromagnetic, infrared, or semiconductor systems, apparatus, or devices, or any suitable combination of the foregoing. Alternatively, a computer-readable storage medium can be a machine-readable signal medium. More specific examples of machine-readable storage media include electrical connections based on one or more wires, portable computer disks, hard disks, random access memory (RAM), read-only memory (ROM), erasable programmable read-only memory (EPROM or flash memory), optical fiber, portable compact disk read-only memory (CD-ROM), optical storage devices, magnetic storage devices, or any suitable combination of the foregoing.
[0245] To provide interaction with a user, the systems and techniques described herein can be implemented on an electronic device having: a display device (e.g., a CRT (cathode ray tube) or LCD (liquid crystal display) monitor) for displaying information to the user; and a keyboard and pointing device (e.g., a mouse or trackball) through which the user provides input to the electronic device. Other types of devices can also be used to provide interaction with the user; for example, feedback provided to the user can be any form of sensory feedback (e.g., visual feedback, auditory feedback, or tactile feedback); and input from the user can be received in any form (including sound input, voice input, or tactile input).
[0246] The systems and technologies described herein can be implemented in computing systems that include backend components (e.g., as data servers), or middleware components (e.g., application servers), or frontend components (e.g., user computers with graphical user interfaces or web browsers through which users can interact with implementations of the systems and technologies described herein), or any combination of such backend, middleware, or frontend components. The components of the system can be interconnected via digital data communication of any form or medium (e.g., communication networks). Examples of communication networks include local area networks (LANs), wide area networks (WANs), blockchain networks, and the Internet.
[0247] A computing system can include clients and servers. Clients and servers are generally located far apart and typically interact through communication networks. The client-server relationship is created by computer programs running on the respective computers and having a client-server relationship with each other. The server can be a cloud server, also known as a cloud computing server or cloud host, which is a hosting product within the cloud computing service system to address the shortcomings of traditional physical hosts and VPS services, such as high management difficulty and weak business scalability.
[0248] It should be understood that the various forms of processes shown above can be used to rearrange, add, or delete steps. For example, the steps described in this application can be executed in parallel, sequentially, or in different orders, as long as the desired result of the technical solution of this application can be achieved, and this is not limited herein.
[0249] The specific embodiments described above do not constitute a limitation on the scope of protection of this application. Those skilled in the art should understand that various modifications, combinations, sub-combinations, and substitutions can be made according to design requirements and other factors. Any modifications, equivalent substitutions, and improvements made within the spirit and principles of this application should be included within the scope of protection of this application.
Claims
1. A method for extracting experience in an interactive context, characterized in that, include: Obtain the interaction sequence from the task interaction record, wherein the interaction sequence includes interaction sequence events; The interaction sequence events are processed to generate an event cluster set; Event relationships are identified based on the event cluster set, and a global behavior graph is generated accordingly. A high-frequency common sequence set is determined based on the global behavioral graph, and a target sample set is constructed based on a pre-set local causal window and the high-frequency common sequence set. Based on the target sample set, experimental group data and control group data are constructed, the experimental group data and control group data are scored, and sample pairs are generated based on the scoring results; causal effect discovery is performed on each sample pair, and interaction experience is extracted.
2. The method according to claim 1, characterized in that, The process of processing each of the interactive sequence events to generate an event cluster set includes: The interactive sequence events are parsed in a structured manner to generate structured information about the events; The structured information of the events is semantically matched and clustered to generate a set of event clusters.
3. The method according to claim 1, characterized in that, The step of identifying event relationships based on the event cluster set and generating a global behavior graph includes: Relationship identification is performed on the events in the event cluster set to obtain event relationship edges, which include at least one of the following: time relationship edge, behavior dependency relationship edge, co-occurrence relationship edge; Construct a global behavior graph based on the event relationship edges.
4. The method according to claim 3, characterized in that, The step of identifying relationships among events in the event cluster set to obtain event relationship edges includes at least one of the following: The events in the event cluster set are subjected to time extraction and normalization processing to determine the temporal order of each event, the temporal order of the core events of each event cluster set is determined, and the temporal relationship edge between each event is constructed based on the temporal order of each event and the temporal order of each core event. The event cluster set is subjected to temporal dependency identification according to a preset identification algorithm, and temporal dependency edges between the events are constructed according to the temporal dependency of each event. The identification algorithm includes at least one of the following: behavior triggering pattern matching, semantic and dependency analysis, and dependency identification model. Based on the entity dictionary, co-occurrence relationships of events in the event cluster set are identified and co-occurrence relationship edges between the events are constructed. The entity dictionary is generated by normalizing and disambiguating the events contained in each event cluster set.
5. The method according to claim 4, characterized in that, The step of identifying co-occurrence relationships among events in the event cluster set based on an entity dictionary and constructing co-occurrence relationship edges between the events includes: Based on the entity dictionary, determine the entity-standardized unique identifier and / or semantically equivalent representation of each event; The entities of each event are matched with standardized unique identifiers and / or semantically equivalent expressions, and co-occurrence relationships are established for the successfully matched events; For events that co-occur, calculate the semantic similarity between the events. If the semantic similarity is higher than a set threshold, then establish a co-occurrence relationship edge between the events.
6. The method according to claim 1, characterized in that, The step of determining the set of high-frequency common sequences based on the global behavioral map includes: The paths and subgraph structures in the global behavior graph are traversed to determine the event sequence; The frequency of each event sequence is counted, a high-frequency common sequence is determined based on the frequency of each event sequence, and a high-frequency common sequence set is generated based on each high-frequency common sequence.
7. The method according to claim 1, characterized in that, The construction of the target sample set based on the pre-set local causal window and the high-frequency common sequence set includes: Based on a pre-set local causal window, a context connection relationship query is performed on each high-frequency common sequence in the high-frequency common sequence set, and a candidate sample set is generated based on the query results. The candidate samples in the candidate sample set are filtered to generate the target sample set.
8. The method according to claim 7, characterized in that, The step of performing a context connectivity query on each high-frequency common sequence in the high-frequency common sequence set based on a pre-set local causal window, and generating a candidate sample set based on the query results, includes: For each high-frequency common sequence in the set of high-frequency common sequences, using the structure of the high-frequency common sequence as the core template, a query is performed in the global behavioral graph to determine all subgraph instances that match the high-frequency common sequence; For each subgraph instance, the context connectivity of the subgraph instance is queried based on the local causal window to determine the predecessor window event and successor window event corresponding to the subgraph instance; candidate samples are generated based on the predecessor window event and successor window event corresponding to the subgraph instance. A candidate sample set is formed based on each of the candidate samples.
9. The method according to claim 8, characterized in that, The local causal window includes a predecessor window and a successor window; the step of querying the context connectivity of the subgraph instance based on the local causal window to determine the predecessor window event and successor window event corresponding to the subgraph instance includes: Query the context connections of the subgraph instance to determine if the subgraph instance has a first event with a connection depth equal to the size of the predecessor window and a timestamp earlier than the start time of the subgraph instance. If so, use the first event as the predecessor window event. Query the following connection relationships of the subgraph instance to determine whether the subgraph instance has a second event with a connection depth equal to the successor window size and a timestamp later than the end time of the subgraph instance. If so, use the second event as the successor window event.
10. The method according to claim 7, characterized in that, The step of filtering candidate samples in the candidate sample set to generate a target sample set includes at least one of the following: The candidate samples in the candidate sample set are filtered based on the pre-set attribute matching rules to generate the target sample set; the attribute matching rules include at least one of the following: the key attributes of each event in the candidate samples are the same, and the numerical attributes of each event in the candidate samples are within the preset error range. The attribute difference values of each candidate sample are determined, and the attribute difference values are input into a first propensity score model for scoring to obtain the scores of each candidate sample; the candidate samples are then filtered based on their scores to generate a target sample set.
11. The method according to claim 1, characterized in that, The construction of experimental group data and control group data based on the target sample set includes at least one of the following: For each target sample in the target sample set, the causal factor of the target sample is determined based on the preceding window event of the target sample, and the effect factor of the target sample is determined based on the succeeding window event of the target sample. An observation sample is generated based on the causal and effect factors of the target sample. Each observation sample is clustered based on its causal factor to generate sample group subsets. Two sample group subsets are selected from each sample group subset as experimental group data and control group data, respectively. The target sample set was used as the experimental group data. A target common sequence set is determined, and the global behavior graph is filtered based on the target common sequence set to obtain control sequences. The contextual connectivity of each control sequence is queried to determine the preceding window event and the succeeding window event of each control sequence. Control group data is formed based on each control sequence and its corresponding preceding and succeeding window events. Each control sequence is an interaction sequence that does not contain the target common sequence in the target common sequence set and is similar to the experimental group data. Similarity to the experimental group data includes at least one of the following: temporal similarity, semantic similarity, and contextual feature similarity.
12. The method according to claim 1, characterized in that, The step of scoring the experimental group data and the control group data, and generating sample pairs based on the scoring results, includes: For each record in the experimental group data and the control group data, covariate vectors are extracted from the record, and the extracted covariate vectors are input into the second propensity score model. The score for each record is determined based on the output of the second propensity score model. Based on the principle of closest scoring, the records in the experimental group data and the records in the control group data are matched, and sample pairs are generated according to the matching results.
13. An experience extraction device in an interactive process, characterized in that, include: An interaction sequence acquisition module is used to acquire the interaction sequence in the task interaction record, wherein the interaction sequence includes interaction sequence events; The graph generation module is used to process each of the interaction sequence events to generate an event cluster set; to identify event relationships based on the event cluster set, and to generate a global behavior graph. The target sample construction module is used to determine the high-frequency common sequence set based on the global behavioral graph, and construct the target sample set based on the pre-set local causal window and the high-frequency common sequence set. The sample pair generation module is used to construct experimental group data and control group data based on the target sample set, score the experimental group data and control group data, and generate sample pairs based on the scoring results; perform causal effect discovery on each sample pair, and extract interaction experience.
14. An electronic device, characterized in that, The electronic device includes: At least one processor, and a memory communicatively connected to said at least one processor; The memory stores a computer program that can be executed by the at least one processor, the computer program being executed by the at least one processor to enable the at least one processor to perform the experience extraction method in the interaction according to any one of claims 1-12.
15. A computer-readable storage medium, characterized in that, The computer-readable storage medium stores computer instructions that, when executed by a processor, implement the experience extraction method in the interaction described in any one of claims 1-12.
16. A computer program product, characterized in that, The computer program product includes a computer program that, when executed by a processor, implements the experience extraction method in the interaction according to any one of claims 1-12.