A term recognition method and system based on large language model
Through word segmentation processing based on a large language model and a three-layer stacked bidirectional long-short-term neural network, the problem that feature engineering is difficult to capture changes in word context is solved, and more accurate term recognition is achieved.
Patent Information
- Application Number
- CN202411584298.5
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-11-07
- Publication Date
- 2025-09-12
- Estimated Expiration
- 2044-11-07
AI Technical Summary
In the existing technology, the manually designed features of feature engineering are difficult to fully capture the changes in the meaning of words in different contexts, resulting in insufficient accuracy in term recognition.
A method based on a large language model is adopted to calculate the probability value of text data belonging to a term through word segmentation processing, extraction of word segmentation features, and the use of the N-gram model and a three-layer stacked bidirectional long-short-term neural network. Term recognition is achieved by combining weighted word vectors and comprehensive latent states.
It improves the accuracy of term recognition, can more comprehensively capture the long-distance dependencies and word importance in the text, and improves the effect of term recognition.
Smart Images

Figure CN119441483B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of data storage technology, and in particular to a term recognition method and system based on a large language model. Background Art
[0002] Accurately identifying terms in a vast amount of policy documents and legal literature can improve information retrieval. Users can more quickly find documents and clauses related to specific terms, saving time and improving work efficiency.
[0003] Traditional terminology recognition often relies on manual retrieval, which is not only time-consuming and labor-intensive, but also limited by human energy, resulting in low accuracy in terminology recognition.
[0004] With the rapid development of science and technology, more and more modern technologies are being applied to terminology recognition. Large language models have powerful language generation, text understanding and context processing capabilities, and are widely used in various natural language processing tasks.
[0005] Current large language models primarily use feature engineering to extract text features for term recognition, and then identify terms based on these features. However, the manually designed features in feature engineering typically only capture certain aspects of the text and struggle to fully cover all potential, useful information. In particular, it is difficult to capture the changing meanings of words in different contexts, resulting in a need to improve the accuracy of term recognition. Summary of the Invention
[0006] In order to solve the technical problem that the manually designed features used in feature engineering in the existing technology can usually only capture certain aspects of information in the text, it is difficult to fully cover all potential and useful information, especially it is difficult to capture the changes in the meaning of words in different contexts, resulting in the accuracy of term recognition still needs to be improved, the present invention provides a term recognition method and system based on a large language model.
[0007] The technical solutions provided by the embodiments of the present invention are as follows:
[0008] First aspect:
[0009] An embodiment of the present invention provides a term recognition method based on a large language model, comprising:
[0010] S1: Obtain the text data to be recognized;
[0011] S2: performing word segmentation processing on the text data to be recognized;
[0012] S3: extract the segmentation features of each segmentation obtained by the segmentation process;
[0013] S4: Using the segmentation features of each segmentation, the weighted word vector of each segmentation is extracted through the N-gram large language model based on term weights;
[0014] S5: Based on the weighted word vectors of each word segmentation, a three-layer stacked bidirectional long-short-term neural network is used to calculate the probability value of the text data to be recognized belonging to the term;
[0015] S6: Determine whether the probability value of the text data to be recognized belonging to a term is greater than a preset probability value; if so, determine the text data to be recognized as a term; otherwise, determine the text data to be recognized as a non-term.
[0016] Second aspect:
[0017] An embodiment of the present invention provides a term recognition system based on a large language model, comprising:
[0018] processor;
[0019] A memory having computer-readable instructions stored thereon, wherein when the computer-readable instructions are executed by the processor, the term recognition method based on the large language model as described in the first aspect is implemented.
[0020] The third aspect:
[0021] An embodiment of the present invention provides a computer-readable storage medium having a computer program stored thereon. When the program is executed by a processor, the method for term recognition based on a large language model as described in the first aspect is implemented.
[0022] The beneficial effects brought about by the technical solution provided by the embodiment of the present invention include at least:
[0023] (1) In the present invention, a three-layer stacked bidirectional long short-term neural network can capture long-distance dependencies in the text from both the forward and backward directions, providing more comprehensive contextual information, helping to identify complex terms and improving the accuracy of term recognition.
[0024] (2) In the present invention, the segmentation features of each segmentation word obtained by the segmentation process are extracted, and the segmentation features of each segmentation word are used to extract the weighted word vector of each segmentation word through the N-gram large language model based on the term weight. This can better reflect the importance of each word in the entire text. Through the weighted word vector, important terms can be highlighted and irrelevant high-frequency words can be ignored, thereby improving the accuracy of term recognition. BRIEF DESCRIPTION OF THE DRAWINGS
[0025] In order to more clearly illustrate the technical solutions in the embodiments of the present invention, the following briefly introduces the drawings required for use in the description of the embodiments. Obviously, the drawings described below are only some embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without creative work.
[0026] Figure 1 A flowchart of a term recognition method based on a large language model provided by an embodiment of the present invention;
[0027] Figure 2 A schematic diagram of the structure of a term recognition system based on a large language model provided by an embodiment of the present invention. DETAILED DESCRIPTION
[0028] The technical solution of the present invention is described below in conjunction with the accompanying drawings.
[0029] In the embodiments of the present invention, words such as "exemplarily" and "for example" are used to indicate examples, illustrations, or explanations. Any embodiment or design described as an "exemplary" in the present invention should not be interpreted as being preferred or advantageous over other embodiments or designs. Rather, the use of the word "exemplary" is intended to present concepts in a concrete manner. Furthermore, in the embodiments of the present invention, "and / or" can mean both or either of the two.
[0030] In the embodiments of the present invention, the terms "image" and "picture" may sometimes be used interchangeably. It should be noted that, when the distinction is not emphasized, the meanings they convey are the same. The terms "of," "corresponding," and "corresponding" may sometimes be used interchangeably. It should be noted that, when the distinction is not emphasized, the meanings they convey are the same.
[0031] In the embodiments of the present invention, sometimes a subscript such as W1 may be mistakenly written as a non-subscript form such as W1. When the difference is not emphasized, the meanings to be expressed are the same.
[0032] In order to make the technical problems, technical solutions and advantages to be solved by the present invention clearer, a detailed description will be given below with reference to the accompanying drawings and specific embodiments.
[0033] Reference Manual Figure 1 , which shows a flow chart of a term recognition method based on a large language model provided by an embodiment of the present invention.
[0034] An embodiment of the present invention provides a method for identifying terms based on a large language model. This method can be implemented by a device for identifying terms based on a large language model, which can be a terminal or a server. The processing flow of the method for identifying terms based on a large language model may include the following steps:
[0035] S1: Obtain the text data to be recognized.
[0036] S2: Perform word segmentation on the text data to be recognized.
[0037] Optionally, the text data to be identified can be segmented using technologies such as regular expressions, maximum matching (MM), bidirectional maximum matching (BMM), hidden Markov model (HMM), and conditional random field (CRF).
[0038] S3: Extract the segmentation features of each segmentation word obtained by the segmentation process.
[0039] Optionally, the word segmentation features include: word frequency TF feature, word frequency-inverse document frequency TF-IDF feature, inverse gravity moment IGM feature, odds ratio OR feature, related frequency RF feature, balanced distribution concentration BDC feature, etc.
[0040] Optionally, the TF feature is specifically:
[0041]
[0042] in, TF i Indicates the i TF features of word segmentation, c i Indicates the i The number of times a participle appears, n Indicates the total number of participles.
[0043] Optionally, the TF-IDF feature is specifically:
[0044]
[0045] in, TFIDF i Indicates the i TF-IDF features of word segments, IDF i Indicates the i The reverse information frequency of each word, DIndicates the total number of texts, D i Indicates that it contains i The total number of texts with word segments.
[0046] Optionally, the IGM features are:
[0047]
[0048] in, IGM i Indicates the i IGM features of word segmentation, p j Indicates the i The first word in the text j The position of the first occurrence, , m i Indicates the i The total number of times a word appears in the text, G w Indicates the center of gravity of the position.
[0049] S4: Using the segmentation features of each segmentation, the weighted word vector of each segmentation is extracted through the N-gram large language model based on term weights.
[0050] In a possible implementation, S4 specifically includes sub-steps S401 to S403:
[0051] S401: Determine a weight parameter of each word segmentation according to the word segmentation features of each word segmentation.
[0052] Optionally, S401 specifically includes determining a weight parameter of each word segmentation according to the following formula:
[0053]
[0054] in, oh i Indicates the i The weight parameter of each word segmentation, TF i Indicates the i TF features of word segmentation, TFIDF i Indicates the i TF-IDF features of word segments, IGM i Indicates the i IGM features of word segmentation, l 1 represents the fusion coefficient of TF features, l 2 represents the fusion coefficient of TF-IDF features, l 3 represents the fusion coefficient of IGM features.
[0055] Among them, those skilled in the art can set the fusion coefficient of TF features according to actual conditions. l 1. Fusion coefficient of TF-IDF features l 2 and the fusion coefficient of IGM features l The size of 3 is not limited in the present invention.
[0056] In the present invention, by comprehensively utilizing the term frequency (TF), term frequency-inverse document frequency (TF-IDF) and inverse gravity moment (IGM) features, and combining them with appropriate fusion coefficients, the weight parameters of each word segmentation can be accurately calculated, which can effectively highlight the importance of terms in the text and ignore irrelevant high-frequency words, thereby improving the accuracy of term recognition.
[0057] S402: Determine multiple triple word vectors of each word in different sliding windows using the N-gram large language model and combining the weight parameters of each word segmentation.
[0058] The N-gram model is a statistical method used to capture word order information in text. It models language by calculating the frequency of occurrence of consecutive word sequences of a fixed length N (i.e., N-grams).
[0059] Optionally, S402 specifically includes: determining multiple triple word vectors of each word in different sliding windows according to the following formula in combination with weight parameters of each word segmentation:
[0060]
[0061] in, V 1i Indicates the i The first triplet word vector of the word segmentation, oh i Indicates the i The weight parameter of each word segmentation, v i Indicates the i word vectors of word segments, V 2i Indicates the i The second triplet word vector of the word segmentation, V 3i Indicates the i The third triplet word vector of the word segmentation.
[0062] Among them, word vector refers to the vectorized representation of word segmentation, which can be obtained through algorithms such as Word2Vec, FastText, and BERT.
[0063] In this paper, the use of the N-gram model, specifically trigrams, effectively captures the local context of words in text. This is crucial for understanding and identifying specific collocations and structures within terms. Generating trigram word vectors using different sliding windows captures the variations in words across different contexts, providing a multi-level feature representation and improving the model's ability to understand context.
[0064] S403: Perform weighted fusion on multiple triple word vectors to determine the weighted word vector of each word segment.
[0065] Optionally, S403 specifically includes: performing weighted fusion on multiple triple word vectors according to the following formula to determine the weighted word vector of each word segment:
[0066]
[0067] in, V i Indicates the i The weighted word vector of each word segmentation, α 1 represents the weight coefficient of the first triple word vector, α 2 represents the weight coefficient of the second triple word vector, α 3 represents the weight coefficient of the third triplet word vector.
[0068] Among them, those skilled in the art can set the weight coefficient of the first triple word vector according to actual conditions. α 1. Weight coefficient of the second triple word vector α 2 and the weight coefficient of the third triple word vector α The size of 3 is not limited in the present invention.
[0069] In the present invention, by weighted fusion of triple word vectors under different sliding windows, the information of word segmentation in multiple local contexts can be comprehensively considered, making the final weighted word vector richer and more comprehensive.
[0070] S5: Based on the weighted word vectors of each word segmentation, a three-layer stacked bidirectional long-short-term neural network is used to calculate the probability value of the text data to be identified belonging to the term.
[0071] The bidirectional long short-term memory (BiLSTM) neural network is an improved recurrent neural network (RNN) that processes sequence data by combining forward and backward long short-term memory (LSTM) neural networks. LSTM is a special type of RNN designed to address the long-term dependency issues inherent in standard RNNs. LSTM controls the flow of information by introducing a gating mechanism, including an input gate, a forget gate, and an output gate, thereby preserving long-term dependencies in sequence data.
[0072] It's important to note that each layer of the three-layer BiLSTM extracts features at a different level: the first layer primarily extracts low-level semantic information, the second layer extracts mid-level features, and the third layer extracts high-level abstract features. This multi-layered feature extraction approach enables the model to gain a deeper and more comprehensive understanding of text.
[0073] In a possible implementation, S5 specifically includes:
[0074] S501: Concatenate the weighted word vectors of each word segment to form a weighted word vector sequence of the text data to be recognized.
[0075] S502: Input the weighted word vector sequence of the text data to be recognized into a three-layer stacked bidirectional long-short term neural network to extract the comprehensive hidden state of the text data to be recognized.
[0076] Optionally, S502 specifically includes:
[0077] S5021: Input the weighted word vector sequence of the text data to be recognized into the first layer of the bidirectional long short-term neural network, perform forward learning, and obtain the first forward hidden state.
[0078] Specifically, for a certain layer of bidirectional long-term short-term neural network, the hidden state is extracted h , the hidden state obtained when the bidirectional long short-term memory neural network learns in the forward direction h is the forward hidden state, expressed as , the hidden state obtained when the bidirectional long short-term memory neural network learns in the backward direction h is the backward hidden state, expressed as :
[0079]
[0080] in, I t express t The activation output vector of the input gate at the moment, Sigmoid () represents the Sigmoid activation function, W XI Represents the weight matrix between the word segmentation sequence and the input gate, X t express t The weighted word vector input at each moment, W HI represents the weight matrix between the hidden state and the input gate, b I represents the bias term of the input gate, F t express t Always forget the activation output vector of the gate,W XF Represents the weight matrix between the word segmentation sequence and the forget gate, W HF represents the weight matrix between the hidden state and the forget gate, b F represents the bias term of the forget gate, O t express t The activation output vector of the output gate at time t, W XO Represents the weight matrix between the word segmentation sequence and the output gate, W HO represents the weight matrix between the hidden state and the output gate, b O represents the bias term of the output gate, C t express t The activation output vector of the cell storage unit at the moment, express t The candidate output vector of the cell storage unit at the moment, C t-1 express t -1 moment cell storage unit activation output vector, tanh() represents the tanh activation function, W XC Represents the weight matrix between the word segmentation sequence and the cell storage unit, W HC represents the weight matrix between the hidden state and the cell storage unit, b C represents the bias term of the cell storage unit, h t express t The hidden state of the moment, h t-1 express t The hidden state at time -1.
[0081] S5022: Input the first forward hidden state into the second-layer bidirectional long short-term neural network, perform forward learning, and obtain a second forward hidden state.
[0082] S5023: Input the second forward hidden state into the second-layer bidirectional long short-term neural network, perform forward learning, and obtain a third forward hidden state.
[0083] S5024: Input the weighted word vector sequence of the text data to be recognized into the first layer of the bidirectional long short-term neural network, perform backward learning, and obtain the first backward hidden state.
[0084] S5025: Input the first backward hidden state into the second-layer bidirectional long short-term neural network, perform backward learning, and obtain the second backward hidden state.
[0085] S5026: Input the second backward hidden state into the second-layer bidirectional long short-term neural network, perform backward learning, and obtain a third backward hidden state.
[0086] S5027: Fuse the third forward hidden state with the third backward hidden state to obtain a comprehensive hidden state:
[0087]
[0088] in, H t Represents the comprehensive hidden state of the text data to be recognized, Sigmoid () represents the Sigmoid activation function, W f represents the forward weight matrix, W b represents the backward weight matrix, represents the third forward hidden state, Represents the third backward hidden state.
[0089] In this paper, BiLSTM can simultaneously capture both forward and backward information in sequence data, allowing the model to fully understand the semantics of each word in its surrounding context. This is particularly effective when dealing with long-range dependencies and complex sentence structures. By stacking multiple layers of BiLSTM, the model can gradually extract higher-level abstract features, thereby more comprehensively understanding the semantics and structure of the text.
[0090] S503: Calculate the probability value of the text data to be recognized belonging to the term based on the comprehensive latent state of the text data to be recognized:
[0091]
[0092] in, P Represents the probability value of the text data to be identified belonging to the term, Sigmoid () represents the Sigmoid activation function, W h represents the weight matrix between the hidden layer and the classification layer, b h represents the classification layer bias term, H t Represents the comprehensive hidden state of the text data to be recognized.
[0093] In the present invention, the Sigmoid activation function is used to calculate the probability value of the text data to be identified belonging to the term, which can make full use of the high-level semantic information of the comprehensive latent state and improve the accuracy and robustness of classification.
[0094] S6: Determine whether the probability value of the text data to be recognized belonging to a term is greater than a preset probability value. If so, determine the text data to be recognized as a term. Otherwise, determine the text data to be recognized as a non-term.
[0095] Among them, those skilled in the art can set the size of the preset probability value according to actual conditions, and the present invention does not limit it.
[0096] In this paper, by calculating the probability that text data belongs to a term and comparing it with a preset probability threshold, we can achieve flexible, adjustable, and efficient term recognition. This method is not only simple and intuitive, but also provides probabilistic interpretation, adapting to different scenarios and needs, reducing false positives, and improving the practical application effect of the model.
[0097] The beneficial effects brought about by the technical solution provided by the embodiment of the present invention include at least:
[0098] (1) In the present invention, a three-layer stacked bidirectional long short-term neural network can capture long-distance dependencies in the text from both the forward and backward directions, providing more comprehensive contextual information, helping to identify complex terms and improving the accuracy of term recognition.
[0099] (2) In the present invention, the segmentation features of each segmentation word obtained by the segmentation process are extracted, and the segmentation features of each segmentation word are used to extract the weighted word vector of each segmentation word through the N-gram large language model based on the term weight. This can better reflect the importance of each word in the entire text. Through the weighted word vector, important terms can be highlighted and irrelevant high-frequency words can be ignored, thereby improving the accuracy of term recognition.
[0100] Reference Manual Figure 2 , which shows a structural diagram of a term recognition system based on a large language model provided by the present invention.
[0101] The present invention further provides a term identification system 20 based on a large language model, which is applied to the above-mentioned term identification method based on a large language model, comprising:
[0102] Processor 201;
[0103] The memory 202 stores computer-readable instructions. When the computer-readable instructions are executed by the processor 201 , the term recognition method based on the large language model as described in the method embodiment is implemented.
[0104] The large language model-based terminology recognition system 20 provided by the present invention can execute the above-mentioned large language model-based terminology recognition method and achieve the same or similar technical effects. To avoid repetition, the present invention will not elaborate on it.
[0105] The beneficial effects brought about by the technical solution provided by the embodiment of the present invention include at least:
[0106] (1) In the present invention, a three-layer stacked bidirectional long short-term neural network can capture long-distance dependencies in the text from both the forward and backward directions, providing more comprehensive contextual information, helping to identify complex terms and improving the accuracy of term recognition.
[0107] (2) In the present invention, the segmentation features of each segmentation word obtained by the segmentation process are extracted, and the segmentation features of each segmentation word are used to extract the weighted word vector of each segmentation word through the N-gram large language model based on the term weight. This can better reflect the importance of each word in the entire text. Through the weighted word vector, important terms can be highlighted and irrelevant high-frequency words can be ignored, thereby improving the accuracy of term recognition.
[0108] It should be understood that the processor in the embodiments of the present invention may be a central processing unit (CPU), but may also be other general-purpose processors, digital signal processors (DSP), application-specific integrated circuits (ASIC), field programmable gate arrays (FPGA), or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, etc. The general-purpose processor may be a microprocessor or any conventional processor, etc.
[0109] It should also be understood that the memory in the embodiments of the present invention may be volatile memory or non-volatile memory, or may include both volatile and non-volatile memory. The non-volatile memory may be read-only memory (ROM), programmable read-only memory (PROM), erasable programmable read-only memory (EPROM), electrically erasable programmable read-only memory (EEPROM), or flash memory. The volatile memory may be random access memory (RAM), which is used as an external cache. By way of example and not limitation, many forms of random access memory (RAM) are available, such as static RAM (SRAM), dynamic random access memory (DRAM), synchronous DRAM (SDRAM), double data rate SDRAM (DDR SDRAM), enhanced SDRAM (ESDRAM), synchronous link DRAM (SLDRAM), and direct rambus RAM (DR RAM).
[0110] The above embodiments can be implemented in whole or in part via software, hardware (e.g., circuits), firmware, or any other combination thereof. When implemented using software, the above embodiments can be implemented in whole or in part in the form of a computer program product. The computer program product comprises one or more computer instructions or computer programs. When loaded or executed on a computer, the processes or functions described in accordance with the embodiments of the present invention are fully or partially performed. The computer can be a general-purpose computer, a special-purpose computer, a computer network, or other programmable device. The computer instructions can be stored in a computer-readable storage medium or transmitted from one computer-readable storage medium to another. For example, the computer instructions can be transmitted from one website, computer, server, or data center to another website, computer, server, or data center via wired means (e.g., infrared, wireless, microwave, etc.). The computer-readable storage medium can be any available medium accessible by a computer or a data storage device such as a server or data center that contains a collection of one or more available media. The available medium can be magnetic media (e.g., floppy disks, hard disks, magnetic tapes), optical media (e.g., DVDs), or semiconductor media. The semiconductor media can be a solid-state drive.
[0111] It should be understood that the term "and / or" as used herein simply describes a relationship between associated objects, indicating that three possible relationships exist. For example, "A and / or B" can represent: A alone, A and B together, or B alone. A and B can be singular or plural. Furthermore, the character " / " as used herein generally indicates an "or" relationship between the associated objects, but it may also indicate an "and / or" relationship. For specific understanding, please refer to the context.
[0112] In this disclosure, "at least one" means one or more, and "plurality" means two or more. "At least one of the following" or similar expressions refers to any combination of these items, including any combination of single or plural items. For example, "at least one of a, b, or c" can mean: a, b, c, ab, ac, bc, or abc, where a, b, and c can be single or plural.
[0113] It should be understood that in various embodiments of the present invention, the size of the serial numbers of the above-mentioned processes does not mean the order of execution. The execution order of each process should be determined by its function and internal logic, and should not constitute any limitation on the implementation process of the embodiments of the present invention.
[0114] Those skilled in the art will appreciate that the units and algorithm steps of each example described in conjunction with the embodiments disclosed herein can be implemented in electronic hardware, or a combination of computer software and electronic hardware. Whether these functions are performed in hardware or software depends on the specific application and design constraints of the technical solution. Professionals and technicians can use different methods to implement the described functions for each specific application, but such implementation should not be considered beyond the scope of the present invention.
[0115] Those skilled in the art will clearly understand that, for the convenience and brevity of description, the specific working processes of the above-described equipment, devices and units can refer to the corresponding processes in the aforementioned method embodiments and will not be repeated here.
[0116] In the several embodiments provided by the present invention, it should be understood that the disclosed devices, apparatuses and methods can be implemented in other ways. For example, the device embodiments described above are merely illustrative. For example, the division of the units is merely a logical function division. In actual implementation, there may be other division methods, such as multiple units or components can be combined or integrated into another device, or some features can be ignored or not executed. Another point is that the mutual coupling or direct coupling or communication connection shown or discussed can be through some interface, indirect coupling or communication connection of the device or unit, which can be electrical, mechanical or other forms.
[0117] The units described as separate components may or may not be physically separate, and the components shown as units may or may not be physical units, that is, they may be located in one place or distributed across multiple network units. Some or all of these units may be selected to achieve the purpose of this embodiment according to actual needs.
[0118] In addition, each functional unit in each embodiment of the present invention may be integrated into one processing unit, or each unit may exist physically separately, or two or more units may be integrated into one unit.
[0119] If the functions are implemented as software functional units and sold or used as independent products, they can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of the present invention, or the portion that contributes to the prior art, or the portion of the technical solution, can be embodied in the form of a software product. This computer software product is stored in a storage medium and includes several instructions for enabling a computer device (which can be a personal computer, server, or network device, etc.) to execute all or part of the steps of the methods described in various embodiments of the present invention. The aforementioned storage media include various media that can store program code, such as USB flash drives, mobile hard drives, read-only memories (ROM), random access memories (RAM), magnetic disks, or optical disks.
[0120] An embodiment of the present invention provides a computer-readable storage medium having a computer program stored thereon. When the program is executed by a processor, the method for term recognition based on a large language model as described in the method embodiment is implemented.
[0121] The computer-readable storage medium provided by the present invention can implement the steps and effects of the term recognition method based on the large language model in the above method embodiment. To avoid repetition, the present invention will not go into details.
[0122] The beneficial effects brought about by the technical solution provided by the embodiment of the present invention include at least:
[0123] (1) In the present invention, a three-layer stacked bidirectional long short-term neural network can capture long-distance dependencies in the text from both the forward and backward directions, providing more comprehensive contextual information, helping to identify complex terms and improving the accuracy of term recognition.
[0124] (2) In the present invention, the segmentation features of each segmentation word obtained by the segmentation process are extracted, and the segmentation features of each segmentation word are used to extract the weighted word vector of each segmentation word through the N-gram large language model based on the term weight. This can better reflect the importance of each word in the entire text. Through the weighted word vector, important terms can be highlighted and irrelevant high-frequency words can be ignored, thereby improving the accuracy of term recognition.
[0125] The above description is merely a specific embodiment of the present invention, but the scope of protection of the present invention is not limited thereto. Any modifications or substitutions that can be easily conceived by a person skilled in the art within the technical scope disclosed in the present invention should be included in the scope of protection of the present invention. Therefore, the scope of protection of the present invention should be based on the scope of protection of the claims.
[0126] There are a few points to note:
[0127] (1) The drawings of the embodiments of the present invention only relate to the structures related to the embodiments of the present invention. Other structures may refer to conventional designs.
[0128] (2) For the sake of clarity, the thickness of layers or regions in the drawings used to describe the embodiments of the present invention are exaggerated or reduced, that is, these drawings are not drawn to scale. It is understood that when an element such as a layer, film, region, or substrate is referred to as being "on" or "under" another element, the element may be "directly on" or "under" the other element or intervening elements may be present.
[0129] (3) In the absence of conflict, the embodiments of the present invention and the features therein may be combined with each other to form new embodiments.
[0130] The above are only specific embodiments of the present invention, but the protection scope of the present invention is not limited thereto. The protection scope of the present invention shall be based on the protection scope of the claims.
Claims
1. A term recognition method based on a large language model, characterized in that: include: S1: Obtain the text data to be recognized; S2: performing word segmentation processing on the text data to be recognized; S3: extract the segmentation features of each segmentation obtained by the segmentation process; S4: Using the segmentation features of each segmentation, the weighted word vector of each segmentation is extracted through the N-gram large language model based on term weights; S5: Based on the weighted word vectors of each word segmentation, a three-layer stacked bidirectional long-short-term neural network is used to calculate the probability value of the text data to be recognized belonging to the term; S6: Determine whether the probability value of the text data to be identified belonging to the term is greater than a preset probability value; If so, the text data to be identified is determined as a term; Otherwise, the text data to be identified is determined as non-term; The S4 specifically includes: S401: Determine the weight parameters of each word segmentation according to the following formula: in, ω i Indicates the i The weight parameter of each word segmentation, TF i Indicates the i TF features of word segmentation, TFIDF i Indicates the i TF-IDF features of word segments, IGM i Indicates the i IGM features of word segmentation, λ 1 represents the fusion coefficient of TF features, λ 2 represents the fusion coefficient of TF-IDF features, λ 3 represents the fusion coefficient of IGM features; S402: Determine multiple triple word vectors of each word in different sliding windows according to the following formula in combination with the weight parameters of each word: in, V 1i Indicates the i The first triplet word vector of the word segmentation, ω i Indicates the i The weight parameter of each word segmentation, v i Indicates the i word vectors of word segments, V 2i Indicates the i The second triplet word vector of the word segmentation, V 3i Indicates the i The third triplet word vector of the word segmentation; S403: Perform weighted fusion on multiple triple word vectors according to the following formula to determine the weighted word vector of each word segment: in, V i Indicates the i The weighted word vector of each word segmentation, α 1 represents the weight coefficient of the first triple word vector, α 2 represents the weight coefficient of the second triple word vector, α 3 represents the weight coefficient of the third triplet word vector.
2. The term recognition method based on a large language model according to claim 1, characterized in that The word segmentation features include: word frequency TF feature, word frequency-inverse document frequency TF-IDF feature and inverse gravity moment IGM feature.
3. The term identification method based on a large language model according to claim 1, characterized in that: The S5 specifically includes: S501: concatenate the weighted word vectors of each word segment to form a weighted word vector sequence of the text data to be recognized; S502: Inputting the weighted word vector sequence of the text data to be recognized into a three-layer stacked bidirectional long-short term neural network to extract the comprehensive latent state of the text data to be recognized; S503: Calculate the probability value of the text data to be recognized belonging to the term based on the comprehensive latent state of the text data to be recognized.
4. The term identification method based on a large language model according to claim 3, characterized in that: The S502 specifically includes: S5021: Input the weighted word vector sequence of the text data to be recognized into the first layer of the bidirectional long short-term neural network, and learn along the forward direction to obtain the first forward hidden state; S5022: Input the first forward hidden state into the second-layer bidirectional long short-term neural network, and perform forward learning to obtain a second forward hidden state; S5023: Input the second forward hidden state into the third-layer bidirectional long short-term neural network, and perform forward learning to obtain a third forward hidden state; S5024: Inputting the weighted word vector sequence of the text data to be recognized into the first layer of the bidirectional long short-term neural network, performing backward learning, and obtaining a first backward hidden state; S5025: Input the first backward hidden state into the second-layer bidirectional long short-term neural network, and perform backward learning to obtain a second backward hidden state; S5026: Input the second backward hidden state into the third-layer bidirectional long short-term neural network, and perform backward learning to obtain a third backward hidden state; S5027: Fusing the third forward hidden state with the third backward hidden state to obtain a comprehensive hidden state: in, H t Represents the comprehensive hidden state of the text data to be recognized, Sigmoid () represents the Sigmoid activation function, W f represents the forward weight matrix, W b represents the backward weight matrix, represents the third forward hidden state, Represents the third backward hidden state.
5. The term identification method based on a large language model according to claim 4, characterized in that: The S503 is specifically as follows: The probability value of the text data to be recognized belonging to the term is calculated according to the following formula: in, P Represents the probability value of the text data to be identified belonging to the term, Sigmoid () represents the Sigmoid activation function, W h represents the weight matrix between the hidden layer and the classification layer, b h represents the classification layer bias term, H t Represents the comprehensive hidden state of the text data to be recognized.
6. A term recognition system based on a large language model, characterized in that: include: processor; A memory having computer-readable instructions stored thereon, wherein when the computer-readable instructions are executed by the processor, the term recognition method based on a large language model according to any one of claims 1 to 5 is implemented.
Citation Information
Patent Citations
Character recognition method based on an attention mechanism and linkage time classification loss
CN109492679A
Aspect-level sentiment classification method and device, equipment and readable storage medium
CN112347787A
Ship engine control method and system based on oil mist monitoring
CN118793527A