A knowledge graph construction method for palm ink teachers to orally transmit technical knowledge

By constructing a component library and a metrical template library for the craft of master ink makers, the oral texts of master ink makers are analyzed and trained to generate standardized term sequences and rhythmic position feature matrices. This solves the problems of term omission and metrical structure, and achieves efficient entity relationship recognition and knowledge graph construction.

CN123050574APending Publication Date: 2026-11-06HUNAN UNIV OF TECH
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202611266906.7
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2026-08-20
Publication Date
2026-11-06

AI Technical Summary

Technical Problem

Existing technologies cannot effectively recover the omission of terms in the oral transmission of ink masters' skills, are difficult to utilize metrical structure information, lack the ability to represent the internal structure of terms, and the relation extraction model is difficult to capture the structured associations across sentences in low-resource texts.

Method used

By using a pre-built library of terminology components and prosody templates for master ink makers, the oral texts of master ink makers' skills are parsed to generate standardized terminology sequences and prosodic position feature matrices. A knowledge graph is then constructed through end-to-end training using an entity relation joint extraction model.

Benefits of technology

It enables automatic recovery of complete terms when core category components are omitted, enhances the ability to identify cross-segment entity relationships, overcomes the limitations of conventional methods, and improves the accuracy of entity type identification and the effectiveness of relationship extraction.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN123050574A_ABST
    Figure CN123050574A_ABST
Patent Text Reader

Abstract

The application provides a knowledge graph construction method for oral transmission of technical knowledge of palm ink teachers, and relates to the technical field of knowledge graphs. The method comprises the following steps: collecting palm ink teacher oral transmission of technical knowledge texts, and forming a palm ink teacher oral transmission of technical knowledge training sample set by marking and processing the palm ink teacher oral transmission of technical knowledge texts; generating a standardized term sequence, a term component constituting label matrix and a prosodic position feature matrix based on a pre-constructed palm ink teacher art language component library and a palm ink teacher oral transmission of technical knowledge template library; constructing an entity relationship joint extraction model, inputting a palm ink teacher oral transmission of technical knowledge text segment to be extracted into the trained entity relationship joint extraction model, and obtaining a triple; and constructing a palm ink teacher oral transmission of technical knowledge knowledge graph according to the triple. The application can automatically restore complete terms in oral transmission of technical knowledge expressions in which core generic components are omitted, and solves the problem that conventional word segmentation and string matching methods cannot recognize implicit terms.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of knowledge graph technology, and more specifically, to a method for constructing a knowledge graph for knowledge of oral transmission techniques by master calligraphers. Background Technology

[0002] Master craftsmen were the core artisans in traditional wooden architecture. Their skills and knowledge were passed down orally from master to apprentice for a long time, covering tool use, component processing, dimensional control, process coordination, and highly condensed technical formulas. These oral texts have distinct domain characteristics: dense terminology and flexible word formation, with a common phenomenon of omitting core category components; sentence structure strictly follows specific metrical templates, and terms within the same metrical structure have strong semantic correspondences; in addition, the digitization of traditional construction techniques has long faced the dilemma of scarce labeled data, making it difficult to support the large-scale training needs of conventional deep learning models.

[0003] Currently, existing technologies have the following shortcomings:

[0004] 1. Existing text processing methods cannot recover the omission of terms in oral tradition texts. The incantations of master calligraphers contain numerous expressions that retain only modifying components while omitting core category components. Methods based on complete string matching or conventional word segmentation can only identify surface-level characters and cannot complete the implicit domain terms according to word formation rules.

[0005] 2. Existing sequence processing methods struggle to utilize the metrical structure information of orally transmitted texts. The mnemonic rhymes of calligraphers are organized according to fixed metrical rules, and terms in the same position within the same antithetical structure have close semantic connections. However, conventional models only treat text as a linear sequence, failing to model and utilize this cross-sentence prosodic correspondence.

[0006] 3. Existing entity recognition models lack the ability to represent the internal structure of terms. General pre-trained models use words or sub-words as basic units and cannot distinguish between modifying components and core class components within terms. When terms are omitted, the lack of core morphemes can easily lead to errors in entity type recognition or incomplete boundaries.

[0007] 4. Existing relation extraction models struggle to capture structured relationships across sentence segments in low-resource oral texts. Standard attention mechanisms primarily calculate relation strength based on contextual co-occurrence, lacking awareness of metrical parallelism and easily overlooking entity relationships such as parallel tools and sequential processes that have neat correspondences distributed across preceding and following sentence segments.

[0008] No effective solutions have yet been proposed to address the problems in the relevant technologies. Summary of the Invention

[0009] In view of this, the present invention provides a method for constructing a knowledge graph for the oral transmission of ink-making skills by master ink makers, in order to solve the aforementioned problems.

[0010] To solve the above problems, the specific technical solution adopted by the present invention is as follows:

[0011] A method for constructing a knowledge graph for the oral transmission of ink-making skills by master ink makers, the method comprising the following steps:

[0012] S1. Collect the oral transmission texts of ink masters, and annotate the oral transmission texts to form a training sample set of ink masters' oral transmission techniques.

[0013] S2. Based on the pre-built terminology component library and rhyme template library of the master ink master, the text fragments of the master ink master's oral skills are parsed and processed to generate a standardized term sequence, a term component composition label matrix and a rhyme position feature matrix. The parsing and processing adopts the forward maximum matching and backward maximum matching recognition methods and the dynamic programming method of the text fragments.

[0014] S3. Construct an entity relation joint extraction model, and input the standardized term sequence, term component label matrix and prosodic position feature matrix into the entity relation joint extraction model for end-to-end training;

[0015] S4. Input the text fragment of the oral skills passed down by the master ink master to be extracted into the trained entity relation joint extraction model to obtain the knowledge triplet of the oral skills passed down by the master ink master, which includes entity boundary, entity type and entity relation type; and construct the knowledge graph of the oral skills passed down by the master ink master based on the knowledge triplet of the oral skills passed down by the master ink master.

[0016] The beneficial effects of this invention are as follows:

[0017] 1. This invention proposes a bidirectional combination discovery and standardization method based on a terminology component library. By splitting complete process terms into modifying components and core category components, and using component co-occurrence statistics and category compatibility relationships to calculate the combination tightness, it can automatically recover complete terms in mnemonic expressions where core category components are omitted, thus solving the problem that conventional word segmentation and string matching methods cannot identify implicit terms.

[0018] 2. This invention proposes a prosodic structure analysis method based on prosodic templates and dynamic programming. By constructing a prosodic template library covering multiple dimensions such as number of characters, tone patterns, and rhyme, and using dynamic programming to find the optimal segmentation in the global scope, the prosodic relationships such as antithesis and rhyme are transformed into computable structured features, overcoming the limitations of segmentation based solely on punctuation or fixed number of characters.

[0019] 3. This invention constructs a component-aware embedding layer driven by a gating mechanism. By dynamically adjusting the fusion ratio of pre-trained word vectors and term component representations in each feature dimension through gating vectors, the model can adaptively balance surface semantics and internal component information according to different omissions of terms, avoiding feature interference caused by uniformly superimposed component information.

[0020] 4. This invention introduces an attention bias mechanism based on prosodic semantic units, which encodes the prosodic semantic unit to which a term belongs and the prosodic position as a bias value, and directly superimposes it into the Transformer self-attention score. This enables the model to automatically enhance the semantic association between terms in antithetical positions and within the same prosodic unit without changing the main structure, thereby strengthening the ability to identify cross-segment entity relationships. Attached Figure Description

[0021] 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 described 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. In the drawings:

[0022] Figure 1 This is a flowchart according to an embodiment of the present invention;

[0023] Figure 2 This is a schematic diagram of a knowledge graph constructed according to an embodiment of the present invention;

[0024] Figure 3 This is a schematic diagram of text collection and entity annotation of the oral transmission skills of the master calligrapher according to an embodiment of the present invention;

[0025] Figure 4 This is a schematic diagram illustrating the standardization of text fragments of oral transmission techniques by master calligraphers according to an embodiment of the present invention;

[0026] Figure 5 This is a visual diagram illustrating the label matrix formed by terminology components according to an embodiment of the present invention;

[0027] Figure 6 This is a schematic diagram illustrating the construction of the prosodic position feature matrix according to an embodiment of the present invention;

[0028] Figure 7 This is a schematic diagram illustrating an example of a prosodic position feature matrix according to an embodiment of the present invention. Detailed Implementation

[0029] To enable those skilled in the art to better understand the technical solutions in this application, the technical solutions in the embodiments of this application will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only a part of the embodiments of this application, and not all of the embodiments. Based on the embodiments in this application, all other embodiments obtained by those skilled in the art without creative effort should fall within the scope of protection of this application.

[0030] According to an embodiment of the present invention, a method for constructing a knowledge graph for the oral transmission of ink-making skills by master calligraphers is provided.

[0031] The present invention will now be further described in conjunction with the accompanying drawings and specific embodiments, such as... Figure 1 As shown, according to a first embodiment of the present invention, a method for constructing a knowledge graph for the oral transmission skills of master calligraphers is provided, the method comprising the following steps:

[0032] S1. Collect the oral transmission texts of ink masters, and annotate the oral transmission texts to form a training sample set of ink masters' oral transmission techniques.

[0033] Specifically, such as Figure 3 As shown, this invention collects oral recordings, manually edited manuscripts, and historically transmitted texts generated by master carvers during the use of tools, component processing, size control, process connection, and explanation of techniques. The oral recordings are then converted into text, and the text is segmented according to the original punctuation, rhyming lines, parallel sentences, or semantically complete fragments to form multiple text fragments of the master carver's oral techniques. For example, a master carver's oral recording, after transcription, yields the text: "The bottom point must first be nailed straight, use a two-tenths chisel to make a circle. Then switch to a three-tenths chisel to clean the bottom, and finally use a flat chisel to clean the surface." After being segmented according to semantically complete fragments, it can form two text fragments: Fragment 1 is "The bottom point must first be nailed straight, use a two-tenths chisel to make a circle"; Fragment 2 is "Then switch to a three-tenths chisel to clean the bottom, and finally use a flat chisel to clean the surface."

[0034] The textual fragments of oral techniques passed down by master ink makers are labeled with entities and entity relationships. Entity types include tools, processes, dimensions, components, technical actions, and other entity types predefined according to application requirements; entity relationship types include tools in parallel, tool uses, process sequence, and other entity relationship types predefined according to the master ink maker's technical knowledge.

[0035] In one implementation, entity annotation adopts a sequence annotation method matching the conditional random field layer, for example, adopting a BIO or BIOES annotation system; entity relationship annotation records the head entity, the tail entity, and the entity relationship type. For example, in the text segment "er fen zao zi zou yi quan", using the BIO annotation system, "er" is annotated as "B-size", "fen" is annotated as "I-size", "zao" is annotated as "B-tool", "zi" is annotated as "I-tool", "zou" is annotated as "B-technique action", "yi" is annotated as "I-technique action", and "quan" is annotated as "I-technique action". The corresponding entity relationship annotation is: (head entity: "er fen zao", tail entity: "zou yi quan", relationship type: "tool usage").

[0036] The text segments of the master carpenter's orally transmitted techniques, the entity label sequence, and the entity relationship labels jointly form a training sample set for the master carpenter's orally transmitted techniques. The training sample set for the master carpenter's orally transmitted techniques consists of a plurality of samples, each sample corresponding to one text segment of the master carpenter's orally transmitted techniques. A single sample specifically includes:

[0037] Text segment: the original text segment string of the master carpenter's orally transmitted techniques;

[0038] Entity label sequence: a sequence with the same length as the number of characters in the text segment, each element in the sequence being the entity label corresponding to that character (such as B-tool, I-size, O, etc.);

[0039] Entity relationship label: a list, each element in the list is a triplet that records (head entity, tail entity, relationship type), where the head / tail entity is referred to by its start character position and end character position in the text segment.

[0040] For example, for the text segment "er fen zao zi zou yi quan", one training sample is:

[0041] Text segment: "er fen zao zi zou yi quan";

[0042] Entity label sequence: [B-size, I-size, B-tool, I-tool, B-technique action, I-technique action, I-technique action];

[0043] Entity relationship label: [((0,3,"tool"),(4,6,"technique action"),"tool usage")].

[0044] It should be noted that the BIO annotation system is a sequence annotation method that labels each character as "B - entity type" (entity start), "I - entity type" (entity interior), or "O" (non-entity). The BIOES annotation system adds "E - entity type" (entity end) and "S - entity type" (single character entity) to the BIO system, forming a more refined entity boundary annotation method.

[0045] S2. Based on the pre-built terminology component library and rhyme template library of the master ink master, the text fragments of the master ink master's oral skills are parsed and processed to generate a standardized term sequence, a term component composition label matrix and a rhyme position feature matrix. The parsing and processing adopts the forward maximum matching and backward maximum matching recognition methods and the dynamic programming method of the text fragments.

[0046] Specifically, the oral transmission of ink-making skills by master craftsmen has been preserved through oral tradition between master and apprentice, characterized by dense industry terminology, omission of core category components, variations in morpheme forms, and metrical sentence structures. For example, the tool term "two-part chisel" consists of the modifying component "two-part" indicating dimensional characteristics and the core category component "chisel" indicating the tool category. However, in expressions such as "two-part line cutting," the core category component "chisel" may be omitted.

[0047] Conventional word segmentation and string matching methods can only identify the actual characters appearing in the text, making it difficult to recover omitted core category components based on modifiers. Furthermore, the oral transmission of calligraphy skills by master calligraphers is typically organized according to metrical templates such as the Three Character Classic, Four-Six Couplets, and Seven-Character Verses. Terms and techniques within the same metrical structure have strong semantic connections, making it difficult for conventional sequence processing methods to directly utilize this type of domain structure information.

[0048] It should be noted that the classification of modifying components and core category components, as well as their allowed combination relationships, recorded in the terminology component database of master inscription craftsmen were objectively extracted after performing dependency parsing, word frequency statistics, and contextual semantic clustering on a large-scale corpus of oral traditions of master inscription craftsmen. This reflects the actual co-occurrence and distribution patterns of terminology units in the text. Human intervention was limited to entering component entries that were automatically discovered by the above algorithm and objectively existed in the text into the database, without interfering with the objective classification results of terminology categories and levels.

[0049] It should also be noted that the number of characters, tones, parallelism, and rhyme rules recorded in the Master of Calligraphy's Proverbs template library are objective summaries of the surface string features that are commonly present in the Master of Calligraphy's Proverbs text and can be automatically calculated. Tones are objectively determined by the tones of Chinese characters, rhymes are objectively determined by the vowels, and parallelism is objectively determined by the arrangement features of the character sequence in the text. These are all structured data features inherent in the text itself.

[0050] In a preferred embodiment, step S2 includes the following steps:

[0051] S21. Based on the pre-organized terminology of ink masters, and by dividing the terminology of ink masters into decorative components and core category components, construct a component library of ink masters' terminology.

[0052] S22. Based on the component library of the master craftsman's craft terminology, take the text fragments of the master craftsman's oral skills as input, and perform forward maximum matching and reverse maximum matching respectively to obtain component candidate pairs.

[0053] In a preferred embodiment, S22 includes the following steps: S221, taking the text fragment of the oral tradition of the master calligrapher as input, performing forward maximum matching, reading from the beginning character of the text fragment and selecting the longest terminology component that matches the terminology component in the master calligrapher's craft terminology component library at the current position; S222, taking the same text fragment of the oral tradition of the master calligrapher as input, performing reverse maximum matching, reading from the end character of the text fragment and selecting the terminology component that matches the terminology component in the master calligrapher's craft terminology component library at the current position. S223. Merge the longest term component with the forward maximum matching and the longest term component with the reverse maximum matching to obtain a set of candidate component fragments; S224. For each candidate component fragment in the set of candidate component fragments, when only a modifier component is identified in the candidate component fragment and no core category component is identified, according to the allowed combination relationship recorded in the Zhangmoshi process term component database, retrieve all core category components that can be combined with the modifier component, and form candidate component pairs to be evaluated with each retrieved core category component respectively.

[0054] S23. Based on the component joint probability, component marginal probability and category compatibility relationship, calculate the combination tightness score for each component candidate pair, and determine the optimal term segmentation scheme according to the combination tightness score. Standardize the term expression in the text fragment of the master calligrapher's oral skills, and generate a standardized term sequence and term components to form a label matrix.

[0055] As a preferred embodiment, S23 includes the following steps: S231, for each candidate pair of components, calculate the combination tightness score by analyzing the component joint probability, component marginal probability and category compatibility relationship; S232, based on the combination tightness score and a preset terminology judgment threshold, determine the optimal terminology segmentation scheme; S233, use the optimal terminology segmentation scheme to standardize the terminology expressions in the text fragment of the oral transmission of the master calligrapher's skills, form standardized terms, and arrange the standardized terms in the order of the text fragment of the oral transmission of the master calligrapher's skills to obtain a standardized terminology sequence; S234, for each standardized term, generate a terminology component composition label vector according to the modifier components and core category components it contains, and construct a terminology component composition label matrix according to the terminology component composition label vector.

[0056] S24. Based on the pre-organized mnemonic rhymes of the master calligrapher, construct a mnemonic rhyme template library for the master calligrapher;

[0057] S25. For the text fragments of oral transmission techniques by the master calligrapher, the original surface character sequence is obtained by deleting punctuation marks that do not participate in the calculation of the number of characters in the meter and retaining the original positions of the punctuation marks.

[0058] S26. Based on the Zhangmoshi mnemonic metrical template library, dynamic programming is used to perform metrical template matching on the original surface character sequence to determine the optimal prosodic boundary index set. Based on the optimal prosodic boundary index set, the prosodic semantic unit and prosodic position category of each normalized term are labeled, and a prosodic position feature matrix is ​​generated.

[0059] In a preferred embodiment, S26 includes the following steps:

[0060] S261. Starting from the beginning position of the original surface character sequence, compare the different metrical templates in the Master of Calligraphy's metrical template library with the character segments after the current position in turn. For each character segment to be compared, calculate the matching degree of the number of characters, the matching degree of tone, and the matching degree of rhyme.

[0061] S262. Calculate the template matching score between each candidate prosodic semantic unit and the corresponding metrical template based on the matching degree of word count, the matching degree of tone, and the matching degree of rhyme.

[0062] S263. Based on template matching scores, a dynamic programming algorithm is used to globally optimize the entire original surface character sequence to determine the prosodic semantic unit partitioning scheme that maximizes the total matching score, thereby obtaining the optimal prosodic boundary index set and the corresponding optimal prosodic template type set.

[0063] In a preferred embodiment, S263 includes the following steps:

[0064] S2631. Using the effective character positions in the original surface character sequence as the dynamic programming state, starting from the beginning position of the original surface character sequence, traverse sequentially to the end position; for the current end position, sequentially obtain the number of effective characters specified by each metrical template in the Master of Calligraphy's Prosody Template Library, determine the candidate starting position based on the number of effective characters, and extract the original surface character sequence between the candidate starting position and the current end position as the candidate prosodic semantic unit;

[0065] S2632. When the number of effective characters, the position of the internal sentence segment, and the tonal rhyme conditions of the candidate prosodic semantic unit meet the preset basic requirements of the corresponding metrical template, calculate the template matching score between the candidate prosodic semantic unit and the corresponding metrical template, and add the template matching score to the maximum cumulative template matching score before the candidate starting position to obtain the cumulative template matching score under the current candidate segmentation scheme.

[0066] S2633. For multiple candidate starting positions and multiple metrical template types corresponding to the same ending position, retain the candidate starting position and metrical template type with the highest cumulative template matching score.

[0067] It should be noted that for incomplete text (i.e., cases where complete segmentation from start to end is impossible), when at a certain ending position, if none of the combinations of all candidate starting positions and the metrical template can make the candidate prosodic semantic unit satisfy the basic requirements of the metrical template, the cumulative template matching score at that ending position should be set to a predefined minimum value (e.g., -∞) to ensure that this segmentation scheme will not be selected as the optimal solution. During the backtracking process in step S2634, if it is impossible to recover the starting position from the last valid character position based on the saved predecessor position, it indicates that the text segment has no complete metrical match. In this case, a backtracking segmentation scheme based on punctuation or a fixed number of characters is returned, and all terms are assigned to the default prosodic semantic unit.

[0068] S2634. After traversing the entire original surface character sequence, starting from the position of the last valid character, the start and end positions and metrical template types of each prosodic semantic unit are recovered in reverse according to the saved optimal predecessor position, so as to obtain the optimal prosodic boundary index set and the corresponding optimal metrical template type set.

[0069] S264. Based on the optimal prosodic boundary index set, the original surface character sequence is divided into multiple prosodic semantic units. For each normalized term, its prosodic semantic unit and prosodic position category within the unit are determined, and a prosodic position feature matrix is ​​generated.

[0070] Specifically, based on a pre-built terminology component library for master ink makers, co-occurrence statistics of terminology components, and a metrical template library for master ink makers' oral traditions, the system performs terminology fragment discovery, terminology standardization, and prosodic structure analysis on text fragments of master ink makers' oral traditions. This yields standardized terminology sequences, a terminology component composition label matrix, a prosodic position feature matrix, and an optimal prosodic boundary index set. This allows for the completion of omitted terms and the modeling of metrical structures, providing structured domain prior knowledge for subsequent joint extraction models, such as... Figure 4 As shown, the specific steps are as follows:

[0071] Step 1: Discovery and standardization of composite term fragments based on bidirectional component combinations;

[0072] To address the issues of omitted core category components and inconsistent combinations of modifying and core category components in oral tradition texts of master ink makers, this invention pre-decomposes complete master ink maker terminology into modifying and core category components, and records the permissible combination relationships between different components according to terminology categories. Then, forward maximum matching and backward maximum matching are used to identify candidate component segments in the oral tradition text fragments, and the optimal terminology combination is determined by combining the statistical correlation degree and category compatibility of terminology components. For candidate component segments that only contain modifying components but not core category components, core category components compatible with the modifying component are retrieved from the master ink maker terminology component database, and core category components whose combination tightness scores meet the terminology determination criteria are selected to complete terminology standardization. The specific steps are as follows:

[0073] 1) Organize the terminology of ink masters in advance, and divide each complete ink master terminology that can be separated into decorative components and core category components, and then build an ink master terminology component library. The ink master terminology component library records the standard component name, component category, terminology category and allowed combination relationship for each term component.

[0074] In one implementation, when building the component library, determining whether a complete "master ink craft term" can be split primarily depends on whether the term consists of two or more semantically and functionally independent word-forming units that can be reproduced in other different term combinations. Specifically, if a term can be clearly divided into at least one modifier component and one core category component, and the split modifier component can describe size, shape, function, or craft characteristics, and the core category component can independently refer to categories such as tools or components, and the modifier component has a precedent in other terms (such as "three-part chisel") or the core category component has a precedent in other terms (such as "two-part plane"), then the term is determined to be split. Conversely, if the components of a term cannot independently bear the above functions, or if forcibly splitting it would cause it to lose its specific semantics in the oral tradition of master ink craftsmen, then it is considered indivisible and recorded as a whole component.

[0075] For example, the "two-part chisel" can be broken down into the decorative component "two-part" and the core category component "chisel". "Two-part" describes the tool's cutting edge size or machining size, while "chisel" determines the tool's category. Similarly, the "three-point planer" can be broken down into the decorative component "three-point" and the core category component "planer". "Three-point" describes the planer's structural features, while "planer" determines the tool's category.

[0076] The total number of terminology components in the Master Ink Craftsmanship Terminology Component Library is denoted as: This corresponds to the number of term components with unique indexes in the Zhangmoshi craft term component library; each term component corresponds to a unique component index, and the positions of each vector in the subsequent term component label vector are consistent with the corresponding component index.

[0077] Specifically, the pre-compiled oral tradition data of the master calligraphers is statistically analyzed according to the original punctuation, mnemonic lines, or manually marked mnemonic fragments. Each mnemonic fragment is used as a co-occurrence statistical range, recording the number of times any modifying component and the core category component co-occur within the same mnemonic fragment. For modifying components... and core category components The number of times both appear together within the same mnemonic segment is recorded as follows: ,in, This indicates the modified component currently to be evaluated. This indicates the core category component currently being evaluated. Used to reflect decorative parts With core category components The actual co-occurrence frequency in the oral traditions of master calligraphers. For example, in the same mnemonic fragment "Two parts chisel for lines, three parts chisel for the bottom," if the modifier "two parts" and the core category component "chisel" appear together, then the co-occurrence frequency is... Add 1 cumulatively; if the modifying component "three parts" and the core category component "chisele" appear together, then... Add 1 to the total.

[0078] Furthermore, the combination of all modifier components and core category components allowed to form combinations in the component library of the master ink maker's craft terminology is smoothed by adding one, and the co-occurrence counts after smoothing are normalized to obtain the component joint probability, expressed as: ;

[0079] in, Indicates decorative components With core category components The smooth joint probability; and These represent the modified components and core category components traversed during the summation process, respectively; the summation range is all component combinations allowed to form combinations in the Master Ink Techniques Component Library.

[0080] It should be noted that the denominator It is a global normalization constant over all allowed combinations in the component library, used to ensure that all The sum is 1, when calculating a single When the denominator remains unchanged.

[0081] In one implementation, the permissible combination relationships within the Zhangmoshi craft terminology component library are pre-determined based on Zhangmoshi's practical experience, the inherent logic of the terms, and verified terminology examples. Specifically, a combination relationship is considered permissible if and only if the attribute described by the modifying component can physically or technologically modify the object category referred to by the core category component, and the complete terminology formed by the combination conforms to industry conventions and understanding. For example, the modifying component "three-tenths" describing the blade width can be combined with "chisel" because the tool "three-tenths chisel" exists; however, it is generally not combined with "planer" because the specification descriptions of planers differ. This relationship is reviewed and entered by domain experts when constructing the component library, constituting a hard constraint on terminology combinations.

[0082] Furthermore, by summing the joint probabilities of components along the directions of the core category components and the modification components respectively, the marginal probability of the modification component is obtained. and the marginal probability of core category components In practical implementation, the marginal probability of the modified component is... By component joint probability Along the core category components The summation of dimensions yields, i.e. Marginal probability of core category components By component joint probability Along the trimmed parts The summation of dimensions yields, i.e. .

[0083] It should be noted that when the oral corpus of the master of ink is limited in size, and some terminology component combinations appear with extremely low frequency or do not appear in the corpus, the calculation method of adding 1 to smooth can avoid low-frequency component combinations from being unable to participate in the subsequent combination tightness calculation due to the co-occurrence count being 0.

[0084] 2) Using the text fragment of the master craftsman's oral tradition as input, perform forward maximum matching and backward maximum matching respectively to obtain candidate fragments of components that can match the terminology components in the master craftsman's terminology component library. Forward maximum matching reads from the beginning character of the text fragment and prioritizes the longest matching terminology component at the current position; backward maximum matching reads from the end character of the text fragment and prioritizes the longest matching terminology component according to the same principle.

[0085] In the specific implementation, the corresponding surface character content, start character position, end character position, component category, and matching direction are recorded for each component candidate fragment. By merging the forward maximum matching results and the reverse maximum matching results, component candidate fragments that may serve as modifying components, core category components, or components of complete master ink craft terminology are obtained. Ordinary skill actions or ordinary words that are not matched by either forward or reverse maximum matching retain their original surface expressions and are not completed as terminology components. For example, for the mnemonic fragment "first plane flat, then clean the surface," "first" and "then" are ordinary function words. Although "plane flat" and "clean the surface" are skill actions, their surface expressions do not directly correspond to the terminology components that have been split in the master ink craft terminology component library. For example, although "plane flat" contains the character "plane," "plane" is a separate core category component in the component library, while "flat" is not a currently registered modifying component. After forward and reverse maximum matching, "plane flat" and "clean the surface" are not matched as component candidate fragments, so their original surface expressions "plane flat" and "clean the surface" are retained and no terminology component is completed.

[0086] In practical implementation, when both a modifier and a core category component appear in adjacent component candidate fragments, and the allowed combinations of the two are recorded in the Master Ink Craft Terminology Component Library, the modifier and the core category component are combined into a component candidate pair. When only a modifier is identified in a component candidate fragment, all core category components that can be combined with the modifier are retrieved according to the allowed combination relationships recorded in the Master Ink Craft Terminology Component Library, and the modifier is then combined with the retrieved core category components to form component candidate pairs to be evaluated. Thus, even if the core category component does not directly appear in the Master Ink Craft Oral Text Fragment, corresponding completion candidates can be generated based on the combination relationships between the modifier and the domain. For example, for the mnemonic fragment "two-part line", after forward maximum matching and reverse maximum matching, the component candidate fragment "two-part" is identified, and its component category is decorative component. No core category component appears in the same component candidate fragment. At this time, according to the allowed combination relationship recorded in the component library of the master craftsman's process terminology, it is found that the decorative component "two-part" is allowed to be combined with the core category component "chisel". Therefore, a component candidate pair to be evaluated ("two-part", "chisel") is generated for subsequent combination tightness score calculation.

[0087] 3) Based on the joint probability of components, the marginal probability of components, and the category compatibility relationship, calculate the combination tightness score for each candidate pair of components. The calculation method is expressed as follows:

[0088] ;

[0089] in, Indicates decorative components With core category components The higher the assembly tightness score, the better the quality of the modified parts. With core category components The more likely it is to form a complete terminology for the master ink maker's craft; Indicates decorative components With core category components The smooth joint probability; Indicates decorative components The smoothed marginal probability; Indicates core category components The smoothed marginal probability; the logarithmic ratio term is used to measure the modified parts. With core category components The statistical association strength relative to random combinations, Indicates decorative components With core category components The category compatibility indicator value. When the master craftsman records the modified component in the process terminology component library. Allows for use with core class components When combining, Take 1; when the ink master's process terminology component library does not record an allowed combination relationship between the two, Take 0. This represents the category compatibility weighting coefficient, used to adjust the influence of the ink master's process combination rules on the combination tightness score. It must be a non-negative number, for example, 0.5.

[0090] In the specific implementation, the combination tightness score of all candidate component pairs corresponding to the same candidate component fragment is calculated, and the combination tightness score is compared with a preset terminology judgment threshold. Comparison. Among them, This represents the minimum score required for a candidate component pair to be considered a valid combination of process terminology. It can be determined based on the annotated corpus, and for example, it can be between 0.2 and 1.0.

[0091] In practical implementation, for candidate component segments whose character positions do not overlap, the combination tightness score is retained to be no less than the preset terminology judgment threshold. For component candidate pairs, if the character positions overlap or the forward maximum matching result and the reverse maximum matching result are inconsistent, each candidate combination that does not have internal character conflicts is taken as a term segmentation scheme. The combination tightness scores of all component candidate pairs in the term segmentation scheme are summed, and the term segmentation scheme with the largest sum of scores is selected as the optimal term segmentation scheme.

[0092] In practical implementation, the joint probability of components The statistical scope does not refer to the co-occurrence of characters in the original surface character sequence, but rather to the statistical analysis performed on the oral tradition corpus of the master calligraphers after the terminology normalization and completion. Specifically, first, step S22 (bidirectional maximum matching) and step S23 (combinatorial tightness calculation) are performed on all the mnemonic fragments in the oral tradition corpus to obtain the normalized terminology sequence for each mnemonic (where the omitted core category components have been completed in the normalized terminology names); then, the normalized terminology sequences of all mnemonic fragments are used as the co-occurrence statistical corpus, and each mnemonic fragment is considered as one co-occurrence range to record the modifying components. With core category components The number of times they co-occur in the same normalized term sequence Since each term in the normalized term sequence has been completed to include both modifiers and core category components, "dichotomy" and "chisel" are recorded as co-occurring only once in the normalized statistical corpus, regardless of whether they appeared simultaneously in the original text, thus ensuring... To accurately reflect the true correlation between the two in the ink master's technical knowledge, and to avoid the problem of statistical underestimation caused by superficial omissions.

[0093] It should be noted that by using both statistical association strength and category compatibility, we can avoid the formation of incorrect master ink craft terms due to the accidental co-occurrence of two term components in a small number of mnemonic fragments. We can also use the combination rules in the master ink craft term component library to reduce the probability of low-frequency master ink craft terms being missed due to insufficient statistical samples.

[0094] 4) Standardize the terminology in the text fragments of the master calligrapher's oral transmission of skills according to the optimal terminology segmentation scheme, and retain the correspondence between each standardized term and the original surface character position.

[0095] In practical implementation, for candidate component fragments where both the decorative component and the core category component have appeared completely in the oral transmission text of the master craftsman's skills (such as "two-part chisel"), the standard terminology name recorded in the master craftsman's terminology component library is used for standardization (e.g., the standard name is also "two-part chisel"). For candidate component fragments where only the decorative component appears (such as "two-part"), the core category component with the highest combination tightness score that is compatible with the decorative component is selected, and the score is not less than the preset terminology judgment threshold. The core category component (such as "chise") is then added to the standard terminology name (forming the complete standardized terminology name "two-part chisel"), resulting in a complete master chisel craft terminology corresponding to the original surface expression.

[0096] In one embodiment, following the above example, after the mnemonic fragment "two-point line routing, three-tip clean surface" is normalized, the term "two-point" is normalized to "two-point chisel", and "three-tip" is normalized to "three-tip plane". "Line routing" and "clean surface" remain unchanged. The finally obtained normalized term sequence is .

[0097] It should be noted that the core generic component completion only changes the standard name of the normalized term, and does not actually insert characters into the original surface character sequence. Each normalized term continues to record its start character position and end character position in the original surface character sequence, so as to ensure that the subsequent prosodic structure parsing is still based on the original word count structure of the text fragment of the master carpenter's orally transmitted skill.

[0098] Further, the normalization results are arranged in the order of the normalized terms in the text fragment of the master carpenter's orally transmitted skill to obtain a normalized term sequence, that is . Wherein, represents the normalized term sequence; represents the th normalized term in the normalized term sequence; represents the normalized term serial number, with a value range from 1 to ; represents the total number of normalized terms and reserved ordinary skill action expressions in the current text fragment of the master carpenter's orally transmitted skill.

[0099] It should be noted that each normalized term has a unique standard name, and the omitted core generic component has been completed in the corresponding standard name, that is, for the sequence each normalized term in it, its name is a complete form after completion and standardization. For example, is "two-point chisel", even if only "two-point" appears in the original text, its standard name in already includes the omitted "chisel".

[0100] 5) Generate a term component composition label vector according to the modifying component and the core generic component included in the th normalized term , the term component composition label vector is a multi-hot binary vector of length , and each vector position corresponds to a unique component index in the master carpenter's skill term component library. When the normalized term contains a certain term component, the vector position corresponding to the term component is set to 1, and the vector positions corresponding to the remaining non-included term components are set to 0.

[0101] ​It should be noted that a standardized term usually includes both a modifier part and a core generic part, so the corresponding term part composition label vector may have multiple positions with a value of 1. For ordinary craft actions or common words that do not match the craftsman term part library, the corresponding term part composition label vector is set to a full-zero vector with a length of , so as to keep the dimensions of the vectors corresponding to all standardized terms consistent.

[0102] In an embodiment, for the mnemonic fragment "Er fen zou xian, San jian jing mian", the bidirectional maximum matching identifies the modifier parts "Er fen" and "San jian", but does not identify the directly appearing core generic parts at the corresponding character positions. According to the allowed combination relationships in the craftsman term part library, core generic part candidates are retrieved for "Er fen" and "San jian" respectively. Through combination compactness calculation, the combination compactness score of "Er fen" and "chisel" is the highest, and the two satisfy the category compatibility relationship, so the original surface expression "Er fen" is standardized as "Er fen chisel"; the combination compactness score of "San jian" and "plane" is the highest, and the two satisfy the category compatibility relationship, so the original surface expression "San jian" is standardized as "San jian plane". The finally obtained standardized term sequence can be expressed as ; wherein, the term part composition label vector corresponding to "Er fen chisel" takes the value 1 at the part index positions of "Er fen" and "chisel"; the term part composition label vector corresponding to "San jian plane" takes the value 1 at the part index positions of "San jian" and "plane"; when "zou xian" and "jing mian" do not match the craftsman term part library, the corresponding term part composition label vectors are full-zero vectors.

[0103] It should be noted that the discovery and standardization of compound term fragments based on bidirectional part combination does not directly perform string replacement on the original surface expression, but establishes a mapping relationship between the original surface expression and the complete standard term while retaining the original character positions, which can restore the omitted core generic parts without destroying the character count and metrical structure of the original mnemonic, and provide term priors with clear internal composition for subsequent neural networks.

[0104] In an embodiment, the term part composition label matrix is visualized (partial), as Figure 5 shown, the rows correspond to each term in the standardized term sequence, the columns correspond to the part indices in the part library, and the value of a cell is 1 or 0 to indicate whether the term contains the corresponding part, and the internal part composition of each standardized term is encoded as a multi-hot binary vector. The horizontal axis is the index of the craftsman term part library, unitless; the vertical axis is the sequence number of the standardized term sequence, unitless.

[0105] Step 2: Prosodic structure parsing and semantic unit calibration based on metrical templates;

[0106] In view of the characteristics that the palm master mnemonics are organized according to fixed character counts, tone relationships and rhyme positions, the present invention pre-constructs a palm master mnemonic metrical template library, and compares the matching results of different metrical template combinations and different text segmentation positions through a dynamic planning manner to obtain prosodic semantic units and their boundaries.

[0107] To avoid changing the character count structure of the original mnemonic due to the increase in the number of characters of the standard term name after completing the core generic component in step 1, the metrical template matching takes the original surface character sequence in the text fragment of the palm master's orally transmitted skill as the processing object, and maps the prosodic structure parsing result to the normalized term sequence according to the character position correspondence between the normalized term and the original surface expression, as Figure 6 shown in the figure, the specific steps are as follows:

[0108] 1) Pre-sort the three-character verses, four-character antithetical couplets, four-six antithetical couplets, seven-character mnemonics and other fixed sentence patterns used in the palm master mnemonics, and construct a palm master mnemonic metrical template library. Each metrical template in the palm master mnemonic metrical template library records the number of valid characters of the complete metrical template unit, the number of internal sentence segments, the number of characters of each internal sentence segment, the boundary position of internal sentence segments, the allowed tone types of level and oblique tones at each character position, and the positions that need to rhyme. For example, a metrical template of "four-character antithetical couplet" is recorded as: the number of valid characters is 8, the number of internal sentence segments is 2, the number of characters of each internal sentence segment is [4, 4], the boundary position of internal sentence segments is at [4], the tone type of level and oblique tone at each character position is "oblique, oblique, level, level; oblique, oblique, level, level", and the rhyme positions are [4, 8] which belong to the same rhyme group.

[0109] In specific implementation, for the character positions where no restriction is imposed on the level and oblique tones, the character positions are recorded as allowing both level and oblique tones; for multiple sentence end positions that require rhyming, the corresponding positions are recorded as the same rhyme group. In one implementation, the tone type of level and oblique tones can be mapped according to the tone category of Chinese character pronunciation, and the rhyme relationship can be judged according to the pre-sorted rhyme table or the finals of Chinese character pinyin; for example, the high and level tone and the rising tone in Mandarin are mapped to level tone, and the falling-rising tone and the falling tone are mapped to oblique tone; the two Chinese characters "fang" and "chang" whose finals are both "ang" are determined to rhyme.

[0110] It should be noted that for metrical templates containing front and rear antithetical sentence segments such as four-six antithetical couplets and four-character antithetical couplets, the front and rear sentence segments jointly form a complete prosodic semantic unit. The palm master mnemonic metrical template library simultaneously records the overall boundary of the complete prosodic semantic unit and the positions of the internal sentence segments, which can divide the normalized terms at the same position in the front and rear antithetical sentence segments into the same prosodic semantic unit, so as to provide a unified unit determination basis for subsequent prosodic bias attention calculation.

[0111] 2) Remove punctuation marks that are not included in the metrical character count from the text fragments of oral transmission of skills by the master calligrapher, and retain the original positions of the punctuation marks to obtain the original surface character sequence.

[0112] Specifically, the original surface character sequence is denoted as ,in, This represents a valid sequence of surface characters arranged in their original order. Represents the first character in the original surface character sequence. One valid character; Indicates the index of the valid character position; This represents the total number of valid characters in the original surface character sequence.

[0113] Furthermore, tone marking is performed on each valid character in the original surface character sequence to obtain the tone type corresponding to each valid character. It should be noted that punctuation marks are not considered valid characters in the metrical character count, but the position of punctuation marks is used to help determine possible internal sentence boundaries and complete prosodic semantic unit boundaries.

[0114] Furthermore, starting from the beginning of the original surface character sequence, different metrical templates in the Master of Calligraphy's metrical template library are compared sequentially with the character segments following the current position. In specific implementation, for each character segment to be compared, the word count matching degree, tone matching degree, and rhyme matching degree are calculated respectively. Among them, the word count matching degree is used to determine whether the number of valid characters in the character segment meets the number of valid characters specified by the metrical template; the tone matching degree is determined based on the ratio of the number of constrained character positions that meet the template's tone requirements to the total number of constrained character positions; the rhyme matching degree is determined based on the ratio of the number of position combinations that meet the template's rhyme requirements to the total number of rhyming position combinations.

[0115] In one implementation, the matching degree of word count, the matching degree of tone pattern, and the matching degree of rhyme are respectively denoted as... , and The values ​​for all three fit scores range from 0 to 1. For character segments whose effective character count is exactly the same as the character count specified in the metrical template, Set to 1; for character fragments with inconsistent numbers of valid characters, they are not considered valid matching candidates for this metrical template. Character fragment With metrical templates The template matching score is calculated as follows:

[0116] ;

[0117] in, Indicates the number of items to be evaluated. The original surface character sequence contained in each candidate prosodic semantic unit; Representation of candidate prosodic semantic units The metrical template types for comparison; Representing candidate prosodic semantic units With metrical templates Template matching score; Indicates the weight of word count fit; Indicates the weight of tonal harmony; These represent the rhyme matching weights. All three weights are non-negative numbers and can be normalized, for example, to 0.4, 0.3, and 0.3 respectively.

[0118] It should be noted that by weighting the matching of word count, tone pattern, and rhyme scheme, character segments with identical word count, high degree of tonal matching, and consistent rhyme scheme can obtain higher template matching scores.

[0119] 3) Using the effective character positions in the original surface character sequence as the dynamic programming state, the maximum cumulative template matching score that can be obtained from the starting position to different ending positions of the original surface character sequence is recorded using dynamic programming, and the previous prosodic boundary position and metrical template type corresponding to the maximum cumulative template matching score are recorded.

[0120] In the specific implementation, for the current ending position (i.e., during the traversal of the original surface character sequence) At this point, the state transition loop examines a specific valid character position index (which serves as the right boundary of the candidate prosodic semantic unit). It then sequentially reads the number of valid characters specified by each metrical template in the "Master of Prosody" metrical template library. Based on the number of valid characters in the metrical template, it determines the candidate starting position and extracts the original surface character sequence from the candidate starting position to the current ending position as the candidate prosodic semantic unit. When the number of valid characters, the internal sentence position, and the tonal and rhyming conditions of the candidate prosodic semantic unit meet the basic requirements of the corresponding metrical template, it calculates the template matching score of the candidate prosodic semantic unit and adds this score to the maximum cumulative template matching score before the candidate starting position.

[0121] Furthermore, for multiple candidate start positions and multiple metrical template types corresponding to the same end position, the candidate start position and metrical template type with the highest cumulative template matching score are retained. After traversing the entire original surface character sequence, starting from the last valid character position, the start and end positions and metrical template types of each prosodic semantic unit are recovered in reverse based on the saved optimal predecessor position.

[0122] Based on this, by indexing all possible prosodic boundary sets globally... and its corresponding set of metrical template types A search is performed to find the optimal segmentation scheme that maximizes the cumulative template matching score of the entire oral tradition text fragment. The overall optimization objective of the prosodic structure analysis is expressed as:

[0123] ;

[0124] in, This represents the candidate prosodic boundary index set, which records the start and end positions of each candidate prosodic semantic unit in the original surface character sequence. This represents the optimal prosodic boundary index set obtained when the cumulative template matching score is maximized; This represents the set of candidate prosodic template types corresponding to each candidate prosodic semantic unit; Representation and optimal prosodic boundary index set The corresponding set of optimal metrical template types; Indicates the total number of prosodic semantic units; Indicates the first Each prosodic semantic unit contains a sequence of original surface characters; Indicates the first The prosodic semantic unit corresponds to the metrical template type.

[0125] It should be noted that by comparing the cumulative template matching scores of different rhythmic boundary positions and different metrical template types as a whole, we can avoid the misalignment of the preceding and following sentences caused by greedy segmentation based solely on the number of characters in a local section. This ensures that the final optimal rhythmic boundary index set simultaneously conforms to the character count structure, tonal relationship, and rhyme relationship of the entire verse.

[0126] 4) Based on the optimal prosodic boundary index set Determine the prosodic semantic unit to which each normalized term belongs in the normalized term sequence. Since step one preserves the start and end character positions of the original surface expression for each normalized term, the prosodic semantic unit can be determined based on the inclusion relationship of the original character positions. A standardized term Mapping to the corresponding prosodic semantic units instead of recalculating word counts and metrical positions using the completed standard terminology names.

[0127] In specific implementations, the candidate prosodic boundaries used in dynamic programming are not set inside the candidate segments of identified components, so as to avoid dividing the same normalized term into two prosodic semantic units. For a prosodic semantic unit composed of multiple internal segments, the internal segment to which each normalized term belongs is further determined according to the internal segment positions recorded in the metrical template library for master carpenter mnemonic rhymes. For example, an antithesis template parses "long plane for smoothing the surface, short plane for trimming the edge" into one prosodic semantic unit containing two internal segments; according to the demarcation positions of the internal segments, "long plane for smoothing the surface" is the first internal segment, and "short plane for trimming the edge" is the second internal segment; the normalized terms "long plane" and "short plane" are divided into the first and the second internal segments respectively.

[0128] Further, according to the relative position of the normalized term in the internal segment to which it belongs, the -th normalized term is determined for the prosodic position category , which refers to the position category of the -th normalized term in the internal segment to which it belongs; and the prosodic position categories include sentence beginning, sentence middle, and sentence end. When the starting position of the original surface expression of the -th normalized term is consistent with the starting position of the internal segment to which it belongs, it is determined as the sentence beginning; when the ending position of the original surface expression of the -th normalized term is consistent with the ending position of the internal segment to which it belongs, it is determined as the sentence end; in other cases, it is determined as the sentence middle. For an internal segment that contains only one normalized term, it can be regarded as both the sentence beginning and the sentence end according to a preset encoding rule, or uniformly mapped to the sentence end according to application data, as long as the same rule is adopted in the training and inference phases. For example, in a three-character internal segment "mountain-splitting axe", if it contains only one normalized term "mountain-splitting axe", whose starting and ending positions are both consistent with the boundaries of the segment, its prosodic position category can be uniformly mapped to "sentence beginning" according to the rule .

[0129] Further, according to the prosodic position category , a prosodic position feature vector is generated , and the prosodic position feature vector is a one-hot vector, whose dimension is denoted as , which represents the total number of prosodic position categories. When the prosodic position categories include sentence beginning, sentence middle, and sentence end, the dimension is 3. The sentence beginning, sentence middle, and sentence end can be encoded in sequence as , and . The prosodic position feature vector is used to characterize the structural role of the normalized term in the metrical sentence segment, so that the normalized terms located at the same position in the preceding and following antithetical sentence segments have consistent initial prosodic position encoding.

[0130] In one embodiment, by way of example, for the mnemonic "Long plane smooths the surface, short plane trims the edge", 8 valid characters are obtained after removing punctuation marks. The four-character antithesis template in the master carpenter mnemonic metrical template library specifies that a complete prosodic semantic unit includes 2 four-character internal sentence segments, and the same positions of the 2 internal sentence segments form antithesis positions. Through template matching and dynamic规划 processing, the entire "Long plane smooths the surface, short plane trims the edge" is calibrated as one prosodic semantic unit, and the 2 four-character internal sentence segments "Long plane smooths the surface" and "short plane trims the edge" are recorded within this prosodic semantic unit. "Long plane" and "short plane" are respectively located at the beginning of the two internal sentence segments, so they correspond to the same sentence-start prosodic position feature vector; "smooths the surface" and "trims the edge" are respectively located at the end of the two internal sentence segments, so they correspond to the same sentence-end prosodic position feature vector. Using the complete antithesis template as the prosodic semantic unit can ensure that the subsequent entity relationship joint extraction model identifies the normalized terms with corresponding positional relationships in the preceding and following sentence segments as associated objects within the same structural scope.

[0131] It should be noted that the prosodic structure parsing based on the metrical template does not perform segmentation simply according to punctuation marks or a fixed number of characters, but simultaneously compares the character count structure, level-oblique tone relationship and rhyme relationship, and selects the optimal metrical template combination for the entire segment of the master carpenter's orally transmitted craft text through dynamic programming, thereby reducing the impact of local character segmentation errors on subsequent antithesis relationship recognition, and providing structural prior with clear boundaries and position categories for the prosody-biased multi-head self-attention.

[0132] Further, all the term component constituent label vectors are stacked according to the term order in the normalized term sequence to obtain a term component constituent label matrix, that is:

[0133] ;

[0134] The dimension of the term component constituent label matrix is . Wherein, denotes the term component constituent label matrix; The -th row of corresponds to the term component constituent label vector of the -th normalized term denotes the total number of terms in the normalized term sequence; denotes the total number of term components in the master carpenter craft term component library.

[0135] Furthermore, by stacking all prosodic position feature vectors according to the term order in the normalized term sequence, we obtain the prosodic position feature matrix, i.e.:

[0136] ;

[0137] The prosodic position feature matrix has a dimension of .in, Represents the prosodic position feature matrix; The The row corresponds to the first A standardized term prosodic position feature vector ; This represents the dimension of the prosodic position feature vector.

[0138] It should be noted that the final output includes a normalized term sequence. Terminology components constitute a tag matrix Prosodic position feature matrix and optimal prosodic boundary index set The above outputs are aligned according to a unified, standardized term index and input into the entity relation joint extraction model as a domain-structured prior for the entity relation joint extraction model.

[0139] In one embodiment, an example of a prosodic location feature matrix is ​​shown, such as... Figure 7 As shown, the structure consists of prosodic position feature vectors corresponding to several normalized terms. Each row represents a one-hot encoding of a term, corresponding to three prosodic position categories: sentence beginning, sentence middle, and sentence end. The structural role of each term within its internal sentence segment is explicitly encoded. The horizontal axis represents the prosodic position category and has no unit; the vertical axis represents the sequence number of the normalized term and has no unit.

[0140] S3. Construct an entity relation joint extraction model, and input the standardized term sequence, term component label matrix and prosodic position feature matrix into the entity relation joint extraction model for end-to-end training;

[0141] Specifically, conventional entity relationship extraction models mainly rely on the general semantic representation of words, making it difficult to directly utilize the internal component composition of the terminology of the master craftsman and the antithetical relationship in the rhymes. When the number of labeled samples is small, problems such as omission of term category identification errors, incomplete entity boundaries, and omission of entity relationships between antithetical terms are likely to occur.

[0142] In a preferred embodiment, step S3 includes the following steps:

[0143] S31. Construct an entity-relation joint extraction model that includes a component-aware gating embedding layer, a prosodic bias Transformer encoding layer, and a joint decoding layer for entity recognition and relation extraction.

[0144] S32. The standardized term sequence and term components are used to form a label matrix input component perception gated embedding layer. The gated vectors are weighted and fused element by element to obtain the fused embedding vector. All fused embedding vectors are stacked into a sequence input matrix.

[0145] In a preferred embodiment, S32 includes the following steps: S321, according to the terminology order in the standardized terminology sequence, read the original surface expression corresponding to each standardized term, and input the text fragment of the oral transmission technique of the master calligrapher containing the original surface expression into the pre-trained language model to obtain the pre-trained word vector of each standardized term; S322, based on the terminology components corresponding to each standardized term, construct a label vector, and perform dense vector mapping through a trainable component embedding matrix to obtain the terminology component representation of each standardized term; S323, after concatenating the pre-trained word vector and the terminology component representation along the feature dimension, input the gated linear transformation and the Sigmoid activation function to obtain the gated vector; S324, based on the gated vector, perform element-wise weighted fusion on the pre-trained word vector and the terminology component representation of each standardized term to obtain the fused embedding vector; S325, stack the fused embedding vectors corresponding to all standardized terms according to the terminology order in the standardized terminology sequence to obtain the sequence input matrix.

[0146] S33. Input the sequence input matrix into the Transformer encoder, calculate the prosodic bias value between any two normalized terms based on the optimal prosodic boundary index set and prosodic position feature vector, and superimpose the prosodic bias value into the self-attention score of the Transformer encoder. After multi-layer encoding, the context representation of each normalized term is obtained.

[0147] In a preferred embodiment, S33 includes the following steps: S331, inputting the sequence input matrix into the Transformer encoder, performing linear transformations of query, key, and value to obtain the query vector, key vector, and value vector corresponding to each normalized term position, and calculating the basic attention score between any two normalized term positions based on the scaled dot product of the query vector and the key vector; S332, determining whether any two normalized terms belong to the same prosodic semantic unit based on the optimal prosodic boundary index set, and generating a unit-indicator value; based on the prosodic position feature vector of each normalized term, performing linear mapping through a trainable prosodic position embedding projection matrix to obtain the prosodic position projection vector of each normalized term; S333, for any two normalized terms, calculating the prosodic bias value by combining the unit-indicator value and the cosine similarity between the prosodic position projection vector; S334, superimposing the prosodic bias value onto the basic attention score of the corresponding position in each Transformer encoding layer and each attention head, and obtaining the context representation of each normalized term after multi-layer encoding processing.

[0148] S34. Input the context representation into the joint decoding layer of entity recognition and relation extraction, perform entity recognition and entity relation classification, and update all trainable parameters of the joint entity relation extraction model through backpropagation until the joint entity relation extraction model converges, thereby completing the training of the joint entity relation extraction model.

[0149] In a preferred embodiment, S34 includes the following steps: S341, inputting the context representation of each normalized term into the entity recognition linear mapping layer to obtain the emission score of each entity label, inputting all emission scores into the conditional random field layer, decoding to obtain the entity boundary and entity type, forming an entity candidate set; S342, performing ordered combination of head entities and tail entities in the entity candidate set to form entity candidate pairs, and pooling the context representations covered by the head entity and tail entity in each entity candidate pair to obtain the head entity pooled context representation and the tail entity pooled context representation; S343, for each predefined entity relationship type, calculating the head entity pooled context representation using bilinear interaction terms. The following text indicates the degree of matching between the head entity pooling context representation and the tail entity pooling context representation. It also uses linear terms to fuse the head entity pooling context representation, the tail entity pooling context representation, and the entity prosodic position vectors of the two entities to obtain the relation scores of the entity candidate pairs under the entity relation type. Each relation score is mapped to a relation probability. S344: Calculate the entity recognition loss based on the emission score and the manually labeled entity label sequence. Calculate the relation extraction loss based on the relation probability and the manually labeled entity relation label. Calculate the joint loss based on the weighted sum of the entity recognition loss and the relation extraction loss. Update all trainable parameters of the entity relation joint extraction model through backpropagation until the entity relation joint extraction model converges, thus completing the training.

[0150] This step constructs a joint entity relation extraction model, introducing the term component label matrix and prosodic structure features into the input embedding stage and the self-attention encoding stage, respectively. The joint entity relation extraction model includes a component-aware gated embedding layer, a prosodic bias Transformer encoding layer, and a joint entity recognition and relation extraction decoding layer. Through end-to-end training, term component information and prosodic structure information jointly participate in entity boundary determination and entity relation classification. The specific steps are as follows:

[0151] Step 1: Construction of the component-aware gating embedding layer;

[0152] To address the issue that general pre-trained word vectors cannot clearly represent the internal modifying components and core class components of traditional Chinese ink-making techniques, this invention performs gated fusion of the original surface semantic representation corresponding to the standardized term and the component composition representation of the term. The gate vector is jointly determined based on the original surface semantics and component composition of the current standardized term, enabling the entity relation joint extraction model to automatically adjust the fusion ratio of the two types of information for different standardized terms. The specific steps are as follows:

[0153] 1) According to the standardized terminology sequence The order of terms in the text, read the first A standardized term The corresponding original surface expression is then input into the pre-trained language model along with a text fragment containing the original surface expression of the master calligrapher's oral transmission techniques, resulting in the first... The pre-trained word vectors corresponding to each standardized term .

[0154] in, It refers to the first The first normalized term corresponds to the pre-trained word vector of the original surface expression, used to provide the first normalized term. The basic surface semantic information of each normalized term in the current context, with dimensions of . , This represents the dimension of the pre-trained word vectors.

[0155] In practical implementation, when the first When the original surface representation corresponding to a standardized term is segmented into multiple sub-word units by a pre-trained language model, the hidden vectors of the corresponding sub-word units are read from the output of the pre-trained language model, and average pooling is performed on the multiple hidden vectors to obtain a dimension of Pre-trained word vectors When a raw surface expression corresponds to a single sub-word unit, the hidden vector of that sub-word unit is used directly.

[0156] For example, when the original surface expression "bisection" is normalized to "bisection chisel", the pre-trained word vectors... It is still based on the "binary" that actually appears in the text fragment of the master's oral transmission of skills, and is used to preserve the original oral expression and its contextual semantics. The completed "binary chisel" is not directly used to replace the input of the pre-trained language model.

[0157] In one implementation, the pre-trained language model uses the BERT-base-Chinese model. During use, the text fragments of the calligrapher's oral transmission of skills are constructed as input sequences, starting with [CLS] and ending with [SEP]. After forward propagation, the output of the last Transformer encoding layer is taken as the context hidden vector for each character. For the... For each normalized term, based on its start and end character positions in the original text, the hidden vectors of the corresponding sub-word units are extracted from these outputs. If there are multiple sub-words, these vectors are average-pooled to obtain pre-trained word vectors with a dimension of 768. .

[0158] It should be noted that the pre-trained language model used is BERT-base-Chinese, which consists of 12 stacked Transformer encoding layers, each containing 12 attention heads, and the hidden layer dimension is... The model has 768 parameters and a total of approximately 110M parameters. It is pre-trained using Chinese Wikipedia and general Chinese corpora, and can provide character-level or sub-word-level hidden vector representations with rich contextual semantics for the input text. When training the entity relation joint extraction model of this application, some or all of the parameters of this pre-trained model can be fine-tuned according to the specific task.

[0159] 2) Based on the first The term components corresponding to each standardized term constitute a tag vector. Through a trainable component embedding matrix By performing dense vector mapping on the components of the terminology, we obtain the representation of the terminology components. ,Right now .

[0160] in, It refers to the first A terminology component representation for a standardized term, used to encode the modifier components and core category components contained in the standardized term, with dimensions of [dimensions missing]. ; It is a trainable component embedding matrix with dimension . ; It refers to the first The terminology components of a standardized term constitute a tag vector; This indicates the total number of terminology components in the Zhangmoshi process terminology component library.

[0161] In practical implementation, the component embedding matrix The The corresponding component in the ink master's process terminology library. A dense embedding vector of term components. When term components constitute a label vector. When multiple positions in the matrix are set to 1, matrix multiplication superimposes the dense embedding vectors corresponding to multiple terminology components to obtain a terminology component representation that simultaneously contains both modifier component information and core category component information. For ordinary skill actions or ordinary words whose label vectors are all zeros, the term component represents... It is a vector consisting entirely of zeros.

[0162] It should be noted that, in order to enable the term component representation to perform element-wise gating fusion with pre-trained word vectors, the component embedding matrix... The output dimension is set to , to make the term component represent With pre-trained word vectors They have the same dimensions.

[0163] 3) Transfer the pre-trained word vectors With terms and components The concatenation is performed along the feature dimension, and the concatenation result is input into a gated linear transformation and a sigmoid activation function to obtain a gated vector. , represented as:

[0164] ;

[0165] in, Indicates the first A gating vector for each normalized term, where each component controls the fusion ratio of pre-trained word vectors and term component representations in the corresponding feature dimension; This represents the Sigmoid activation function; Represents pre-trained word vectors and terminology component representation The splicing result has the following dimensions. ; Let represent a trainable gated weight matrix with dimension . ; Let represent a trainable gated bias vector, with dimension . .

[0166] It should be noted that the gating vector By the The original surface semantics of a normalized term and the composition of its term components jointly determine its meaning. When a component in the gating vector is close to 1, the corresponding feature dimension mainly retains the pre-trained word vectors. The surface semantic information; when a component in the gate vector is close to 0, the corresponding feature dimension is mainly represented by terminology components. Information about the internal components.

[0167] 4) Based on gated vectors For pre-trained word vectors and terminology component representation Perform element-wise weighted fusion to obtain the fused embedding vector. , represented as: ;

[0168] in, It refers to the first The fusion embedding vector of the first normalized term represents the first normalized term after fusing the original surface semantic information and the internal component composition information. The final embedding representation of each normalized term has a dimension of . ; This represents element-wise multiplication; This represents a vector where all components are 1, with dimension . ; Its function is to characterize the terminology and component representation. The corresponding dimension-by-dimensional fusion ratio.

[0169] In one embodiment, as an example, when the original surface expression "bisection" is normalized to "bisection chisel", the pre-trained word vectors Used to preserve the original surface-level expression of "dichotomy" and its semantic information within its context, terminology component representation Simultaneously, the encoding modifies the component "binary" and completes the core category component "chisel". After training the entity relation joint extraction model, the expression of this type of core category component can be omitted, and the value of the corresponding component of the gating vector in the feature dimension related to the tool category can be reduced, so that the information of the core category component "chisel" is represented by the terminology component. Entering the fusion embedding vector This reduces tool entity category identification errors caused by core category components not appearing directly.

[0170] 5) Stack the fusion embedding vectors corresponding to all normalized terms according to the term order in the normalized term sequence to obtain the sequence input matrix, i.e.:

[0171] ;

[0172] In the formula, This represents the sequence input matrix of the input prosodic bias Transformer coding layer, with dimension 1. ; The The row corresponds to the first Fusion embedding vector of normalized terms ; Indicates the total number of terms in the normalized term sequence; This represents the dimension of the fused embedding vector. Sequence input matrix. It also contains the original surface semantic information of the text fragments of the master calligrapher's oral transmission of skills and the internal component information of standardized terminology.

[0173] It should be noted that the component-aware gating embedding layer does not append term component representations to pre-trained word vectors at a fixed ratio. Instead, it generates a dimension-wise gating vector based on the actual surface semantics of each normalized term and the composition of its term components. This design can increase the participation of term component information when core category components are omitted, while preserving the contextual information provided by the pre-trained language model in ordinary skill actions or when the surface semantics are already sufficiently expressed, thus avoiding interference from irrelevant features caused by uniformly superimposing term component information.

[0174] Step 2: Prosodic bias multi-head self-attention encoding;

[0175] To address the issue that standard Transformer encoders cannot distinguish between ordinary contextual adjacency and metrical parallelism, this invention utilizes an optimal prosodic boundary index set. Determine whether any two normalized terms belong to the same prosodic semantic unit, and calculate the degree of prosodic position correlation between normalized terms based on the prosodic position feature vector; then, superimpose the obtained prosodic bias value onto the scaled dot product score of multi-head self-attention, so that normalized terms with the same or similar metrical positions within the same prosodic semantic unit receive a higher relative attentional tendency. The specific steps are as follows:

[0176] 1) Input the sequence into the matrix Input the Transformer encoder. Specifically, for each attention head of each Transformer encoding layer in the Transformer encoder, perform query linear transformation, key linear transformation, and value linear transformation on the input of the current Transformer encoding layer to obtain the query vector, key vector, and value vector corresponding to each normalized term position, and calculate the basic attention score between any two normalized term positions based on the scaled dot product of the query vector and the key vector.

[0177] In the actual implementation, the query linear transformation, key linear transformation, value linear transformation, multi-head result concatenation, output linear transformation, residual connection, layer normalization and feedforward network all adopt the conventional processing method of Transformer encoder. Furthermore, the prosodic structure information is only added to the scaled dot product score in the form of prosodic bias value, without changing the main data flow and the dimensions of each hidden vector of Transformer encoder.

[0178] 2) Based on the optimal prosodic boundary index set , judge the first A standardized term and the A standardized term Whether they belong to the same prosodic semantic unit, obtain the unit indicator value. .

[0179] In practical implementation, when the first A standardized term and the A standardized term When the corresponding original surface character positions are within the same complete metrical template unit, Take 1; when the two are located in different metrical template units, Take 0.

[0180] It should be noted that for metrical templates containing internal sentence segments, such as four-six parallelism and four-character antithesis, the internal sentence segments have already been identified as the same prosodic semantic unit in the preceding text. Therefore, the same unit indicator value between the standardized term at the beginning of the preceding sentence and the standardized term at the beginning of the following sentence is 1, and the same unit indicator value between the standardized term at the end of the preceding sentence and the standardized term at the end of the following sentence is also 1.

[0181] 3) Based on the first Prosodic position feature vector of a normalized term By embedding a trainingable prosodic position projection matrix Perform a linear mapping to obtain the prosodic position projection vector. ,Right now .

[0182] in, Indicates the first The prosodic position projection vector of each normalized term, with dimension [missing information]. ; The trainable prosodic position embedding projection matrix has a dimension of . ; This indicates the dimension of the prosodic position projection, for example, 32; Indicates the first The prosodic position feature vector of a normalized term; This represents the dimension of the prosodic position feature vector.

[0183] It should be noted that the prosodic position is embedded in the projection matrix. This is used to map discrete prosodic position categories such as sentence beginning, sentence middle, and sentence end to a continuous vector space, enabling the entity relation joint extraction model to learn the degree of association between the same prosodic position and different prosodic positions during training.

[0184] 4) Combining the first The first standardized term and the first The position is calculated using the same unit indicator value of each normalized term and the cosine similarity between two prosodic position projection vectors. With position The prosodic offset values ​​between them are expressed as: ;

[0185] in, Indicates the first The first standardized term and the first Prosodic bias values ​​between normalized terms; This represents a non-negative trainable global prosodic intensity parameter used to adjust the overall influence of the prosodic bias relative to the base attention score; the initial value can be set to, for example, 0.1. Indicates the first The first standardized term and the first The same unit indicator value for each standardized term; Represents the prosodic position projection vector With prosodic position projection vector The cosine similarity between them; the "increment 1" operation is used to adjust the cosine similarity from... Translate to .

[0186] In practical implementation, when the first The first standardized term and the first When normalized terms do not belong to the same prosodic semantic unit, A value of 0 corresponds to the prosodic bias value. A value of 0 does not change the underlying attention score between the two. When the... The first standardized term and the first When two normalized terms belong to the same prosodic semantic unit, and both are located in the same position in the preceding and following antithetical phrases, the prosodic position projection vector... With prosodic position projection vector It has a high cosine similarity and corresponds to a prosodic bias value. Relatively large.

[0187] 5) Adjust the prosody bias value Stacked onto each Transformer encoding layer and each attention head position With position The corresponding scaled dot product score. For the th The th Transformer coding layer in the th The attention score, after adding prosodic bias values ​​to each attention head, is expressed as:

[0188] ;

[0189] In the formula, Indicates the first The Transformer coding layer, the... A position in the attention. Position Attention score; Indicates position The corresponding query vector; Indicates position The corresponding key vector; Indicates the dimensions of the query vector and key vector; Indicates position With position The prosodic bias value between them.

[0190] In practical implementation, for fixed positions All corresponding Along position The direction is normalized using Softmax to obtain the position. The attention weights at each position are then used to perform a weighted summation of the corresponding value vectors. Then, following the processing order of the Transformer encoder, the multi-head results are concatenated, the output linear transformation is performed, residual connections are established, layer normalization is implemented, and feedforward network processing is completed.

[0191] It should be noted that the same prosodic bias matrix can be shared across different Transformer encoding layers and different attention heads. The prosodic bias matrix only changes the relative magnitude of the attention scores, without altering the dimensions of the query vector, key vector, and value vector. By incorporating the prosodic bias value into each Transformer encoding layer, prosodic structural information can continuously participate in updating the contextual representation of normalized terms at different levels of semantic abstraction.

[0192] The Transformer coding layers employing a prosodic bias multi-head self-attention mechanism are stacked. Layers (e.g., can be set) After completing the context encoding of all Transformer encoding layers in sequence, the context representation matrix is ​​obtained, which is represented as follows:

[0193] ;

[0194] in, This refers to the context representation matrix output by the last Transformer encoding layer, with dimensions of 1. ; Indicates the first The context representation obtained after processing all Transformer encoding layers for each normalized term is derived from the input sequence's first normalized term. Each position (i.e., the fused embedding vector) )go through The final output vector obtained after encoding by the prosodic bias Transformer coding layer has a dimension of And the context indicates It also includes raw surface semantic information, term component composition information, general contextual dependencies, and prosodic structure association information.

[0195] In one embodiment, for example, the proverb "One axe splits the mountain, two shovels level the plain" is identified as a rhyming template consisting of two four-character internal phrases, and the two internal phrases are jointly labeled as a prosodic semantic unit. "One axe" and "two shovels" are located at the beginning of the preceding and following internal phrases, respectively, so their unit indices are set to 1, and their prosodic position projection vectors have a high cosine similarity, corresponding to a large prosodic bias value. "Splitting the mountain" and "leveling the plain" are located at the end of the preceding and following internal phrases, respectively, also obtaining a large prosodic bias value. Thus, the entity relation joint extraction model can enhance the tool-parallel semantic association between "one axe" and "two shovels," and the rhyming skill-action semantic association between "splitting the mountain" and "leveling the plain," reducing the probability of missing cross-segment entity relations due to relying solely on character distance.

[0196] It should be noted that the prosodic bias multi-head self-attention encoding does not construct a separate prosodic encoding network. Instead, it directly adds the prosodic bias value calculated based on the prosodic semantic unit and the prosodic position to the attention score of the Transformer encoder. This allows the structural correspondence within the complete antithetical template to directly affect the context information aggregation process while keeping the main structure of the Transformer encoder unchanged. This improves the stability of recognizing cross-segment entity relationships in low-resource texts.

[0197] Step 3: Joint decoding of entity recognition and relation extraction;

[0198] This sub-step performs entity recognition and entity relation classification simultaneously based on the context representation matrix output by the prosodic bias Transformer encoding layer. Entity recognition determines the boundaries and entity types of entities such as tools, processes, dimensions, components, and technical actions; relation extraction determines whether there are predefined entity relation types such as tool juxtaposition, tool purpose, process sequence, or others. The entity recognition and relation extraction tasks share the same context representation matrix and are trained end-to-end using a joint loss. The specific steps are as follows:

[0199] 1) The first Contextual representation of a standardized term Input entity recognition linear mapping layer, to obtain the first Each normalized term corresponds to an emission score for each entity label. Then, the emission scores of all normalized terms are stacked according to the term order in the normalized term sequence to obtain an emission score matrix, which is then input into the conditional random field layer.

[0200] In its implementation, the Conditional Random Field (CRF) layer scores the complete entity label sequence based on the trainable transition scores between adjacent entity labels and the emission scores at each normalized term position. During the training phase, the emission score matrix and the manually annotated entity label sequence are input into the CRF layer to calculate the negative log-likelihood loss for entity recognition. In the reasoning phase, Viterbi decoding is used to obtain the entity label sequence with the highest score, and the entity boundary and entity type are determined based on the entity label sequence.

[0201] It should be noted that the Conditional Random Field (CRF) layer can utilize the legitimate transition relationships between adjacent entity labels to reduce the probability of combinations that do not conform to the labeling system between entity start labels, entity internal labels, entity end labels, and non-entity labels. For example, when using the BIO labeling system, it can prevent tool entity internal labels from appearing directly in positions where there is no corresponding tool entity start label.

[0202] It should also be noted that the specific structure of the conditional random field layer consists of a trainable transition score matrix, with a matrix dimension of [missing information]. ,in The total number of entity labels (including B-type, I-type, and O-type labels) is represented by the total number of entity labels. Each element in the matrix represents the score for the transition from the entity label at the previous position to the entity label at the next position. This layer receives the emission scores for all entity labels at each position and combines them with the transition score matrix to solve for the optimal label sequence using the Viterbi algorithm.

[0203] 2) Obtain a candidate entity set based on entity boundaries and entity types, and then orderly combine the head and tail entities in the candidate entity set to form candidate entity pairs to be classified; where the head entity is denoted as... The tail entity is denoted as .

[0204] In practice, during the training phase, entity candidate pairs can be constructed based on manually labeled entity boundaries to ensure that relation extraction loss can stably participate in model parameter updates; during the inference phase, entity candidate pairs can be constructed based on the entity recognition results output by the conditional random field layer.

[0205] In the training phase of entity relation extraction, in addition to constructing candidate entities based on manually labeled positive entity relations, negative samples also need to be constructed simultaneously. This allows the model to learn the feature boundaries of unrelated entity pairs. The negative samples are constructed as follows: for each text fragment of a master craftsman's oral transmission of skills, all manually labeled entities are obtained, and all possible ordered combinations of head and tail entities are enumerated. Entity pairs labeled as having entity relations are marked as positive samples, and all other unlabeled entity pairs are marked as negative samples. The entity relation label corresponding to the negative samples is "no relation". To avoid severe imbalance between positive and negative samples, negative samples are randomly downsampled during training to maintain the ratio of positive to negative samples within a preset range (e.g., 1:3 to 1:5) in each training batch. The relation extraction loss is calculated only for positive samples and the sampled negative samples, ensuring that the model can effectively distinguish between entity pairs with and without relations.

[0206] Furthermore, for each entity, the context representations corresponding to all normalized terms covered by that entity are averaged and pooled to obtain the entity pooled context representation; where the head entity... The entity pooling context is denoted as , dimension Tail entity The entity pooling context is denoted as , dimension .

[0207] In practical implementation, if the head entity The covered set of normalized terminology indexes is Then, the matrix is ​​represented from the context. Reading the index set The corresponding context representations are used, and the average value is calculated along the normalized terminology dimension to obtain the entity pooling context representation. And the tail entity The entity pooling context representation is obtained in the same way. .

[0208] Furthermore, obtain the head entity Tail-end entity The entity prosodic position vector. Specifically, for an entity containing only one normalized term, the prosodic position feature vector of that normalized term is directly used; for an entity containing multiple normalized terms, average pooling is performed on all prosodic position feature vectors covered by the entity. Head entity The entity prosodic position vector is denoted as , dimension Tail entity The entity prosodic position vector is denoted as , dimension .

[0209] It should be noted that the entity pooling context representation already includes term component composition information and prosodic structure association information. Therefore, no separate term component calculation module is added in the relation classification stage to avoid changing the original main structure of the entity relation joint extraction model.

[0210] 3) For each predefined entity relationship type The matching degree between the head entity pooling context representation and the tail entity pooling context representation is calculated using bilinear interaction terms. Then, the head entity pooling context representation, the tail entity pooling context representation, and the entity prosodic position vectors of the two entities are fused using linear terms to obtain the entity candidate pair in terms of entity relation type. The relationship score is expressed as follows:

[0211] ;

[0212] in, Refers to the entity With tail entity In entity relationship type The higher the relation score, the stronger the head entity. With tail entity There are entity relationship types The higher the probability; Indicates entity relationship type The corresponding trainable bilinear transformation matrix is ​​used to characterize the interaction relationship between the head entity pooling context representation and the tail entity pooling context representation across different semantic dimensions, with dimensions of . ; Indicates entity relationship type The corresponding trainable linear projection vector has a dimension of The concatenated vector is represented by the head entity pooling context. Tail entity pooling context representation Head entity prosodic position vector Summarizing entity prosodic position vector Formed by concatenating along the feature dimensions, the resulting dimension is ; Indicates entity relationship type The corresponding trainable scalar bias.

[0213] It should be noted that bilinear interaction terms (i.e.) This matrix is ​​used to capture the combination relationships between head and tail entities across different semantic dimensions. Instead of simply measuring the similarity between two vectors, it acts as a trainable projection operator, first mapping the head entity vector to a vector specific to the "relationship". The semantic space of "tool purpose" (e.g., "tool purpose" requires the head entity to have the "use" attribute) is then used to calculate the dot product with the tail entity vector in this new space, thereby capturing deep relationship couplings that cannot be discovered by surface semantic similarity alone; and the linear term, i.e.:

[0214] ;

[0215] This linear term is used to supplement the influence of the semantics of the head entity itself, the semantics of the tail entity itself, and the prosodic positions of the two entities on entity relation determination. This is achieved by directly linking information such as the head entity, the tail entity, and their prosodic positions to a trainable weight vector. Perform weighted combination and independently assign relation types to each feature dimension. The importance score is then added to the bias score. This allows the model to directly learn the fundamental contribution of the prior pattern "a certain type of entity appears in a specific prosodic position" to relation determination, even without entity interactions. For example, when two tool entities are located at the beginning of the corresponding sentence in the same antithetical metrical template, the entity pooling context representation can provide tool category and contextual semantics, and the entity prosodic position vector can provide antithetical position consistency, thereby improving the accuracy of determining the parallel relationship between tools.

[0216] 4) Input the relation scores corresponding to each entity relation type into the Sigmoid function to obtain the head entity. With tail entity Relationship probabilities under each entity relationship type.

[0217] In the specific implementation, during the training phase, the relation probabilities corresponding to each entity relation type are compared with manually labeled entity relation tags, and binary cross-entropy is used to calculate the relation extraction loss. By employing the Sigmoid function and binary cross-entropy loss, we can determine whether each entity relation type is valid, enabling the same entity candidate pair to correspond to one or more entity relation types according to the labeling rules.

[0218] And in the inference phase, the relation probability is compared with a preset relation determination threshold; when the relation probability corresponding to a certain entity relation type is not less than the preset relation determination threshold, the entity relation type is determined as the entity relation type between the head entity and the tail entity ; when the relation probabilities corresponding to all entity relation types are less than the preset relation determination threshold, it is determined that no predefined entity relation exists for the current entity candidate pair.

[0219] In one embodiment, by way of example, for the head entity "one axe" and the tail entity "two plane" identified from the phrase "One axe splits the mountain, two planes level the ground", the model calculates that their relation probability under the tool parallel relation is 0.91, which exceeds the preset threshold of 0.5, so it is determined that the two have a tool parallel relation. Meanwhile, the probabilities calculated for all other relation types of them are lower than the threshold, so no other relations are added to them.

[0220] Further, the joint loss of the entity relation joint extraction model is calculated based on the entity recognition loss and the relation extraction loss, which is expressed as: ;

[0221] wherein, represents the joint loss of the entity relation joint extraction model; represents the negative log-likelihood loss for entity recognition; represents the binary cross-entropy loss for relation extraction; represents the relation extraction loss weight coefficient, which is used to balance the influence of the entity recognition task and the relation extraction task on the parameter update of the model, for example, it can be 0.5.

[0222] 5) Based on the joint loss perform back propagation, and update the parameters involved in training in the pre-trained language model, the component embedding matrix , the gated weight matrix , the gated bias vector , the prosody position embedding projection matrix , the global prosody intensity parameter , the Transformer encoder parameters, the conditional random field layer parameters and the relation classification parameters.

[0223] In specific implementation, during the training process, the joint loss is calculated according to the entity label sequences and entity relation labels in the training sample set of the oral craftsmanship of master carpenters, and the trainable parameters of the entity relation joint extraction model are continuously updated until the performance of entity recognition and entity relation extraction on the verification set no longer improves, so as to obtain the trained entity relation joint extraction model.

[0224] It should be noted that the terminology component library of the master craftsman, the co-occurrence statistics of terminology components, the mnemonic and rhythmic template library of the master craftsman, the standardized terminology sequence, the terminology component composition label matrix, the prosodic position feature matrix, and the optimal prosodic boundary index set are all used as deterministic domain structured priors and do not participate in backpropagation.

[0225] It should also be noted that the entity recognition task and the relation extraction task share the context representation output by the component-aware gated embedding layer and the prosodic bias Transformer encoding layer. The entity recognition loss ensures that the context representation preserves entity boundary and entity category information, while the relation extraction loss ensures that the context representation preserves semantic interactions and prosodic correspondences between entities. Through joint training, the feature inconsistencies caused by training the entity recognition model and the relation extraction model separately can be avoided, and the terminology component prior and the prosodic structure prior can simultaneously serve entity boundary recognition and entity relation classification.

[0226] It should also be noted that the specific hierarchical structure of the entity relation joint extraction model is shown in Table 1 below:

[0227] Table 1. Specific Hierarchical Structure of the Entity Relationship Joint Extraction Model

[0228] S4. Input the text fragment of the oral skills passed down by the master ink master to be extracted into the trained entity relation joint extraction model to obtain the knowledge triplet of the oral skills passed down by the master ink master, which includes entity boundary, entity type and entity relation type; and construct the knowledge graph of the oral skills passed down by the master ink master based on the knowledge triplet of the oral skills passed down by the master ink master.

[0229] Specifically, after the model training is completed, the text fragments of the oral techniques passed down by the master calligraphers to be extracted are sequentially input into S2 and S3. First, by performing compound term fragment discovery and normalization on the text fragments of the oral techniques passed down by the master calligraphers to be extracted, a normalized term sequence and a term component label matrix are obtained. By performing prosodic structure parsing on the original surface character sequence, a prosodic position feature matrix and an optimal prosodic boundary index set are obtained. Then, the normalized term sequence, the term component label matrix, the prosodic position feature matrix, and the optimal prosodic boundary index set are input into the trained entity relation joint extraction model to obtain the entity boundaries, entity types, and entity relation types between entities.

[0230] Furthermore, the standardized terminology name corresponding to the entity is read based on the entity boundary, and the character position correspondence between the standardized terminology and the original surface expression is preserved. Knowledge triplets of the oral tradition of the master inscription master are formed in the order of head entity, entity relation type, and tail entity. For entities that omit core category components in the original surface expression, the knowledge triplets use the completed standardized terminology name, while simultaneously recording the corresponding original surface expression and original character position to support the tracing of knowledge retrieval results back to the original text fragment of the oral tradition of the master inscription master.

[0231] This paper summarizes the knowledge triplets of oral ink-making techniques extracted from multiple text fragments of these techniques. Then, based on standardized terminology and standard names, it merges entity nodes pointing to the same ink-making craft object, resulting in a knowledge graph of oral ink-making techniques. This knowledge graph can be used for ink-making tool knowledge retrieval, process association queries, technique mnemonic analysis, digital organization of intangible cultural heritage, and auxiliary teaching of ink-making techniques.

[0232] In one embodiment, as an example, from the mnemonic fragment "First use a two-part chisel to make a circle at the bottom, then use a three-part chisel to clean the bottom," knowledge triplets are extracted through S2 and S3: "two-part chisel - tool purpose - make a circle," "three-part chisel - tool purpose - clean the bottom," and "make a circle - process sequence - clean the bottom." Simultaneously, from another mnemonic fragment "two-part chisel blade width is two parts," triplets are extracted: "two-part chisel - size - two parts (blade width)." Based on standardized terminology, the head entity "two-part chisel" in multiple triplets is merged into a single entity node. In the final constructed knowledge graph of the master ink maker's oral skills, the "two-part chisel" node is associated with attributes and relationships such as "tool purpose - make a circle" and "size - two parts (blade width)," and there is a "process sequence" relationship between the "make a circle" and "clean the bottom" nodes, collectively forming a retrieval and reasoning-enabled knowledge network of the master ink maker's craftsmanship. Figure 2 The image shown is a visualization example of the constructed knowledge graph.

[0233] According to a second embodiment of the present invention, a knowledge graph construction system for knowledge of oral transmission techniques of ink masters is provided, the system comprising:

[0234] The text collection and annotation module is used to collect the text of the oral transmission of skills by master calligraphers and to form a training sample set of oral transmission skills by annotating the text.

[0235] The domain terminology discovery and prosodic structure parsing module is used to parse text fragments of oral techniques passed down by master craftsmen based on a pre-built library of master craftsmen's craft terminology components and a library of master craftsmen's mnemonic rhymes and metrical templates, in order to generate a standardized term sequence, a term component composition label matrix, and a prosodic position feature matrix. The parsing process adopts forward maximum matching and backward maximum matching recognition methods and a dynamic programming method for text fragments.

[0236] The model building and training module is used to build an entity relation joint extraction model and input the standardized term sequence, term component label matrix and prosodic position feature matrix into the entity relation joint extraction model for end-to-end training.

[0237] The knowledge graph construction module is used to input the text fragments of the oral skills of the master ink master to be extracted into the trained entity relation joint extraction model, and obtain the knowledge triples of the oral skills of the master ink master that include entity boundaries, entity types and entity relation types; and construct the knowledge graph of the oral skills of the master ink master based on the knowledge triples of the oral skills of the master ink master.

[0238] 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 descriptions are merely specific embodiments of the present invention and are 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 constructing a knowledge graph of oral transmission techniques for master ink makers, characterized in that, The method includes the following steps: S1. Collect the oral transmission texts of ink masters, and annotate the oral transmission texts to form a training sample set of ink masters' oral transmission techniques. S2. Based on the pre-built terminology component library and rhyme template library of the master ink master, the text fragments of the master ink master's oral skills are parsed and processed to generate a standardized term sequence, a term component composition label matrix and a rhyme position feature matrix. The parsing and processing adopts the forward maximum matching and backward maximum matching recognition methods and the dynamic programming method of the text fragments. S3. Construct an entity relation joint extraction model, and input the standardized term sequence, term component label matrix and prosodic position feature matrix into the entity relation joint extraction model for end-to-end training; S4. Input the text fragment of the oral skills passed down by the master ink master to be extracted into the trained entity relation joint extraction model to obtain the knowledge triplet of the oral skills passed down by the master ink master, which includes entity boundary, entity type and entity relation type; and construct the knowledge graph of the oral skills passed down by the master ink master based on the knowledge triplet of the oral skills passed down by the master ink master.

2. The method for constructing a knowledge graph for oral transmission of ink-making skills according to claim 1, characterized in that, S2 includes the following steps: S21. Based on the pre-organized terminology of ink masters, and by dividing the terminology of ink masters into decorative components and core category components, construct a component library of ink masters' terminology. S22. Based on the component library of the master craftsman's craft terminology, take the text fragments of the master craftsman's oral skills as input, and perform forward maximum matching and reverse maximum matching respectively to obtain component candidate pairs. S23. Based on the component joint probability, component marginal probability and category compatibility relationship, calculate the combination tightness score for each component candidate pair, and determine the optimal term segmentation scheme according to the combination tightness score. Standardize the term expression in the text fragment of the master calligrapher's oral skills, and generate a standardized term sequence and term components to form a label matrix. S24. Based on the pre-organized mnemonic rhymes of the master calligrapher, construct a mnemonic rhyme template library for the master calligrapher; S25. For the text fragments of oral transmission techniques by the master calligrapher, the original surface character sequence is obtained by deleting punctuation marks that do not participate in the calculation of the number of characters in the meter and retaining the original positions of the punctuation marks. S26. Based on the Zhangmoshi mnemonic metrical template library, dynamic programming is used to perform metrical template matching on the original surface character sequence to determine the optimal prosodic boundary index set. Based on the optimal prosodic boundary index set, the prosodic semantic unit and prosodic position category of each normalized term are labeled, and a prosodic position feature matrix is ​​generated.

3. The method for constructing a knowledge graph for oral transmission of ink-making skills according to claim 2, characterized in that, S22 includes the following steps: S221. Take the text fragment of the oral transmission of the master ink master as input, perform forward maximum matching to read backward from the starting character of the text fragment of the oral transmission of the master ink master, and select the longest term component that matches the term component in the term component library of the master ink master's craftsmanship at the current position. S222. Take the same text fragment of the oral transmission of the master ink master as input, perform reverse maximum matching to read backward from the last character of the text fragment of the oral transmission of the master ink master, and select the longest term component that matches the term component in the term component library of the master ink master's craftsmanship at the current position. S223. Merge the longest term component of the forward maximum matching and the longest term component of the reverse maximum matching to obtain a set of component candidate segments; S224. For each component candidate segment in the component candidate segment set, when only a modification component is identified in the component candidate segment but no core category component is identified, according to the allowed combination relationship recorded in the component library of the master craftsman's process terminology, all core category components that can be combined with the modification component are retrieved, and the modification component is combined with each retrieved core category component to form a component candidate pair to be evaluated.

4. The method for constructing a knowledge graph for oral transmission of ink-making skills according to claim 2, characterized in that, S23 includes the following steps: S231. For each candidate pair of components, calculate the combination tightness score by analyzing the component joint probability, component marginal probability and category compatibility. S232. Based on the combination tightness score and the preset term judgment threshold, determine the optimal term segmentation scheme; S233. The terminology in the oral transmission text of the master ink master is standardized using the optimal terminology segmentation scheme to form standardized terms. The standardized terms are then arranged in the order of their appearance in the oral transmission text to obtain a standardized terminology sequence. S234. For each standardized term, generate a term component composition label vector based on its included modifiers and core category components, and construct a term component composition label matrix based on the term component composition label vector.

5. The method for constructing a knowledge graph for oral transmission of ink-making skills according to claim 2, characterized in that, S26 includes the following steps: S261. Starting from the beginning position of the original surface character sequence, compare the different metrical templates in the Master of Calligraphy's metrical template library with the character segments after the current position in turn. For each character segment to be compared, calculate the matching degree of the number of characters, the matching degree of tone, and the matching degree of rhyme. S262. Calculate the template matching score between each candidate prosodic semantic unit and the corresponding metrical template based on the matching degree of word count, the matching degree of tone, and the matching degree of rhyme. S263. Based on template matching scores, a dynamic programming algorithm is used to globally optimize the entire original surface character sequence to determine the prosodic semantic unit partitioning scheme that maximizes the total matching score, thereby obtaining the optimal prosodic boundary index set and the corresponding optimal prosodic template type set. S264. Based on the optimal prosodic boundary index set, the original surface character sequence is divided into multiple prosodic semantic units. For each normalized term, its prosodic semantic unit and prosodic position category within the unit are determined, and a prosodic position feature matrix is ​​generated.

6. The method for constructing a knowledge graph for oral transmission of ink-making skills according to claim 5, characterized in that, S263 includes the following steps: S2631. Using the effective character positions in the original surface character sequence as the dynamic programming state, starting from the beginning position of the original surface character sequence, traverse sequentially to the end position; for the current end position, sequentially obtain the number of effective characters specified by each metrical template in the Master of Calligraphy's Prosody Template Library, determine the candidate starting position based on the number of effective characters, and extract the original surface character sequence between the candidate starting position and the current end position as the candidate prosodic semantic unit; S2632. When the number of effective characters, the position of the internal sentence segment, and the tonal rhyme conditions of the candidate prosodic semantic unit meet the preset basic requirements of the corresponding metrical template, calculate the template matching score between the candidate prosodic semantic unit and the corresponding metrical template, and add the template matching score to the maximum cumulative template matching score before the candidate starting position to obtain the cumulative template matching score under the current candidate segmentation scheme. S2633. For multiple candidate starting positions and multiple metrical template types corresponding to the same ending position, retain the candidate starting position and metrical template type with the highest cumulative template matching score. S2634. After traversing the entire original surface character sequence, starting from the position of the last valid character, the start and end positions and metrical template types of each prosodic semantic unit are recovered in reverse according to the saved optimal predecessor position, so as to obtain the optimal prosodic boundary index set and the corresponding optimal metrical template type set.

7. The method for constructing a knowledge graph for oral transmission of ink-making skills according to claim 1, characterized in that, S3 includes the following steps: S31. Construct an entity-relation joint extraction model that includes a component-aware gating embedding layer, a prosodic bias Transformer encoding layer, and a joint decoding layer for entity recognition and relation extraction. S32. The standardized term sequence and term components are used to form a label matrix input component perception gated embedding layer. The gated vectors are weighted and fused element by element to obtain the fused embedding vector. All fused embedding vectors are stacked into a sequence input matrix. S33. Input the sequence input matrix into the Transformer encoder, calculate the prosodic bias value between any two normalized terms based on the optimal prosodic boundary index set and prosodic position feature vector, and superimpose the prosodic bias value into the self-attention score of the Transformer encoder. After multi-layer encoding, the context representation of each normalized term is obtained. S34. Input the context representation into the joint decoding layer of entity recognition and relation extraction, perform entity recognition and entity relation classification, and update all trainable parameters of the joint entity relation extraction model through backpropagation until the joint entity relation extraction model converges, thereby completing the training of the joint entity relation extraction model.

8. The method for constructing a knowledge graph for oral transmission of ink-making skills according to claim 7, characterized in that, S32 includes the following steps: S321. According to the terminology order in the standardized terminology sequence, read the original surface expression corresponding to each standardized term, and input the text fragment of the oral transmission technique of the master of ink containing the original surface expression into the pre-trained language model to obtain the pre-trained word vector of each standardized term. S322. Based on the term components corresponding to each standardized term, a label vector is constructed. Dense vector mapping is performed through a trainable component embedding matrix to obtain the term component representation of each standardized term. S323. After concatenating the pre-trained word vectors and term component representations along the feature dimension, input the gated linear transformation and the Sigmoid activation function to obtain the gated vector; S324. Based on the gated vector, perform element-wise weighted fusion of the pre-trained word vectors and term component representations for each normalized term to obtain the fused embedding vector; S325. Stack the fusion embedding vectors corresponding to all normalized terms according to the term order in the normalized term sequence to obtain the sequence input matrix.

9. A method for constructing a knowledge graph for oral transmission of ink-making skills according to claim 7, characterized in that, S33 includes the following steps: S331. Input the sequence input matrix into the Transformer encoder, and obtain the query vector, key vector and value vector corresponding to each normalized term position by performing linear transformations of query, key and value. Calculate the basic attention score between any two normalized term positions based on the scaled dot product of the query vector and the key vector. S332. Based on the optimal prosodic boundary index set, determine whether any two normalized terms belong to the same prosodic semantic unit and generate the same unit indicator value; based on the prosodic position feature vector of each normalized term, perform linear mapping through a trainable prosodic position embedding projection matrix to obtain the prosodic position projection vector of each normalized term. S333. For any two normalized terms, calculate the prosodic bias value by combining the cosine similarity between the unit indicator value and the prosodic position projection vector. S334. The prosodic bias value is superimposed on the base attention score at the corresponding position in each Transformer encoding layer and each attention head, and after multi-layer encoding processing, the context representation of each normalized term is obtained.

10. A method for constructing a knowledge graph for oral transmission of ink-making skills according to claim 7, characterized in that, S34 includes the following steps: S341. Input the context representation of each normalized term into the entity recognition linear mapping layer to obtain the emission score of each entity label. Input all emission scores into the conditional random field layer to decode and obtain the entity boundary and entity type, forming an entity candidate set. S342. The head entity and tail entity in the entity candidate set are ordered to form entity candidate pairs. The context representations covered by the head entity and tail entity in each entity candidate pair are pooled to obtain the head entity pooled context representation and the tail entity pooled context representation. S343. For each predefined entity relationship type, calculate the matching degree between the head entity pooling context representation and the tail entity pooling context representation using bilinear interaction terms, and fuse the head entity pooling context representation, the tail entity pooling context representation, and the entity prosodic position vectors of the two entities using linear terms to obtain the relationship score of the entity candidate pair under the entity relationship type, and map each relationship score to a relationship probability. S344. Calculate the entity recognition loss based on the emission score and the manually labeled entity tag sequence, calculate the relation extraction loss based on the relation probability and the manually labeled entity relation tags, calculate the joint loss based on the weighted sum of the entity recognition loss and the relation extraction loss, update all trainable parameters of the entity relation joint extraction model through backpropagation until the entity relation joint extraction model converges, and complete the training.