A cross-domain education interactive behavior analysis method and system based on semantic alignment and inclination matching
By employing semantic alignment and propensity matching methods, we have addressed the issues of semantic inconsistency and structural differences in cross-domain educational interaction behavior analysis, enabling efficient and interpretable cross-domain comparisons and ensuring the reliability and objectivity of the analysis results.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- JIANGMEN POLYTECHNIC
- Filing Date
- 2026-03-03
- Publication Date
- 2026-06-02
AI Technical Summary
Existing technologies for analyzing cross-domain educational interaction behaviors suffer from poor semantic commensurability, structural confounding bias, and a lack of transparency in technical implementation, making it difficult to achieve causal inferences with high internal validity and interpretable cross-domain comparisons.
By acquiring and preprocessing human-computer interaction and interpersonal community interaction data, semantic alignment and sentiment matching methods are used, including identifying and removing formatted noise, performing joint topic modeling and homogeneity screening, to generate a semantically aligned dataset, and multi-dimensional analysis is performed using a psycholinguistic dictionary and a deep learning sentiment analysis model.
It achieves reliable comparisons within the scope of similar cognitive tasks, eliminates the influence of text length differences, improves internal validity, reduces measurement error, and ensures the interpretability and objectivity of the analysis results.
Smart Images

Figure CN122133679A_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the fields of computer data processing and artificial intelligence application technology, and more specifically, to a method and system for cross-domain educational interaction behavior analysis based on semantic alignment and tendency matching. Background Technology
[0002] With the rapid development of generative artificial intelligence (AIGC) technology, learners are increasingly turning to generative AI systems (such as ChatGPT and Claude) for help when encountering learning difficulties, shifting from traditional interpersonal communities (e.g., Stack Overflow, Zhihu) to these systems. This shift not only changes the fundamental form of educational interaction but also profoundly impacts learners' cognitive strategies and psychological states. To scientifically assess the effects of this technological revolution, a comparable, reliable, and interpretable cross-domain comparative analysis of heterogeneous educational dialogue data—both "human-to-human interaction" and "human-to-machine interaction"—is urgently needed.
[0003] However, existing technological solutions have significant limitations when handling cross-domain educational interaction behavior analysis tasks, making it difficult to support causal inferences or behavioral comparisons with high internal validity. Specifically, these limitations manifest in the following three aspects:
[0004] 1. Lack of semantic commensurability (Topic Bias): Human-computer interaction data typically includes a large number of AI-driven generative tasks (such as text polishing, code generation, and content creation), while interactions in interpersonal communities are mainly diagnostic or debugging tasks (such as error checking and concept clarification). The inherent differences in the types of tasks carried by different platforms lead to a high degree of inconsistency in their semantic distribution. If existing technologies (such as the cosine similarity matching method based on BERT in the comparison document CN113553405A) are directly used for cross-domain semantic comparison, it will be impossible to effectively remove the semantic heterogeneity noise introduced by the task type, resulting in an invalid comparison of "apples and pears" and seriously weakening the reliability of the analysis conclusions.
[0005] 2. A severe confounding bias exists: Communication in interpersonal communities typically follows social norms, with more complete, polite language and longer texts; while human-computer interaction often manifests as decontextualized, command-style short texts. This difference in language style and structural features (such as word count, syntactic complexity, and politeness markers) determined by the interaction modality itself systematically interferes with the extraction and comparison of psychological or cognitive indicators (such as emotional intensity, cognitive load, and self-disclosure). Although some solutions (such as the logistic regression control variable method described in comparative document CN118897623A) attempt to mitigate the bias through covariate adjustment, they are not based on a strict causal inference framework, lack the ability to balance high-dimensional covariates, and are difficult to achieve effective alignment of cross-domain samples with potential confounding factors.
[0006] 3. Lack of transparency and reproducibility in technical implementation: Most current related patents or research solutions often use vague descriptions (such as extracting topics through clustering algorithms or using pre-trained models for feature encoding) when describing key steps such as data preprocessing, semantic clustering, or model building, without providing clear mathematical formalizations, algorithmic processes, or parameter configuration logic. This "black box" approach not only limits the reproducibility of the method but also hinders educational researchers from understanding and verifying the underlying mechanisms of the analysis results.
[0007] No effective solutions have yet been proposed to address the problems in the relevant technologies. Summary of the Invention
[0008] To address the problems in related technologies, this invention proposes a method and system for analyzing cross-domain educational interaction behavior based on semantic alignment and preference matching, in order to overcome the aforementioned technical problems existing in existing related technologies.
[0009] Therefore, the specific technical solution adopted by the present invention is as follows:
[0010] According to one aspect of the present invention, a method for analyzing cross-domain educational interaction behavior based on semantic alignment and preference matching is provided, the method comprising:
[0011] S1. Obtain text data from human-computer interaction data and interpersonal community interaction data, identify and remove formatting noise of non-natural social language and text content within citation tags in the text data, and generate a candidate analysis corpus based on the removal results;
[0012] S2. Perform joint topic modeling and homogeneity screening on the candidate analysis corpus to generate a semantically aligned dataset. Extract the structural feature vector of each text data in the dataset. Perform biased structural matching on the dataset based on the structural feature vector to generate feature-balanced pairwise analysis samples to establish a balanced dataset.
[0013] S3. Using a pre-set psycholinguistic dictionary and a pre-trained deep learning sentiment analysis model, perform parallel computation on the balanced dataset, and integrate the parallel computation results to generate a multi-dimensional educational interaction behavior analysis report, so as to realize cross-domain educational interaction behavior analysis.
[0014] Preferably, the process involves acquiring text data from human-computer interaction data and interpersonal community interaction data, identifying and removing formatting noise (non-natural social language) and text content within citation tags from the text data, and generating a candidate analysis corpus based on the removal results, including:
[0015] S11. Collect multi-round dialogue logs between the user and the preset artificial intelligence model through the application programming interface, and extract the first round of question data from the multi-round dialogue logs to obtain human-computer interaction data;
[0016] S12. Using web crawler technology, collect user posting and reply data from a pre-set online Q&A community to obtain interpersonal community interaction data;
[0017] S13. Traverse the text data in human-computer interaction data and interpersonal community interaction data, identify and remove formatting noise of non-natural social language and text content within quotation tags in the text data, including rich text format and plain text format;
[0018] S14. Based on the preset search dictionary, perform keyword matching and filtering on the removal results, and generate a candidate analysis corpus based on the filtering results. The search dictionary includes knowledge acquisition markers.
[0019] Preferably, if the text data is in rich text format, then:
[0020] We use regular expressions to traverse rich text formats in human-computer interaction data and interpersonal community interaction data, and identify and remove formatting noise of non-natural social language in rich text formats.
[0021] Using DOM parsing techniques, we traverse the formatting noise removal results of non-natural social language, locate and extract the text content within the quotation tags;
[0022] If the text data is in plain text format, then:
[0023] Using multi-line pattern regular expressions, we can traverse plain text formats in human-computer interaction data and interpersonal community interaction data, identify and remove formatting noise of non-natural social language and text content within quotation tags in the plain text formats.
[0024] Preferably, joint topic modeling and homogeneity screening are performed on the candidate analysis corpus to generate a semantically aligned dataset. The structural feature vector of each text data in the dataset is extracted, and biased structural matching is performed on the dataset based on the structural feature vector to generate feature-balanced pairwise analysis samples. This establishes a balanced dataset, including:
[0025] S21. Using a pre-trained language model, each text data in the candidate analysis corpus is mapped to a unified high-dimensional vector space to generate the corresponding semantic feature vector.
[0026] S22. The semantic feature vector is reduced in dimension by uniform manifold approximation and projection algorithm, and multiple topic clusters are obtained by identifying target density regions in the reduced manifold space through density-based clustering algorithm.
[0027] S23. Simultaneously calculate the centroid vector of each topic cluster and the cosine similarity between the human-computer interaction data topic cluster and the interpersonal community interaction data topic cluster. Combine the centroid vector and cosine similarity, and use the preset topic homogeneity judgment rules to filter the topic clusters to generate a semantically aligned dataset.
[0028] S24. Extract the structural feature vector of each text data in the dataset, and calculate the propensity score of the structural feature vector using the constructed logistic regression model.
[0029] S25. Using the propensity score as the matching benchmark, a greedy matching algorithm is used to perform no-replacement pairing between human-computer interaction data and interpersonal community interaction data. The standardized mean difference between the paired human-computer interaction data and interpersonal community interaction data on each covariate is calculated to generate feature-balanced pairwise analysis samples to establish a balanced dataset.
[0030] Preferably, a uniform manifold approximation and projection algorithm is used to reduce the dimensionality of the semantic feature vectors. Then, in the reduced-dimensional manifold space, a density-based clustering algorithm is used to identify target density regions, obtaining multiple topic clusters, including:
[0031] S221. Calculate the k-nearest neighbor distance of each semantic feature vector. Based on the calculation results, construct a weighted graph according to the assumption of local connectivity and form a fuzzy simplex. Complete the low-dimensional manifold embedding of semantic feature vectors through cross-entropy optimization technique.
[0032] S222. Based on the low-dimensional manifold embedding results, calculate the cross distance between each semantic feature vector, construct a fully connected weighted graph based on the cross distance and extract the minimum spanning tree to generate a hierarchical clustering tree;
[0033] S223. Based on the preset minimum cluster size threshold, the clustering tree is compressed and removed. Based on the compression and removal results, the persistence index of each cluster in the clustering tree is calculated, and the cluster with the highest persistence is selected as the initial topic cluster.
[0034] S224. Merge initial topic clusters of the same category to generate corresponding documents, calculate the TF-IDF score of each document, and select the first few initial topic clusters with the highest TF-IDF scores as the final topic clusters based on the TF-IDF scores.
[0035] Preferably, based on the low-dimensional manifold embedding results, the cross-distance between each semantic feature vector is calculated, a fully connected weighted graph is constructed based on the cross-distance, and the minimum spanning tree is extracted to generate a hierarchical clustering tree, including:
[0036] S2221. Calculate the Euclidean distance between each semantic feature vector in the low-dimensional manifold embedding result, and combine it with the k-nearest neighbor distance to calculate the cross-distance between each semantic feature vector according to the preset cross-distance definition.
[0037] S2222: Using the semantic feature vectors embedded in the low-dimensional manifold as nodes and the distance between nodes as the edge weights, construct a fully connected weighted graph, and use the minimum spanning tree extraction algorithm to extract the minimum spanning tree from the fully connected weighted graph and establish the corresponding edge set.
[0038] S2223. Disconnect the edge with the largest weight in the edge set, iteratively merge the nodes according to the order of edge weight from smallest to largest, and record the distance threshold during the merging process to generate a clustering tree with the distance threshold as the vertical axis.
[0039] Preferably, the structural feature vector of each text data in the dataset is extracted, and the propensity score of the structural feature vector is calculated using the constructed logistic regression model, including:
[0040] S241. Perform word segmentation on the text data in the dataset, and calculate the structural feature vector of each text data based on the word segmentation result. The structural feature vector includes the text length index and the text complexity index.
[0041] S242. Using the interaction modality as the dependent variable and the structural feature vector as the independent variable, construct an initial logistic regression model to distinguish different interaction modalities. The interaction modalities include human-computer interaction modalities and interpersonal community interaction modalities.
[0042] S243. The initial logistic regression model is trained using the log-likelihood loss function, and the trained initial logistic regression model is optimized using the quasi-Newton algorithm to obtain the logistic regression model.
[0043] S244. Input the structural feature vectors of each text data in the dataset into the logistic regression model, and calculate and output the corresponding propensity score through the logistic regression model to represent the probability that the text data belongs to the target interaction modality.
[0044] Preferably, the initial logistic regression model is trained using the log-likelihood loss function, and the trained initial logistic regression model is optimized using a quasi-Newton algorithm to obtain the logistic regression model, which includes:
[0045] S2431. Based on the optimization requirements of the initial logistic regression model with the log-likelihood loss function as the training objective, define a storage pair containing the displacement vector and the gradient difference vector, and use a double-ended queue of a preset size to store the storage pairs generated during the iteration process.
[0046] S2432. Combining the gradients of the stored pairs and the log-likelihood loss function, the optimal descent direction for updating the parameters of the initial logistic regression model is determined by recursively calculating the product of the inverse approximation of the Hessian matrix and the current gradient through a double loop.
[0047] S2433. Based on the determined optimal descent direction, and combining the sufficient descent condition and the curvature condition, search for the optimal step size for updating the parameters of the initial logistic regression model.
[0048] S2434. Iteratively update the parameters of the initial logistic regression model along the optimal descent direction using the optimal step size, and determine the convergence state of the initial logistic regression model according to the preset convergence condition. If the convergence condition is met, terminate the iteration and solidify the parameters to obtain the optimized logistic regression model.
[0049] Preferably, a pre-defined psycholinguistic dictionary and a pre-trained deep learning sentiment analysis model are used to perform parallel computation on the balanced dataset, and the results of the parallel computation are fused to generate a multi-dimensional educational interaction behavior analysis report, so as to realize cross-domain educational interaction behavior analysis, including:
[0050] S31. Using a pre-set psycholinguistic dictionary, count the frequency of occurrence of target function word categories in the balanced dataset, and calculate the defensive communication density index based on the statistical results.
[0051] S32. Input the balanced dataset into the pre-trained deep learning sentiment analysis model, use the deep learning sentiment analysis model to capture the contextual dependencies in the balanced dataset, output the classification probability of the target psychological state, extract the confidence score of the target category, and calculate the cognitive vulnerability exposure probability index.
[0052] S33. Based on the defensive communication density index and the cognitive vulnerability disclosure probability index, perform difference tests between human-computer interaction data and interpersonal community interaction data respectively, and generate a multi-dimensional educational interaction behavior analysis report according to the preset judgment logic, so as to realize the interaction behavior analysis of cross-domain education.
[0053] According to another aspect of the present invention, a cross-domain educational interaction behavior analysis system based on semantic alignment and preference matching is also provided, the system comprising:
[0054] The data acquisition and preprocessing module is used to acquire text data from human-computer interaction data and interpersonal community interaction data, identify and remove formatting noise of non-natural social language and text content within citation tags in the text data, and generate a candidate analysis corpus based on the removal results.
[0055] The balanced dataset building module is used to perform joint topic modeling and homogeneity screening on the candidate analysis corpus, generate a semantically aligned dataset, extract the structural feature vector of each text data in the dataset, perform bias structure matching on the dataset based on the structural feature vector, and generate feature-balanced pairwise analysis samples to build a balanced dataset.
[0056] The interactive behavior analysis module is used to perform parallel computation on a balanced dataset using a pre-set psycholinguistic dictionary and a pre-trained deep learning sentiment analysis model. It then integrates the parallel computation results to generate a multi-dimensional educational interactive behavior analysis report, thereby enabling interactive behavior analysis in cross-domain education.
[0057] The beneficial effects of this invention are as follows:
[0058] 1. This invention uses a semantic manifold alignment mechanism to map human-computer interaction and interpersonal interaction data to the same high-dimensional vector space using a pre-trained artificial intelligence model. It also combines a density-based clustering algorithm to eliminate heterogeneous tasks, ensuring that the comparative analysis is strictly limited to the intersection of similar cognitive tasks. This avoids spurious correlations caused by different task types, thereby establishing a reliable comparison benchmark between heterogeneous data sources.
[0059] 2. This invention introduces a biased structure matching mechanism, which uses text length and reading difficulty as covariates for dynamic pairing. This eliminates the text length differences caused by different stylistic norms across different platforms at the physical level, and solves the problem that traditional dictionary-based psycholinguistic analysis tools are highly sensitive to the total number of words. This ensures that the extracted language features reflect the differences in users' psychological states rather than differences in text length, and significantly improves internal validity.
[0060] 3. This invention employs dictionary-based feature extraction and neural network-based state computation in parallel, achieving triangulation at the technical level. This not only preserves the high interpretability and benchmark stability of the dictionary method, but also uses deep learning models to solve the problems of polysemy and syntactic dependency in natural language, significantly reducing the measurement error that may be caused by a single analysis method.
[0061] 4. This invention utilizes a data acquisition interface and a noise reduction and cleaning process to extract pure digital behavioral traces from massive amounts of unstructured data. This non-invasive data acquisition method avoids the Hawthorne effect and social desirability bias that are difficult to eliminate in traditional methods, thereby ensuring that the output comparative analysis results can objectively and truthfully reflect the learners' interactive behavior patterns under natural stress situations.
[0062] 5. Traditional methods (such as simple logistic regression with controlled variables) exhibit extremely narrow valley-like loss functions when faced with the extreme nonlinear structural differences in human-computer and human-interpersonal interactions. This invention does not employ conventional stochastic gradient descent or Adam optimizers in deep learning, but instead specifically selects the L-BFGS algorithm. Combined with experimental verification, the second-order curvature approximation correction mechanism of this invention effectively suppresses the oscillations of the algorithm at the narrow valley bottom, not only improving the convergence speed of the propensity score calculation by several times, but also ensuring that the final generated matching pairs maintain an extremely high data retention rate under extremely stringent caliper constraints. This solves the technical problem faced by existing technologies in performing accurate matching of heterogeneous data, which leads to a large number of lost matching samples due to insufficient computational accuracy. Attached Figure Description
[0063] To more clearly illustrate the technical solutions in the embodiments of the present invention or the prior art, the drawings used in the embodiments will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present invention. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.
[0064] Figure 1 This is a flowchart of a cross-domain educational interaction behavior analysis method based on semantic alignment and tendency matching according to an embodiment of the present invention;
[0065] Figure 2 This is a flowchart of an embodiment of a cross-domain educational interaction behavior analysis method based on semantic alignment and tendency matching according to an embodiment of the present invention;
[0066] Figure 3 This is a principle block diagram of a cross-domain educational interaction behavior analysis system based on semantic alignment and tendency matching according to an embodiment of the present invention;
[0067] Figure 4This is a structural diagram of a cross-domain educational interaction behavior analysis system based on semantic alignment and tendency matching according to an embodiment of the present invention;
[0068] Figure 5 This is a general hardware structure diagram of a cross-domain educational interaction behavior analysis method based on semantic alignment and preference matching according to an embodiment of the present invention.
[0069] In the picture:
[0070] 1. Data acquisition and preprocessing module; 2. Balanced dataset creation module; 3. Interactive behavior analysis module. Detailed Implementation
[0071] To further illustrate the various embodiments, the present invention provides accompanying drawings, which are part of the disclosure of the present invention. These drawings are mainly used to illustrate the embodiments and can be used in conjunction with the relevant descriptions in the specification to explain the operating principles of the embodiments. With reference to these drawings, those skilled in the art should be able to understand other possible implementation methods and the advantages of the present invention.
[0072] According to embodiments of the present invention, a method and system for cross-domain educational interaction behavior analysis based on semantic alignment and preference matching is provided.
[0073] The present invention will now be further described in conjunction with the accompanying drawings and specific embodiments, such as... Figures 1-2 As shown, according to an embodiment of the present invention, a method for analyzing cross-domain educational interaction behavior based on semantic alignment and preference matching includes:
[0074] S1. Acquire text data from human-computer interaction data and interpersonal community interaction data, identify and remove formatting noise of non-natural social language and text content within citation tags in the text data, and generate a candidate analysis corpus based on the removal results.
[0075] In this optional embodiment, text data is acquired from human-computer interaction data and interpersonal community interaction data. Non-natural social language formatting noise and text content within citation tags in the text data are identified and removed. A candidate analysis corpus is generated based on the removal results, including:
[0076] S11. Collect multi-round dialogue logs between the user and the preset artificial intelligence model through the application programming interface, and extract the first round of question data from the multi-round dialogue logs to obtain human-computer interaction data.
[0077] It should be noted that multi-turn dialogue logs between users and the generative AI model are collected through the application programming interface (API) or log export module. The dialogue logs include: natural language prompts entered by the user, AI-generated responses, and timestamps. The human-computer interaction data represents private interaction scenarios under the threat of low social evaluation.
[0078] The generative AI model refers to a large language model (LLM) built on a deep learning architecture that can automatically generate coherent natural language responses based on input text. The generative AI model of this invention preferably adopts a Transformer architecture (especially a Decoder-only architecture). This model learns the statistical laws, grammatical structures, and world knowledge of language through pre-training on a large-scale text corpus; and it undergoes alignment training through human feedback reinforcement learning (RLHF) or supervised fine-tuning (SFT) to acquire the ability to follow instructions and engage in multi-turn dialogue. In terms of functionality, the model utilizes a multi-head self-attention mechanism to capture long-distance dependencies in the input text and calculates the association weights between various tokens in the context. When generating a response, the model, based on the semantic features of the input prompt, generates the next token with the highest probability through a probability prediction mechanism (Next Token Prediction), thereby constructing a semantically coherent and logically sound complete response.
[0079] Furthermore, the generative artificial intelligence model of this invention includes, but is not limited to, the following types: GPT series models, such as GPT-3.5 and GPT-4 released by OpenAI; open-source large language models, such as the LLaMA series and Mistral series released by Meta, or the ChatGLM series released by Tsinghua University; domain-specific fine-tuning models, which are dedicated models based on the above-mentioned base models and fine-tuned for corpora in the fields of education or psychological counseling. In this embodiment, the main functions of the model include: context understanding, receiving and parsing natural language prompts input by the user, identifying the user's explicit intent (such as asking a question) and implicit emotional coloring; content generation: generating decontextualized, direct knowledge or suggestion responses based on probability distribution; multi-turn interaction maintenance: maintaining the dialogue context window to ensure that the generated responses maintain logical consistency with the previous dialogue history.
[0080] S12. Using web crawler technology, collect user posting and reply data from a pre-set online Q&A community to obtain interpersonal community interaction data.
[0081] It should be further explained that user posting and reply data in online Q&A communities are collected through web crawlers or public dataset interfaces; posting data includes: the question description text (Body Text) and title (Title) of the main post; interpersonal community interaction data also includes metadata: the number of upvotes (Upvotes), the number of downvotes (Downvotes), the number of replies, and the user's reputation value; interpersonal community interaction data represents public interaction scenarios under high social evaluation threats.
[0082] S13. Traverse the text data in human-computer interaction data and interpersonal community interaction data, identify and remove formatting noise of non-natural social language and text content within quotation tags in the text data, including rich text format and plain text format.
[0083] In this optional embodiment, if the text data is in rich text format, then:
[0084] We use regular expressions to traverse rich text formats in human-computer interaction data and interpersonal community interaction data, and identify and remove formatting noise of non-natural social language in rich text formats.
[0085] Using DOM parsing techniques, we traverse the formatting noise removal results of non-natural social language, locate and extract the text content within the quotation tags;
[0086] If the text data is in plain text format, then:
[0087] Using multi-line pattern regular expressions, we can traverse plain text formats in human-computer interaction data and interpersonal community interaction data, identify and remove formatting noise of non-natural social language and text content within quotation tags in the plain text formats.
[0088] It should be further explained that, using regular expressions or text parsing algorithms, all collected text data is traversed to identify and remove formatting noise that does not belong to natural social language. Specifically, this includes removing HTML tags, URL hyperlinks, and code snippets wrapped in specific syntax markers (such as Markdown backticks). This prevents code snippets or tags from being misread by personality / sentiment analysis algorithms and also calibrates the denominator (total number of words) in subsequent word frequency statistics to avoid dilution of feature density. For interpersonal community interaction data, the text content within quotations (such as Blockquotes) is identified and removed, thereby strictly limiting the analysis object to the current user's original narrative, preventing the misattribution of others' quotations to the current user, and ensuring the subject consistency of psychological feature extraction.
[0089] The removal of formatted noise that does not belong to natural social language includes:
[0090] 1. HTML Tag and Formatting Markup Cleaning: For interpersonal community interaction data obtained by web crawlers, the system constructs the following regular expression rules for matching and replacement: The matching rule uses the regular expression r'<[^>]+>' to identify all HTML tags, such as... 、 、 This process replaces the matched string with an empty string to eliminate the interference of the webpage structure on the semantics of the text, retaining only the plain text content.
[0091] 2. URL Hyperlink Filtering: For external links embedded in text, the system performs the following identification process: It uses the regular expression r'http[s]?: / / (?:[a-zA-Z]|[0-9]|[$-_@.&+]|[!*\\(\\),]|(?:%[0-9a-fA-F][0-9a-fA-F]))+' to identify Uniform Resource Locators (URLs) that begin with http or https; it replaces the identified URLs with specific placeholders (such as [URL]) or removes them directly; this is to prevent random characters (such as hash values) in the URL from being misidentified as words with emotional meaning.
[0092] 3. Separation of Code Blocks from Markdown Syntax: For common code snippets in human-computer interaction data (such as ChatGPT replies) and technical community data, the system performs specific syntax parsing: For Markdown format, the regular expression r'```[\s\S]*?```' is used to identify multi-line code blocks enclosed in three backticks, and the regular expression r'[^]+'` is used to identify inline code markers; all content within the code block is removed; since the syntax structure of code languages (such as Python, Java) is completely different from that of natural languages (such as Chinese, English), and contains a large number of variable names and logical symbols, failure to remove them will lead to serious deviations in subsequent word frequency statistics (TF-IDF) and sentiment analysis, such as misreading if and while in the code as logical connectors, or misreading variable names as out-of-vocabulary words.
[0093] Removing text content within quotation tags includes:
[0094] 1. Structured data extraction based on the Document Object Model (DOM): When the collected data is in rich text (HTML) format, the system does not use simple string matching, but instead uses DOM parsing technology (such as based on BeautifulSoup or lxml parsing libraries) for processing: parsing the HTML document tree and traversing to find all... <blockquote> Tag nodes, and those with specific CSS class names (such as class="reply-text" or class="quoted-content"). The container calls the node's decompose() or remove() method to completely remove the identified reference node and all its child nodes from the document tree, retaining only the original text nodes in the sibling structure.
[0095] 2. Text stream cleaning based on line start symbols: When the collected data is plain text or Markdown format, the system uses a multi-line pattern regular expression to scan line by line: the regular expression r'^\s*>.*$' (matches lines that start with a greater than sign >, ignoring the leading indentation space) is used. This rule is specifically used to identify common forum reply quotation formats (QuoteBlocks); the matched lines are replaced with empty strings.
[0096] 3. Header metadata cleaning: At the same time, the regular expression r'^On\s+.*?\s+wrote:$' is used to identify and remove automatically generated metadata above the reference block (e.g., in [date][user] write), ensuring that only the text content generated in real time by the current user and with independent intellectual property rights is retained in the dataset.
[0097] S14. Based on the preset search dictionary, perform keyword matching and filtering on the removal results, and generate a candidate analysis corpus based on the filtering results. The search dictionary includes knowledge acquisition markers.
[0098] It should be further explained that a search dictionary containing epistemic markers is preset to perform keyword matching and filtering on text. Epistemic markers include, but are not limited to: explanation, understanding, distinction, and meaning. Only text containing at least one epistemic marker is retained to lock in interactive data with a clear intention to acquire knowledge, and to eliminate idle chatter or meaningless input. For multi-turn dialogue logs, only the first-turn questions or main posts in the interaction sequence are extracted to lock in the user's initial psychological state when entering the interaction field, eliminate the interference of subsequent interaction feedback on the user's language style, and ensure that the behavioral characteristics compared are under the same starting baseline.
[0099] S2. Perform joint topic modeling and homogeneity screening on the candidate analysis corpus to generate a semantically aligned dataset. Extract the structural feature vector of each text data in the dataset. Perform biased structural matching on the dataset based on the structural feature vector to generate feature-balanced pairwise analysis samples to establish a balanced dataset.
[0100] In this optional embodiment, joint topic modeling and homogeneity screening are performed on the candidate analysis corpus to generate a semantically aligned dataset. The structural feature vector of each text data in the dataset is extracted, and biased structural matching is performed on the dataset based on the structural feature vector to generate feature-balanced pairwise analysis samples. This establishes a balanced dataset, including:
[0101] S21. Using a pre-trained language model, each text data in the candidate analysis corpus is mapped to a unified high-dimensional vector space to generate the corresponding semantic feature vector.
[0102] It should be further explained that by using pre-trained language models (such as SBERT, Sentence-BERT), each text in human-computer interaction data and interpersonal community interaction data is mapped to the same high-dimensional vector space to generate corresponding semantic feature vectors. This breaks through the limitations of keyword matching and realizes the mathematical representation of heterogeneous texts based on deep contextual semantics, ensuring that the two sets of data are comparable under the same mathematical benchmark.
[0103] S22. The semantic feature vector is reduced in dimension by uniform manifold approximation and projection algorithm, and multiple topic clusters are obtained by identifying target density regions in the reduced manifold space through density-based clustering algorithm.
[0104] In this optional embodiment, a consistent manifold approximation and projection algorithm is used to reduce the dimensionality of the semantic feature vector. Then, in the reduced-dimensional manifold space, a density-based clustering algorithm is used to identify target density regions, obtaining multiple topic clusters, including:
[0105] S221. Calculate the k-nearest neighbor distance of each semantic feature vector. Based on the calculation results, construct a weighted graph according to the assumption of local connectivity and form a fuzzy simplex. Complete the low-dimensional manifold embedding of the semantic feature vector through cross-entropy optimization technology.
[0106] It should be further explained that in the high-dimensional space, the k-nearest neighbors of each data point are calculated, and a weighted graph is constructed using the local connectivity assumption to form a set of fuzzy simplex complexes representing the data topology. By minimizing the cross entropy between the high-dimensional and low-dimensional topological representations, the 768-dimensional (or 384-dimensional) sparse semantic vectors are mapped to a dense manifold space of 5 to 10 dimensions. Compared with traditional PCA dimensionality reduction, this step preserves the nonlinear local neighborhood structure between heterogeneous data, providing a geometric space that can reflect the true semantic distance for subsequent density-based clustering.
[0107] S222. Based on the low-dimensional manifold embedding results, calculate the cross-distance between each semantic feature vector, construct a fully connected weighted graph based on the cross-distance and extract the minimum spanning tree to generate a hierarchical clustering tree.
[0108] In this optional embodiment, based on the low-dimensional manifold embedding results, the cross-distance between each semantic feature vector is calculated. A fully connected weighted graph is constructed based on the cross-distance, and the minimum spanning tree is extracted to generate a hierarchical clustering tree, including:
[0109] S2221. Calculate the Euclidean distance between each semantic feature vector in the low-dimensional manifold embedding result, and combine it with the k-nearest neighbor distance to calculate the cross-distance between each semantic feature vector according to the preset cross-distance definition.
[0110] It should be noted that, in order to eliminate local density differences in heterogeneous data sources, the system first defines two semantic vectors. and Interconnection distance This distance depends not only on the spatial distance between the two points, but also introduces core distance as a sparsity penalty: ; where d semantic For the Euclidean or cosine distance in the generated unified semantic space; core k (x) represents the distance from point x to its k-th neighborhood; for loose chatter (sparse regions) common in interpersonal interactions, core k A large value leads to a significant increase in the reach distance, which is then pushed away during subsequent mapping. For AI-generated patterned responses (dense regions), the reach distance mainly depends on the original semantic distance. This mechanism normalizes the density of data from different modalities. Furthermore, compared with existing technologies that directly use Euclidean or cosine distance for text clustering, this invention innovatively introduces core distance as a sparsity penalty term into the calculation of reach distance, addressing the physical distribution differences between highly homogeneous (dense) AI-generated text and loose (sparse) real-person interactive text. This non-obvious improvement breaks the technical bias of traditional clustering algorithms that tend to over-cut dense regions and misjudge sparse regions as noise on heterogeneous data sources, achieving density normalization of cross-domain data in the same topological manifold space.
[0111] S2222: Using the semantic feature vectors embedded in the low-dimensional manifold as nodes and the distance between nodes as the edge weights, construct a fully connected weighted graph, and use the minimum spanning tree extraction algorithm to extract the minimum spanning tree from the fully connected weighted graph to establish the corresponding edge set.
[0112] S2223. Disconnect the edge with the largest weight in the edge set, iteratively merge the nodes according to the order of edge weight from smallest to largest, and record the distance threshold during the merging process to generate a clustering tree with the distance threshold as the vertical axis.
[0113] It should be further explained that a fully connected weighted graph G reflecting the connectivity of the dialogue topics is constructed based on the reach distance. semantic The SBERT vector of each dialogue segment is mapped to a node in the graph, using a fully connected weighted approach: the reachability distance between any two nodes is calculated and assigned as the edge weight; here, the edge weight in the graph represents the semantic reachability rather than simply the geometric distance; to remove non-core semantic noise (such as AI illusions or meaningless social small talk), the system performs G... semantic Perform a minimum spanning tree extraction algorithm (such as a Prim variant): traverse all nodes in the graph and retain only the set E of edges that connect all nodes and have the minimum total reachability distance weight. MST Since noise points are typically located in low-density areas, the reach edges connecting them to the main cluster have extremely high weights. In a minimum spanning tree, these noise points will appear as leaf nodes suspended from the trunk by a "long edge," providing a topological basis for subsequent pruning operations. The system disconnects E... MST The edge with the largest weight in the middle is used to reorganize the data space into a hierarchical tree structure (Cluster Hierarchy). Connected components are iteratively merged according to their weights from smallest to largest. The distance threshold λ during the merging process is recorded to generate a clustering tree with the distance threshold λ as the vertical axis. The root of the tree represents a broad general topic (such as programming problems), while the branches and ends represent specific subdivision intentions (such as Python list index out-of-bounds errors). This allows the system to adaptively find the best splitting granularity for cross-domain comparisons, rather than being manually specified.
[0114] S223. Based on the preset minimum cluster size threshold, the clustering tree is compressed and removed. Based on the compression and removal results, the persistence index of each cluster in the clustering tree is calculated, and the cluster with the highest persistence is selected as the initial topic cluster.
[0115] S224. Merge initial topic clusters of the same category to generate corresponding documents, calculate the TF-IDF score of each document, and select the first few initial topic clusters with the highest TF-IDF scores as the final topic clusters based on the TF-IDF scores.
[0116] It should be further explained that the hierarchical tree structure is traversed, a minimum cluster size threshold is set, and excessively small micro-clusters are removed; the persistence of each cluster in the hierarchical structure is calculated, that is, the range of density thresholds under which the cluster can maintain its structure without splitting; the cluster with the highest stability score is selected as the final topic cluster, and outliers that cannot be classified into any stable cluster are marked as "-1" (noise); documents in the same cluster in the clustering results are treated as a long document, and the class-based TF-IDF score is calculated. The top N words (e.g., 10) with the highest scores in each cluster are extracted as descriptive tags for the topic, such as code debugging and emotional venting; the sensitivity of HDBSCAN to outliers is used to automatically identify and remove meaningless chatter or garbled text (marked as noise), thereby significantly reducing the confounding bias when comparing heterogeneous data. Combined with UMAP, the topological distribution of heterogeneous corpora (human-computer vs. interpersonal) in the semantic space is preserved, ensuring that the clustering results are based on deep semantic similarity rather than simple keyword overlap.
[0117] S23. Simultaneously calculate the centroid vector of each topic cluster and the cosine similarity between the human-computer interaction data topic cluster and the interpersonal community interaction data topic cluster. Combine the centroid vector and cosine similarity, and use the preset topic homogeneity judgment rules to filter the topic clusters to generate a semantically aligned dataset.
[0118] It should be further explained that, based on the preset topic homogeneity judgment rules, the identified topic clusters are screened: (1) Identify heterogeneous topics: identify and mark topics that appear frequently only in a single interaction domain, for example, mark role-playing generation topics that appear only in human-computer interaction data, or low-level code debugging topics that appear only in interpersonal community interaction data; (2) Retain homogeneous intersection: retain only intersection topics that have significant distribution density in both interaction domains, such as concept explanation and theoretical discussion; thereby eliminating topic bias introduced by different platform task attributes, ensuring that subsequent analysis is carried out on the premise of solving similar cognitive tasks, and improving the internal validity of comparative analysis.
[0119] Semantic vectorization and similarity calculation: The SBERT model is used to map any text T into a d-dimensional dense vector V. T For the human-computer interaction corpus D HAI and interpersonal interaction corpus D HHI Any two topic clusters C in A and C B Calculate the cosine similarity of their centroid vectors:
[0120] ;
[0121] Screening rules: Set a semantic overlap threshold γ (e.g., 0.85). Only when Sim(CA,CB)>γ are topics CA and CB considered homogeneous knowledge acquisition topics, such as both discussing "concept definitions," are they retained; otherwise, they are considered heterogeneous noise and are removed. Represents the topic cluster C in human-computer interaction data. A Topic cluster C in interpersonal community interaction data B The semantic cosine similarity between them, with values ranging from [-1, 1]; Represents the topic cluster C A The centroid vector of the cluster is calculated as the arithmetic mean of all text vectors within the cluster. Represents the topic cluster C B The centroid vector; ·: denotes the dot product operation of vectors; γ represents the Euclidean norm of the vector (i.e., the magnitude of the vector); γ represents the preset semantic overlap threshold, which is preferably set to 0.85 in this embodiment.
[0122] Regarding the centroid vector ( , Definition and calculation method of topic cluster C: In this invention, topic cluster C A centroid vector , defined as the arithmetic mean vector of all text semantic vectors within the cluster, represents the central position or average semantic feature of the topic cluster in the semantic space, and is expressed by the formula:
[0123] ;
[0124] In the formula, N A Represents the topic cluster C A The total number of text samples contained in the cluster (i.e., the size of the cluster); ∑: represents the vector summation operation; Represents the topic cluster C A The original semantic feature vector generated after the i-th text is encoded by the SBERT model is usually a dense vector of 384 or 768 dimensions; in order to determine the centroid vector The system performs the following steps:
[0125] Vector acquisition: Traversing topic cluster C A For each piece of text data, a pre-trained language model (SBERT) is used to extract its corresponding semantic vector. , ,….. ; Dimensional accumulation: This N A The vectors are summed along each dimension to obtain a sum vector; mean normalization: the value of each dimension of the sum vector is divided by the total number of samples N. A Output: The resulting vector is the centroid vector of the topic cluster. .
[0126] Theme Cluster C B The centroid vector ( ) Calculation method: Similarly, for the topic cluster C from the second interaction domain (i.e., interpersonal community interaction data) B Its centroid vector The computational logic and C A To maintain consistency, specifically defined as follows:
[0127] ;
[0128] In the formula, M A Represents the topic cluster C B The total number of text samples contained in the cluster (i.e., the size of the cluster); ∑ represents the dimension-wise summation operation of all vectors within the cluster; Represents the topic cluster C B The original semantic feature vector generated after the j-th text is encoded by the SBERT model; by calculating The system obtains the standard semantic expression paradigm of interpersonal interaction data under specific topics (e.g., concept explanation); the significance of similarity calculation: the above formula Essentially, it is calculating the average semantic features generated by AI. ) and average semantic features generated by real people ( The cosine of the angle between two objects in the vector space is used to determine their relationship. If the angle is small (Sim is close to 1), it means that the two objects are talking about the same topic. If the angle is large (Sim is close to 0), it means that the two objects are not related (heterogeneity) and should be removed.
[0129] S24. Extract the structural feature vector of each text data in the dataset, and calculate the propensity score of the structural feature vector using the constructed logistic regression model.
[0130] In this optional embodiment, the structural feature vector of each text data in the dataset is extracted, and the propensity score of the structural feature vector is calculated using the constructed logistic regression model, including:
[0131] S241. Perform word segmentation on the text data in the dataset, and calculate the structural feature vector of each text data based on the word segmentation results. The structural feature vector includes the text length index and the text complexity index.
[0132] It should be noted that the calculation of structural feature vectors includes:
[0133] 1. Tokenize the text. For English text, use the NLTK toolkit to split spaces and punctuation; for Chinese text, use the Jieba tokenizer to split into word units. At the same time, identify sentence-ending symbols (such as periods, question marks, exclamation marks) to count the number of sentences.
[0134] 2. Calculation of text length metric (X len ) : Consider the text length as the key structured covariate for measuring verbosity, and perform quantification using the set cardinality statistical algorithm:
[0135] (1) Definition of discrete semantic unit set (Tokens):
[0136] Define the variable Tokens as a finite ordered set T after preprocessing: , where each element t i in the set is defined as the smallest discrete language unit carrying independent semantic information; for Indo-European data (such as English), t i is mapped to the stem or the original word after removing morphological variations; for Sino-Tibetan data (such as Chinese), t i is mapped to the independent morphemes segmented by the tokenization algorithm. To ensure that what is measured is information density rather than format noise, the set T explicitly excludes the following non-semantic symbols: punctuation marks; stop words (such as the, a, 的, 了); identified special format markers (such as remnants of HTML tags).
[0137] (2) Cardinality operation logic (Count()):
[0138] Define the operator Count() as the cardinality calculation operation in set theory, used to obtain the cardinality of the set T, that is: ; this operation corresponds to the length reading instruction of the valid word index array in memory at the physical level.
[0139] (3) Final metric calculation and distribution calibration:
[0140] Based on the above definitions, calculate the text length metric X len , considering that human-computer interaction data (usually verbose) and interpersonal interaction data (usually short) follow different long-tail distributions in length. To eliminate the problem of gradient explosion in the logistic regression model caused by differences in order of magnitude, the system performs logarithmic smoothing normalization: ; where the constant 1 is a smoothing term used to handle the mathematically undefined case when the empty set (|T|=0); in addition, logarithmic smoothing normalization eliminates the long-tail bias in physical memory allocation of cross-domain heterogeneous datasets from the data level, avoiding floating-point overflow and gradient explosion phenomena triggered during the training process of logistic regression models due to differences in data magnitude.
[0141] 3. Text complexity metric (X) read Calculation: The Flesch-Kincaid Grade Level algorithm is used to quantify the reading difficulty of the text. This algorithm comprehensively considers syntactic complexity and lexical complexity; the calculation formula is as follows: ; Parameters are defined as This indicates the average sentence length, reflecting the depth of the syntactic structure. This represents the average number of syllables per word, reflecting the cognitive difficulty of the vocabulary. Furthermore, the constants (0.39, 11.8, -15.59) in the formula are derived from the Flesch-Kincaid Grade Level standard model established by J. Peter Kincaid et al. in 1975. This model is based on linear regression analysis in large-scale linguistic statistics and is widely used in various natural language processing libraries (such as Python's textstat library). It is a well-known technical constant in the field and is used to map the physical features of text to a standardized cognitive difficulty level.
[0142] 4. Structural Feature Vector Synthesis: The indices calculated above are concatenated into a two-dimensional structural feature vector. This vector will serve as input covariates for the subsequent logistic regression model, used to measure the structural differences in form among different texts.
[0143] S242. Using the interaction modality as the dependent variable and the structural feature vector as the independent variable, construct an initial logistic regression model to distinguish different interaction modalities, including human-computer interaction modalities and interpersonal community interaction modalities.
[0144] It should be further explained that, with the interaction modality (human-computer interaction or interpersonal community interaction) as the dependent variable and the structural feature vector as the independent variable, a logistic regression model is constructed. The model is used to calculate the conditional probability that each sample belongs to a specific interaction domain (such as the human-computer interaction domain), and this probability value is defined as the propensity score.
[0145] S243. The initial logistic regression model is trained using the log-likelihood loss function, and the trained initial logistic regression model is optimized using the quasi-Newton algorithm to obtain the logistic regression model.
[0146] In this optional embodiment, the initial logistic regression model is trained using the log-likelihood loss function, and the trained initial logistic regression model is optimized using a quasi-Newton algorithm to obtain the logistic regression model, which includes:
[0147] S2431. Based on the optimization requirements of the initial logistic regression model with the log-likelihood loss function as the training objective, define a storage pair containing the displacement vector and the gradient difference vector, and use a double-ended queue of a preset size to store the storage pairs generated during the iteration process.
[0148] S2432. Combining the gradients of the stored pairs and the log-likelihood loss function, the optimal descent direction for updating the parameters of the initial logistic regression model is determined by recursively calculating the product of the inverse approximation of the Hessian matrix and the current gradient through a double loop.
[0149] S2433. Based on the determined optimal descent direction, and combining the sufficient descent condition and the curvature condition, search for the optimal step size for updating the parameters of the initial logistic regression model.
[0150] S2434. Iteratively update the parameters of the initial logistic regression model along the optimal descent direction using the optimal step size, and determine the convergence state of the initial logistic regression model according to the preset convergence condition. If the convergence condition is met, terminate the iteration and solidify the parameters to obtain the optimized logistic regression model.
[0151] S244. Input the structural feature vectors of each text data in the dataset into the logistic regression model, and calculate and output the corresponding propensity score through the logistic regression model to represent the probability that the text data belongs to the target interaction modality.
[0152] It should be noted that the propensity score calculation includes:
[0153] 1. Variable definition and feature engineering:
[0154] Define a binary treatment variable (Z): Z is set as an indicator variable; Z=1 when the sample belongs to human-computer interaction data; Z=0 when the sample belongs to interpersonal community interaction data. Define a covariate matrix (X): the structural feature vector extracted in the previous steps. As independent variables; Feature standardization: To accelerate model convergence, Z-Score standardization is performed on all covariates, i.e. This makes its mean 0 and its variance 1.
[0155] 2. Construct a regularized logistic regression model: Build a logistic regression model that includes an L2 regularization term to prevent overfitting caused by multicollinearity between text length and complexity. The formula is:
[0156] ;
[0157] In the formula, e(x) represents the propensity score of the sample, that is, the conditional probability that the sample belongs to the experimental group given the covariates; Z represents the group indicator variable; in this embodiment, Z=1 represents the sample coming from human-computer interaction data, and Z=0 represents the sample coming from interpersonal community interaction data; X represents the structural feature vector of the sample, which includes covariates such as text length and reading difficulty; X len Xread represents the total number of words in the sample text; β0 represents the text readability score of the sample; β1 and β2 represent the regression coefficients of the corresponding covariates; the regression coefficients β0, β1, and β2 are obtained through iterative training using maximum likelihood estimation based on a pre-constructed training set containing labeled samples (i.e., historical data with known interaction modality labels); after matching, the standardized mean difference of the k-th covariate is calculated to verify balance.
[0158] ;
[0159] Termination condition: When the sum of all covariates |SMD| is equal to the sum of all covariates |SMD|. k When | < 0.01, the matching is considered complete, and the final dataset is output; SMD k This represents the standardized mean difference of the k-th covariate (such as text length) after matching; This represents the arithmetic mean of the matched human-computer interaction group on the k-th covariate; This represents the arithmetic mean of the matched interpersonal interaction group on the kth covariate. This represents the sample variance of the matched human-computer interaction group on the k-th covariate. This represents the sample variance of the matched interpersonal interaction group on the k-th covariate.
[0160] 3. Loss Function and Optimization Algorithm Selection: The loss function adopted is the log-likelihood loss function with a regularization term. Where λ is the regularization coefficient (hyperparameter, preset to 1.0), and N is the total number of samples; Optimization algorithm: Unlike the stochastic gradient descent used in conventional deep learning, this embodiment utilizes the L-BFGS (Limited-memory Broyden–Fletcher–Goldfarb–Shanno) algorithm based on the second-order curvature information of the loss function to solve for parameters. L-BFGS is a quasi-Newton method, using the approximate inverse of the Hessian matrix to guide the search direction. When dealing with statistical inference tasks with low feature dimensionality but extremely high accuracy requirements, it has a faster convergence speed and more stable numerical solutions than SGD, and can accurately calculate the propensity probability of each sample; Specifically as follows:
[0161] (1) Storage structure definition: The system allocates a fixed-size double-ended queue in memory as a correction pair storage area, which only retains the curvature information of the most recent m iterations (m=10 in this embodiment), instead of storing the complete N×N Hessian matrix. The storage pair of the kth iteration is defined as (s k ,y k ): Displacement vector s k Indicates the amount of parameter update. Gradient difference vector y k This represents the change in the gradient of the loss function. .
[0162] (2) Two-loop recursion algorithm: In each iteration, instead of directly solving for the inverse matrix, the inverse approximation H of the Hessian matrix is estimated through the following linear algebra operations. k With the current gradient g k The product of d and d is used to determine the descent direction. k :
[0163] Backward Scan: Traverse from i=k-1 to km and calculate the projection coefficients. And update the temporary gradient vector q; Forward Scan: Traverse from i=km to k-1, using Correct the search direction r, and finally output the descent direction. .
[0164] (3) Line Search with Strong Wolfe Conditions: In order to ensure a sufficient decrease in the loss function J(β) and the satisfaction of the curvature condition, the system determines the direction d. k Instead of using a fixed step size, we search for a step size η that satisfies the following condition. k Sufficient descent condition: Curvature condition: ;in, This is a preset constant.
[0165] (4) Convergence determination and parameter fixation: The system executes the above iterative process and terminates the operation when any of the following statistical stability indices are met:
[0166] Gradient norm convergence: the infinite norm of the current gradient (For example =1e -5 This indicates that the extreme point of the log-likelihood function has been reached; relative function value tolerance: the relative change in the loss function value between two consecutive iterations. (For example, δ=1e) -8 ).
[0167] Where, β k ∈R n The regression coefficient vector at the k-th iteration represents, in physical terms, the state of the hyperplane normal vector of the current propensity score model in the n-dimensional feature space (text length, complexity, etc.); J(β) represents the objective function to be optimized; in this embodiment, it specifically refers to the negative log-likelihood function with L2 regularization. J(βk) represents the objective function in βk. k The gradient vector at a given point, which is the set of first-order partial derivatives, indicates the direction in which the function value increases the fastest. The displacement vector in the parameter space records the update magnitude of the system state in the k-th iteration. The difference vector in the gradient space reflects the rate of change of the curvature of the objective function at the k-th step; H k α represents the approximate inverse of the Hessian matrix (i.e., the second derivative matrix). In the L-BFGS algorithm, this matrix is not explicitly stored, but implicitly constructed through a double-loop recursive algorithm; m represents the memory horizon, i.e., the number of (s,y) vector pairs held in the memory buffer (set to 10 in this embodiment); this parameter controls the balance between the fineness of the local curvature approximation and memory consumption; α i γ i d represents the projection scalars in the double-loop recursive computation, used to map the current gradient vector to a subspace constructed from historical curvature information to correct the search direction; k This represents the corrected descent direction, which incorporates second-order curvature information, compared to a simple negative gradient direction. It can more accurately pinpoint extreme points, and is particularly effective in suppressing oscillations in narrow, valley-shaped loss surfaces; η k The step size factor (StepSize), determined through a linear search, determines the step size along the descent direction. k The distance traveled.
[0168] Furthermore, by opening up a double-ended queue of a preset size to store correction pairs and using a double-loop recursive implicit construction of the approximate inverse matrix of the Hessian matrix, the problem of memory overflow (OOM) caused by the traditional Newton method in processing high-dimensional heterogeneous text features, which requires the complete storage and inversion of the N×N level Hessian matrix in memory, is solved, significantly reducing the peak usage of video memory / memory when the computer performs bias score calculation.
[0169] 4. Training process and convergence criteria:
[0170] Initialization: Initialize the regression coefficients β to a zero vector; Iteration process: Calculate the gradient of the loss function with respect to β, and update the weights using L-BFGS; Convergence criterion: When the change in the loss function value between two consecutive iterations... If the gradient norm is less than a preset threshold, the iteration stops and the final model parameters are output.
[0171] The core advantage of using the L-BFGS algorithm lies in its ability to utilize (s k L-BFGS captures the local curvature features of the loss function surface. When processing the heterogeneous data propensity scoring task involved in this invention, since there are often complex nonlinear correlations between covariates (text length, complexity), the loss function surface presents a narrow valley shape (Ill-conditioned). Compared with SGD, which is prone to oscillation in the valley, L-BFGS can correct the search direction through approximate second derivative information, thereby obtaining a more stable and smaller variance propensity score e(x), which is a necessary mathematical prerequisite for subsequent accurate caliper matching.
[0172] S25. Using the propensity score as the matching benchmark, a greedy matching algorithm is used to perform no-replacement pairing between human-computer interaction data and interpersonal community interaction data. The standardized mean difference between the paired human-computer interaction data and interpersonal community interaction data on each covariate is calculated to generate feature-balanced pairwise analysis samples to establish a balanced dataset.
[0173] It should be further explained that a greedy matching algorithm is used to perform 1:1 pairing without replacement between human-computer interaction data and interpersonal community interaction data. The matching logic is as follows: for each experimental group sample, the sample with the smallest absolute difference in propensity score is searched in the control group sample pool and paired to form a matching pair. A caliper constraint is set: a tolerance threshold for matching is set, for example, 0.05 times the standard deviation, to remove outlier data that cannot find a matching sample within the tolerance range. The standardized mean difference (SMD) of the two sets of data on each covariate is calculated after matching. The termination condition is: if the SMD values of all covariates are lower than a preset threshold, for example, 0.01, the final balanced analysis dataset is output; otherwise, the caliper constraint parameters are adjusted and pairing without replacement is re-executed until the balance requirement is met. This physically eliminates the distribution differences in text length and complexity of heterogeneous data, achieving "structural equivalence" in experimental design and ensuring the purity of subsequent feature analysis results.
[0174] S3. Using a pre-set psycholinguistic dictionary and a pre-trained deep learning sentiment analysis model, perform parallel computation on the balanced dataset, and integrate the parallel computation results to generate a multi-dimensional educational interaction behavior analysis report, so as to realize cross-domain educational interaction behavior analysis.
[0175] In this optional embodiment, a pre-set psycholinguistic dictionary and a pre-trained deep learning sentiment analysis model are used to perform parallel computation on a balanced dataset, and the results of the parallel computation are fused to generate a multi-dimensional educational interaction behavior analysis report, thereby realizing cross-domain educational interaction behavior analysis, including:
[0176] S31. Using a pre-set psycholinguistic dictionary, count the frequency of occurrence of target function word categories in the balanced dataset, and calculate the defensive communication density index based on the statistical results.
[0177] S32. Input the balanced dataset into the pre-trained deep learning sentiment analysis model, use the deep learning sentiment analysis model to capture the contextual dependencies in the balanced dataset, output the classification probability of the target psychological state, extract the confidence score of the target category, and calculate the cognitive vulnerability exposure probability index.
[0178] S33. Based on the defensive communication density index and the cognitive vulnerability disclosure probability index, perform difference tests between human-computer interaction data and interpersonal community interaction data respectively, and generate a multi-dimensional educational interaction behavior analysis report according to the preset judgment logic, so as to realize the interaction behavior analysis of cross-domain education.
[0179] It should be further explained that a pre-built psycholinguistic dictionary, such as the LIWC dictionary, is invoked to traverse and match the text. The computational logic involves: statistically analyzing the frequency of specific functional word categories, including vague restrictive words, politeness markers, and first-person pronouns, in the text; and outputting a defensive communication density index by calculating the percentage of each word category relative to the total number of words, thus providing statistically based, highly interpretable benchmark language feature data. The text is then input into a pre-trained deep learning sentiment analysis model, such as the RoBERTa model based on the Transformer architecture. The computational logic involves: using the model to capture deep contextual dependencies in the text, and outputting the classification probability of specific psychological states (such as confusion, frustration, and embarrassment) through a Softmax layer; and outputting a confidence score for a specific category, resulting in a probability index of cognitive vulnerability exposure. This addresses the limitations of dictionary-based methods in handling polysemous words and complex syntax, capturing deep psychological states within decontextualized instructions. The quantitative indicators output from the two channels are then subjected to difference tests, such as Welch's method, between the human-computer interaction data set and the interpersonal community interaction data set. t-test; where the judgment logic is: calculate the effect size of the difference between groups, such as Cohen's d. Only when the statistical significance (p-value) and the effect size simultaneously meet the preset criteria is it determined that there is a structural behavioral difference. The result output is: generate an educational interaction behavior analysis report that includes a comparison of the intensity of impression management and the degree of cognitive vulnerability concealment.
[0180] In addition, such as Figure 5 As shown in the figure, an embodiment of this application provides a structural schematic diagram of an electronic device, which includes: a processor, a memory, a communication interface, and a communication bus.
[0181] 1. Processor: Used to execute a computer program stored in memory to implement the method steps of the above embodiments. The processor may be a central processing unit (CPU), an ASIC, or one or more integrated circuits configured to implement the embodiments of this application.
[0182] 2. Memory: Used to store computer programs and data. Memory may include high-speed random access memory (RAM) and may also include non-volatile memory, such as at least one disk storage device, flash memory device, or other volatile solid-state storage device.
[0183] 3. Communication interface: Used to enable communication between the electronic device and external devices (such as user terminals and database servers).
[0184] 4. Communication bus: Used to enable communication between the above components.
[0185] The present invention also provides a computer-readable storage medium storing a computer program, which, when executed by a processor, implements the method of any of the above embodiments. The storage medium includes, but is not limited to, a USB flash drive, a portable hard drive, a read-only memory (ROM), a random access memory (RAM), a magnetic disk, or an optical disk.
[0186] like Figures 3-4 As shown, according to another embodiment of the present invention, a cross-domain educational interaction behavior analysis system based on semantic alignment and preference matching is also provided, the system comprising:
[0187] The data acquisition and preprocessing module 1 is used to acquire text data from human-computer interaction data and interpersonal community interaction data, identify and remove formatting noise of non-natural social language and text content within citation tags in the text data, and generate a candidate analysis corpus based on the removal results.
[0188] The balanced dataset building module 2 is used to perform joint topic modeling and homogeneity screening on the candidate analysis corpus, generate a semantically aligned dataset, extract the structural feature vector of each text data in the dataset, perform bias structure matching on the dataset based on the structural feature vector, and generate feature-balanced pairwise analysis samples to build a balanced dataset.
[0189] The interactive behavior analysis module 3 is used to perform parallel computation on a balanced dataset using a pre-set psycholinguistic dictionary and a pre-trained deep learning sentiment analysis model, and to fuse the parallel computation results to generate a multi-dimensional educational interactive behavior analysis report, so as to realize interactive behavior analysis in cross-domain education.
[0190] The above description is only a preferred embodiment of the present invention and is not intended to limit the present invention. Any modifications, equivalent substitutions, improvements, etc., made within the spirit and principles of the present invention should be included within the protection scope of the present invention. < / blockquote>
Claims
1. A method for analyzing cross-domain educational interaction behavior based on semantic alignment and preference matching, characterized in that, The method includes: S1. Obtain text data from human-computer interaction data and interpersonal community interaction data, identify and remove formatting noise of non-natural social language and text content within citation tags in the text data, and generate a candidate analysis corpus based on the removal results; S2. Perform joint topic modeling and homogeneity screening on the candidate analysis corpus to generate a semantically aligned dataset. Extract the structural feature vector of each text data in the dataset. Perform biased structural matching on the dataset based on the structural feature vector to generate feature-balanced pairwise analysis samples to establish a balanced dataset. S3. Using a pre-set psycholinguistic dictionary and a pre-trained deep learning sentiment analysis model, perform parallel computation on the balanced dataset, and integrate the parallel computation results to generate a multi-dimensional educational interaction behavior analysis report, so as to realize cross-domain educational interaction behavior analysis.
2. The method for analyzing cross-domain educational interaction behavior based on semantic alignment and preference matching according to claim 1, characterized in that, The process of acquiring text data from human-computer interaction data and interpersonal community interaction data, identifying and removing formatting noise (non-natural social language) and text content within citation tags from the text data, and generating a candidate analysis corpus based on the removal results includes: S11. Collect multi-round dialogue logs between the user and the preset artificial intelligence model through the application programming interface, and extract the first round of question data from the multi-round dialogue logs to obtain human-computer interaction data; S12. Using web crawler technology, collect user posting and reply data from a pre-set online Q&A community to obtain interpersonal community interaction data; S13. Traverse the text data in the human-computer interaction data and interpersonal community interaction data, identify and remove formatting noise of non-natural social language and text content in the citation tags in the text data, the text data including rich text format and plain text format; S14. Based on a preset retrieval dictionary, the removal results are filtered by keyword matching, and a candidate analysis corpus is generated based on the filtering results. The retrieval dictionary includes knowledge acquisition marker words.
3. The method for analyzing cross-domain educational interaction behavior based on semantic alignment and preference matching according to claim 2, characterized in that, If the text data is in rich text format, then: We use regular expressions to traverse rich text formats in human-computer interaction data and interpersonal community interaction data, and identify and remove formatting noise of non-natural social language in rich text formats. Using DOM parsing techniques, we traverse the formatting noise removal results of non-natural social language, locate and extract the text content within the quotation tags; If the text data is in plain text format, then: Using multi-line pattern regular expressions, we can traverse plain text formats in human-computer interaction data and interpersonal community interaction data, identify and remove formatting noise of non-natural social language and text content within quotation tags in the plain text formats.
4. The method for analyzing cross-domain educational interaction behavior based on semantic alignment and preference matching according to claim 1, characterized in that, The process of performing joint topic modeling and homogeneity screening on the candidate analysis corpus to generate a semantically aligned dataset, extracting the structural feature vector of each text data in the dataset, and performing biased structural matching on the dataset based on the structural feature vector to generate feature-balanced pairwise analysis samples to establish a balanced dataset includes: S21. Using a pre-trained language model, each text data in the candidate analysis corpus is mapped to a unified high-dimensional vector space to generate the corresponding semantic feature vector. S22. The semantic feature vector is reduced in dimension by uniform manifold approximation and projection algorithm, and multiple topic clusters are obtained by identifying target density regions in the reduced manifold space through density-based clustering algorithm. S23. Simultaneously calculate the centroid vector of each topic cluster and the cosine similarity between the human-computer interaction data topic cluster and the interpersonal community interaction data topic cluster. Combine the centroid vector and cosine similarity, and use the preset topic homogeneity judgment rules to filter the topic clusters to generate a semantically aligned dataset. S24. Extract the structural feature vector of each text data in the dataset, and calculate the propensity score of the structural feature vector using the constructed logistic regression model. S25. Using the propensity score as the matching benchmark, a greedy matching algorithm is used to perform no-replacement pairing between human-computer interaction data and interpersonal community interaction data. The standardized mean difference between the paired human-computer interaction data and interpersonal community interaction data on each covariate is calculated to generate feature-balanced pairwise analysis samples to establish a balanced dataset.
5. The method for analyzing cross-domain educational interaction behavior based on semantic alignment and preference matching according to claim 4, characterized in that, The method employs a consistent manifold approximation and projection algorithm to reduce the dimensionality of semantic feature vectors. Then, within the reduced-dimensionality manifold space, a density-based clustering algorithm is used to identify target density regions, resulting in multiple topic clusters, including: S221. Calculate the k-nearest neighbor distance of each semantic feature vector. Based on the calculation results, construct a weighted graph according to the assumption of local connectivity and form a fuzzy simplex. Complete the low-dimensional manifold embedding of semantic feature vectors through cross-entropy optimization technique. S222. Based on the low-dimensional manifold embedding results, calculate the cross distance between each semantic feature vector, construct a fully connected weighted graph based on the cross distance and extract the minimum spanning tree to generate a hierarchical clustering tree; S223. Based on the preset minimum cluster size threshold, the clustering tree is compressed and removed. Based on the compression and removal results, the persistence index of each cluster in the clustering tree is calculated, and the cluster with the highest persistence is selected as the initial topic cluster. S224. Merge initial topic clusters of the same category to generate corresponding documents, calculate the TF-IDF score of each document, and select the first few initial topic clusters with the highest TF-IDF scores as the final topic clusters based on the TF-IDF scores.
6. The method for analyzing cross-domain educational interaction behavior based on semantic alignment and preference matching according to claim 5, characterized in that, The process of calculating the cross-distance between semantic feature vectors based on the low-dimensional manifold embedding results, constructing a fully connected weighted graph based on the cross-distance, extracting the minimum spanning tree, and generating a hierarchical clustering tree includes: S2221. Calculate the Euclidean distance between each semantic feature vector in the low-dimensional manifold embedding result, and combine it with the k-nearest neighbor distance to calculate the cross-distance between each semantic feature vector according to the preset cross-distance definition. S2222: Using the semantic feature vectors embedded in the low-dimensional manifold as nodes and the distance between nodes as the edge weights, construct a fully connected weighted graph, and use the minimum spanning tree extraction algorithm to extract the minimum spanning tree from the fully connected weighted graph and establish the corresponding edge set. S2223. Disconnect the edge with the largest weight in the edge set, iteratively merge the nodes according to the order of edge weight from smallest to largest, and record the distance threshold during the merging process to generate a clustering tree with the distance threshold as the vertical axis.
7. The method for analyzing cross-domain educational interaction behavior based on semantic alignment and preference matching according to claim 6, characterized in that, The extraction of structural feature vectors for each text data in the dataset, and the calculation of propensity scores for these structural feature vectors using a constructed logistic regression model, include: S241. Perform word segmentation on the text data in the dataset, and calculate the structural feature vector of each text data based on the word segmentation result. The structural feature vector includes the text length index and the text complexity index. S242. Using the interaction modality as the dependent variable and the structural feature vector as the independent variable, construct an initial logistic regression model to distinguish different interaction modalities, wherein the interaction modalities include human-computer interaction modalities and interpersonal community interaction modalities. S243. The initial logistic regression model is trained using the log-likelihood loss function, and the trained initial logistic regression model is optimized using the quasi-Newton algorithm to obtain the logistic regression model. S244. Input the structural feature vectors of each text data in the dataset into the logistic regression model, and calculate and output the corresponding propensity score through the logistic regression model to represent the probability that the text data belongs to the target interaction modality.
8. The method for analyzing cross-domain educational interaction behavior based on semantic alignment and preference matching according to claim 7, characterized in that, The initial logistic regression model is trained using the log-likelihood loss function, and then optimized using a quasi-Newton algorithm to obtain the following logistic regression model: S2431. Based on the optimization requirements of the initial logistic regression model with the log-likelihood loss function as the training objective, define a storage pair containing the displacement vector and the gradient difference vector, and use a double-ended queue of a preset size to store the storage pairs generated during the iteration process. S2432. Combining the gradients of the stored pairs and the log-likelihood loss function, the optimal descent direction for updating the parameters of the initial logistic regression model is determined by recursively calculating the product of the inverse approximation of the Hessian matrix and the current gradient through a double loop. S2433. Based on the determined optimal descent direction, and combining the sufficient descent condition and the curvature condition, search for the optimal step size for updating the parameters of the initial logistic regression model. S2434. Iteratively update the parameters of the initial logistic regression model along the optimal descent direction using the optimal step size, and determine the convergence state of the initial logistic regression model according to the preset convergence condition. If the convergence condition is met, terminate the iteration and solidify the parameters to obtain the optimized logistic regression model.
9. The method for analyzing cross-domain educational interaction behavior based on semantic alignment and preference matching according to claim 1, characterized in that, The process involves using a pre-defined psycholinguistic dictionary and a pre-trained deep learning sentiment analysis model to perform parallel computations on a balanced dataset, and then fusing the parallel computation results to generate a multi-dimensional educational interaction behavior analysis report. This enables cross-domain educational interaction behavior analysis, including: S31. Using a pre-set psycholinguistic dictionary, count the frequency of occurrence of target function word categories in the balanced dataset, and calculate the defensive communication density index based on the statistical results. S32. Input the balanced dataset into the pre-trained deep learning sentiment analysis model, use the deep learning sentiment analysis model to capture the contextual dependencies in the balanced dataset, output the classification probability of the target psychological state, extract the confidence score of the target category, and calculate the cognitive vulnerability exposure probability index. S33. Based on the defensive communication density index and the cognitive vulnerability disclosure probability index, perform difference tests between human-computer interaction data and interpersonal community interaction data respectively, and generate a multi-dimensional educational interaction behavior analysis report according to the preset judgment logic, so as to realize the interaction behavior analysis of cross-domain education.
10. A cross-domain educational interaction behavior analysis system based on semantic alignment and preference matching, used to implement the cross-domain educational interaction behavior analysis method based on semantic alignment and preference matching as described in any one of claims 1-9, characterized in that, The system includes: The data acquisition and preprocessing module is used to acquire text data from human-computer interaction data and interpersonal community interaction data, identify and remove formatting noise of non-natural social language and text content within citation tags in the text data, and generate a candidate analysis corpus based on the removal results. The balanced dataset building module is used to perform joint topic modeling and homogeneity screening on the candidate analysis corpus, generate a semantically aligned dataset, extract the structural feature vector of each text data in the dataset, perform bias structure matching on the dataset based on the structural feature vector, and generate feature-balanced pairwise analysis samples to build a balanced dataset. The interactive behavior analysis module is used to perform parallel computation on a balanced dataset using a pre-set psycholinguistic dictionary and a pre-trained deep learning sentiment analysis model. It then integrates the parallel computation results to generate a multi-dimensional educational interactive behavior analysis report, thereby enabling interactive behavior analysis in cross-domain education.