Term recognition method and system based on large language model
Through the term recognition method based on the large language model, using three-layer stacked bidirectional long and short-term neural network and weighted word vector extraction technology, the problem of difficulty in capturing the meaning changes of words in different contexts in the existing technology is solved, and the more High term recognition accuracy.
Patent Information
- Application Number
- CN202411584298.5
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-11-07
- Publication Date
- 2025-02-14
- Estimated Expiration
- 2044-11-07
AI Technical Summary
The features of artificially designed in feature engineering in the prior art are difficult to fully cover all potential and useful information, and are especially difficult to capture the meaning changes of words in different contexts, resulting in the accuracy of term recognition still needs to be improved.
The term recognition method based on the large language model is adopted to improve the accuracy of term recognition by obtaining text data to be identified, word segmentation processing, word segmentation features extracted, weighted word vector extraction and three-layer stacked bidirectional long and short-term neural network calculation.
Through a three-layer stacked bidirectional long-term and short-term neural network, capturing long-distance dependencies in text from both forward and backward directions, providing more comprehensive contextual information, being able to identify complex terms and improving the accuracy of term recognition.
Smart Images

Figure CN119441483A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of data storage, and in particular to a term recognition method and system based on a large language model. Background Art
[0002] In a large number of policy documents and legal documents, accurate identification of terms can improve the effectiveness of information retrieval. Users can find documents and clauses related to specific terms more quickly, 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, and the accuracy of terminology recognition is also relatively low.
[0004] With the rapid development of science and technology, more and more modern technologies are 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 mainly use feature engineering to extract text features when identifying terms, and then identify terms based on the text features. However, the artificially designed features in feature engineering can usually only capture certain aspects of the text and it is difficult to fully cover all potential and useful information. In particular, 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. Summary of the invention
[0006] In order to solve the technical problem that the manually designed features used in feature engineering in the prior art can usually only capture certain aspects of information in the text, and it is difficult to comprehensively 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 solution provided by the embodiment of the present invention is as follows: First aspect: An embodiment of the present invention provides a term recognition method based on a large language model, comprising: S1: Obtain the text data to be recognized; S2: Perform word segmentation processing on the text data to be recognized; S3: extracting the segmentation features of each segmentation obtained by the segmentation process; S4: Using the word segmentation features of each word segmentation, the weighted word vector of each word 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, the probability value of the text data to be identified belonging to the term is calculated through a three-layer stacked bidirectional long-term short-term neural network; 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.
[0008] Second aspect: An embodiment of the present invention provides a term recognition system based on a large language model, comprising: 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 the large language model as described in the first aspect is implemented.
[0009] The third aspect: An embodiment of the present invention provides a computer-readable storage medium, on which a computer program is stored. 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.
[0010] The beneficial effects brought about by the technical solution provided by the embodiment of the present invention include at least: (1) In the present invention, the three-layer stacked bidirectional long short-term neural network can capture the long-distance dependencies in the text from both the forward and backward directions, provide more comprehensive contextual information, help identify complex terms, and improve the accuracy of term recognition.
[0011] (2) In the present invention, the segmentation features of each word obtained by the segmentation process are extracted, and the weighted word vectors of each word are extracted by using the segmentation features of each 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
[0012] 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.
[0013] Figure 1 A flowchart of a term recognition method based on a large language model provided by an embodiment of the present invention; Figure 2A schematic diagram of the structure of a terminology recognition system based on a large language model provided in an embodiment of the present invention. DETAILED DESCRIPTION
[0014] The technical solution of the present invention is described below in conjunction with the accompanying drawings.
[0015] 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 "example" in the present invention should not be interpreted as being more preferred or more advantageous than other embodiments or designs. Specifically, the use of the word "example" is intended to present the concept in a specific way. In addition, in the embodiments of the present invention, the meaning expressed by "and / or" can be both, or it can be either of the two.
[0016] In the embodiments of the present invention, "image" and "picture" can sometimes be used interchangeably. It should be noted that when the difference between them is not emphasized, the meanings they intend to express are the same. "of", "corresponding, relevant" and "corresponding" can sometimes be used interchangeably. It should be noted that when the difference between them is not emphasized, the meanings they intend to express are the same.
[0017] In the embodiments of the present invention, sometimes a subscript such as W1 may be mistakenly written as a non-subscript such as W1. When the difference is not emphasized, the meanings to be expressed are consistent.
[0018] In order to make the technical problems, technical solutions and advantages to be solved by the present invention more clear, a detailed description will be given below with reference to the accompanying drawings and specific embodiments.
[0019] Reference Manual Attached Figure 1 , showing a flow chart of a term recognition method based on a large language model provided by an embodiment of the present invention.
[0020] The embodiment of the present invention provides a terminology recognition method based on a large language model, which can be implemented by a terminology recognition device based on a large language model, and the terminology recognition device based on a large language model can be a terminal or a server. The processing flow of the terminology recognition method based on a large language model may include the following steps: S1: Obtain text data to be recognized.
[0021] S2: Perform word segmentation on the text data to be recognized.
[0022] Optionally, the text data to be recognized 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).
[0023] S3: Extract the segmentation features of each word obtained by the segmentation process.
[0024] 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.
[0025] Optionally, the TF feature is specifically:
[0026] in, TF i Indicates i TF features of word segmentation, c i Indicates i The number of times a participle appears, n Indicates the total number of participles.
[0027] Optionally, the TF-IDF feature is specifically:
[0028] in, TFIDF i Indicates i TF-IDF features of word segments, IDF i Indicates i The reverse information frequency of the word segment, D Indicates the total number of texts, D i Indicates that it contains i The total number of texts with word segments.
[0029] Optionally, the IGM features are specifically:
[0030] in, IGM i Indicates i IGM features of word segmentation, p j Indicatesi The first word in the text j The position of the next occurrence, , m i Indicates i The total number of times a word appears in the text. G w Indicates the center of gravity of the location.
[0031] 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.
[0032] In a possible implementation, S4 specifically includes sub-steps S401 to S403: S401: Determine a weight parameter of each word segmentation according to the word segmentation feature of each word segmentation.
[0033] Optionally, S401 specifically includes: determining a weight parameter of each word segmentation according to the following formula:
[0034] in, oh i Indicates i The weight parameter of the word segmentation, TF i Indicates i TF features of word segmentation, TFIDF i Indicates i TF-IDF features of word segments, IGM i Indicates 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.
[0035] 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.
[0036] 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 the term in the text and ignore irrelevant high-frequency words, thereby improving the accuracy of term recognition.
[0037] S402: Determine multiple triple word vectors of each word segment in different sliding windows through the N-gram large language model and in combination with weight parameters of each word segment.
[0038] Among them, 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 continuous word sequences of fixed length N (i.e., N-grams).
[0039] Optionally, S402 specifically includes: determining multiple triple word vectors of each word segmentation in different sliding windows according to the following formula in combination with weight parameters of each word segmentation:
[0040] in, V 1i Indicates i The first triplet of the word vector of the segmentation, oh i Indicates i The weight parameter of the word segmentation, v i Indicates i The word vectors of the word segments, V 2i Indicates i The second triplet word vector of the segmentation, V 3i Indicates i The third triplet word vector of the word segmentation.
[0041] Among them, word vector refers to the vectorized representation of word segmentation, which can be obtained through algorithms such as Word2Vec, FastText, and BERT.
[0042] In the present invention, by using the N-gram model, especially the trigram, the local context information of words in the text can be effectively captured. This is very important for understanding and identifying specific collocations and structures in terms. Generating trigram word vectors under different sliding windows can capture the changes of words in different contexts, provide multi-level feature representation, and improve the model's ability to understand context.
[0043] S403: Perform weighted fusion on multiple triple word vectors to determine the weighted word vector of each word segment.
[0044] 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:
[0045] in, V i Indicates i The weighted word vector of the 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 triple word vector.
[0046] 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.
[0047] 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.
[0048] 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.
[0049] Among them, the bidirectional long short-term memory neural network (BiLSTM) is an improved recurrent neural network (RNN) that processes sequence data by combining long short-term memory neural networks (LSTM) in both forward and backward directions. LSTM is a special RNN designed to solve the long-term dependency problem in ordinary RNN. LSTM controls the flow of information by introducing a gating mechanism, including input gate, forget gate, and output gate, so as to maintain long-term dependencies in sequence data.
[0050] It should be noted that in the three-layer stacked BiLSTM, each layer of BiLSTM will extract features at different levels. The first layer mainly extracts the underlying semantic information, the second layer extracts the middle-level features, and the third layer extracts the high-level abstract features. This multi-level feature extraction method enables the model to understand the text more deeply and comprehensively.
[0051] In a possible implementation, 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.
[0052] 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.
[0053] Optionally, 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 in the forward direction to obtain the first forward hidden state.
[0054] Specifically, for a certain layer of bidirectional long short-term neural network, the hidden state is extracted h , when the bidirectional long short-term memory neural network is learning in the forward direction, the hidden state h is the forward hidden state, expressed as , when the bidirectional long short-term memory neural network is learned in the backward direction, the hidden state h is the backward hidden state, expressed as :
[0055] 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 time instant, express t The candidate output vector of the cell storage unit at the moment, C t-1 express t -1 is the activation output vector of the cell storage unit, 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.
[0056] S5022: Input the first forward hidden state into the second-layer bidirectional long short-term neural network, perform learning in the forward direction, and obtain the second forward hidden state.
[0057] S5023: Input the second forward hidden state into the second-layer bidirectional long short-term neural network, and learn in the forward direction to obtain the third forward hidden state.
[0058] 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.
[0059] 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.
[0060] S5026: Input the second backward hidden state into the second-layer bidirectional long short-term neural network, perform backward learning, and obtain the third backward hidden state.
[0061] S5027: Fuse the third forward hidden state with the third backward hidden state to obtain a comprehensive hidden state:
[0062] 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.
[0063] In the present invention, BiLSTM can capture both forward and backward information in sequence data, so that the model can fully understand the semantics of each word in its context. This is particularly effective when dealing with long-distance dependencies and complex sentence structures. By stacking multiple layers of BiLSTM, the model can extract higher-level abstract features layer by layer, thereby more comprehensively understanding the semantics and structure of the text.
[0064] S503: Calculate the probability value of the text data to be recognized belonging to the term according to the comprehensive latent state of the text data to be recognized:
[0065] in, P represents the probability value of the text data to be recognized 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.
[0066] 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.
[0067] S6: Determine whether the probability value of the text data to be identified as a term is greater than a preset probability value. If so, determine the text data to be identified as a term. Otherwise, determine the text data to be identified as a non-term.
[0068] 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.
[0069] In the present invention, by calculating the probability value of text data belonging to a term and comparing it with a preset probability threshold, flexible, adjustable and efficient term recognition can be achieved. This method is not only simple and intuitive, but also provides probabilistic explanations, adapts to different scenarios and needs, reduces misjudgments, and improves the practical application effect of the model.
[0070] The beneficial effects brought about by the technical solution provided by the embodiment of the present invention include at least: (1) In the present invention, the three-layer stacked bidirectional long short-term neural network can capture the long-distance dependencies in the text from both the forward and backward directions, provide more comprehensive contextual information, help identify complex terms, and improve the accuracy of term recognition.
[0071] (2) In the present invention, the segmentation features of each word obtained by the segmentation process are extracted, and the weighted word vectors of each word are extracted by using the segmentation features of each 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.
[0072] Reference Manual Attached Figure 2 , showing a structural diagram of a terminology recognition system based on a large language model provided by the present invention.
[0073] 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, and comprises: Processor 201; The memory 202 stores computer-readable instructions, and 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.
[0074] 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 go into details.
[0075] The beneficial effects brought about by the technical solution provided by the embodiment of the present invention include at least: (1) In the present invention, the three-layer stacked bidirectional long short-term neural network can capture the long-distance dependencies in the text from both the forward and backward directions, provide more comprehensive contextual information, help identify complex terms, and improve the accuracy of term recognition.
[0076] (2) In the present invention, the segmentation features of each word obtained by the segmentation process are extracted, and the weighted word vectors of each word are extracted by using the segmentation features of each 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.
[0077] It should be understood that the processor in the embodiment of the present invention may be a central processing unit (CPU), and the processor 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 the processor may also be any conventional processor, etc.
[0078] It should also be understood that the memory in the embodiments of the present invention may be a volatile memory or a non-volatile memory, or may include both volatile and non-volatile memories. Among them, the non-volatile memory may be a read-only memory (ROM), a programmable read-only memory (PROM), an erasable programmable read-only memory (EPROM), an electrically erasable programmable read-only memory (EEPROM), or a flash memory. The volatile memory may be a 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 synchronous dynamic random access memory (DDR SDRAM), enhanced synchronous dynamic random access memory (ESDRAM), synchronous link DRAM (SLDRAM), and direct rambus RAM (DR RAM).
[0079] The above embodiments can be implemented in whole or in part by software, hardware (such as circuits), firmware or any other combination. When implemented by software, the above embodiments can be implemented in whole or in part in the form of a computer program product. The computer program product includes one or more computer instructions or computer programs. When the computer instructions or computer programs are loaded or executed on a computer, the process or function described in the embodiment of the present invention is generated in whole or in part. 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 computer-readable storage medium. For example, the computer instructions can be transmitted from one website, computer, server or data center to another website, computer, server or data center by wired (such as infrared, wireless, microwave, etc.). The computer-readable storage medium can be any available medium that can be accessed by a computer or a data storage device such as a server or data center that contains one or more available media sets. The available medium can be a magnetic medium (for example, a floppy disk, a hard disk, a tape), an optical medium (for example, a DVD), or a semiconductor medium. The semiconductor medium can be a solid-state hard disk.
[0080] It should be understood that the term "and / or" in this article is only a description of the association relationship of associated objects, indicating that there can be three relationships. For example, A and / or B can represent: A exists alone, A and B exist at the same time, and B exists alone. A and B can be singular or plural. In addition, the character " / " in this article generally indicates that the associated objects before and after are in an "or" relationship, but it may also indicate an "and / or" relationship. Please refer to the context for specific understanding.
[0081] In the present invention, "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 items 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 multiple.
[0082] 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.
[0083] Those of ordinary skill 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. Professional and technical personnel can use different methods to implement the described functions for each specific application, but such implementation should not be considered to be beyond the scope of the present invention.
[0084] Those skilled in the art can 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.
[0085] 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 only schematic. For example, the division of the units is only a logical function division. There may be other division methods in actual implementation, 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 interfaces, indirect coupling or communication connection of devices or units, which can be electrical, mechanical or other forms.
[0086] The units described as separate components may or may not be physically separated, and the components shown as units may or may not be physical units, that is, they may be located in one place or distributed on multiple network units. Some or all of the units may be selected according to actual needs to achieve the purpose of the solution of this embodiment.
[0087] 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.
[0088] If the functions are implemented in the form of 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 part that contributes to the prior art, or the part of the technical solution, can be embodied in the form of a software product. The computer software product is stored in a storage medium, including several instructions for enabling a computer device (which can be a personal computer, server, or network device, etc.) to perform all or part of the steps of the methods described in various embodiments of the present invention. The aforementioned storage medium includes: U disk, mobile hard disk, read-only memory (ROM), random access memory (RAM), disk or optical disk, and other media that can store program codes.
[0089] 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.
[0090] A computer-readable storage medium provided by the present invention can implement the steps and effects of the term recognition method based on a large language model in the above method embodiment. To avoid repetition, the present invention will not go into details.
[0091] The beneficial effects brought about by the technical solution provided by the embodiment of the present invention include at least: (1) In the present invention, the three-layer stacked bidirectional long short-term neural network can capture the long-distance dependencies in the text from both the forward and backward directions, provide more comprehensive contextual information, help identify complex terms, and improve the accuracy of term recognition.
[0092] (2) In the present invention, the segmentation features of each word obtained by the segmentation process are extracted, and the weighted word vectors of each word are extracted by using the segmentation features of each 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.
[0093] The above is only a specific embodiment of the present invention, but the protection scope of the present invention is not limited thereto. Any person skilled in the art can easily think of changes or substitutions within the technical scope disclosed by the present invention, which should be included in the protection scope of the present invention. Therefore, the protection scope of the present invention should be based on the protection scope of the claims.
[0094] There are a few points to note: (1) The drawings of the embodiments of the present invention only involve structures related to the embodiments of the present invention. Other structures may refer to conventional designs.
[0095] (2) For the sake of clarity, in the drawings used to describe the embodiments of the present invention, the thickness of layers or regions is exaggerated or reduced, that is, these drawings are not drawn according to the actual 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 there may be intermediate elements.
[0096] (3) In the absence of conflict, the embodiments of the present invention and the features therein may be combined with each other to obtain new embodiments.
[0097] 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: Perform word segmentation processing on the text data to be recognized; S3: extracting the segmentation features of each segmentation obtained by the segmentation process; S4: Using the word segmentation features of each word segmentation, the weighted word vector of each word 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, the probability value of the text data to be identified belonging to the term is calculated through a three-layer stacked bidirectional long-term short-term neural network; 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.
2. The term identification 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 S4 specifically includes: S401: Determine a weight parameter of each participle according to the participle features of each participle; S402: Determine multiple triple word vectors of each word in different sliding windows by using the N-gram large language model and combining weight parameters of each word segmentation; S403: Perform weighted fusion on multiple triple word vectors to determine the weighted word vector of each word segment.
4. The term identification method based on a large language model according to claim 3, characterized in that: The S401 is specifically as follows: Determine the weight parameters of each word segmentation according to the following formula: in, ω i Indicates i The weight parameter of the word segmentation, TF i Indicates i TF features of word segmentation, TFIDF i Indicates i TF-IDF features of word segments, IGM i Indicates 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.
5. The term identification method based on a large language model according to claim 4, characterized in that: The S402 is specifically as follows: According to the following formula, combined with the weight parameters of each word segmentation, multiple triple word vectors of each word segmentation in different sliding windows are determined: in, V 1i Indicates i The first triplet of the word vector of the segmentation, ω i Indicates i The weight parameter of the word segmentation, v i Indicates i The word vectors of the word segments, V 2i Indicates i The second triplet word vector of the segmentation, V 3i Indicates i The third triplet word vector of the word segmentation.
6. The term identification method based on a large language model according to claim 5, characterized in that: The S403 is specifically as follows: According to the following formula, multiple triple word vectors are weighted and fused to determine the weighted word vector of each word segment: in, V i Indicates i The weighted word vector of the 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 triple word vector.
7. 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 hidden state of the text data to be recognized; S503: Calculate the probability value of the text data to be recognized belonging to the term according to the comprehensive latent state of the text data to be recognized.
8. The term identification method based on a large language model according to claim 7, 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 in 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 learning in the forward direction to obtain a second forward hidden state; S5023: inputting the second forward hidden state into the third-layer bidirectional long short-term neural network, and performing forward learning to obtain a third forward hidden state; 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, and perform backward learning to obtain a first backward hidden state; S5025: inputting the first backward hidden state into the second-layer bidirectional long short-term neural network, and performing backward learning to obtain a second backward hidden state; S5026: inputting the second backward hidden state into the third-layer bidirectional long short-term neural network, and performing 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.
9. The term identification method based on a large language model according to claim 8, characterized in that: The S503 is specifically as follows: According to the following formula, the probability value of the text data to be recognized belonging to the term is calculated: in, P represents the probability value of the text data to be recognized 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.
10. A terminology 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 as described in any one of claims 1 to 9 is implemented.
Citation Information
Patent Citations
Character recognition method based on an attention mechanism and linkage time classification loss
CN109492679A
Text recognition method and device
CN111414757A
Military high-tech text classification method and system fusing named entity recognition
CN112163089A
Aspect-level sentiment classification method and device, equipment and readable storage medium
CN112347787A
Chinese named entity recognition method and system
CN114298044A