A method for generating sports commentary based on AIGC
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- WUHAN SPORTS UNIV
- Filing Date
- 2026-04-17
- Publication Date
- 2026-06-05
AI Technical Summary
Existing technologies cannot effectively integrate multimodal heterogeneous data from sports events, lack the ability to integrate domain knowledge and dynamically adjust emotions, resulting in insufficient professionalism and real-time nature of commentary content, and failing to meet the real-time text generation needs in dynamic scenarios of sports events.
Employing a sports-aware multi-head cross-modal attention model (SA-MHCA) and a three-level heterogeneous pipeline parallel inference architecture, combined with a sports knowledge graph and a large language model, we achieve efficient fusion of multimodal data and dynamic adjustment of emotions, ensuring adaptive matching of commentary content with the pace of the event and low-latency output.
It achieves adaptive pacing of sports commentary and improved accuracy of emotional simulation, ensuring the real-time nature of live sports broadcasts and the professional and humanistic expression of commentary content.
Smart Images

Figure CN122153804A_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of media technology, and more specifically to a method for generating sports commentary based on AIGC. Background Technology
[0002] Sports commentary is a crucial component of sports event communication. It uses language to convey information such as the game's progress, tactical analysis, and athlete performance to the audience, enhancing the viewing experience. Traditional sports commentary primarily relies on real-time creation by professional commentators, which presents the following technical challenges: 1. Low creative efficiency: Large-scale sports events often involve multiple matches simultaneously, making it difficult for human commentators to cover all matches. Furthermore, the production cycle for commentary content is relatively long, which cannot meet the needs of real-time dissemination.
[0003] 2. Inconsistent professionalism: The professional level, knowledge base, and expression ability of commentators vary, resulting in inconsistent commentary quality across different sessions and commentators.
[0004] 3. Lack of personalization: Traditional commentary content is mostly a general version, making it difficult to provide customized content based on the audience's interests and preferences (such as the depth of tactical analysis, introduction of athletes' backgrounds, etc.).
[0005] With the development of AIGC technology, some research has attempted to apply it to the field of content generation. For example, Chinese patent application CN120219577 A, entitled "An Animation Generation Method Based on AIGC," discloses an AIGC-based animation generation method that improves animation creation efficiency through script generation models and multimodal feature fusion technology. Chinese patent application CN120319261A, entitled "A Classical Music Visualization Content Generation Method for AIGC Large Model Applications," proposes a method for generating classical music visualization content that utilizes time-frequency analysis and emotional feature extraction to achieve synchronous generation of music and visual content. However, these methods are mainly aimed at animation or music visualization scenarios and cannot be directly applied to sports commentary generation because: (1) Sports event data has strong real-time and high dynamic characteristics, and requires processing a large amount of real-time changing structured data (such as scores and technical statistics) and unstructured data (such as match footage and player actions). Existing methods lack efficient fusion mechanisms for such multimodal heterogeneous data.
[0006] (2) Sports commentary needs to follow specific professional norms and language styles (such as tactical terms in football commentary and data analysis expressions in basketball commentary). Existing AIGC models are insufficient in terms of in-depth integration of domain knowledge.
[0007] (3) Sports commentary needs to dynamically adjust the emotional tone according to the rhythm of the game and key events (such as excitement when scoring a goal, tension at key moments). Existing methods have limited research on dynamic emotional regulation.
[0008] Furthermore, Chinese patent application CN119516059B, entitled "An AIGC Video Creation Method for Cultural Relics Explanation," discloses an AIGC video creation method for cultural relics explanation, employing 3D modeling and audio separation technology to generate explanation content. However, it is primarily geared towards the display of static cultural relics and cannot handle dynamic scenes from sports events. Chinese patent application CN120218239A, entitled "An AIGC-Based Method and System for Generating Idiom Story Picture Books," proposes an idiom story picture book generation method. While it involves text preprocessing and text-to-image model training, its application scenario is static picture book creation, which differs significantly from the real-time text generation requirements of sports commentary.
[0009] The shortcomings of existing technology are: Lack of heterogeneous data fusion mechanism: Existing methods lack an efficient fusion mechanism for real-time, highly dynamic multimodal heterogeneous sports data (such as scores, images, action sequences, etc.).
[0010] Insufficient depth of domain knowledge integration: Existing large models struggle to deeply integrate the professional standards, tactical terminology, and specific language styles of sports events, resulting in limitations on the professionalism of the commentary content.
[0011] Weak ability to dynamically adjust emotions: Lacking a real-time adjustment mechanism for emotional tone based on the rhythm of the game and key events, it is difficult to achieve adaptive matching between the commentator's emotions and the game situation.
[0012] Poor real-time dynamic adaptability to scenes: Existing technologies are mostly geared towards static displays (such as cultural relics and picture books) or specific vertical fields (such as animation and music), and cannot meet the real-time text generation needs of dynamic scenes in sports events.
[0013] Therefore, there is an urgent need for an AIGC sports commentary generation method that can integrate multimodal sports event data, combine professional domain knowledge, and dynamically adjust emotional style. In particular, it is necessary to solve the following key technical problems: how to design a multimodal feature fusion mechanism that adaptively matches the pace of the event, how to accurately model the temporal decay characteristics of event emotions, and how to achieve low-latency inference that meets the real-time requirements of live streaming under a large number of parameters. Summary of the Invention
[0014] To address the aforementioned problems, this invention provides a method for generating sports commentary based on AIGC, aiming to achieve adaptive pacing of events, improve the accuracy of emotional simulation, and enable ultra-low latency output of large-parameter, large-language models in sports commentary scenarios, ensuring the real-time nature of live broadcasts.
[0015] To solve the above problems, the technical solution provided by the present invention is as follows: A method for generating sports commentary based on AIGC includes the following steps: S100. Sports event data acquisition and preprocessing process: Data cleaning, standardization, and feature extraction are performed on multi-source sports event data; the feature extraction includes extracting time series features, semantic features, and visual features. S200: Sports Domain Knowledge Graph Construction Process: Integrate a sports knowledge base and construct a dynamically updated knowledge graph; the sports knowledge base includes event rules, athlete information, and tactical system knowledge; the knowledge graph includes core entity types and relationship types; S300: Multimodal Explanation Generation Model Training Process: Based on the pre-trained large language model, the features extracted in step S100 and the knowledge graph constructed in step S200 are fused for knowledge enhancement fine-tuning; the knowledge enhancement fine-tuning adopts a competition-aware multi-head cross-modal attention model to fuse the semantic features, the visual features and the time series features, and optimizes the large language model by optimizing the objective function; S400: Commentary content generation and optimization process: Input the real-time event data, then guide the large language model to generate commentary text through prompt word engineering, and perform style adaptation and emotion adjustment; the emotion adjustment is based on the emotion intensity model driven by the piecewise exponential-power law hybrid decay function, and the context adaptive weight adjustment algorithm is used to determine the emotion weight of the event; S500 Three-Level Heterogeneous Pipeline Parallel Inference Optimization Process: A three-level pipeline cascade architecture consisting of data preprocessing, multimodal fusion and model inference, and post-processing and streaming output is adopted to optimize the end-to-end inference latency and throughput performance of the large language model in the sports commentary generation scenario through parallel scheduling.
[0016] Preferably, the multi-source sports event data in step S100 includes structured data, unstructured data, and semi-structured data; the structured data includes real-time scores and player statistics; the unstructured data includes match video streams and live audio; and the semi-structured data includes pre-match analysis reports and historical match records.
[0017] Preferably, the data cleaning in step S100 includes structured data cleaning and unstructured data cleaning; the specific method for structured data cleaning is to remove outliers and fill in missing values using forward imputation; the unstructured data cleaning includes a video frame deblurring module and an audio denoising and voice separation module; the video frame deblurring module uses the Codeformer image restoration algorithm to deblur and super-resolution process the video frames; the audio denoising and voice separation module uses the MossFormer2 speech separation model to denoise and separate the audio. Preferably, the feature extraction method in step S100 is as follows: the multi-source sports event data is segmented into time windows, and then the event density and rhythm change rate per unit time are extracted; the text data is encoded using the BERT model, and then context-related word vectors are generated; The YOLOv4 algorithm was used to perform target detection on the competition video stream and extract the visual features; the visual features include athlete position and action type features.
[0018] Preferably, the knowledge graph construction in step S200 includes the following sub-processes: S210. Define the core entity type and the relationship type; the core entity type includes players, teams, events, venues, and tactical systems; the relationship type includes membership relationships, competitive relationships, and technical characteristics; S220. The spaCy library is used for named entity recognition to obtain an entity set; and a relation classifier is trained based on the BERT model to identify semantic relationships between entities; S230. An entity dynamic importance evaluation algorithm that integrates structural centrality and temporal decay is used to calculate the entity dynamic importance, expressed as follows: in: Used to characterize the dynamic importance of the entity; Used to characterize the structural centrality score based on degree centrality and graph ordering; Used to characterize context co-occurrence scores based on graph distance; The retrieval weights of the knowledge graph are adjusted based on the dynamic importance of the entities, using a temporal activity score characterized by exponential decay. , , Used to characterize importance weight parameters.
[0019] Preferably, the specific calculation process of the event-aware multi-head cross-modal attention model in step S300 includes the following steps: S310. Feature Projection: The semantic features, visual features, and time-series features are projected onto a unified multi-dimensional space using their respective learnable projection matrices to obtain a query matrix, a key matrix, and a value matrix. The key matrix and the value matrix are generated by projecting the concatenation of the visual features and the time-series features. The projection algorithm is expressed as follows: in: Used to characterize the learnable projection matrix; Used to characterize feature splicing operations; Used to characterize the semantic features; Used to characterize the visual features; Q is used to characterize the time series features; K is used to characterize the query matrix; V is used to characterize the key matrix; and d is used to characterize the dimension of the multidimensional space. S320. Match Intensity Assessment: The instantaneous match intensity index is calculated based on the tempo change rate of the current time window, the average tempo change rate for the entire match, and key event indicators, and is expressed by the following formula: in: The rate of change of the rhythm used to characterize the current time window; Used to characterize the overall average rate of change of rhythm; Used to characterize the occurrence of the key event; Used to characterize the event amplification factor.
[0020] S330. Dynamic Head Weight Calculation: Attention heads are functionally divided into visually dominant head groups and temporally dominant head groups, expressed as follows: in: Used to characterize the visually dominant head group; h is used to characterize the temporally dominant head group; h is used to characterize the number of attention heads; When the instantaneous event intensity index exceeds a preset intensity index threshold, the visual dominant head group weight coefficient is increased proportionally based on the difference between the instantaneous event intensity index and the intensity index threshold; when the instantaneous event intensity index is not higher than the preset intensity index threshold, the temporal dominant head weight coefficient is increased proportionally; specifically expressed by the following formula: in: Used to characterize the weighting coefficients of the visually dominant head group; Used to characterize the time-series dominant head weight coefficient; The threshold used to characterize the intensity index; Used to characterize the adjustment sensitivity parameter; S340. Cross-modal attention fusion: Calculate the output of each attention head, multiply it by the corresponding weight coefficient according to the group to which each attention head belongs, and then concatenate them. Finally, obtain the fused multi-head output through the output projection matrix; the output of each attention head is expressed by the following formula: The fused multi-head output is expressed by the following formula: in: Used to characterize the The dynamic weight coefficients corresponding to each attention head; Used to characterize the output projection matrix; S350. Sentence Structure Adaptation: The fused multi-head output is processed by a linear classification head to output a sentence structure control signal, which is expressed by the following formula: in: , Used to characterize a preset linear classification threshold.
[0021] Preferably, the optimization objective function in step S300 is expressed by the following formula: in: y is used to characterize cross-entropy loss; y is used to characterize the real explanatory text; ŷ is used to characterize the model's predicted text. K is used to characterize the consistency loss of the knowledge graph; K is used to characterize the fact triples in the knowledge graph; Ĵ is used to characterize the entity relations in the text generated by the model; λ is used to characterize the balance coefficient.
[0022] Preferably, the prompt word engineering in step S400 includes a basic layer, a professional layer, and a style layer; the basic layer is used to specify the commentary scenario and competition type; the professional layer is used to inject domain knowledge and data indicators; and the style layer is used to define the commentary style and speaking speed.
[0023] Preferably, the emotion regulation in step S400 is based on triggering and regulating the emotion intensity according to key events of the competition; the emotion intensity is expressed by the following formula: in: Used to characterize basic emotional intensity; α and β are used to characterize weighting coefficients; m is used to characterize the number of key events; The sentiment weight used to characterize event k; Used to characterize the time interval from the occurrence of event k to the present; The piecewise exponential-power-law hybrid decay function used to characterize event k; The piecewise exponential-power-law hybrid decay function is expressed as follows: in: Used to characterize the elapsed time after an event occurs; Used to characterize the long-tail decay index; Used to characterize the threshold between fast and slow decay, in seconds; Used to characterize an event The short-term decay time constant.
[0024] The key events in the competition include four general types: scoring events, penalty events, general confrontation events, and turn-of-round events. The sentiment weight is determined by an adaptive adjustment algorithm and expressed as follows: in: Used to characterize context adjustment factors; , Used to characterize the adjustment coefficient; Used to indicate a close score; Used to characterize the final time window; Used to characterize preset basic weights; When similar events occur consecutively, cumulative suppression is achieved through the aforementioned emotional weights, expressed as follows: Where: j represents the cumulative number of similar events within a preset past time window.
[0025] Preferably, the three-stage pipeline cascade architecture in step S500 specifically includes: The first-level CPU data preprocessing pipeline uses a circular buffer queue to achieve lock-free data reading and writing. The second-level GPU multimodal fusion and model inference pipeline adopts a tensor parallel strategy and segments the model parameters according to the attention head dimension, and uses KV-Cache pre-filling technology to cache the prefix sequence of the knowledge graph; The third-level post-processing and streaming output pipeline: uses a streaming output mechanism to perform token-by-token verification output; The three-stage pipeline cascading architecture is cascaded using asynchronous message queues based on shared memory.
[0026] Compared with the prior art, the present invention has the following advantages: (1) Adaptive to the rhythm of the event: Since the present invention adopts the event-aware multi-head cross-modal attention mechanism (SA-MHCA), it dynamically adjusts the weight distribution of the visual dominant head and the temporal dominant head through the instantaneous event intensity index, thereby realizing the end-to-end adaptive adaptation of the generated commentary text in terms of sentence length and emotional intensity to the rhythm of the event, effectively solving the technical pain points of the AI commentary content being out of touch with the atmosphere of the competition and the sentence structure being monotonous in the existing technology.
[0027] (2) Accuracy of emotion simulation: Since the present invention adopts a piecewise exponential-power law hybrid emotion decay function and context adaptive weight adjustment mechanism, it has obtained the ability to accurately simulate the rapid decline effect and long-tail residual effect of emotions in sports events, which significantly improves the humanized expression level of the commentary content and the appeal of the audience.
[0028] (3) Live broadcast real-time performance: Since the present invention adopts a three-level heterogeneous pipeline parallel inference architecture, through asynchronous parallel cascading of data preprocessing, model inference and post-processing, it realizes ultra-low latency output of large parameter large language model in sports commentary scenario, ensuring that end-to-end inference latency meets the real-time constraints of live sports event broadcast. Attached Figure Description
[0029] Figure 1 This is a schematic diagram of the overall process of the sports commentary generation method according to a specific embodiment of the present invention; Figure 2 This is a schematic diagram of a competition-aware multi-head cross-modal attention mechanism according to a specific embodiment of the present invention; Figure 3 This is a schematic diagram of a three-level heterogeneous pipelined parallel inference architecture according to a specific embodiment of the present invention. Detailed Implementation
[0030] The present invention will be further illustrated below with reference to specific embodiments. It should be understood that these embodiments are for illustrative purposes only and are not intended to limit the scope of the invention. After reading the present invention, any modifications of the present invention in various equivalent forms by those skilled in the art will fall within the scope defined by the appended claims.
[0031] This invention application claims protection for a method for generating sports commentary based on AIGC, such as... Figure 1 As shown, it includes the following steps: S100. Sports event data acquisition and preprocessing process: Data cleaning, standardization and feature extraction of multi-source sports event data; feature extraction includes extracting time series features, semantic features and visual features.
[0032] S200: Sports Domain Knowledge Graph Construction Process: Integrate the sports knowledge base and construct a dynamically updated knowledge graph; the sports knowledge base includes event rules, athlete information, and tactical system knowledge; the knowledge graph includes core entity types and relationship types.
[0033] S300: Multimodal Explanation Generation Model Training Process: Based on the pre-trained large language model, the features extracted in step S100 and the knowledge graph constructed in step S200 are fused for knowledge enhancement fine-tuning; the knowledge enhancement fine-tuning adopts the competition-aware multi-head cross-modal attention model (SA-MHCA) to fuse semantic features, visual features and time series features, and optimizes the large language model by optimizing the objective function.
[0034] S400: Commentary content generation and optimization process: Input real-time event data, then guide the large language model to generate commentary text through prompt word engineering, and perform style adaptation and sentiment adjustment; sentiment adjustment is based on the sentiment intensity model driven by the piecewise exponential-power law hybrid decay function, and the context adaptive weight adjustment algorithm is used to determine the sentiment weight of the event.
[0035] S500 Three-Level Heterogeneous Pipeline Parallel Inference Optimization Process: The three-level pipeline cascade architecture of data preprocessing, multimodal fusion and model inference, post-processing and streaming output is adopted to optimize the end-to-end inference latency and throughput performance of large language models in sports commentary generation scenarios, so as to meet the real-time requirements of live sports broadcasts.
[0036] It should be noted that the multi-source sports event data in step S100 includes structured data, unstructured data, and semi-structured data; structured data includes real-time match scores, player statistics (such as pass completion rate and running distance), and match time; unstructured data includes match video streams, player action sequences, and live audio; semi-structured data includes pre-match analysis reports, historical match records, and player interview transcripts.
[0037] It should be further explained that the data cleaning in step S100 includes structured data cleaning and unstructured data cleaning; the specific method of structured data cleaning is to remove outliers and fill in missing values using the forward imputation method; the unstructured data cleaning includes a video frame deblurring module and an audio denoising and voice separation module; the video frame deblurring module uses the Codeformer image restoration algorithm to deblur and super-resolution process the video frames; the audio denoising and voice separation module uses the MossFormer2 speech separation model to denoise and separate the audio.
[0038] It should be further explained that the feature extraction method in step S100 is as follows: the multi-source sports event data is segmented into time windows, and then the event density and rhythm change rate per unit time are extracted; the text data is encoded using the BERT model, and then context-related word vectors are generated; the YOLOv4 algorithm is used to perform target detection on the competition video stream and extract visual features; the visual features include athlete position and action type features.
[0039] It should be noted that the knowledge graph construction in step S200 includes the following sub-processes: S210. Define core entity types and relationship types; core entity types include players, teams, events, venues, and tactical systems; relationship types include membership relationships (player-team), competitive relationships (team-team), and technical characteristics (player-attribute).
[0040] S220. The spaCy library is used for named entity recognition to obtain an entity set; and a relation classifier is trained based on the BERT model to identify the semantic relationships between entities.
[0041] S230. The entity dynamic importance evaluation algorithm that integrates structural centrality and temporal decay is adopted to calculate the entity dynamic importance, which is expressed by the following formula (1): (1) in: Used to characterize the dynamic importance of entities; Used to characterize the structural centrality score based on degree centrality and graph ordering; Used to characterize context co-occurrence scores based on graph distance; Used to characterize time-series activity scores based on exponential decay, and adjust the retrieval weights of the knowledge graph according to the dynamic importance of entities; , , Used to characterize importance weight parameters.
[0042] The structure centrality score based on degree centrality and graph ordering is expressed by the following formula (2): (2) in: Used to characterize the degree centrality of entities; Used to characterize the maximum degree value in the graph; Used to characterize graph ranking scores based on random walks; Used to characterize the balance coefficient.
[0043] Context co-occurrence scores are expressed as follows (3): (3) in: Used to characterize entities With the currently identified set of entities The average graph distance.
[0044] Temporal activity scores are expressed as follows (4): (4) in: Used to characterize entities The most recently mentioned timestamp; Used to characterize the temporal decay rate.
[0045] It should be noted that in step S300, a pre-trained large language model from the LLaMA series or GPT series is selected as the base model. For example... Figure 2 As shown, the event-aware multi-head cross-modal attention model includes text feature input, visual feature input, time series feature input, visual dominant head group, time series dominant head group, fusion representation module and sentence control signal output module.
[0046] The specific calculation process of the event-aware multi-head cross-modal attention model in step S300 includes the following steps: S310. Feature Projection: The semantic features, visual features, and time series features are projected onto a unified multidimensional space through their respective learnable projection matrices to obtain the query matrix, key matrix, and value matrix. The key matrix and value matrix are generated by projecting the concatenation of the visual features and the time series features. The projection algorithm is expressed by the following formula (5): (5) in: Used to characterize learnable projection matrices; Used to characterize feature splicing operations; Used to characterize semantic features; Used to characterize visual features; Q is used to represent time series features; Q is used to represent the query matrix; K is used to represent the key matrix; V is used to represent the value matrix; and d is used to represent the dimension of the multidimensional space.
[0047] S320. Match Intensity Assessment: The instantaneous match intensity index is calculated based on the current time window's tempo change rate, the overall average tempo change rate, and the occurrence of key events, and is expressed as follows (6): (6) in: Used to characterize the rate of change of rhythm in the current time window; Used to characterize the average rate of change of rhythm throughout the game; Used to indicate the occurrence of key events; Used to characterize the event amplification factor, the default value is η=0.5.
[0048] S330. Dynamic head weight calculation: The attention heads are divided into visually dominant head group and temporally dominant head group according to their functions, as expressed by the following formula (7): (7) in: Used to characterize the visually dominant head group; h is used to characterize the temporally dominant head group; h is used to characterize the number of attention heads.
[0049] When the instantaneous event intensity index exceeds the preset intensity index threshold, the weight coefficient of the visual dominant head group is increased proportionally according to the difference between the instantaneous event intensity index and the intensity index threshold; when the instantaneous event intensity index is not higher than the preset intensity index threshold, the weight coefficient of the temporal dominant head is increased proportionally; specifically expressed as follows (8): (8) in: Used to characterize the weighting coefficients of the visually dominant head group; Used to characterize the time-series dominant head weight coefficient; Used to characterize the threshold of the intensity index; This parameter is used to characterize the adjustment sensitivity; its default value is μ=0.8.
[0050] S340. Cross-modal attention fusion: Calculate the output of each attention head, multiply it by the corresponding weight coefficient according to the group to which each attention head belongs, and then concatenate them. Finally, obtain the fused multi-head output through the output projection matrix; the output of the attention head is expressed by the following formula (9): (9) The merged multi-head output is expressed by the following formula (10): (10) in: Used to characterize the The dynamic weight coefficients corresponding to each attention head; Used to characterize the output projection matrix.
[0051] S350. Sentence Structure Adaptation: The fused multi-head output is processed by a linear classification head to output a sentence structure control signal, which is expressed by the following formula (11): (11) in: , Used to characterize a preset linear classification threshold. The default value is 2.0. The default value is 0.8. Specifically: when When outputting short sentences, not exceeding 15 characters, such as parallel sentences or exclamatory sentences; when... When outputting a standard sentence, the length should be controlled between 15 and 40 characters; when... At that time, it outputs long analytical sentences exceeding 40 characters, including some tactical analysis content. This mechanism achieves end-to-end adaptive control based on the intensity of the competition, the weight of visual features, and the shorter and more powerful the generated sentences.
[0052] It should be further explained that the core innovation of the SA-MHCA mechanism lies in: dynamically adjusting the weight distribution of each attention point through instantaneous event intensity indicators, so that during high-intensity moments of the game (such as fast breaks and goals), the model automatically increases the weight of visual features, thereby driving the backend text generator to output shorter and more powerful parallel sentences; while during breaks or slow-paced phases of the game, the model increases the weight of temporal features to generate more detailed tactical analysis sentences, achieving a high degree of adaptation between the algorithm structure and the characteristics of sports competition.
[0053] It should be noted that the knowledge enhancement fine-tuning in step S300 adopts the following method: Knowledge Injection: The knowledge graph constructed in step S200 is associated with text features through entity links to generate a knowledge-enhanced input sequence.
[0054] Domain data fine-tuning: Fine-tuning is performed using historical sports commentary text datasets (such as professional football and basketball commentary corpora).
[0055] It should be further explained that the optimization objective function in step S300 is expressed by the following formula (12): (12) in: y is used to characterize cross-entropy loss; y is used to characterize the real explanatory text; ŷ is used to characterize the model's predicted text. K is used to characterize the consistency loss of the knowledge graph; K is used to characterize the fact triples in the knowledge graph; Ĵ is used to characterize the entity relations in the text generated by the model; λ is used to characterize the balance coefficient.
[0056] It should be noted that step S400 specifically includes the following steps: S410. Real-time data input: Organize the real-time match data (such as current score, possession rate, key events) preprocessed in step S100 into structured input.
[0057] S420. Prompt word engineering design: Construct multi-level prompt word templates.
[0058] S430. Dynamic emotional regulation, based on key events in the competition (such as classification events, penalty events, etc.) to trigger emotional intensity regulation.
[0059] S440. Content optimization: The initial explanatory text generated by the model is processed as follows: Fact checking: Compare with the knowledge graph to correct entity errors (such as player names, team affiliation).
[0060] Fluency adjustment: N-gram language model is used to detect and correct syntax errors.
[0061] Length control: Dynamically adjust sentence length according to the pace of the game (e.g., use short sentences during fast attacks and long sentences during dead balls).
[0062] It should be further explained that the prompt word engineering in step S400 includes a basic layer, a professional layer, and a style layer; the basic layer is used to specify the commentary scenario (such as live football broadcast, basketball replay) and the type of game (such as the World Cup final, NBA regular season); the professional layer is used to inject domain knowledge (such as "currently using the 4-3-3 tactic") and data indicators (such as "passing success rate 85%)"; the style layer is used to define the commentary style (such as passionate, analytical, humorous) and speaking speed (such as "180 words per minute").
[0063] It should be further explained that the emotion regulation in step S400 is based on the triggering and regulation of emotion intensity by key events in the competition; the emotion intensity is expressed by the following formula (13): (13) in: Used to characterize basic emotional intensity; α and β are used to characterize weighting coefficients; m is used to characterize the number of key events; The sentiment weight used to characterize event k; Used to characterize the time interval from the occurrence of event k to the present; A piecewise exponential-power-law hybrid decay function used to characterize event k.
[0064] The piecewise exponential-power-law hybrid decay function is expressed by the following equation (14): (14) in: Used to characterize the elapsed time after an event occurs; Used to characterize the long-tail decay index; Used to characterize the threshold between fast and slow decay, in seconds; Used to characterize an event The short-term decay time constant.
[0065] It needs further explanation that the physical meaning of this segmented design lies in: in sports events, within a short period of time after a key event (such as a goal) occurs (i.e., The audience's emotions are at their peak and then rapidly decline, so exponential decay is used to simulate the rapid decline of neural excitation; after the turning point (i.e., The event still has a lingering effect on the atmosphere of the competition, so power-law decay is used to simulate the slow decay characteristics of long-term memory. The function satisfies the integrability condition of the following equation (15): (15) This ensures that the intensity of emotions converges within a bounded manner after multiple events overlap, preventing infinite accumulation.
[0066] It should be further explained that key events in the event include four general types: scoring events, penalty events, general confrontation events, and turn-of-the-round events. The specific parameter values are as follows: ① Scoring events: such as goals in football, baskets in basketball, and winning points in tennis. This type of event has the strongest emotional impact on the audience and corresponds to a larger [percentage missing]. and smaller ② Referee-related incidents: such as red and yellow cards in football, technical fouls in basketball, and challenges to Hawk-Eye decisions in tennis, corresponding to medium penalties. and ; ③ General confrontation events: such as corner kicks / free kicks in football, ordinary fouls in basketball, and double faults in tennis, corresponding to smaller incidents. and larger ④ Turning point events: such as substitutions in football, timeouts in basketball, and changes of sides in tennis. Specific parameters for each type of event ( , , The parameters were obtained by least-squares fitting of the commentator's tone intensity variation curve in the historical commentary corpus of the corresponding sport. See the implementation case for specific sport parameter values.
[0067] It should be noted that the sentiment weight is determined by an adaptive adjustment algorithm and expressed as follows (16): (16) in: Used to characterize context adjustment factors; , Used to characterize the adjustment coefficient; Used to indicate a close score; Used to characterize the final time window; Used to characterize the preset basic weights.
[0068] Based on the above four general event types, preset basic weights are used. Among them, the categorized events are... The highest, turn-turning event Minimum, the specific value is configured according to the characteristics of the sport.
[0069] It should be further explained that the "close score" flag is defined as follows: a value of 1 is set when the absolute value of the current score difference between the two sides does not exceed a preset close score threshold, and a value of 0 is set otherwise. The "final time window" flag is defined as follows: a value of 1 is set when the current game time enters a preset final time window, and a value of 0 is set otherwise. The close score threshold and final time window are configured according to the game rules of different sports. For example, in football, it is set to a score difference ≤ 1 and t > 80 minutes; in basketball, it is set to a score difference ≤ 5 and entering the last 3 minutes of the fourth quarter; in tennis, it is set to a deciding set and a game difference ≤ 1. δ1 and δ2 are adjustment coefficients used to control the degree of emotional amplification in close and final scenarios.
[0070] It should be further explained that when similar events occur consecutively, cumulative suppression is achieved through emotional weighting, expressed as follows (17): (17) Where j represents the cumulative number of similar events within a preset past time window. This mechanism avoids an unreasonable stacking of emotional intensity when similar events occur consecutively.
[0071] It should be noted that, as Figure 3 As shown, this invention constructs a three-level heterogeneous pipeline parallel processing architecture, which includes a data preprocessing pipeline, a multimodal fusion and model inference pipeline, and a post-processing and output pipeline. By cascading and scheduling the above pipelines in parallel, the end-to-end inference latency of the AIGC model in sports commentary generation scenarios can be reduced, thereby achieving low-latency output.
[0072] It needs to be further explained that, The three-stage pipeline cascade architecture in step S500 specifically includes: The first-level CPU data preprocessing pipeline (CPU cluster) cleans, extracts features, and structures the real-time data stream of the competition. A ring buffer queue is used to achieve lock-free data reading and writing, with a buffer depth set to 3 frames (approximately 300 ms), thereby ensuring decoupled operation between data preprocessing and model inference.
[0073] The second-level GPU multimodal fusion and model inference pipeline (GPU cluster): The multimodal feature fusion module and the large language model inference module are deployed in the GPU cluster. Tensor parallelism is adopted and the model parameters are split onto N GPU cards according to the attention head dimension. The i-th GPU is responsible for calculating the attention head in the interval as shown in equation (18): (18) Where H is the total number of attention heads. If an integer index is used, the attention head responsible for the i-th GPU can be further expressed as the following equation (19): (19) Meanwhile, KV-Cache pre-filling technology is used to pre-compute and cache the fixed prefix sequence (approximately 200–500 tokens) injected into the knowledge graph to avoid repeated reasoning, thereby effectively reducing the number of tokens in the repeated reasoning stage.
[0074] The third-level post-processing and streaming output pipeline (CPU + rule engine) performs fact-checking, fluency adjustment, and sentiment strength verification on the initial text generated by the model. A streaming output mechanism is used for token-by-token verification; each time the model generates a token, it is passed to the post-processing module, thus achieving simultaneous generation, verification, and output.
[0075] The three-tier pipeline cascade architecture is cascaded using asynchronous message queues based on shared memory. The asynchronous message queues are preferably based on a producer-consumer pattern using shared memory. This approach significantly reduces end-to-end inference latency, making it lower than the average reaction time of human commentators (typically 1–2 seconds), thus meeting the real-time requirements of live sports broadcasts.
[0076] The present invention will be further described in detail below with reference to specific embodiments.
[0077] Implementation Case: Generating Live Football Match Commentary S1: Data Acquisition and Preprocessing Collect real-time data from the 2022 Qatar World Cup final (Argentina vs. France), including player running trajectories (sampling frequency 10Hz), passing events (updated every second), and match video (1080P / 60fps).
[0078] The structured data cleaning process is as follows: Remove three outlier running distance values. Outliers must meet the following criteria: Distance > 20km / 90min The forward padding method is used to fill the 2-second data transmission interruption.
[0079] The video data processing procedure is as follows: The CodeFormer algorithm is used to upgrade the resolution of blurred frames from 720P to 1080P; YOLOv4 is used to detect targets such as players, footballs, and referees, thereby achieving a high detection accuracy.
[0080] The feature extraction process is as follows: The tempo change rate at the 75th minute of the match was calculated, resulting in Rt=0.7. This represents the current high tempo state of the match. Simultaneously, the feature vector of Messi (player ID: 10) was extracted, with key features including: speed = 8.5m / s, ball possession time = 12.3s.
[0081] In this embodiment, the emotional attenuation parameters for football matches are configured as follows: 1. Classification event (goal): σ k =15s, T th =30s, γ=1.5, w0=0.9 2. Offenses involving penalties (red cards): σ k =12s, T th =25s, γ=1.8, w0=0.7 3. Refereeing incidents (penalty kick decisions): w0=0.75 4. Penalty-related incidents (yellow card): w0=0.3 5. General confrontation events (corner kick / free kick): σ k =5s, T th =10s, γ=2.5, w0=0.15 6. Turning point event (character change): w0=0.2 Context adjustment factor configuration: The score stalemate threshold is set to a difference of no more than 1, i.e.: |∆Score|≤1 The final time window is set as follows: t>80min The adjustment coefficient is set as follows: δ1=0.3, δ2=0.25 S2: Knowledge Graph Construction Entity recognition: Identify the entity set E={Messi, Mbappe, Argentina, France, 4-3-3 formation, World Cup final}.
[0082] Relationship extraction: Extract the relationship triple (Messi, belongs to, Argentina team), (Argentina team, uses, 4-3-3 tactics).
[0083] Entity importance calculation: Based on the dynamic importance assessment results, Messi and Mbappe are identified as high-priority commentary entities in the current stage of the match. According to the formula above, Messi's structural centrality S=0.82, contextual co-occurrence score C=0.91, temporal activity T=0.95, and overall importance f=0.89; Mbappe's f=0.76.
[0084] S3: Model Training Basic model: The LLaMA-2-7B model is selected.
[0085] Fine-tuning the data: using professional commentary texts from 500 football matches (approximately 1 million words).
[0086] Knowledge enhancement: Inject historical World Cup data (such as "Messi won the Golden Ball award at the 2014 World Cup").
[0087] Training parameters: learning rate set to 5×10⁻⁵, batch size set to 16, training epochs set to 30.
[0088] S4: Narration Generation Real-time input: 78th minute, Argentina 2-1 France, 58% possession, Messi receives the ball on the left side of the penalty area.
[0089] Example prompt: "As a commentator for the World Cup final, I will be using a passionate style, speaking at a rate of 190 words per minute. Currently, Messi (Argentina's number 10) is controlling the ball on the left side of the penalty area, double-teamed by the opponent. Analyze his career World Cup goals (7 goals) and the distance he has covered in this match (8.5km)."
[0090] Emotional regulation: Due to Messi's possession of the ball triggering an attacking event, E(t) = 0.7 (medium to high passion).
[0091] Example of generated result: "Look at this! Messi receives the ball on the left side of the penalty area, facing two defenders! His footwork is so exquisite, a feint creates space! He has already run 8.5 kilometers in this match, equivalent to more than two standard 400-meter tracks! As the seventh-highest scorer in World Cup history, he is now looking for a scoring opportunity..." It should be noted that the practical application scenarios of this invention include, but are not limited to: (1) Simultaneous commentary on multiple OTT sports live streaming platforms: During major events (such as the World Cup group stage where multiple matches are played simultaneously), this invention can generate commentary texts in multiple styles for each match to meet the needs of different audience groups.
[0092] (2) Automatic narration for event highlights on short video platforms: Automatically generate accompanying narration text for exciting event clips, which can be used directly or edited by short video creators.
[0093] (3) Tactical analysis and explanation of the sports teaching platform: adopting an analytical explanation style, combined with the tactical system knowledge in the knowledge graph, to provide in-depth tactical analysis and explanation for sports majors.
[0094] (4) Visual description and explanation of accessible sports content: Provide detailed descriptions of the competition scenes for visually impaired viewers, transform visual features into precise text descriptions, and enhance the accessible viewing experience.
[0095] (5) Automated content production for sports media: Automated generation of text content such as event news and match summaries for sports news websites and apps.
[0096] In the above detailed description, various features are combined together in a single embodiment to simplify this disclosure. This approach to disclosure should not be construed as reflecting an intention that embodiments of the claimed subject matter require more features than are explicitly stated in each claim. Rather, as reflected in the appended claims, the invention is presented with fewer features than all of the features of the single disclosed embodiment. Therefore, the appended claims are hereby explicitly incorporated into the detailed description, wherein each claim stands alone as a preferred embodiment of the invention.
[0097] The disclosed embodiments have been described above to enable any person skilled in the art to implement or use the present invention. Various modifications to these embodiments will be apparent to those skilled in the art, and the general principles defined herein can be applied to other embodiments without departing from the spirit and scope of this disclosure. Therefore, this disclosure is not limited to the embodiments given herein, but is consistent with the broadest scope of the principles and novel features disclosed in this application.
[0098] The foregoing description includes examples of one or more embodiments. It is certainly impossible to describe all possible combinations of components or methods in order to describe the above embodiments; however, those skilled in the art will recognize that further combinations and arrangements of the various embodiments are possible. Therefore, the embodiments described herein are intended to cover all such changes, modifications, and variations that fall within the scope of the appended claims.
[0099] Furthermore, the term "comprising" as used in the specification or claims is interpreted in a manner similar to the term "including," just as "including," when used as a conjunction in the claims, is understood. Additionally, the use of any term "or" in the specification or claims is intended to mean "non-exclusive or."
[0100] The specific embodiments described above further illustrate the purpose, technical solution, and beneficial effects of the present invention. It should be understood that the above description is only a specific embodiment of the present invention and is not intended to limit the scope of protection of the present invention. Any modifications, equivalent substitutions, improvements, etc., made within the spirit and principles of the present invention should be included within the scope of protection of the present invention.
Claims
1. A method for generating sports commentary based on AIGC, characterized in that: Includes the following steps: S100. Sports event data acquisition and preprocessing process: Data cleaning, standardization and feature extraction of multi-source sports event data; The feature extraction includes extracting time-series features, semantic features, and visual features; S200: Sports Domain Knowledge Graph Construction Process: Integrate a sports knowledge base and construct a dynamically updated knowledge graph; the sports knowledge base includes event rules, athlete information, and tactical system knowledge; the knowledge graph includes core entity types and relationship types; S300: Multimodal Explanation Generation Model Training Process: Based on the pre-trained large language model, the features extracted in step S100 and the knowledge graph constructed in step S200 are fused together for knowledge enhancement and fine-tuning; The knowledge enhancement fine-tuning adopts a competition-aware multi-head cross-modal attention model to fuse the semantic features, the visual features, and the time series features, and optimizes the large language model by optimizing the objective function; S400: Commentary content generation and optimization process: Input the real-time event data, then guide the large language model to generate commentary text through prompt word engineering, and perform style adaptation and emotion adjustment; the emotion adjustment is based on the emotion intensity model driven by the piecewise exponential-power law hybrid decay function, and the context adaptive weight adjustment algorithm is used to determine the emotion weight of the event; S500 Three-Level Heterogeneous Pipeline Parallel Inference Optimization Process: A three-level pipeline cascade architecture consisting of data preprocessing, multimodal fusion and model inference, and post-processing and streaming output is adopted to optimize the end-to-end inference latency and throughput performance of the large language model in the sports commentary generation scenario through parallel scheduling.
2. The method for generating sports commentary based on AIGC according to claim 1, characterized in that: The multi-source sports event data in step S100 includes structured data, unstructured data, and semi-structured data; the structured data includes real-time scores and player statistics; the unstructured data includes match video streams and live audio; and the semi-structured data includes pre-match analysis reports and historical match records.
3. The method for generating sports commentary based on AIGC according to claim 1, characterized in that: The data cleaning in step S100 includes structured data cleaning and unstructured data cleaning; the specific method of structured data cleaning is to remove outliers and fill in missing values using forward imputation; the unstructured data cleaning includes a video frame deblurring module and an audio denoising and voice separation module; the video frame deblurring module uses the Codeformer image restoration algorithm to deblur and super-resolution process the video frames; the audio denoising and voice separation module uses the MossFormer2 speech separation model to denoise and separate the audio.
4. The method for generating sports commentary based on AIGC according to claim 2, characterized in that: The feature extraction method in step S100 is as follows: the multi-source sports event data is segmented into time windows, and then the event density and rhythm change rate per unit time are extracted; the text data is encoded using the BERT model, and then context-related word vectors are generated; the YOLOv4 algorithm is used to perform target detection on the competition video stream, and the visual features are extracted; the visual features include athlete position and action type features.
5. The method for generating sports commentary based on AIGC according to claim 1, characterized in that: The knowledge graph construction in step S200 includes the following sub-processes: S210. Define the core entity type and the relationship type; the core entity type includes players, teams, events, venues, and tactical systems; the relationship type includes membership relationships, competitive relationships, and technical characteristics; S220. The spaCy library is used for named entity recognition to obtain an entity set; and a relation classifier is trained based on the BERT model to identify semantic relationships between entities; S230. An entity dynamic importance evaluation algorithm that integrates structural centrality and temporal decay is used to calculate the entity dynamic importance, expressed as follows: in: Used to characterize the dynamic importance of the entity; Used to characterize the structural centrality score based on degree centrality and graph ordering; Used to characterize context co-occurrence scores based on graph distance; Used to characterize time-series activity scores based on exponential decay, the retrieval weights of the knowledge graph are adjusted according to the dynamic importance of the entities. , , Used to characterize importance weight parameters.
6. The method for generating sports commentary based on AIGC according to claim 1, characterized in that: The specific calculation process of the event-aware multi-head cross-modal attention model in step S300 includes the following steps: S310. Feature Projection: The semantic features, visual features, and time-series features are projected onto a unified multi-dimensional space using their respective learnable projection matrices to obtain a query matrix, a key matrix, and a value matrix. The key matrix and the value matrix are generated by projecting the concatenation of the visual features and the time-series features. The projection algorithm is expressed as follows: in: Used to characterize the learnable projection matrix; Used to characterize feature splicing operations; Used to characterize the semantic features; Used to characterize the visual features; Q is used to characterize the time series features; K is used to characterize the query matrix; V is used to characterize the key matrix; and d is used to characterize the dimension of the multidimensional space. S320. Match Intensity Assessment: The instantaneous match intensity index is calculated based on the tempo change rate of the current time window, the average tempo change rate for the entire match, and key event indicators, and is expressed by the following formula: in: The rate of change of the rhythm used to characterize the current time window; Used to characterize the overall average rate of change of rhythm; Used to characterize the occurrence of the key event; Used to characterize the event amplification factor; S330. Dynamic Head Weight Calculation: Attention heads are functionally divided into visually dominant head groups and temporally dominant head groups, expressed as follows: in: Used to characterize the visually dominant head group; h is used to characterize the temporally dominant head group; h is used to characterize the number of attention heads; When the instantaneous event intensity index exceeds a preset intensity index threshold, the visual dominant head group weight coefficient is increased proportionally based on the difference between the instantaneous event intensity index and the intensity index threshold; when the instantaneous event intensity index is not higher than the preset intensity index threshold, the temporal dominant head weight coefficient is increased proportionally; specifically expressed by the following formula: in: Used to characterize the weighting coefficients of the visually dominant head group; Used to characterize the time-series dominant head weight coefficient; The threshold used to characterize the intensity index; Used to characterize the adjustment sensitivity parameter; S340. Cross-modal attention fusion: Calculate the output of each attention head, multiply it by the corresponding weight coefficient according to the group to which each attention head belongs, and then concatenate them. Finally, obtain the fused multi-head output through the output projection matrix; the output of each attention head is expressed by the following formula: The fused multi-head output is expressed by the following formula: in: Used to characterize the The dynamic weight coefficients corresponding to each attention head; Used to characterize the output projection matrix; S350. Sentence Structure Adaptation: The fused multi-head output is processed by a linear classification head to output a sentence structure control signal, which is expressed by the following formula: in: , Used to characterize a preset linear classification threshold.
7. The method for generating sports commentary based on AIGC according to claim 1, characterized in that: The optimization objective function in step S300 is expressed by the following formula: in: y is used to characterize cross-entropy loss; y is used to characterize the real explanatory text; ŷ is used to characterize the model's predicted text. K is used to characterize the consistency loss of the knowledge graph; K is used to characterize the fact triples in the knowledge graph; Ĵ is used to characterize the entity relations in the text generated by the model; λ is used to characterize the balance coefficient.
8. The method for generating sports commentary based on AIGC according to claim 1, characterized in that: The prompt word engineering in step S400 includes a basic layer, a professional layer, and a style layer; the basic layer is used to specify the commentary scenario and competition type; the professional layer is used to inject domain knowledge and data indicators; and the style layer is used to define the commentary style and speaking speed.
9. The method for generating sports commentary based on AIGC according to claim 1, characterized in that: The emotion regulation in step S400 is based on key events of the competition and adjusts the intensity of emotions; the intensity of emotions is expressed by the following formula: in: Used to characterize basic emotional intensity; α and β are used to characterize weighting coefficients; m is used to characterize the number of key events; The sentiment weight used to characterize event k; Used to characterize the time interval from the occurrence of event k to the present; The piecewise exponential-power-law hybrid decay function used to characterize event k; The piecewise exponential-power-law hybrid decay function is expressed as follows: in: Used to characterize the elapsed time after an event occurs; Used to characterize the long-tail decay index; Used to characterize the threshold between fast and slow decay, in seconds; Used to characterize an event The short-term decay time constant; The key events in the competition include four general types: scoring events, penalty events, general confrontation events, and turn-of-round events. The sentiment weight is determined by an adaptive adjustment algorithm and expressed as follows: in: Used to characterize context adjustment factors; , Used to characterize the adjustment coefficient; Used to indicate a close score; Used to characterize the final time window; Used to characterize preset basic weights; When similar events occur consecutively, cumulative suppression is achieved through the aforementioned emotional weights, expressed as follows: Where: j represents the cumulative number of similar events within a preset past time window.
10. The method for generating sports commentary based on AIGC according to claim 1, characterized in that: The three-stage pipeline cascade architecture in step S500 specifically includes: The first-level CPU data preprocessing pipeline uses a circular buffer queue to achieve lock-free data reading and writing. The second-level GPU multimodal fusion and model inference pipeline adopts a tensor parallel strategy and segments the model parameters according to the attention head dimension, and uses KV-Cache pre-filling technology to cache the prefix sequence of the knowledge graph; The third-level post-processing and streaming output pipeline: uses a streaming output mechanism to perform token-by-token verification output; The three-stage pipeline cascading architecture is cascaded using asynchronous message queues based on shared memory.