WO2020232882A1 - Named entity recognition method and apparatus, device, and computer readable storage medium - Google Patents

Named entity recognition method and apparatus, device, and computer readable storage medium Download PDF

Info

Publication number
WO2020232882A1
WO2020232882A1 PCT/CN2019/103141 CN2019103141W WO2020232882A1 WO 2020232882 A1 WO2020232882 A1 WO 2020232882A1 CN 2019103141 W CN2019103141 W CN 2019103141W WO 2020232882 A1 WO2020232882 A1 WO 2020232882A1
Authority
WO
WIPO (PCT)
Prior art keywords
word
layer
vector
target sentence
named entity
Prior art date
Application number
PCT/CN2019/103141
Other languages
French (fr)
Chinese (zh)
Inventor
邓悦
金戈
徐亮
Original Assignee
平安科技(深圳)有限公司
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by 平安科技(深圳)有限公司 filed Critical 平安科技(深圳)有限公司
Publication of WO2020232882A1 publication Critical patent/WO2020232882A1/en

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F40/00Handling natural language data
    • G06F40/10Text processing
    • G06F40/12Use of codes for handling textual entities
    • G06F40/126Character encoding
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F40/00Handling natural language data
    • G06F40/20Natural language analysis
    • G06F40/205Parsing
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F40/00Handling natural language data
    • G06F40/20Natural language analysis
    • G06F40/279Recognition of textual entities
    • G06F40/289Phrasal analysis, e.g. finite state techniques or chunking
    • G06F40/295Named entity recognition
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06NCOMPUTING ARRANGEMENTS BASED ON SPECIFIC COMPUTATIONAL MODELS
    • G06N3/00Computing arrangements based on biological models
    • G06N3/02Neural networks
    • G06N3/08Learning methods
    • G06N3/084Backpropagation, e.g. using gradient descent

Definitions

  • This application relates to the technical field of semantic parsing, and in particular to a named entity recognition method, device, equipment, and computer-readable storage medium.
  • NER Named Entity Recognition
  • natural language processing refers to identifying named referents from text, paving the way for tasks such as relation extraction.
  • proper nouns such as names of persons, places and organizations are recognized.
  • interviewer it is necessary to analyze the interviewer’s answer text, and identify named entities from the answer text, such as person’s name, place name, and organization’s name, so that the interviewer’s information can be structured automatically, such as the interview
  • the name of the person, the school of graduation, and the location of the school of graduation are identified from the answer text and stored in the database.
  • word-based named entity recognition For Chinese named entity recognition, it currently includes word-based named entity recognition and word-based named entity recognition.
  • word-based named entity recognition and word-based named entity recognition both have semantic information missing, and semantic information is missing. This will lead to the problem that the recognition accuracy of the named entity is not high. Therefore, how to improve the recognition accuracy of the named entity is a problem to be solved urgently.
  • the main purpose of this application is to provide a named entity recognition method, device, equipment and computer-readable storage medium, aiming to improve the accuracy of named entity recognition.
  • this application provides a named entity recognition method, which includes the following steps:
  • the target sentence to be recognized is determined according to the named entity recognition request, and a named entity recognition model is obtained, wherein the named entity recognition model includes at least a word encoding layer, a word encoding layer, and a bidirectional Long and short-term memory network layer and named entity recognition layer;
  • the first word vector and the second word vector corresponding to each word are input into the named entity recognition layer to obtain the named entity in the target sentence.
  • the present application also provides a named entity recognition device, the named entity recognition device includes:
  • the determining module is used to determine the target sentence to be recognized according to the named entity recognition request when the named entity recognition request is monitored;
  • An acquisition module for acquiring a named entity recognition model where the named entity recognition model includes at least a word encoding layer, a word encoding layer, a two-way long and short-term memory network layer, and a named entity recognition layer;
  • the first word vector determining module is configured to input the target sentence into the word encoding layer to obtain a first word vector corresponding to each word in the target sentence;
  • a word vector determining module configured to input the target sentence into the word encoding layer to obtain a target word vector corresponding to each word in the target sentence;
  • the second word vector determining module is used to input the target word vector of each word in each word into the two-way long-term short-term memory network layer in turn, to obtain a second word vector corresponding to each word respectively;
  • the named entity recognition module is used to input the first word vector and the second word vector corresponding to each word into the named entity recognition layer to obtain the named entity in the target sentence.
  • the present application also provides a computer device that includes a processor, a memory, and a computer program that is stored on the memory and can be executed by the processor, wherein the computer program is When the processor is executed, the steps of the above-mentioned named entity recognition method are realized.
  • the present application also provides a computer-readable storage medium having a computer program stored on the computer-readable storage medium, and when the computer program is executed by a processor, the steps of the aforementioned named entity identification method are implemented .
  • This application provides a named entity recognition method, device, equipment, and computer-readable storage medium.
  • This application uses the word encoding layer of the named entity recognition model to obtain the vector representation of each word in the target sentence at the word granularity, and Through the word encoding layer of the named entity recognition model and the two-way long and short-term memory network layer, the vector representation of each word in the target sentence at the word granularity can be obtained, which can reduce the loss of information at the word granularity, and then combine each word in the word.
  • the vector representation and the named entity recognition model under the granularity and word granularity can accurately identify the named entity in the sentence and effectively improve the accuracy of the recognition of the named entity.
  • FIG. 1 is a schematic flowchart of a named entity identification method provided by an embodiment of the application
  • Figure 2 is a hierarchical schematic diagram of a named entity recognition model provided by an embodiment of the application
  • FIG. 3 is a schematic flowchart of sub-steps of the named entity recognition method in FIG. 1;
  • FIG. 5 is a schematic block diagram of a named entity recognition device provided by an embodiment of this application.
  • FIG. 6 is a schematic block diagram of sub-modules of the named entity recognition device in FIG. 5;
  • FIG. 7 is a schematic block diagram of another named entity recognition device provided by an embodiment of this application.
  • FIG. 8 is a schematic block diagram of the structure of a computer device related to an embodiment of the application.
  • the embodiments of the present application provide a named entity recognition method, device, computer equipment, and computer-readable storage medium.
  • the named entity identification method can be applied to a server, and the server can be a single server or a server cluster.
  • FIG. 1 is a schematic flowchart of a named entity recognition method according to an embodiment of the application.
  • the named entity identification method is used to accurately recommend wealth management products to users, wherein the named entity identification method includes steps S101 to S105.
  • Step S101 When a named entity recognition request is monitored, a target sentence to be recognized is determined according to the named entity recognition request, and a named entity recognition model is obtained.
  • the named entity recognition model includes at least a word encoding layer, a word encoding layer, a two-way long short-term memory network layer, and a named entity recognition layer, and the named entity recognition layer includes a one-way long short-term memory network layer and a conditional random field (Conditional Random Field). algorithm, CRF) layer.
  • CRF Conditional Random Field
  • the loss function of the named entity recognition model to be trained can be selected as:
  • e s(X,y) is the sequence score of sentence X
  • Z i,x is the hidden layer output of the i-th word in sentence X in the hidden layer of the LSTM model layer
  • y i is the label corresponding to the i-th word in sentence X
  • y i-1 is The label corresponding to the i-1th word in sentence X
  • n is the number of words in sentence X
  • matrices W and b represent the transition probability between entity tags
  • the elements in W are vectors
  • the elements in b are Numerical value.
  • the relationship between the hidden layer output of the one-way long and short-term memory network layer and the probability transition matrix of the CRF layer is multiplication, which can increase the hypothesis space of the model and further improve the recognition of the named entity recognition model Accuracy.
  • Fig. 2 is a hierarchical schematic diagram of a named entity recognition model provided by an embodiment of the application.
  • the named entity recognition model includes a word encoding layer, a word encoding layer, a two-way long short-term memory network layer, and a named entity recognition layer.
  • the target sentence is input into the word coding layer and the word coding layer respectively.
  • the interviewer’s voice data is collected through the terminal device, and a named entity recognition request carrying the voice data is generated, and the named entity recognition request is sent to the server.
  • the server detects the named entity recognition request, it will be recognized according to the named entity Request, determine the target sentence to be recognized, and obtain the named entity recognition model.
  • the method for determining the target sentence to be recognized is specifically: acquiring voice data from the named entity request, and performing voice recognition on the voice data to convert the voice data into a text sentence, and then determining the text sentence as a pending sentence. The identified target sentence.
  • Step S102 Input the target sentence into the word encoding layer to obtain a first word vector corresponding to each word in the target sentence.
  • the server After determining the target sentence, the server inputs the target sentence to the word encoding layer of the named entity recognition model, and obtains the first word vector corresponding to each word in the target sentence, specifically: a word vector stored in the word encoding layer Matrix, when the target sentence is input to the word coding layer, the target sentence is split into several words, and according to the word vector matrix, each word in the several words is represented as a corresponding
  • the first word vector is to obtain a word from several words in turn, and record it as the target word, then obtain the word vector corresponding to the target word from the word vector matrix, and determine the word vector as the first target word
  • the word vector is obtained once for each word in several words, so that the first word vector corresponding to each word in the target sentence can be obtained.
  • one row of the word vector matrix represents the word vector of a word
  • the word vector matrix can be set based on actual conditions, which is not specifically limited in this solution.
  • the word vector matrix is: Among them, the word corresponding to the first row of the word vector matrix is "apple”, the word corresponding to the second row is "phone", and the word corresponding to the last row is "model”. Therefore, the first word vector of the word “apple” is [0.1,0.34, alone,0.89], the first word vector of the word “mobile phone” is [0.98,0.3, «,0.76], and the second word vector of the word "model” is [0.77,0.3, «,0.22].
  • Step S103 Input the target sentence into the word encoding layer to obtain a target word vector corresponding to each word in the target sentence.
  • the target sentence While inputting the target sentence into the word encoding layer, the target sentence is input into the word encoding layer of the named entity recognition model to obtain the target word vector corresponding to each word in the target sentence, which is specifically pre-stored in the word encoding layer There is a word vector matrix.
  • the target sentence is split into several single words, and the target word vector corresponding to each word in the target sentence is determined according to the word vector matrix, that is, from Obtain a word from several words one by one and record it as the target word, then obtain the word vector corresponding to the target word from the word vector matrix, and determine the word vector as the target word vector of the target word until the word vector in the word vector matrix
  • the word vector matrix represents a word vector of a single word
  • the word vector matrix can be set based on actual conditions, and this solution does not specifically limit this.
  • Step S104 Using word as a unit, input the target word vector of each word in each word to the bidirectional long-term short-term memory network layer in turn to obtain a second word vector corresponding to each word.
  • the server After obtaining the target word vector of each word in the target sentence, the server sequentially inputs the target word vector of each word in each word into the bidirectional long-term and short-term memory network layer of the named entity recognition model in units of words. Get the second word vector corresponding to each word.
  • step S104 includes: sub-step S1041 to sub-step S1042 .
  • Sub-step S1041 in units of words, input the target word vector of each word in each word to the bidirectional long-term short-term memory network layer in turn to obtain the forward hidden layer output and reverse hidden layer of each word in each word Containing layer output.
  • the server After obtaining the target word vector of each word in the target sentence, the server uses the word as a unit to input the target word vector of each word in each word into the bidirectional long-term short-term memory network layer in turn to obtain each word in each word.
  • the forward hidden layer output and the reverse hidden layer output of the word are composed of a forward recurrent neural network (Recurrent Neural Network, RNN) and a reverse RNN.
  • RNN forward recurrent neural network
  • the bidirectional long and short-term memory network is an extension of the traditional long and short-term memory network, which can improve the model of sequence classification problems. performance.
  • Sub-step S1042 according to the forward hidden layer output and the reverse hidden layer output of each word in each word, determine the second word vector corresponding to each word.
  • each word is determined according to the forward hidden layer output and the reverse hidden layer output of each word in each word
  • the corresponding second word vector is specifically: get the reverse hidden layer output corresponding to the initial word of each word and the forward hidden layer output corresponding to the ending word, and the reverse direction corresponding to the initial word of each word
  • the output of the hidden layer is spliced with the output of the forward hidden layer corresponding to the ending word to obtain the second word vector corresponding to each word.
  • the splicing method of the reverse hidden layer output corresponding to the initial word and the forward hidden layer output corresponding to the ending word of each word is sequential splicing, for example, the reverse hidden layer corresponding to the initial word of a word
  • the output of the containing layer is [0.2,0.3, hence,0.9]
  • the output of the positive hidden layer corresponding to the ending word is [0.8,0.7, alone,0.4]
  • Step S105 Input the first word vector and the second word vector corresponding to each word to the named entity recognition layer to obtain the named entity in the target sentence.
  • the server After obtaining the first word vector and the second word vector corresponding to each word, the server inputs the first word vector and the second word vector corresponding to each word into the named entity recognition layer of the named entity recognition model, Obtain the named entity in the target sentence, that is, take the word as a unit, input the first word vector and the second word vector corresponding to each word into the unidirectional long-term short-term network in the named entity recognition layer, and get each word corresponding The hidden layer output of each word is input to the CRF network in the named entity recognition layer to obtain the entity tag of each word, thereby completing the recognition of the named entity in the sentence to be recognized.
  • the first word vector is a representation of semantic information at word granularity
  • the second word vector is a representation of semantic information at word granularity.
  • the first word vector and second word vector corresponding to each word are sequentially input to the vector splicing sublayer in the named entity recognition layer to obtain the spliced word vector corresponding to each word , And then input the spliced word vector corresponding to each word to the named entity recognition sub-layer in the named entity recognition layer to obtain the named entity in the target sentence, that is, take the word as a unit, the spliced word vector corresponding to each word Input to the unidirectional long- and short-term network in the named entity recognition sublayer to obtain the hidden layer output corresponding to each word, and input the hidden layer output corresponding to each word to the CRF network in the named entity recognition sublayer, Obtain the entity label of each word, thereby completing the recognition of the named entity in the sentence to be recognized.
  • the named entity recognition layer includes a vector splicing sublayer and a named entity recognition sublayer, and the named entity recognition sublayer is composed of a unidirectional long-term short-term
  • the word encoding layer of the named entity recognition model can obtain the vector representation of each word in the target sentence at the word granularity, and the word encoding layer and bidirectional length of the named entity recognition model
  • the short-term memory network layer can obtain the vector representation of each word in the target sentence at the word granularity, which can reduce the loss of information at the word granularity, and then combine the vector representation of each word at the word granularity and the word granularity and named entity recognition
  • the model can accurately identify the named entity in the sentence, which effectively improves the accuracy of the named entity recognition.
  • FIG. 4 is a schematic flowchart of another named entity recognition method provided by an embodiment of the application.
  • the named entity recognition method includes steps S201 to 205.
  • Step S201 When a named entity recognition request is monitored, determine the target sentence to be recognized according to the named entity recognition request, and obtain a named entity recognition model.
  • the named entity recognition model includes at least a word encoding layer, a word encoding layer, a two-way long short-term memory network layer, and a named entity recognition layer, and the named entity recognition layer includes a one-way long short-term memory network layer and a CRF layer.
  • the interviewer’s voice data is collected through the terminal device, and a named entity recognition request carrying the voice data is generated, and the named entity recognition request is sent to the server.
  • the server detects the named entity recognition request, it will be recognized according to the named entity Request, determine the target sentence to be recognized, and obtain the named entity recognition model.
  • the method for determining the target sentence to be recognized is specifically: acquiring voice data from the named entity request, and performing voice recognition on the voice data to convert the voice data into a text sentence, and then determining the text sentence as a pending sentence. The identified target sentence.
  • Step S202 Input the target sentence into the word encoding layer to obtain a first word vector corresponding to each word in the target sentence.
  • the server After determining the target sentence, the server inputs the target sentence to the word encoding layer of the named entity recognition model, and obtains the first word vector corresponding to each word in the target sentence, specifically: a word vector stored in the word encoding layer Matrix, when the target sentence is input to the word coding layer, the target sentence is split into several words, and according to the word vector matrix, each word in the several words is represented as a corresponding
  • the first word vector is to obtain a word from several words in turn, and record it as the target word, then obtain the word vector corresponding to the target word from the word vector matrix, and determine the word vector as the first target word
  • the word vector is obtained once for each word in several words, so that the first word vector corresponding to each word in the target sentence can be obtained.
  • Step S203 Input the target sentence into the word encoding layer to obtain a target word vector corresponding to each word in the target sentence.
  • step S203 includes sub-steps S2031 to S2033.
  • the target sentence is input to the word vector coding sublayer in the word coding layer to obtain a word vector corresponding to each word in the target sentence.
  • the word coding layer includes a word vector coding sublayer, a pinyin vector coding sublayer and a vector stitching sublayer. Input the target sentence to the word vector coding sublayer in the word coding layer to obtain the word vector corresponding to each word in the target sentence.
  • a word vector matrix is preset in the word vector coding sublayer, and After the target sentence is input to the word vector encoding sublayer in the word encoding layer, the word vector matrix in the word vector encoding sublayer is used to obtain the word vector corresponding to each word in the target sentence, which is to split the target sentence into several One word, and obtain a word from several words one by one, record it as the target word, and then obtain the word vector corresponding to the target word from the word vector matrix, until each word in the several words is obtained once, so that the The word vector corresponding to each word in the target sentence.
  • the aforementioned word vector matrix can be set based on actual conditions, which is not specifically limited in this embodiment.
  • the target sentence is input to the pinyin vector coding sublayer in the word coding layer to obtain a pinyin vector corresponding to each word in the target sentence.
  • While inputting the target sentence into the word vector coding sublayer input the target sentence into the pinyin vector coding sublayer in the word coding layer to obtain the pinyin vector corresponding to each word in the target sentence, specifically, The target sentence is input to the pinyin vector coding sublayer in the word coding layer, and the character vector matrix corresponding to each pinyin character contained in each word in the target sentence is obtained through the character vector matrix in the pinyin vector coding sublayer, and then According to the natural sequence of the pinyin characters, the character vectors corresponding to the pinyin characters contained in each word are spliced to obtain the pinyin vectors corresponding to each word in the target sentence.
  • the pinyin characters contained in the word “lang” are "l", “a”, “n” and “g”, and the natural order is lang.
  • Let the pinyin characters “l”, “a”, “n” and “ The character vectors of "g” are [0.1,0.36,»,0.89], [0.9,0.3,>,0.76], [0.88,0.4, «,0.46 ] And [0.6,0.3, «,0.36], then after the character vectors of the pinyin characters "l", “a”, “n” and “g” are spliced, the resulting pinyin vector is [0.1, 0.36, habits,0.89,0.9,0.3,....,0.76,0.88,0.4,....,0.46,0.6,0.3, «,0.36] .
  • Sub-step S2033 in units of words, input the word vector and the pinyin vector corresponding to each word in the target sentence into the vector splicing sub-layer of the word encoding layer in turn to obtain each word in the target sentence The corresponding target word vector respectively.
  • the splicing method includes the word vector splicing before the pinyin vector and the word vector splicing after the pinyin vector.
  • the character vector and pinyin vector of " ⁇ " are [0.2,0.36, together,0.86] and [0.3,0.56, hence,0.89], then the target character of " ⁇ "
  • the vector can be [0.2,0.36,...,0.86,0.3,0.56,...,0.89], and the target word vector for "country” can also be [0.3,0.56,... ..,0.89,0.2,0.36, hence,0.86].
  • Step S204 Using word as a unit, input the target word vector of each word in each word into the two-way long and short-term memory network layer in turn to obtain a second word vector corresponding to each word.
  • the server After obtaining the target word vector of each word in the target sentence, the server sequentially inputs the target word vector of each word in each word into the bidirectional long-term and short-term memory network layer of the named entity recognition model in units of words. Get the second word vector corresponding to each word.
  • Step S205 Input the first word vector and the second word vector corresponding to each word into the named entity recognition layer to obtain the named entity in the target sentence.
  • the server After obtaining the first word vector and the second word vector corresponding to each word, the server inputs the first word vector and the second word vector corresponding to each word into the named entity recognition layer of the named entity recognition model, Obtain the named entity in the target sentence, that is, take the word as a unit, input the first word vector and the second word vector corresponding to each word into the unidirectional long-term short-term network in the named entity recognition layer, and get each word corresponding The hidden layer output of each word is input to the CRF network in the named entity recognition layer to obtain the entity tag of each word, thereby completing the recognition of the named entity in the sentence to be recognized.
  • the vector representation of each word in the target sentence at the word granularity can be obtained, through the word vector, pinyin vector and two-way long and short-term memory
  • the network layer can further accurately characterize the semantic information under the word granularity and reduce the loss of information under the word granularity. Then combined with the vector representation of each word in the word granularity and the word granularity and the named entity recognition model, it can accurately identify The named entity in the sentence effectively improves the recognition accuracy of the named entity.
  • FIG. 5 is a schematic block diagram of a named entity recognition apparatus provided by an embodiment of the application.
  • the named entity recognition device 300 includes: a determination module 301, an acquisition module 302, a first word vector determination module 303, a word vector determination module 304, a second word vector determination module 305, and a named entity recognition module 306 .
  • the determining module 301 is configured to determine the target sentence to be recognized according to the named entity recognition request when a named entity recognition request is monitored.
  • the obtaining module 302 is configured to obtain a named entity recognition model, where the named entity recognition model includes at least a word encoding layer, a word encoding layer, a two-way long and short-term memory network layer, and a named entity recognition layer;
  • the first word vector determining module 303 is configured to input the target sentence into the word encoding layer to obtain a first word vector corresponding to each word in the target sentence.
  • the word vector determining module 304 is configured to input the target sentence into the word encoding layer to obtain a target word vector corresponding to each word in the target sentence.
  • the second word vector determining module 305 is configured to input the target word vector of each word in each word into the two-way long-term short-term memory network layer in turn to obtain the second word vector corresponding to each word in the unit of word .
  • the second word vector determining module 305 includes:
  • the hidden layer output determination sub-module 3051 is used to input the target word vector of each word in each word to the bidirectional long-term short-term memory network layer in turn in the unit of word, to obtain the forward direction of each word in each word Hidden layer output and reverse hidden layer output;
  • the word vector determination sub-module 3052 is used to determine the second word vector corresponding to each word according to the forward hidden layer output and the reverse hidden layer output of each word in each word.
  • the word vector determining submodule 3052 is also used to obtain the reverse hidden layer output corresponding to the initial word of each word and the forward hidden layer output corresponding to the ending word; The output of the reverse hidden layer corresponding to the initial word is spliced with the output of the forward hidden layer corresponding to the ending word to obtain the second word vector corresponding to each word.
  • the named entity recognition module 306 is configured to input the first word vector and the second word vector corresponding to each word into the named entity recognition layer to obtain the named entity in the target sentence.
  • the named entity recognition module 306 is further configured to input the first word vector and the second word vector corresponding to each word into the vector splicing in the named entity recognition layer in order in units of words.
  • the sublayer obtains the spliced word vector corresponding to each word; inputs the spliced word vector corresponding to each word to the named entity recognition sublayer in the named entity recognition layer to obtain the named entity in the target sentence.
  • FIG. 7 is a schematic block diagram of another named entity recognition apparatus provided by an embodiment of the application.
  • the named entity recognition device 400 includes: a determination module 401, an acquisition module 402, a first word vector determination module 403, a word vector determination module 404, a second word vector determination module 405, and a named entity recognition module 406 .
  • the determining module 401 is configured to determine the target sentence to be recognized according to the named entity recognition request when a named entity recognition request is monitored.
  • the acquiring module 402 is configured to acquire a named entity recognition model, where the named entity recognition model includes at least a word encoding layer, a word encoding layer, a two-way long and short-term memory network layer, and a named entity recognition layer;
  • the first word vector determining module 403 is configured to input the target sentence into the word encoding layer to obtain a first word vector corresponding to each word in the target sentence.
  • the word vector determining module 404 is configured to input the target sentence into the word encoding layer to obtain a target word vector corresponding to each word in the target sentence.
  • the word vector determining module 404 includes:
  • the word vector determining submodule 4041 is configured to input the target sentence into the word vector encoding sublayer in the word encoding layer to obtain a word vector corresponding to each word in the target sentence;
  • the pinyin vector determining submodule 4042 is used to input the target sentence into the pinyin vector coding sublayer in the word coding layer to obtain the pinyin vector corresponding to each word in the target sentence;
  • the target word vector determination sub-module 4043 is used to input the word vector and the pinyin vector corresponding to each word in the target sentence into the vector splicing sub-layer of the word encoding layer in order in units of words to obtain the Each word in the target sentence corresponds to the target word vector.
  • the word vector determining sub-module 4041 is further configured to input the target sentence into the word vector coding sublayer in the word coding layer; the word vector in the word vector coding sublayer Matrix to obtain the word vector corresponding to each word in the target sentence.
  • the pinyin vector determining sub-module 4042 is further configured to input the target sentence into the pinyin vector coding sublayer in the character coding layer; the character vector in the pinyin vector coding sublayer is coded by the pinyin vector Matrix to obtain the character vector corresponding to each pinyin character contained in each word in the target sentence; splicing the character vector corresponding to each pinyin character contained in each word to obtain the corresponding character of each word in the target sentence Pinyin vector.
  • the second word vector determining module 405 is configured to input the target word vector of each word in each word into the two-way long-term short-term memory network layer in turn to obtain a second word vector corresponding to each word in word units .
  • the named entity recognition module 406 is configured to input the first word vector and the second word vector corresponding to each word into the named entity recognition layer to obtain the named entity in the target sentence.
  • the named entity recognition module 406 is further configured to input the first word vector and the second word vector corresponding to each word into the vector splicing in the named entity recognition layer in order in units of words.
  • the sublayer obtains the spliced word vector corresponding to each word; inputs the spliced word vector corresponding to each word to the named entity recognition sublayer in the named entity recognition layer to obtain the named entity in the target sentence.
  • the apparatus provided in the foregoing embodiment may be implemented in the form of a computer program, and the computer program may run on the computer device as shown in FIG. 8.
  • FIG. 8 is a schematic block diagram of a structure of a computer device according to an embodiment of the application.
  • the computer device may be a server.
  • the computer device includes a processor, a memory, and a network interface connected through a system bus, where the memory may include a non-volatile storage medium and an internal memory.
  • the non-volatile storage medium can store an operating system and a computer program.
  • the computer program includes program instructions.
  • the processor can execute any named entity recognition method.
  • the processor is used to provide computing and control capabilities and support the operation of the entire computer equipment.
  • the internal memory provides an environment for the running of the computer program in the non-volatile storage medium.
  • the processor can execute any named entity identification method.
  • the network interface is used for network communication, such as sending assigned tasks.
  • FIG. 8 is only a block diagram of a part of the structure related to the solution of the present application, and does not constitute a limitation on the computer device to which the solution of the present application is applied.
  • the specific computer device may Including more or fewer parts than shown in the figure, or combining some parts, or having a different arrangement of parts.
  • the processor may be a central processing unit (Central Processing Unit, CPU), the processor may also be other general-purpose processors, digital signal processors (Digital Signal Processor, DSP), and application specific integrated circuits (Application Specific Integrated Circuits). Circuit, ASIC), Field-Programmable Gate Array (FPGA) or other programmable logic devices, discrete gates 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.
  • the processor is used to run a computer program stored in a memory to implement the following steps:
  • the target sentence to be recognized is determined according to the named entity recognition request, and a named entity recognition model is obtained, wherein the named entity recognition model includes at least a word encoding layer, a word encoding layer, and a bidirectional Long and short-term memory network layer and named entity recognition layer;
  • the first word vector and the second word vector corresponding to each word are input into the named entity recognition layer to obtain the named entity in the target sentence.
  • the processor realizes that the target word vector of each word in each word is sequentially input to the bidirectional long-term and short-term memory network layer in the unit of words to obtain the second corresponding to each word.
  • word vectors it is used to achieve:
  • the second word vector corresponding to each word is determined.
  • the processor determines the second word vector corresponding to each word according to the forward hidden layer output and the reverse hidden layer output of each word in each word, it is used to achieve:
  • the reverse hidden layer output corresponding to the initial word of each word is spliced with the forward hidden layer output corresponding to the ending word to obtain the second word vector corresponding to each word.
  • the processor when the processor realizes that the first word vector and the second word vector corresponding to each word are input into the named entity recognition layer to obtain the named entity in the target sentence, it is used for achieve:
  • the spliced word vector corresponding to each word is input to the named entity recognition sub-layer in the named entity recognition layer to obtain the named entity in the target sentence.
  • the processor is configured to run a computer program stored in a memory, so as to input the target sentence into the word encoding layer to obtain a corresponding corresponding to each word in the target sentence.
  • the steps of the target word vector include:
  • the word vector and pinyin vector corresponding to each word in the target sentence are sequentially input into the vector splicing sublayer in the word encoding layer to obtain the target corresponding to each word in the target sentence.
  • Word vector In units of words, the word vector and pinyin vector corresponding to each word in the target sentence are sequentially input into the vector splicing sublayer in the word encoding layer to obtain the target corresponding to each word in the target sentence. Word vector.
  • the processor is configured to input the target sentence into the word vector encoding sublayer in the word encoding layer to obtain the word vector corresponding to each word in the target sentence. achieve:
  • the word vector matrix in the word vector encoding sublayer Through the word vector matrix in the word vector encoding sublayer, the word vector corresponding to each word in the target sentence is obtained.
  • the processor is configured to input the target sentence to the pinyin vector coding sublayer in the word coding layer to obtain the pinyin vector corresponding to each word in the target sentence achieve:
  • the character vectors corresponding to the pinyin characters contained in each word are spliced to obtain the pinyin vectors corresponding to each word in the target sentence.
  • the embodiments of the present application also provide a computer-readable storage medium, the computer-readable storage medium stores a computer program, the computer program includes program instructions, and the method implemented when the program instructions are executed can refer to this Various embodiments of the named entity recognition method are applied.
  • the computer-readable storage medium may be the internal storage unit of the computer device described in the foregoing embodiment, such as the hard disk or memory of the computer device.
  • the computer-readable storage medium may also be an external storage device of the computer device, such as a plug-in hard disk, a smart memory card (SMC), or a secure digital (Secure Digital, SD) equipped on the computer device. ) Card, Flash Card, etc.

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • Health & Medical Sciences (AREA)
  • Artificial Intelligence (AREA)
  • Computational Linguistics (AREA)
  • General Health & Medical Sciences (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Audiology, Speech & Language Pathology (AREA)
  • Life Sciences & Earth Sciences (AREA)
  • Biomedical Technology (AREA)
  • Biophysics (AREA)
  • Data Mining & Analysis (AREA)
  • Evolutionary Computation (AREA)
  • Molecular Biology (AREA)
  • Computing Systems (AREA)
  • Mathematical Physics (AREA)
  • Software Systems (AREA)
  • Character Discrimination (AREA)

Abstract

Provided in the present application are a named entity recognition method and apparatus, a device, and a computer readable storage medium, the method comprising: by means of a word encoding layer, obtaining a first word vector respectively corresponding to each word; by means of a character encoding layer and a bidirectional long short-term memory network layer, obtaining a second word vector respectively corresponding to each word; and inputting the first word vector and the second word vector respectively corresponding to each word into a named entity recognition layer to obtain a named entity. The present application can increase the precision of named entity recognition.

Description

命名实体识别方法、装置、设备及计算机可读存储介质Named entity recognition method, device, equipment and computer readable storage medium
本申请要求于2019年5月20日提交中国专利局、申请号为201910420794.X、发明名称为“命名实体识别方法、装置、设备及计算机可读存储介质”的中国专利申请的优先权,其全部内容通过引用结合在本申请中。This application claims the priority of a Chinese patent application filed with the Chinese Patent Office, the application number is 201910420794.X, and the invention title is "Named Entity Recognition Method, Apparatus, Equipment, and Computer-readable Storage Medium" on May 20, 2019. The entire content is incorporated into this application by reference.
技术领域Technical field
本申请涉及语义解析的技术领域,尤其涉及一种命名实体识别方法、装置、设备及计算机可读存储介质。This application relates to the technical field of semantic parsing, and in particular to a named entity recognition method, device, equipment, and computer-readable storage medium.
背景技术Background technique
命名实体识别(Named Entity Recognition,NER)是自然语言处理中的一项基础的任务,是指从文本中识别出命名性指称项,为关系抽取等任务做铺垫。狭义上是识别出人名、地名和组织机构名等专有名词。在智能面试场景中,需要对面试者的回答文本进行分析,从该回答文本中识别出命名实体,如人名、地名和机构名等,便于自动化的对面试者信息进行结构化处理,如将面试者的姓名、毕业院校和毕业院校所在地从回答文本中识别出来存放在数据库中。Named Entity Recognition (NER) is a basic task in natural language processing, which refers to identifying named referents from text, paving the way for tasks such as relation extraction. In a narrow sense, proper nouns such as names of persons, places and organizations are recognized. In the smart interview scenario, it is necessary to analyze the interviewer’s answer text, and identify named entities from the answer text, such as person’s name, place name, and organization’s name, so that the interviewer’s information can be structured automatically, such as the interview The name of the person, the school of graduation, and the location of the school of graduation are identified from the answer text and stored in the database.
对于中文命名实体识别,目前包括基于词的命名实体识别和基于字的命名实体识别,然而基于词的命名实体识别和基于字的命名实体识别,均存在语义信息缺失的情况,而缺失语义信息,则会导致命名实体的识别精确性不高的问题,因此,如何提高命名实体的识别精确性是目前亟待解决的问题。For Chinese named entity recognition, it currently includes word-based named entity recognition and word-based named entity recognition. However, word-based named entity recognition and word-based named entity recognition both have semantic information missing, and semantic information is missing. This will lead to the problem that the recognition accuracy of the named entity is not high. Therefore, how to improve the recognition accuracy of the named entity is a problem to be solved urgently.
发明内容Summary of the invention
本申请的主要目的在于提供一种命名实体识别方法、装置、设备及计算机可读存储介质,旨在提高命名实体的识别精确性。The main purpose of this application is to provide a named entity recognition method, device, equipment and computer-readable storage medium, aiming to improve the accuracy of named entity recognition.
第一方面,本申请提供一种命名实体识别方法,所述命名实体识别方法包括以下步骤:In the first aspect, this application provides a named entity recognition method, which includes the following steps:
当监测到命名实体识别请求时,根据所述命名实体识别请求,确定待识别的目标语句,并获取命名实体识别模型,其中,所述命名实体识别模型至少包括词编码层、字编码层、双向长短期记忆网络层和命名实体识别层;When a named entity recognition request is monitored, the target sentence to be recognized is determined according to the named entity recognition request, and a named entity recognition model is obtained, wherein the named entity recognition model includes at least a word encoding layer, a word encoding layer, and a bidirectional Long and short-term memory network layer and named entity recognition layer;
将所述目标语句输入至所述词编码层,得到所述目标语句中的每个词分别对应的第一词向量;Inputting the target sentence into the word coding layer to obtain a first word vector corresponding to each word in the target sentence;
将所述目标语句输入所述字编码层,得到所述目标语句中的每个字分别对应的目标字向量;Input the target sentence into the word encoding layer to obtain a target word vector corresponding to each word in the target sentence;
以词为单位,将每个词中的各个字的目标字向量依次输入至所述双向长短期记忆网络层,得到每个词分别对应的第二词向量;Using word as a unit, input the target word vector of each word in each word into the bidirectional long-term short-term memory network layer in turn to obtain a second word vector corresponding to each word;
将每个词分别对应的第一词向量和第二词向量输入至所述命名实体识别层,得到所述目标语句中的命名实体。The first word vector and the second word vector corresponding to each word are input into the named entity recognition layer to obtain the named entity in the target sentence.
第二方面,本申请还提供一种命名实体识别装置,所述命名实体识别装置包括:In the second aspect, the present application also provides a named entity recognition device, the named entity recognition device includes:
确定模块,用于当监测到命名实体识别请求时,根据所述命名实体识别请求,确定待识别的目标语句;The determining module is used to determine the target sentence to be recognized according to the named entity recognition request when the named entity recognition request is monitored;
获取模块,用于获取命名实体识别模型,其中,所述命名实体识别模型至少包括词编码层、字编码层、双向长短期记忆网络层和命名实体识别层;An acquisition module for acquiring a named entity recognition model, where the named entity recognition model includes at least a word encoding layer, a word encoding layer, a two-way long and short-term memory network layer, and a named entity recognition layer;
第一词向量确定模块,用于将所述目标语句输入至所述词编码层,得到所述目标语句中的每个词分别对应的第一词向量;The first word vector determining module is configured to input the target sentence into the word encoding layer to obtain a first word vector corresponding to each word in the target sentence;
字向量确定模块,用于将所述目标语句输入所述字编码层,得到所述目标语句中的每个字分别对应的目标字向量;A word vector determining module, configured to input the target sentence into the word encoding layer to obtain a target word vector corresponding to each word in the target sentence;
第二词向量确定模块,用于以词为单位,将每个词中的各个字的目标字向量依次输入至所述双向长短期记忆网络层,得到每个词分别对应的第二词向量;The second word vector determining module is used to input the target word vector of each word in each word into the two-way long-term short-term memory network layer in turn, to obtain a second word vector corresponding to each word respectively;
命名实体识别模块,用于将每个词分别对应的第一词向量和第二词向量输入至所述命名实体识别层,得到所述目标语句中的命名实体。The named entity recognition module is used to input the first word vector and the second word vector corresponding to each word into the named entity recognition layer to obtain the named entity in the target sentence.
第三方面,本申请还提供一种计算机设备,所述计算机设备包括处理器、存储器、以及存储在所述存储器上并可被所述处理器执行的计算机程序,其中所述计算机程序被所述处理器执行时,实现如上述的命名实体识别方法的步骤。In a third aspect, the present application also provides a computer device that includes a processor, a memory, and a computer program that is stored on the memory and can be executed by the processor, wherein the computer program is When the processor is executed, the steps of the above-mentioned named entity recognition method are realized.
第四方面,本申请还提供一种计算机可读存储介质,所述计算机可读存储介质上存储有计算机程序,其中所述计算机程序被处理器执行时,实现如上述的命名实体识别方法的步骤。In a fourth aspect, the present application also provides a computer-readable storage medium having a computer program stored on the computer-readable storage medium, and when the computer program is executed by a processor, the steps of the aforementioned named entity identification method are implemented .
本申请提供一种命名实体识别方法、装置、设备及计算机可读存储介质,本申请通过命名实体识别模型的词编码层,可以得到目标语句中的每个词在词粒度下的向量表示,而通过命名实体识别模型的字编码层和双向长短期记忆网络层,可以得到目标语句中的每个词在字粒度下的向量表示,可以减少字粒度下的信息丢失,然后结合每个词在字粒度和词粒度下的向量表示以及命名实体识别模型,可以精确的识别出语句中的命名实体,有效的提高了命名实体的识别精确性。This application provides a named entity recognition method, device, equipment, and computer-readable storage medium. This application uses the word encoding layer of the named entity recognition model to obtain the vector representation of each word in the target sentence at the word granularity, and Through the word encoding layer of the named entity recognition model and the two-way long and short-term memory network layer, the vector representation of each word in the target sentence at the word granularity can be obtained, which can reduce the loss of information at the word granularity, and then combine each word in the word The vector representation and the named entity recognition model under the granularity and word granularity can accurately identify the named entity in the sentence and effectively improve the accuracy of the recognition of the named entity.
附图说明Description of the drawings
为了更清楚地说明本申请实施例技术方案,下面将对实施例描述中所需要使用的附图作简单地介绍,显而易见地,下面描述中的附图是本申请的一些实施例,对于本领域普通技术人员来讲,在不付出创造性劳动的前提下,还可以根据这些附图获得其他的附图。In order to explain the technical solutions of the embodiments of the present application more clearly, the following will briefly introduce the drawings needed in the description of the embodiments. Obviously, the drawings in the following description are some embodiments of the present application. Ordinary technicians can obtain other drawings based on these drawings without creative work.
图1为本申请实施例提供的一种命名实体识别方法的流程示意图;FIG. 1 is a schematic flowchart of a named entity identification method provided by an embodiment of the application;
图2为本申请实施例提供的命名实体识别模型的一层级示意图;Figure 2 is a hierarchical schematic diagram of a named entity recognition model provided by an embodiment of the application;
图3为图1中的命名实体识别方法的子步骤流程示意图;FIG. 3 is a schematic flowchart of sub-steps of the named entity recognition method in FIG. 1;
图4为本申请实施例提供的另一种命名实体识别方法的流程示意图;4 is a schematic flowchart of another named entity identification method provided by an embodiment of the application;
图5为本申请实施例提供的一种命名实体识别装置的示意性框图;FIG. 5 is a schematic block diagram of a named entity recognition device provided by an embodiment of this application;
图6为图5中的命名实体识别装置的子模块的示意性框图;6 is a schematic block diagram of sub-modules of the named entity recognition device in FIG. 5;
图7为本申请实施例提供的另一种命名实体识别装置的示意性框图;FIG. 7 is a schematic block diagram of another named entity recognition device provided by an embodiment of this application;
图8为本申请一实施例涉及的计算机设备的结构示意框图。FIG. 8 is a schematic block diagram of the structure of a computer device related to an embodiment of the application.
本申请目的的实现、功能特点及优点将结合实施例,参照附图做进一步说明。The realization, functional characteristics, and advantages of the purpose of this application will be further described in conjunction with the embodiments and with reference to the accompanying drawings.
具体实施方式Detailed ways
下面将结合本申请实施例中的附图,对本申请实施例中的技术方案进行清楚、完整地描述,显然,所描述的实施例是本申请一部分实施例,而不是全部的实施例。基于本申请中的实施例,本领域普通技术人员在没有做出创造性劳动前提下所获得的所有其他实施例,都属于本申请保护的范围。The technical solutions in the embodiments of the present application will be described clearly and completely in conjunction with the accompanying drawings in the embodiments of the present application. Obviously, the described embodiments are part of the embodiments of the present application, rather than all of them. Based on the embodiments in this application, all other embodiments obtained by those of ordinary skill in the art without creative work shall fall within the protection scope of this application.
附图中所示的流程图仅是示例说明,不是必须包括所有的内容和操作/步骤,也不是必须按所描述的顺序执行。例如,有的操作/步骤还可以分解、组合或部分合并,因此实际执行的顺序有可能根据实际情况改变。The flowchart shown in the drawings is merely an illustration, and does not necessarily include all contents and operations/steps, nor does it have to be executed in the described order. For example, some operations/steps can also be decomposed, combined or partially combined, so the actual execution order may be changed according to actual conditions.
本申请实施例提供一种命名实体识别方法、装置、计算机设备及计算机可读存储介质。其中,该命名实体识别方法可应用于服务器中,该服务器可以为单台的服务器,也可以为服务器集群。The embodiments of the present application provide a named entity recognition method, device, computer equipment, and computer-readable storage medium. Wherein, the named entity identification method can be applied to a server, and the server can be a single server or a server cluster.
下面结合附图,对本申请的一些实施方式作详细说明。在不冲突的情况下,下述的实施例及实施例中的特征可以相互组合。Hereinafter, some embodiments of the present application will be described in detail with reference to the accompanying drawings. In the case of no conflict, the following embodiments and features in the embodiments can be combined with each other.
请参照图1,图1为本申请的实施例提供的一种命名实体识别方法的流程示意图。Please refer to FIG. 1. FIG. 1 is a schematic flowchart of a named entity recognition method according to an embodiment of the application.
如图1所示,该命名实体识别方法,用于精确的向用户推荐理财产品,其中该命名实体识别方法包括步骤S101至步骤S105。As shown in FIG. 1, the named entity identification method is used to accurately recommend wealth management products to users, wherein the named entity identification method includes steps S101 to S105.
步骤S101、当监测到命名实体识别请求时,根据所述命名实体识别请求,确定待识别的目标语句,并获取命名实体识别模型。Step S101: When a named entity recognition request is monitored, a target sentence to be recognized is determined according to the named entity recognition request, and a named entity recognition model is obtained.
其中,该命名实体识别模型为经过训练得到的,具体地,由于命名实体识别为有监督问题,为此,对样本数据集进行标注,设标注后的样本数据集为[X,Y],则输入为X=x_1,x_2,x_3,……,x_n,输出是Y=y_1,y_2,y_3,……,y_n,x_1表示句子序列中的第一个词,X表示由词构成的句子,y_1表示x_1对应的标注,Y表示标注构成的序列,在得到标注后的样本数据集[X,Y]之后,基于标注后的样本数据集对待训练的命名实体识别模型进行训练,直到待训练的命名实体识别模型收敛,从而得到命名实体识别模型。Among them, the named entity recognition model is obtained through training. Specifically, because the named entity recognition is a supervised problem, the sample data set is labeled for this reason, and the labeled sample data set is [X, Y], then The input is X=x_1,x_2,x_3,……,x_n, the output is Y=y_1,y_2,y_3,……,y_n, x_1 represents the first word in the sentence sequence, X represents a sentence composed of words, y_1 Represents the annotation corresponding to x_1, Y represents the sequence of annotations. After the labeled sample data set [X, Y] is obtained, the named entity recognition model to be trained is trained based on the labeled sample data set until the name to be trained The entity recognition model converges to obtain a named entity recognition model.
其中,该命名实体识别模型至少包括词编码层、字编码层、双向长短期记忆网络层和命名实体识别层,且命名实体识别层包括单向长短期记忆网络层和条件随机场(Conditional Random Field algorithm,CRF)层,需要说明的是,待训练的命名实体识别模型的损失函数可选为:Among them, the named entity recognition model includes at least a word encoding layer, a word encoding layer, a two-way long short-term memory network layer, and a named entity recognition layer, and the named entity recognition layer includes a one-way long short-term memory network layer and a conditional random field (Conditional Random Field). algorithm, CRF) layer. It should be noted that the loss function of the named entity recognition model to be trained can be selected as:
Figure PCTCN2019103141-appb-000001
Figure PCTCN2019103141-appb-000002
Figure PCTCN2019103141-appb-000001
And
Figure PCTCN2019103141-appb-000002
其中,e s(X,y)为语句X的序列分数,
Figure PCTCN2019103141-appb-000003
为所有语句的序列分数之和,Z i,x为句子X中第i个词在LSTM模型层的隐含层输出,y i为句子X中第i个词对应的标注,y i-1为句子X中第i-1个词对应的标注,n为句子X中词的个数,矩阵W和b,表示实体标签之间的转移概率,W中的元素为向量,而b中的元素为数值。由于损失函数中,单向长短期记忆网络层的隐含层输出与CRF层的概率转移矩阵之间的关系为相乘,则可以增大模型的假设空间,进一步地提高命名实体识别模型的识别精确性。
Among them, e s(X,y) is the sequence score of sentence X,
Figure PCTCN2019103141-appb-000003
Is the sum of the sequence scores of all sentences, Z i,x is the hidden layer output of the i-th word in sentence X in the hidden layer of the LSTM model layer, y i is the label corresponding to the i-th word in sentence X, and y i-1 is The label corresponding to the i-1th word in sentence X, n is the number of words in sentence X, matrices W and b represent the transition probability between entity tags, the elements in W are vectors, and the elements in b are Numerical value. In the loss function, the relationship between the hidden layer output of the one-way long and short-term memory network layer and the probability transition matrix of the CRF layer is multiplication, which can increase the hypothesis space of the model and further improve the recognition of the named entity recognition model Accuracy.
图2为本申请实施例提供的命名实体识别模型的一层级示意图,如图2所示,该命名实体识别模型包括词编码层、字编码层、双向长短期记忆网络层和命名实体识别层,且目标语句分别输入词编码层和字编码层。Fig. 2 is a hierarchical schematic diagram of a named entity recognition model provided by an embodiment of the application. As shown in Fig. 2, the named entity recognition model includes a word encoding layer, a word encoding layer, a two-way long short-term memory network layer, and a named entity recognition layer. And the target sentence is input into the word coding layer and the word coding layer respectively.
通过终端设备采集面试者的语音数据,并生成携带有该语音数据的命名实体识别请求,且将该命名实体识别请求发送至服务器,当服务器监测到该命名实体识别请求时,根据该命名实体识别请求,确定待识别的目标语句,并获取命名实体识别模型。其中,待识别的目标语句的确定方式具体为:从该命名实体请求中获取语音数据,并对该语音数据进行语音识别,以将该语音数据转换为文本语句,然后将该文本语句确定为待识别的目标语句。The interviewer’s voice data is collected through the terminal device, and a named entity recognition request carrying the voice data is generated, and the named entity recognition request is sent to the server. When the server detects the named entity recognition request, it will be recognized according to the named entity Request, determine the target sentence to be recognized, and obtain the named entity recognition model. The method for determining the target sentence to be recognized is specifically: acquiring voice data from the named entity request, and performing voice recognition on the voice data to convert the voice data into a text sentence, and then determining the text sentence as a pending sentence. The identified target sentence.
步骤S102、将所述目标语句输入至所述词编码层,得到所述目标语句中的每个词分别对应的第一词向量。Step S102: Input the target sentence into the word encoding layer to obtain a first word vector corresponding to each word in the target sentence.
在确定目标语句之后,该服务器将该目标语句输入至命名实体识别模型的词编码层,得到该目标语句中每个词分别对应的第一词向量,具体为:词编码层中预存一词向量矩阵,当目标语句输入到词编码层之后,对该目标语句执行拆分处理,以将目标语句拆分为若干词语,并根据该词向量矩阵,将若干词语中的每个词表示为对应的第一词向量,即从若干词中依次获取一个词,记为目标词,然后从该词向量矩阵中获取与该目标词对应的词向量,并将该词向量确定为该目标词的第一词向量,直至若干词中的每个词均获取一遍,从而可以得到该目标语句中每个词分别对应的第一词向量。After determining the target sentence, the server inputs the target sentence to the word encoding layer of the named entity recognition model, and obtains the first word vector corresponding to each word in the target sentence, specifically: a word vector stored in the word encoding layer Matrix, when the target sentence is input to the word coding layer, the target sentence is split into several words, and according to the word vector matrix, each word in the several words is represented as a corresponding The first word vector is to obtain a word from several words in turn, and record it as the target word, then obtain the word vector corresponding to the target word from the word vector matrix, and determine the word vector as the first target word The word vector is obtained once for each word in several words, so that the first word vector corresponding to each word in the target sentence can be obtained.
需要说明的是,词向量矩阵的一行表示一个词的词向量,且词向量矩阵可基于实际情况进行设置,本方案对此不作具体限定。It should be noted that one row of the word vector matrix represents the word vector of a word, and the word vector matrix can be set based on actual conditions, which is not specifically limited in this solution.
例如,词向量矩阵为:
Figure PCTCN2019103141-appb-000004
其中,词向量矩阵的第一行对应的词语为“苹果”,第二行对应的词语为“手机”,最后一行对应的词语为“模型”,因此,词语“苹果”的第一词向量为[0.1,0.34,......,0.89],词语“手机”的第一词向量为[0.98,0.3,......,0.76],词语“模型”的第二词向量为[0.77,0.3,......,0.22]。
For example, the word vector matrix is:
Figure PCTCN2019103141-appb-000004
Among them, the word corresponding to the first row of the word vector matrix is "apple", the word corresponding to the second row is "phone", and the word corresponding to the last row is "model". Therefore, the first word vector of the word "apple" is [0.1,0.34,......,0.89], the first word vector of the word "mobile phone" is [0.98,0.3,......,0.76], and the second word vector of the word "model" is [0.77,0.3,......,0.22].
步骤S103、将所述目标语句输入所述字编码层,得到所述目标语句中的每个字分别对应的目标字向量。Step S103: Input the target sentence into the word encoding layer to obtain a target word vector corresponding to each word in the target sentence.
在将目标语句输入词编码层的同时,将该目标语句输入至命名实体识别模型的字编码层,得到该目标语句中的每个字分别对应的目标字向量,具体为该字编码层中预存有一字向量矩阵,当目标语句输入至该字编码层之后,将该目标语句拆分为若干单字,并根据该字向量矩阵,确定目标语句中的每个字分别对应的目标字向量,即从若干单字中依次获取一个单字,记为目标单字,然后从该字向量矩阵中获取与该目标单字对应的字向量,并将该字向量确定为该目标单字的目标字向量,直至若干单字中的每个单字均获取一遍,从而可以得到该目标语句中每个字分别对应的目标字向量。需要说明的是,字向量矩阵的一行表示一个单字的字向量,且字向量矩阵可基于实际情况进行设置,本方案对此不作具体限定。While inputting the target sentence into the word encoding layer, the target sentence is input into the word encoding layer of the named entity recognition model to obtain the target word vector corresponding to each word in the target sentence, which is specifically pre-stored in the word encoding layer There is a word vector matrix. After the target sentence is input into the word coding layer, the target sentence is split into several single words, and the target word vector corresponding to each word in the target sentence is determined according to the word vector matrix, that is, from Obtain a word from several words one by one and record it as the target word, then obtain the word vector corresponding to the target word from the word vector matrix, and determine the word vector as the target word vector of the target word until the word vector in the word vector matrix Each single word is obtained once, so that the target word vector corresponding to each word in the target sentence can be obtained. It should be noted that a row of the word vector matrix represents a word vector of a single word, and the word vector matrix can be set based on actual conditions, and this solution does not specifically limit this.
步骤S104、以词为单位,将每个词中的各个字的目标字向量依次输入至所述双向长短期记忆网络层,得到每个词分别对应的第二词向量。Step S104: Using word as a unit, input the target word vector of each word in each word to the bidirectional long-term short-term memory network layer in turn to obtain a second word vector corresponding to each word.
在得到该目标语句中每个字的目标字向量之后,该服务器以词为单位,将每个词中的各个字的目标字向量依次输入至该命名实体识别模型的双向长短期记忆网络层,得到每个词分别对应的第二词向量。After obtaining the target word vector of each word in the target sentence, the server sequentially inputs the target word vector of each word in each word into the bidirectional long-term and short-term memory network layer of the named entity recognition model in units of words. Get the second word vector corresponding to each word.
在一实施例中,为了避免字粒度下的语义信息丢失,需要通过双向长短期记忆网络层表征字粒度下的语义信息,具体地,参照图3,步骤S104包括:子步骤S1041至子步骤S1042。In one embodiment, in order to avoid the loss of semantic information at word granularity, it is necessary to characterize the semantic information at word granularity through a bidirectional long-term short-term memory network layer. Specifically, referring to FIG. 3, step S104 includes: sub-step S1041 to sub-step S1042 .
子步骤S1041、以词为单位,将每个词中各个字的目标字向量依次输入至所述双向长短期记忆网络层,得到每个词中的各个字的正向隐含层输出和逆向隐含层输出。Sub-step S1041, in units of words, input the target word vector of each word in each word to the bidirectional long-term short-term memory network layer in turn to obtain the forward hidden layer output and reverse hidden layer of each word in each word Containing layer output.
在得到该目标语句中每个字的目标字向量之后,该服务器以词为单位,将每个词中各个字的目标字向量依次输入至双向长短期记忆网络层,得到每个词中的各个字的正向隐含层输出和逆向隐含层输出。其中,该双向长短期记忆网络层由一个正向循环神经网络(Recurrent Neural Network,RNN)和一个逆向RNN组成,双向长短期记忆网络为传统长短期记忆网络的扩展,可以提高序列分类问题的模型性能。After obtaining the target word vector of each word in the target sentence, the server uses the word as a unit to input the target word vector of each word in each word into the bidirectional long-term short-term memory network layer in turn to obtain each word in each word. The forward hidden layer output and the reverse hidden layer output of the word. Among them, the bidirectional long and short-term memory network layer is composed of a forward recurrent neural network (Recurrent Neural Network, RNN) and a reverse RNN. The bidirectional long and short-term memory network is an extension of the traditional long and short-term memory network, which can improve the model of sequence classification problems. performance.
子步骤S1042、根据每个词中的各个字的正向隐含层输出和逆向隐含层输出,确定每个词分别对应的第二词向量。Sub-step S1042, according to the forward hidden layer output and the reverse hidden layer output of each word in each word, determine the second word vector corresponding to each word.
在得到每个词中的各个字的正向隐含层输出和逆向隐含层输出之后,根据每个词中的各个字的正向隐含层输出和逆向隐含层输出,确定每个词分别对应的第二词向量,具体为:获取每个词的词首字对应的逆向隐含层输出以及词尾字对应的正向隐含层输出,并将每个词的词首字对应的逆向隐含层输出与词尾字对应的正向隐含层输出进行拼接,得到每个词分别对应的第二词向量。After obtaining the forward hidden layer output and the reverse hidden layer output of each word in each word, each word is determined according to the forward hidden layer output and the reverse hidden layer output of each word in each word The corresponding second word vector is specifically: get the reverse hidden layer output corresponding to the initial word of each word and the forward hidden layer output corresponding to the ending word, and the reverse direction corresponding to the initial word of each word The output of the hidden layer is spliced with the output of the forward hidden layer corresponding to the ending word to obtain the second word vector corresponding to each word.
需要说明的是,词首字对应的逆向隐含层输出与每个词的词尾字对应的正向隐含层输出的拼接方式为顺序拼接,例如,某个词语的词首字对应的逆向隐含层输出为[0.2,0.3,……,0.9],且词尾字对应的正向隐层输出为[0.8,0.7,……,0.4],则拼接得到的第二词向量为[0.2,0.3,……,0.9,0.8,0.7,……,0.4]。It should be noted that the splicing method of the reverse hidden layer output corresponding to the initial word and the forward hidden layer output corresponding to the ending word of each word is sequential splicing, for example, the reverse hidden layer corresponding to the initial word of a word The output of the containing layer is [0.2,0.3,……,0.9], and the output of the positive hidden layer corresponding to the ending word is [0.8,0.7,……,0.4], then the second word vector obtained by splicing is [0.2,0.3 ,……,0.9,0.8,0.7,……,0.4].
步骤S105、将每个词分别对应的第一词向量和第二词向量输入至所述命名实体识别层,得到所述目标语句中的命名实体。Step S105: Input the first word vector and the second word vector corresponding to each word to the named entity recognition layer to obtain the named entity in the target sentence.
在得到每个词分别对应的第一词向量和第二词向量之后,该服务器将每个词分别对应的第一词向量和第二词向量输入至该命名实体识别模型的命名实体识别层,得到该目标语句中的命名实体,即以词为单位,将每个词对应的第一词向量和第二词向量输入至该命名实体识别层中的单向长短期网络,得到每个词对应的隐含层输出,并将每个词对应的隐含层输出输入到该命名实体识别层中的CRF网络,得到每个词的实体标签,从而完成待识别语句中命名实体的识别。After obtaining the first word vector and the second word vector corresponding to each word, the server inputs the first word vector and the second word vector corresponding to each word into the named entity recognition layer of the named entity recognition model, Obtain the named entity in the target sentence, that is, take the word as a unit, input the first word vector and the second word vector corresponding to each word into the unidirectional long-term short-term network in the named entity recognition layer, and get each word corresponding The hidden layer output of each word is input to the CRF network in the named entity recognition layer to obtain the entity tag of each word, thereby completing the recognition of the named entity in the sentence to be recognized.
在一实施例中,第一词向量为词粒度下的语义信息表征,而第二词向量为字粒度下的语义信息表征,为提高命名实体准确性,需要融合词粒度和字粒度下的语义信息表征,具体地,以词为单位,将每个词对应的第一词向量和第二词向量依次输入至该命名实体识别层中的向量拼接子层,得到每个词对应的拼接词向量,然后将每个词对应的拼接词向量输入至该命名实体识别层中的命名实体识别子层,得到该目标语句中的命名实体,即以词为单位,将每个词对应的拼接词向量输入至命名实体识别子层中的单向长短期网络, 得到每个词对应的隐含层输出,并将每个词对应的隐含层输出输入到该命名实体识别子层中的CRF网络,得到每个词的实体标签,从而完成待识别语句中命名实体的识别。其中,该命名实体识别层包括向量拼接子层和命名实体识别子层,且命名实体识别子层由单向长短期网络和CRF网络组成。In an embodiment, the first word vector is a representation of semantic information at word granularity, and the second word vector is a representation of semantic information at word granularity. In order to improve the accuracy of named entities, it is necessary to merge the semantic information at word granularity and word granularity. Information representation, specifically, in units of words, the first word vector and second word vector corresponding to each word are sequentially input to the vector splicing sublayer in the named entity recognition layer to obtain the spliced word vector corresponding to each word , And then input the spliced word vector corresponding to each word to the named entity recognition sub-layer in the named entity recognition layer to obtain the named entity in the target sentence, that is, take the word as a unit, the spliced word vector corresponding to each word Input to the unidirectional long- and short-term network in the named entity recognition sublayer to obtain the hidden layer output corresponding to each word, and input the hidden layer output corresponding to each word to the CRF network in the named entity recognition sublayer, Obtain the entity label of each word, thereby completing the recognition of the named entity in the sentence to be recognized. Among them, the named entity recognition layer includes a vector splicing sublayer and a named entity recognition sublayer, and the named entity recognition sublayer is composed of a unidirectional long-term short-term network and a CRF network.
上述实施例提供的命名实体识别方法,通过命名实体识别模型的词编码层,可以得到目标语句中的每个词在词粒度下的向量表示,而通过命名实体识别模型的字编码层和双向长短期记忆网络层,可以得到目标语句中的每个词在字粒度下的向量表示,可以减少字粒度下的信息丢失,然后结合每个词在字粒度和词粒度下的向量表示以及命名实体识别模型,可以精确的识别出语句中的命名实体,有效的提高了命名实体的识别精确性。In the named entity recognition method provided by the foregoing embodiments, the word encoding layer of the named entity recognition model can obtain the vector representation of each word in the target sentence at the word granularity, and the word encoding layer and bidirectional length of the named entity recognition model The short-term memory network layer can obtain the vector representation of each word in the target sentence at the word granularity, which can reduce the loss of information at the word granularity, and then combine the vector representation of each word at the word granularity and the word granularity and named entity recognition The model can accurately identify the named entity in the sentence, which effectively improves the accuracy of the named entity recognition.
请参照图4,图4为本申请实施例提供的另一种命名实体识别方法的流程示意图。Please refer to FIG. 4, which is a schematic flowchart of another named entity recognition method provided by an embodiment of the application.
如图4所示,该命名实体识别方法包括步骤S201至205。As shown in FIG. 4, the named entity recognition method includes steps S201 to 205.
步骤S201、当监测到命名实体识别请求时,根据所述命名实体识别请求,确定待识别的目标语句,并获取命名实体识别模型。Step S201: When a named entity recognition request is monitored, determine the target sentence to be recognized according to the named entity recognition request, and obtain a named entity recognition model.
其中,该命名实体识别模型至少包括词编码层、字编码层、双向长短期记忆网络层和命名实体识别层,且命名实体识别层包括单向长短期记忆网络层和CRF层。Wherein, the named entity recognition model includes at least a word encoding layer, a word encoding layer, a two-way long short-term memory network layer, and a named entity recognition layer, and the named entity recognition layer includes a one-way long short-term memory network layer and a CRF layer.
通过终端设备采集面试者的语音数据,并生成携带有该语音数据的命名实体识别请求,且将该命名实体识别请求发送至服务器,当服务器监测到该命名实体识别请求时,根据该命名实体识别请求,确定待识别的目标语句,并获取命名实体识别模型。其中,待识别的目标语句的确定方式具体为:从该命名实体请求中获取语音数据,并对该语音数据进行语音识别,以将该语音数据转换为文本语句,然后将该文本语句确定为待识别的目标语句。The interviewer’s voice data is collected through the terminal device, and a named entity recognition request carrying the voice data is generated, and the named entity recognition request is sent to the server. When the server detects the named entity recognition request, it will be recognized according to the named entity Request, determine the target sentence to be recognized, and obtain the named entity recognition model. The method for determining the target sentence to be recognized is specifically: acquiring voice data from the named entity request, and performing voice recognition on the voice data to convert the voice data into a text sentence, and then determining the text sentence as a pending sentence. The identified target sentence.
步骤S202、将所述目标语句输入至所述词编码层,得到所述目标语句中的每个词分别对应的第一词向量。Step S202: Input the target sentence into the word encoding layer to obtain a first word vector corresponding to each word in the target sentence.
在确定目标语句之后,该服务器将该目标语句输入至命名实体识别模型的词编码层,得到该目标语句中每个词分别对应的第一词向量,具体为:词编码层中预存一词向量矩阵,当目标语句输入到词编码层之后,对该目标语句执行拆分处理,以将目标语句拆分为若干词语,并根据该词向量矩阵,将若干词语中的每个词表示为对应的第一词向量,即从若干词中依次获取一个词,记为目标词,然后从该词向量矩阵中获取与该目标词对应的词向量,并将该词向量确定为该目标词的第一词向量,直至若干词中的每个词均获取一遍,从而可以得到该目标语句中每个词分别对应的第一词向量。After determining the target sentence, the server inputs the target sentence to the word encoding layer of the named entity recognition model, and obtains the first word vector corresponding to each word in the target sentence, specifically: a word vector stored in the word encoding layer Matrix, when the target sentence is input to the word coding layer, the target sentence is split into several words, and according to the word vector matrix, each word in the several words is represented as a corresponding The first word vector is to obtain a word from several words in turn, and record it as the target word, then obtain the word vector corresponding to the target word from the word vector matrix, and determine the word vector as the first target word The word vector is obtained once for each word in several words, so that the first word vector corresponding to each word in the target sentence can be obtained.
步骤S203、将所述目标语句输入所述字编码层,得到所述目标语句中的每个字分别对应的目标字向量。Step S203: Input the target sentence into the word encoding layer to obtain a target word vector corresponding to each word in the target sentence.
在将目标语句输入词编码层的同时,将该目标语句输入至命名实体识别模型的字编码层,得到该目标语句中的每个字分别对应的目标字向量。为更准确的表征字粒度下的语义信息,通过融合字向量和拼音向量,可以得到各字对应的目标字向量,具体地,参照图4,步骤S203包括子步骤S2031至S2033。When the target sentence is input into the word encoding layer, the target sentence is input into the word encoding layer of the named entity recognition model, and the target word vector corresponding to each word in the target sentence is obtained. In order to more accurately represent the semantic information under the word granularity, the target word vector corresponding to each word can be obtained by fusing the word vector and the pinyin vector. Specifically, referring to FIG. 4, step S203 includes sub-steps S2031 to S2033.
子步骤S2031、将所述目标语句输入至所述字编码层中的字向量编码子层,得到所述目标语句中每个字分别对应的字向量。In sub-step S2031, the target sentence is input to the word vector coding sublayer in the word coding layer to obtain a word vector corresponding to each word in the target sentence.
其中,该字编码层包括字向量编码子层、拼音向量编码子层和向量拼接子层。将该目标语句输入至该字编码层中的字向量编码子层,得到该目标语 句中每个字分别对应的字向量,具体地,该字向量编码子层中预设有一字向量矩阵,将目标语句输入至字编码层中的字向量编码子层之后,通过该字向量编码子层中的字向量矩阵,获取目标语句中每个字分别对应的字向量,即将该目标语句拆分为若干单字,并从若干单字中依次获取一个单字,记为目标单字,然后从该字向量矩阵中获取与该目标单字对应的字向量,直至若干单字中的每个单字均获取一遍,从而可以得到该目标语句中每个字分别对应的字向量。需要说明的是,上述字向量矩阵可基于实际情况进行设置,本实施例对此不作具体限定。Among them, the word coding layer includes a word vector coding sublayer, a pinyin vector coding sublayer and a vector stitching sublayer. Input the target sentence to the word vector coding sublayer in the word coding layer to obtain the word vector corresponding to each word in the target sentence. Specifically, a word vector matrix is preset in the word vector coding sublayer, and After the target sentence is input to the word vector encoding sublayer in the word encoding layer, the word vector matrix in the word vector encoding sublayer is used to obtain the word vector corresponding to each word in the target sentence, which is to split the target sentence into several One word, and obtain a word from several words one by one, record it as the target word, and then obtain the word vector corresponding to the target word from the word vector matrix, until each word in the several words is obtained once, so that the The word vector corresponding to each word in the target sentence. It should be noted that the aforementioned word vector matrix can be set based on actual conditions, which is not specifically limited in this embodiment.
子步骤S2032、将所述目标语句输入至所述字编码层中的拼音向量编码子层,得到所述目标语句中每个字分别对应的拼音向量。In sub-step S2032, the target sentence is input to the pinyin vector coding sublayer in the word coding layer to obtain a pinyin vector corresponding to each word in the target sentence.
在将目标语句输入至字向量编码子层的同时,将该目标语句输入至该字编码层中的拼音向量编码子层,得到该目标语句中每个字分别对应的拼音向量,具体地,将该目标语句输入至字编码层中的拼音向量编码子层,并通过该拼音向量编码子层中的字符向量矩阵,获取该目标语句中的每个字包含的各拼音字符对应的字符向量,然后按照拼音字符的自然顺序,将每个字包含的各拼音字符对应的字符向量进行拼接,得到该目标语句中每个字分别对应的拼音向量。While inputting the target sentence into the word vector coding sublayer, input the target sentence into the pinyin vector coding sublayer in the word coding layer to obtain the pinyin vector corresponding to each word in the target sentence, specifically, The target sentence is input to the pinyin vector coding sublayer in the word coding layer, and the character vector matrix corresponding to each pinyin character contained in each word in the target sentence is obtained through the character vector matrix in the pinyin vector coding sublayer, and then According to the natural sequence of the pinyin characters, the character vectors corresponding to the pinyin characters contained in each word are spliced to obtain the pinyin vectors corresponding to each word in the target sentence.
例如,“朗”字包含的拼音字符分别为“l”、“a”、“n”和“g”,且自然顺序为l-a-n-g,设拼音字符“l”、“a”、“n”和“g”的字符向量分别为[0.1,0.36,......,0.89]、[0.9,0.3,......,0.76]、[0.88,0.4,......,0.46]和[0.6,0.3,......,0.36],则拼音字符“l”、“a”、“n”和“g”的字符向量进行拼接之后,得到的拼音向量为[0.1,0.36,......,0.89,0.9,0.3,......,0.76,0.88,0.4,......,0.46,0.6,0.3,......,0.36]。For example, the pinyin characters contained in the word "lang" are "l", "a", "n" and "g", and the natural order is lang. Let the pinyin characters "l", "a", "n" and " The character vectors of "g" are [0.1,0.36,......,0.89], [0.9,0.3,......,0.76], [0.88,0.4,......,0.46 ] And [0.6,0.3,......,0.36], then after the character vectors of the pinyin characters "l", "a", "n" and "g" are spliced, the resulting pinyin vector is [0.1, 0.36,......,0.89,0.9,0.3,......,0.76,0.88,0.4,......,0.46,0.6,0.3,......,0.36] .
子步骤S2033、以字为单位,将所述目标语句中每个字分别对应的字向量以及拼音向量依次输入至所述字编码层中的向量拼接子层,得到所述目标语句中每个字分别对应的目标字向量。Sub-step S2033, in units of words, input the word vector and the pinyin vector corresponding to each word in the target sentence into the vector splicing sub-layer of the word encoding layer in turn to obtain each word in the target sentence The corresponding target word vector respectively.
在确定每个字的字向量以及拼音向量之后,以字为单位,将目标语句中每个字分别对应的字向量以及拼音向量依次输入至该字编码层中的向量拼接子层,得到目标语句中每个字分别对应的目标字向量。其中,拼接方式包括字向量拼接在拼音向量之前和字向量拼接在拼音向量之后。例如,“国”的字向量和拼音向量分别为[0.2,0.36,......,0.86]和[0.3,0.56,......,0.89],则“国”的目标字向量可以为[0.2,0.36,......,0.86,0.3,0.56,......,0.89],“国”的目标字向量还可以为[0.3,0.56,......,0.89,0.2,0.36,......,0.86]。After determining the word vector and pinyin vector of each word, take the word as a unit, input the word vector and pinyin vector corresponding to each word in the target sentence into the vector splicing sub-layer in the word encoding layer in turn to obtain the target sentence Each word in the corresponding target word vector. Among them, the splicing method includes the word vector splicing before the pinyin vector and the word vector splicing after the pinyin vector. For example, the character vector and pinyin vector of "国" are [0.2,0.36,......,0.86] and [0.3,0.56,......,0.89], then the target character of "国" The vector can be [0.2,0.36,...,0.86,0.3,0.56,...,0.89], and the target word vector for "country" can also be [0.3,0.56,... ..,0.89,0.2,0.36,......,0.86].
步骤S204、以词为单位,将每个词中的各个字的目标字向量依次输入至所述双向长短期记忆网络层,得到每个词分别对应的第二词向量。Step S204: Using word as a unit, input the target word vector of each word in each word into the two-way long and short-term memory network layer in turn to obtain a second word vector corresponding to each word.
在得到该目标语句中每个字的目标字向量之后,该服务器以词为单位,将每个词中的各个字的目标字向量依次输入至该命名实体识别模型的双向长短期记忆网络层,得到每个词分别对应的第二词向量。After obtaining the target word vector of each word in the target sentence, the server sequentially inputs the target word vector of each word in each word into the bidirectional long-term and short-term memory network layer of the named entity recognition model in units of words. Get the second word vector corresponding to each word.
步骤S205、将每个词分别对应的第一词向量和第二词向量输入至所述命名实体识别层,得到所述目标语句中的命名实体。Step S205: Input the first word vector and the second word vector corresponding to each word into the named entity recognition layer to obtain the named entity in the target sentence.
在得到每个词分别对应的第一词向量和第二词向量之后,该服务器将每个词分别对应的第一词向量和第二词向量输入至该命名实体识别模型的命名实体识别层,得到该目标语句中的命名实体,即以词为单位,将每个词对应的第一词向量和第二词向量输入至该命名实体识别层中的单向长短期网络,得到每个词对应的隐含层输出,并将每个词对应的隐含层输出输入到该命名 实体识别层中的CRF网络,得到每个词的实体标签,从而完成待识别语句中命名实体的识别。After obtaining the first word vector and the second word vector corresponding to each word, the server inputs the first word vector and the second word vector corresponding to each word into the named entity recognition layer of the named entity recognition model, Obtain the named entity in the target sentence, that is, take the word as a unit, input the first word vector and the second word vector corresponding to each word into the unidirectional long-term short-term network in the named entity recognition layer, and get each word corresponding The hidden layer output of each word is input to the CRF network in the named entity recognition layer to obtain the entity tag of each word, thereby completing the recognition of the named entity in the sentence to be recognized.
上述实施例提供的命名实体识别方法,通过命名实体识别模型的词编码层,可以得到目标语句中的每个词在词粒度下的向量表示,通过字的字向量、拼音向量和双向长短期记忆网络层,可以进一步地准确表征字粒度下的语义信息,可以减少字粒度下的信息丢失,然后结合每个词在字粒度和词粒度下的向量表示以及命名实体识别模型,可以精确的识别出语句中的命名实体,有效的提高了命名实体的识别精确性。In the named entity recognition method provided by the foregoing embodiment, through the word encoding layer of the named entity recognition model, the vector representation of each word in the target sentence at the word granularity can be obtained, through the word vector, pinyin vector and two-way long and short-term memory The network layer can further accurately characterize the semantic information under the word granularity and reduce the loss of information under the word granularity. Then combined with the vector representation of each word in the word granularity and the word granularity and the named entity recognition model, it can accurately identify The named entity in the sentence effectively improves the recognition accuracy of the named entity.
请参照图5,图5为本申请实施例提供的一种命名实体识别装置的示意性框图。Please refer to FIG. 5, which is a schematic block diagram of a named entity recognition apparatus provided by an embodiment of the application.
如图5所示,该命名实体识别装置300,包括:确定模块301、获取模块302、第一词向量确定模块303、字向量确定模块304、第二词向量确定模块305和命名实体识别模块306。As shown in FIG. 5, the named entity recognition device 300 includes: a determination module 301, an acquisition module 302, a first word vector determination module 303, a word vector determination module 304, a second word vector determination module 305, and a named entity recognition module 306 .
确定模块301,用于当监测到命名实体识别请求时,根据所述命名实体识别请求,确定待识别的目标语句。The determining module 301 is configured to determine the target sentence to be recognized according to the named entity recognition request when a named entity recognition request is monitored.
获取模块302,用于获取命名实体识别模型,其中,所述命名实体识别模型至少包括词编码层、字编码层、双向长短期记忆网络层和命名实体识别层;The obtaining module 302 is configured to obtain a named entity recognition model, where the named entity recognition model includes at least a word encoding layer, a word encoding layer, a two-way long and short-term memory network layer, and a named entity recognition layer;
第一词向量确定模块303,用于将所述目标语句输入至所述词编码层,得到所述目标语句中的每个词分别对应的第一词向量。The first word vector determining module 303 is configured to input the target sentence into the word encoding layer to obtain a first word vector corresponding to each word in the target sentence.
字向量确定模块304,用于将所述目标语句输入所述字编码层,得到所述目标语句中的每个字分别对应的目标字向量。The word vector determining module 304 is configured to input the target sentence into the word encoding layer to obtain a target word vector corresponding to each word in the target sentence.
第二词向量确定模块305,用于以词为单位,将每个词中的各个字的目标字向量依次输入至所述双向长短期记忆网络层,得到每个词分别对应的第二词向量。The second word vector determining module 305 is configured to input the target word vector of each word in each word into the two-way long-term short-term memory network layer in turn to obtain the second word vector corresponding to each word in the unit of word .
在一个实施例中,如图6所示,所述第二词向量确定模块305包括:In an embodiment, as shown in FIG. 6, the second word vector determining module 305 includes:
隐含层输出确定子模块3051,用于以词为单位,将每个词中各个字的目标字向量依次输入至所述双向长短期记忆网络层,得到每个词中的各个字的正向隐含层输出和逆向隐含层输出;The hidden layer output determination sub-module 3051 is used to input the target word vector of each word in each word to the bidirectional long-term short-term memory network layer in turn in the unit of word, to obtain the forward direction of each word in each word Hidden layer output and reverse hidden layer output;
词向量确定子模块3052,用于根据每个词中的各个字的正向隐含层输出和逆向隐含层输出,确定每个词分别对应的第二词向量。The word vector determination sub-module 3052 is used to determine the second word vector corresponding to each word according to the forward hidden layer output and the reverse hidden layer output of each word in each word.
在一个实施例中,所述词向量确定子模块3052,还用于获取每个词的词首字对应的逆向隐含层输出以及词尾字对应的正向隐含层输出;将每个词的词首字对应的逆向隐含层输出与词尾字对应的正向隐含层输出进行拼接,得到每个词分别对应的第二词向量。In one embodiment, the word vector determining submodule 3052 is also used to obtain the reverse hidden layer output corresponding to the initial word of each word and the forward hidden layer output corresponding to the ending word; The output of the reverse hidden layer corresponding to the initial word is spliced with the output of the forward hidden layer corresponding to the ending word to obtain the second word vector corresponding to each word.
命名实体识别模块306,用于将每个词分别对应的第一词向量和第二词向量输入至所述命名实体识别层,得到所述目标语句中的命名实体。The named entity recognition module 306 is configured to input the first word vector and the second word vector corresponding to each word into the named entity recognition layer to obtain the named entity in the target sentence.
在一个实施例中,所述命名实体识别模块306,还用于以词为单位,将每个词对应的第一词向量和第二词向量依次输入至所述命名实体识别层中的向量拼接子层,得到每个词对应的拼接词向量;将每个词对应的拼接词向量输入至所述命名实体识别层中的命名实体识别子层,得到所述目标语句中的命名实体。In one embodiment, the named entity recognition module 306 is further configured to input the first word vector and the second word vector corresponding to each word into the vector splicing in the named entity recognition layer in order in units of words. The sublayer obtains the spliced word vector corresponding to each word; inputs the spliced word vector corresponding to each word to the named entity recognition sublayer in the named entity recognition layer to obtain the named entity in the target sentence.
请参照图7,图7为本申请实施例提供的另一种命名实体识别装置的示意性框图。Please refer to FIG. 7. FIG. 7 is a schematic block diagram of another named entity recognition apparatus provided by an embodiment of the application.
如图7所示,该命名实体识别装置400,包括:确定模块401、获取模块 402、第一词向量确定模块403、字向量确定模块404、第二词向量确定模块405和命名实体识别模块406。As shown in FIG. 7, the named entity recognition device 400 includes: a determination module 401, an acquisition module 402, a first word vector determination module 403, a word vector determination module 404, a second word vector determination module 405, and a named entity recognition module 406 .
确定模块401,用于当监测到命名实体识别请求时,根据所述命名实体识别请求,确定待识别的目标语句。The determining module 401 is configured to determine the target sentence to be recognized according to the named entity recognition request when a named entity recognition request is monitored.
获取模块402,用于获取命名实体识别模型,其中,所述命名实体识别模型至少包括词编码层、字编码层、双向长短期记忆网络层和命名实体识别层;The acquiring module 402 is configured to acquire a named entity recognition model, where the named entity recognition model includes at least a word encoding layer, a word encoding layer, a two-way long and short-term memory network layer, and a named entity recognition layer;
第一词向量确定模块403,用于将所述目标语句输入至所述词编码层,得到所述目标语句中的每个词分别对应的第一词向量。The first word vector determining module 403 is configured to input the target sentence into the word encoding layer to obtain a first word vector corresponding to each word in the target sentence.
字向量确定模块404,用于将所述目标语句输入所述字编码层,得到所述目标语句中的每个字分别对应的目标字向量。The word vector determining module 404 is configured to input the target sentence into the word encoding layer to obtain a target word vector corresponding to each word in the target sentence.
在一个实施例中,如图7所示,所述字向量确定模块404包括:In an embodiment, as shown in FIG. 7, the word vector determining module 404 includes:
字向量确定子模块4041,用于将所述目标语句输入至所述字编码层中的字向量编码子层,得到所述目标语句中每个字分别对应的字向量;The word vector determining submodule 4041 is configured to input the target sentence into the word vector encoding sublayer in the word encoding layer to obtain a word vector corresponding to each word in the target sentence;
拼音向量确定子模块4042,用于将所述目标语句输入至所述字编码层中的拼音向量编码子层,得到所述目标语句中每个字分别对应的拼音向量;The pinyin vector determining submodule 4042 is used to input the target sentence into the pinyin vector coding sublayer in the word coding layer to obtain the pinyin vector corresponding to each word in the target sentence;
目标字向量确定子模块4043,用于以字为单位,将所述目标语句中每个字分别对应的字向量以及拼音向量依次输入至所述字编码层中的向量拼接子层,得到所述目标语句中每个字分别对应的目标字向量。The target word vector determination sub-module 4043 is used to input the word vector and the pinyin vector corresponding to each word in the target sentence into the vector splicing sub-layer of the word encoding layer in order in units of words to obtain the Each word in the target sentence corresponds to the target word vector.
在一个实施例中,所述字向量确定子模块4041,还用于将所述目标语句输入至所述字编码层中的字向量编码子层;通过所述字向量编码子层中的字向量矩阵,获取所述目标语句中每个字分别对应的字向量。In one embodiment, the word vector determining sub-module 4041 is further configured to input the target sentence into the word vector coding sublayer in the word coding layer; the word vector in the word vector coding sublayer Matrix to obtain the word vector corresponding to each word in the target sentence.
在一个实施例中,所述拼音向量确定子模块4042,还用于将所述目标语句输入至所述字编码层中的拼音向量编码子层;通过所述拼音向量编码子层中的字符向量矩阵,获取所述目标语句中的每个字包含的各拼音字符对应的字符向量;将每个字包含的各拼音字符对应的字符向量进行拼接,得到所述目标语句中每个字分别对应的拼音向量。In one embodiment, the pinyin vector determining sub-module 4042 is further configured to input the target sentence into the pinyin vector coding sublayer in the character coding layer; the character vector in the pinyin vector coding sublayer is coded by the pinyin vector Matrix to obtain the character vector corresponding to each pinyin character contained in each word in the target sentence; splicing the character vector corresponding to each pinyin character contained in each word to obtain the corresponding character of each word in the target sentence Pinyin vector.
第二词向量确定模块405,用于以词为单位,将每个词中的各个字的目标字向量依次输入至所述双向长短期记忆网络层,得到每个词分别对应的第二词向量。The second word vector determining module 405 is configured to input the target word vector of each word in each word into the two-way long-term short-term memory network layer in turn to obtain a second word vector corresponding to each word in word units .
命名实体识别模块406,用于将每个词分别对应的第一词向量和第二词向量输入至所述命名实体识别层,得到所述目标语句中的命名实体。The named entity recognition module 406 is configured to input the first word vector and the second word vector corresponding to each word into the named entity recognition layer to obtain the named entity in the target sentence.
在一个实施例中,所述命名实体识别模块406,还用于以词为单位,将每个词对应的第一词向量和第二词向量依次输入至所述命名实体识别层中的向量拼接子层,得到每个词对应的拼接词向量;将每个词对应的拼接词向量输入至所述命名实体识别层中的命名实体识别子层,得到所述目标语句中的命名实体。In one embodiment, the named entity recognition module 406 is further configured to input the first word vector and the second word vector corresponding to each word into the vector splicing in the named entity recognition layer in order in units of words. The sublayer obtains the spliced word vector corresponding to each word; inputs the spliced word vector corresponding to each word to the named entity recognition sublayer in the named entity recognition layer to obtain the named entity in the target sentence.
需要说明的是,所属领域的技术人员可以清楚地了解到,为了描述的方便和简洁,上述描述的装置和各模块及单元的具体工作过程,可以参考前述命名实体识别方法实施例中的对应过程,在此不再赘述。It should be noted that those skilled in the art can clearly understand that for the convenience and brevity of description, the specific working process of the above described device and each module and unit can refer to the corresponding process in the aforementioned named entity recognition method embodiment , I won’t repeat it here.
上述实施例提供的装置可以实现为一种计算机程序的形式,该计算机程序可以在如图8所示的计算机设备上运行。The apparatus provided in the foregoing embodiment may be implemented in the form of a computer program, and the computer program may run on the computer device as shown in FIG. 8.
请参阅图8,图8为本申请实施例提供的一种计算机设备的结构示意性框图。该计算机设备可以为服务器。Please refer to FIG. 8. FIG. 8 is a schematic block diagram of a structure of a computer device according to an embodiment of the application. The computer device may be a server.
如图8所示,该计算机设备包括通过系统总线连接的处理器、存储器和 网络接口,其中,存储器可以包括非易失性存储介质和内存储器。As shown in FIG. 8, the computer device includes a processor, a memory, and a network interface connected through a system bus, where the memory may include a non-volatile storage medium and an internal memory.
非易失性存储介质可存储操作系统和计算机程序。该计算机程序包括程序指令,该程序指令被执行时,可使得处理器执行任意一种命名实体识别方法。The non-volatile storage medium can store an operating system and a computer program. The computer program includes program instructions. When the program instructions are executed, the processor can execute any named entity recognition method.
处理器用于提供计算和控制能力,支撑整个计算机设备的运行。The processor is used to provide computing and control capabilities and support the operation of the entire computer equipment.
内存储器为非易失性存储介质中的计算机程序的运行提供环境,该计算机程序被处理器执行时,可使得处理器执行任意一种命名实体识别方法。The internal memory provides an environment for the running of the computer program in the non-volatile storage medium. When the computer program is executed by the processor, the processor can execute any named entity identification method.
该网络接口用于进行网络通信,如发送分配的任务等。本领域技术人员可以理解,图8中示出的结构,仅仅是与本申请方案相关的部分结构的框图,并不构成对本申请方案所应用于其上的计算机设备的限定,具体的计算机设备可以包括比图中所示更多或更少的部件,或者组合某些部件,或者具有不同的部件布置。The network interface is used for network communication, such as sending assigned tasks. Those skilled in the art can understand that the structure shown in FIG. 8 is only a block diagram of a part of the structure related to the solution of the present application, and does not constitute a limitation on the computer device to which the solution of the present application is applied. The specific computer device may Including more or fewer parts than shown in the figure, or combining some parts, or having a different arrangement of parts.
应当理解的是,处理器可以是中央处理单元(Central Processing Unit,CPU),该处理器还可以是其他通用处理器、数字信号处理器(Digital Signal Processor,DSP)、专用集成电路(Application Specific Integrated Circuit,ASIC)、现场可编程门阵列(Field-Programmable Gate Array,FPGA)或者其他可编程逻辑器件、分立门或者晶体管逻辑器件、分立硬件组件等。其中,通用处理器可以是微处理器或者该处理器也可以是任何常规的处理器等。It should be understood that the processor may be a central processing unit (Central Processing Unit, CPU), the processor may also be other general-purpose processors, digital signal processors (Digital Signal Processor, DSP), and application specific integrated circuits (Application Specific Integrated Circuits). Circuit, ASIC), Field-Programmable Gate Array (FPGA) or other programmable logic devices, discrete gates or transistor logic devices, discrete hardware components, etc. Among them, the general-purpose processor may be a microprocessor or the processor may also be any conventional processor.
其中,在一个实施例中,所述处理器用于运行存储在存储器中的计算机程序,以实现如下步骤:Wherein, in an embodiment, the processor is used to run a computer program stored in a memory to implement the following steps:
当监测到命名实体识别请求时,根据所述命名实体识别请求,确定待识别的目标语句,并获取命名实体识别模型,其中,所述命名实体识别模型至少包括词编码层、字编码层、双向长短期记忆网络层和命名实体识别层;When a named entity recognition request is monitored, the target sentence to be recognized is determined according to the named entity recognition request, and a named entity recognition model is obtained, wherein the named entity recognition model includes at least a word encoding layer, a word encoding layer, and a bidirectional Long and short-term memory network layer and named entity recognition layer;
将所述目标语句输入至所述词编码层,得到所述目标语句中的每个词分别对应的第一词向量;Inputting the target sentence into the word coding layer to obtain a first word vector corresponding to each word in the target sentence;
将所述目标语句输入所述字编码层,得到所述目标语句中的每个字分别对应的目标字向量;Input the target sentence into the word encoding layer to obtain a target word vector corresponding to each word in the target sentence;
以词为单位,将每个词中的各个字的目标字向量依次输入至所述双向长短期记忆网络层,得到每个词分别对应的第二词向量;Using word as a unit, input the target word vector of each word in each word into the bidirectional long-term short-term memory network layer in turn to obtain a second word vector corresponding to each word;
将每个词分别对应的第一词向量和第二词向量输入至所述命名实体识别层,得到所述目标语句中的命名实体。The first word vector and the second word vector corresponding to each word are input into the named entity recognition layer to obtain the named entity in the target sentence.
在一个实施例中,所述处理器在实现以词为单位,将每个词中的各个字的目标字向量依次输入至所述双向长短期记忆网络层,得到每个词分别对应的第二词向量时,用于实现:In one embodiment, the processor realizes that the target word vector of each word in each word is sequentially input to the bidirectional long-term and short-term memory network layer in the unit of words to obtain the second corresponding to each word. When using word vectors, it is used to achieve:
以词为单位,将每个词中各个字的目标字向量依次输入至所述双向长短期记忆网络层,得到每个词中的各个字的正向隐含层输出和逆向隐含层输出;Using word as a unit, input the target word vector of each word in each word to the bidirectional long-short-term memory network layer in turn to obtain the forward hidden layer output and the reverse hidden layer output of each word in each word;
根据每个词中的各个字的正向隐含层输出和逆向隐含层输出,确定每个词分别对应的第二词向量。According to the forward hidden layer output and the reverse hidden layer output of each word in each word, the second word vector corresponding to each word is determined.
在一个实施例中,所述处理器在实现根据每个词中各个字的正向隐含层输出和逆向隐含层输出,确定每个词分别对应的第二词向量时,用于实现:In one embodiment, when the processor determines the second word vector corresponding to each word according to the forward hidden layer output and the reverse hidden layer output of each word in each word, it is used to achieve:
获取每个词的词首字对应的逆向隐含层输出以及词尾字对应的正向隐含层输出;Obtain the reverse hidden layer output corresponding to the initial word of each word and the forward hidden layer output corresponding to the ending word;
将每个词的词首字对应的逆向隐含层输出与词尾字对应的正向隐含层输出进行拼接,得到每个词分别对应的第二词向量。The reverse hidden layer output corresponding to the initial word of each word is spliced with the forward hidden layer output corresponding to the ending word to obtain the second word vector corresponding to each word.
在一个实施例中,所述处理器在实现将每个词分别对应的第一词向量和第二词向量输入至所述命名实体识别层,得到所述目标语句中的命名实体时,用于实现:In one embodiment, when the processor realizes that the first word vector and the second word vector corresponding to each word are input into the named entity recognition layer to obtain the named entity in the target sentence, it is used for achieve:
以词为单位,将每个词对应的第一词向量和第二词向量依次输入至所述命名实体识别层中的向量拼接子层,得到每个词对应的拼接词向量;In units of words, input the first word vector and the second word vector corresponding to each word to the vector splicing sub-layer in the named entity recognition layer in order to obtain the spliced word vector corresponding to each word;
将每个词对应的拼接词向量输入至所述命名实体识别层中的命名实体识别子层,得到所述目标语句中的命名实体。The spliced word vector corresponding to each word is input to the named entity recognition sub-layer in the named entity recognition layer to obtain the named entity in the target sentence.
其中,在另一实施例中,所述处理器用于运行存储在存储器中的计算机程序,以实现将所述目标语句输入所述字编码层,得到所述目标语句中的每个字分别对应的目标字向量的步骤包括:Wherein, in another embodiment, the processor is configured to run a computer program stored in a memory, so as to input the target sentence into the word encoding layer to obtain a corresponding corresponding to each word in the target sentence. The steps of the target word vector include:
将所述目标语句输入至所述字编码层中的字向量编码子层,得到所述目标语句中每个字分别对应的字向量;Input the target sentence to the word vector coding sublayer in the word coding layer to obtain a word vector corresponding to each word in the target sentence;
将所述目标语句输入至所述字编码层中的拼音向量编码子层,得到所述目标语句中每个字分别对应的拼音向量;Inputting the target sentence into the pinyin vector coding sublayer in the word coding layer to obtain a pinyin vector corresponding to each word in the target sentence;
以字为单位,将所述目标语句中每个字分别对应的字向量以及拼音向量依次输入至所述字编码层中的向量拼接子层,得到所述目标语句中每个字分别对应的目标字向量。In units of words, the word vector and pinyin vector corresponding to each word in the target sentence are sequentially input into the vector splicing sublayer in the word encoding layer to obtain the target corresponding to each word in the target sentence. Word vector.
在一个实施例中,所述处理器在实现将所述目标语句输入至所述字编码层中的字向量编码子层,得到所述目标语句中每个字分别对应的字向量时,用于实现:In one embodiment, the processor is configured to input the target sentence into the word vector encoding sublayer in the word encoding layer to obtain the word vector corresponding to each word in the target sentence. achieve:
将所述目标语句输入至所述字编码层中的字向量编码子层;Inputting the target sentence into the word vector coding sublayer in the word coding layer;
通过所述字向量编码子层中的字向量矩阵,获取所述目标语句中每个字分别对应的字向量。Through the word vector matrix in the word vector encoding sublayer, the word vector corresponding to each word in the target sentence is obtained.
在一个实施例中,所述处理器在实现将所述目标语句输入至所述字编码层中的拼音向量编码子层,得到所述目标语句中每个字分别对应的拼音向量时,用于实现:In an embodiment, the processor is configured to input the target sentence to the pinyin vector coding sublayer in the word coding layer to obtain the pinyin vector corresponding to each word in the target sentence achieve:
将所述目标语句输入至所述字编码层中的拼音向量编码子层;Inputting the target sentence into the pinyin vector coding sublayer in the word coding layer;
通过所述拼音向量编码子层中的字符向量矩阵,获取所述目标语句中的每个字包含的各拼音字符对应的字符向量;Obtaining a character vector corresponding to each pinyin character contained in each word in the target sentence through the character vector matrix in the pinyin vector encoding sublayer;
将每个字包含的各拼音字符对应的字符向量进行拼接,得到所述目标语句中每个字分别对应的拼音向量。The character vectors corresponding to the pinyin characters contained in each word are spliced to obtain the pinyin vectors corresponding to each word in the target sentence.
本申请实施例还提供一种计算机可读存储介质,所述计算机可读存储介质上存储有计算机程序,所述计算机程序中包括程序指令,所述程序指令被执行时所实现的方法可参照本申请命名实体识别方法的各个实施例。The embodiments of the present application also provide a computer-readable storage medium, the computer-readable storage medium stores a computer program, the computer program includes program instructions, and the method implemented when the program instructions are executed can refer to this Various embodiments of the named entity recognition method are applied.
其中,所述计算机可读存储介质可以是前述实施例所述的计算机设备的内部存储单元,例如所述计算机设备的硬盘或内存。所述计算机可读存储介质也可以是所述计算机设备的外部存储设备,例如所述计算机设备上配备的插接式硬盘,智能存储卡(Smart Media Card,SMC),安全数字(Secure Digital,SD)卡,闪存卡(Flash Card)等。The computer-readable storage medium may be the internal storage unit of the computer device described in the foregoing embodiment, such as the hard disk or memory of the computer device. The computer-readable storage medium may also be an external storage device of the computer device, such as a plug-in hard disk, a smart memory card (SMC), or a secure digital (Secure Digital, SD) equipped on the computer device. ) Card, Flash Card, etc.
需要说明的是,在本文中,术语“包括”、“包含”或者其任何其他变体意在涵盖非排他性的包含,从而使得包括一系列要素的过程、方法、物品或者系统不仅包括那些要素,而且还包括没有明确列出的其他要素,或者是还包括为这种过程、方法、物品或者系统所固有的要素。在没有更多限制的情况下,由语句“包括一个……”限定的要素,并不排除在包括该要素的过程、方法、物 品或者系统中还存在另外的相同要素。It should be noted that in this article, the terms "include", "include" or any other variants thereof are intended to cover non-exclusive inclusion, so that a process, method, article or system including a series of elements not only includes those elements, It also includes other elements that are not explicitly listed, or elements inherent to the process, method, article, or system. Without more restrictions, the element defined by the sentence "including a..." does not exclude the existence of other identical elements in the process, method, article or system that includes the element.
上述本申请实施例序号仅仅为了描述,不代表实施例的优劣。以上所述,仅为本申请的具体实施方式,但本申请的保护范围并不局限于此,任何熟悉本技术领域的技术人员在本申请揭露的技术范围内,可轻易想到各种等效的修改或替换,这些修改或替换都应涵盖在本申请的保护范围之内。因此,本申请的保护范围应以权利要求的保护范围为准。The serial numbers of the foregoing embodiments of the present application are only for description, and do not represent the advantages and disadvantages of the embodiments. The above are only specific implementations of this application, but the protection scope of this application is not limited to this. Anyone familiar with the technical field can easily think of various equivalents within the technical scope disclosed in this application. Modifications or replacements, these modifications or replacements shall be covered within the protection scope of this application. Therefore, the protection scope of this application shall be subject to the protection scope of the claims.

Claims (20)

  1. 一种命名实体识别方法,包括:A named entity recognition method, including:
    当监测到命名实体识别请求时,根据所述命名实体识别请求,确定待识别的目标语句;When a named entity recognition request is monitored, determine the target sentence to be recognized according to the named entity recognition request;
    获取命名实体识别模型,其中,所述命名实体识别模型至少包括词编码层、字编码层、双向长短期记忆网络层和命名实体识别层,所述双向长短期记忆网络层包括正向循环神经网络和逆向循环神经网络;Obtain a named entity recognition model, where the named entity recognition model includes at least a word encoding layer, a word encoding layer, a bidirectional long and short-term memory network layer, and a named entity recognition layer, and the bidirectional long and short-term memory network layer includes a forward loop neural network And reverse loop neural network;
    将所述目标语句输入至所述词编码层,得到所述目标语句中的每个词分别对应的第一词向量;Inputting the target sentence into the word coding layer to obtain a first word vector corresponding to each word in the target sentence;
    将所述目标语句输入所述字编码层,得到所述目标语句中的每个字分别对应的目标字向量;Input the target sentence into the word encoding layer to obtain a target word vector corresponding to each word in the target sentence;
    以词为单位,将每个词中各个字的目标字向量依次输入至所述双向长短期记忆网络层,得到每个词中的各个字的正向隐含层输出和逆向隐含层输出,并将每个词的词首字对应的所述逆向隐含层输出与词尾字对应的所述正向隐含层输出进行拼接,得到每个词分别对应的第二词向量;In units of words, the target word vectors of each word in each word are sequentially input to the bidirectional long- and short-term memory network layer to obtain the forward hidden layer output and the reverse hidden layer output of each word in each word, And concatenate the output of the reverse hidden layer corresponding to the initial word of each word and the output of the forward hidden layer corresponding to the ending word to obtain a second word vector corresponding to each word;
    将每个词分别对应的第一词向量和第二词向量输入至所述命名实体识别层,得到所述目标语句中的命名实体。The first word vector and the second word vector corresponding to each word are input into the named entity recognition layer to obtain the named entity in the target sentence.
  2. 如权利要求1所述的命名实体识别方法,其中,所述将每个词分别对应的第一词向量和第二词向量输入至所述命名实体识别层,得到所述目标语句中的命名实体的步骤包括:The method for recognizing a named entity according to claim 1, wherein the first word vector and the second word vector corresponding to each word are input into the named entity recognition layer to obtain the named entity in the target sentence The steps include:
    以词为单位,将每个词对应的第一词向量和第二词向量依次输入至所述命名实体识别层中的向量拼接子层,得到每个词对应的拼接词向量;In units of words, input the first word vector and the second word vector corresponding to each word to the vector splicing sub-layer in the named entity recognition layer in order to obtain the spliced word vector corresponding to each word;
    将每个词对应的拼接词向量输入至所述命名实体识别层中的命名实体识别子层,得到所述目标语句中的命名实体。The spliced word vector corresponding to each word is input to the named entity recognition sub-layer in the named entity recognition layer to obtain the named entity in the target sentence.
  3. 如权利要求1所述的命名实体识别方法,其中,所述将所述目标语句输入所述字编码层,得到所述目标语句中的每个字分别对应的目标字向量的步骤包括:5. The named entity recognition method according to claim 1, wherein the step of inputting the target sentence into the word encoding layer to obtain the target word vector corresponding to each word in the target sentence comprises:
    将所述目标语句输入至所述字编码层中的字向量编码子层,得到所述目标语句中每个字分别对应的字向量;Input the target sentence to the word vector coding sublayer in the word coding layer to obtain a word vector corresponding to each word in the target sentence;
    将所述目标语句输入至所述字编码层中的拼音向量编码子层,得到所述目标语句中每个字分别对应的拼音向量;Inputting the target sentence into the pinyin vector coding sublayer in the word coding layer to obtain a pinyin vector corresponding to each word in the target sentence;
    以字为单位,将所述目标语句中每个字分别对应的字向量以及拼音向量依次输入至所述字编码层中的向量拼接子层,得到所述目标语句中每个字分别对应的目标字向量。In units of words, the word vector and pinyin vector corresponding to each word in the target sentence are sequentially input into the vector splicing sublayer in the word encoding layer to obtain the target corresponding to each word in the target sentence. Word vector.
  4. 如权利要求3所述的命名实体识别方法,其中,所述将所述目标语句输入至所述字编码层中的字向量编码子层,得到所述目标语句中每个字分别对应的字向量的步骤包括:The named entity recognition method according to claim 3, wherein the input of the target sentence into the word vector encoding sublayer in the word encoding layer obtains the word vector corresponding to each word in the target sentence The steps include:
    将所述目标语句输入至所述字编码层中的字向量编码子层;Inputting the target sentence into the word vector coding sublayer in the word coding layer;
    通过所述字向量编码子层中的字向量矩阵,获取所述目标语句中每个字分别对应的字向量。Through the word vector matrix in the word vector encoding sublayer, the word vector corresponding to each word in the target sentence is obtained.
  5. 如权利要求3所述的命名实体识别方法,其中,所述将所述目标语句输入至所述字编码层中的拼音向量编码子层,得到所述目标语句中每个字分别对应的拼音向量的步骤包括:The named entity recognition method according to claim 3, wherein said inputting said target sentence into a pinyin vector coding sublayer in said character coding layer to obtain a pinyin vector corresponding to each word in said target sentence The steps include:
    将所述目标语句输入至所述字编码层中的拼音向量编码子层;Inputting the target sentence into the pinyin vector coding sublayer in the word coding layer;
    通过所述拼音向量编码子层中的字符向量矩阵,获取所述目标语句中的每个字包含的各拼音字符对应的字符向量;Obtaining a character vector corresponding to each pinyin character contained in each word in the target sentence through the character vector matrix in the pinyin vector encoding sublayer;
    将每个字包含的各拼音字符对应的字符向量进行拼接,得到所述目标语句中每个字分别对应的拼音向量。The character vectors corresponding to the pinyin characters contained in each word are spliced to obtain the pinyin vectors corresponding to each word in the target sentence.
  6. 一种命名实体识别装置,其中,所述命名实体识别装置包括:A named entity recognition device, wherein the named entity recognition device includes:
    确定模块,用于当监测到命名实体识别请求时,根据所述命名实体识别请求,确定待识别的目标语句;The determining module is used to determine the target sentence to be recognized according to the named entity recognition request when the named entity recognition request is monitored;
    获取模块,用于获取命名实体识别模型,其中,所述命名实体识别模型至少包括词编码层、字编码层、双向长短期记忆网络层和命名实体识别层,所述双向长短期记忆网络层包括正向循环神经网络和逆向循环神经网络;An acquisition module for acquiring a named entity recognition model, where the named entity recognition model includes at least a word encoding layer, a word encoding layer, a two-way long and short-term memory network layer, and a named entity recognition layer. The two-way long and short-term memory network layer includes Forward loop neural network and reverse loop neural network;
    第一词向量确定模块,用于将所述目标语句输入至所述词编码层,得到所述目标语句中的每个词分别对应的第一词向量;The first word vector determining module is configured to input the target sentence into the word encoding layer to obtain a first word vector corresponding to each word in the target sentence;
    字向量确定模块,用于将所述目标语句输入所述字编码层,得到所述目标语句中的每个字分别对应的目标字向量;A word vector determining module, configured to input the target sentence into the word encoding layer to obtain a target word vector corresponding to each word in the target sentence;
    第二词向量确定模块,用于以词为单位,将每个词中各个字的目标字向量依次输入至所述双向长短期记忆网络层,得到每个词中的各个字的正向隐含层输出和逆向隐含层输出,并将每个词的词首字对应的所述逆向隐含层输出与词尾字对应的所述正向隐含层输出进行拼接,得到每个词分别对应的第二词向量;The second word vector determination module is used to input the target word vector of each word in each word into the two-way long and short-term memory network layer in turn to obtain the positive implied meaning of each word in each word. Layer output and reverse hidden layer output, and the reverse hidden layer output corresponding to the initial word of each word and the forward hidden layer output corresponding to the ending word are spliced to obtain the corresponding corresponding to each word Second word vector
    命名实体识别模块,用于将每个词分别对应的第一词向量和第二词向量输入至所述命名实体识别层,得到所述目标语句中的命名实体。The named entity recognition module is used to input the first word vector and the second word vector corresponding to each word into the named entity recognition layer to obtain the named entity in the target sentence.
  7. 如权利要求6所述的命名实体识别装置,其中,所述命名实体识别模块,还用于:The named entity recognition device according to claim 6, wherein the named entity recognition module is further used for:
    以词为单位,将每个词对应的第一词向量和第二词向量依次输入至所述命名实体识别层中的向量拼接子层,得到每个词对应的拼接词向量;In units of words, input the first word vector and the second word vector corresponding to each word to the vector splicing sub-layer in the named entity recognition layer in order to obtain the spliced word vector corresponding to each word;
    将每个词对应的拼接词向量输入至所述命名实体识别层中的命名实体识别子层,得到所述目标语句中的命名实体。The spliced word vector corresponding to each word is input to the named entity recognition sub-layer in the named entity recognition layer to obtain the named entity in the target sentence.
  8. 如权利要求6所述的命名实体识别装置,其中,所述字向量确定模块包括:7. The named entity recognition device of claim 6, wherein the word vector determining module comprises:
    字向量确定子模块,用于将所述目标语句输入至所述字编码层中的字向量编码子层,得到所述目标语句中每个字分别对应的字向量;A word vector determining sub-module for inputting the target sentence into the word vector coding sublayer in the word coding layer to obtain a word vector corresponding to each word in the target sentence;
    拼音向量确定子模块,用于将所述目标语句输入至所述字编码层中的拼音向量编码子层,得到所述目标语句中每个字分别对应的拼音向量;The pinyin vector determining submodule is used to input the target sentence into the pinyin vector coding sublayer in the word coding layer to obtain the pinyin vector corresponding to each word in the target sentence;
    目标字向量确定子模块,用于以字为单位,将所述目标语句中每个字分别对应的字向量以及拼音向量依次输入至所述字编码层中的向量拼接子层,得到所述目标语句中每个字分别对应的目标字向量。The target word vector determination sub-module is used to input the word vector and the pinyin vector corresponding to each word in the target sentence into the vector splicing sublayer in the word encoding layer in order in units of words to obtain the target Each word in the sentence corresponds to the target word vector.
  9. 如权利要求8所述的命名实体识别装置,其中,所述字向量确定子模块,还用于:8. The named entity recognition device of claim 8, wherein the word vector determining sub-module is further configured to:
    将所述目标语句输入至所述字编码层中的字向量编码子层;Inputting the target sentence into the word vector coding sublayer in the word coding layer;
    通过所述字向量编码子层中的字向量矩阵,获取所述目标语句中每个字分别对应的字向量。Through the word vector matrix in the word vector encoding sublayer, the word vector corresponding to each word in the target sentence is obtained.
  10. 如权利要求8所述的命名实体识别装置,其中,所述拼音向量确定子模块,还用于:8. The named entity recognition device according to claim 8, wherein the pinyin vector determining sub-module is further used for:
    将所述目标语句输入至所述字编码层中的拼音向量编码子层;Inputting the target sentence into the pinyin vector coding sublayer in the word coding layer;
    通过所述拼音向量编码子层中的字符向量矩阵,获取所述目标语句中的每个字包含的各拼音字符对应的字符向量;Obtaining a character vector corresponding to each pinyin character contained in each word in the target sentence through the character vector matrix in the pinyin vector encoding sublayer;
    将每个字包含的各拼音字符对应的字符向量进行拼接,得到所述目标语句中每个字分别对应的拼音向量。The character vectors corresponding to the pinyin characters contained in each word are spliced to obtain the pinyin vectors corresponding to each word in the target sentence.
  11. 一种计算机设备,其中,所述计算机设备包括处理器、存储器、以及存储在所述存储器上并可被所述处理器执行的计算机程序,其中所述计算机程序被所述处理器执行时,实现如下步骤:A computer device, wherein the computer device includes a processor, a memory, and a computer program stored on the memory and executable by the processor, and when the computer program is executed by the processor, The following steps:
    当监测到命名实体识别请求时,根据所述命名实体识别请求,确定待识别的目标语句;When a named entity recognition request is monitored, determine the target sentence to be recognized according to the named entity recognition request;
    获取命名实体识别模型,其中,所述命名实体识别模型至少包括词编码层、字编码层、双向长短期记忆网络层和命名实体识别层,所述双向长短期记忆网络层包括正向循环神经网络和逆向循环神经网络;Obtain a named entity recognition model, where the named entity recognition model includes at least a word encoding layer, a word encoding layer, a bidirectional long and short-term memory network layer, and a named entity recognition layer, and the bidirectional long and short-term memory network layer includes a forward loop neural network And reverse loop neural network;
    将所述目标语句输入至所述词编码层,得到所述目标语句中的每个词分别对应的第一词向量;Inputting the target sentence into the word coding layer to obtain a first word vector corresponding to each word in the target sentence;
    将所述目标语句输入所述字编码层,得到所述目标语句中的每个字分别对应的目标字向量;Input the target sentence into the word encoding layer to obtain a target word vector corresponding to each word in the target sentence;
    以词为单位,将每个词中各个字的目标字向量依次输入至所述双向长短期记忆网络层,得到每个词中的各个字的正向隐含层输出和逆向隐含层输出,并将每个词的词首字对应的所述逆向隐含层输出与词尾字对应的所述正向隐含层输出进行拼接,得到每个词分别对应的第二词向量;In units of words, the target word vectors of each word in each word are sequentially input to the bidirectional long- and short-term memory network layer to obtain the forward hidden layer output and the reverse hidden layer output of each word in each word, And concatenate the output of the reverse hidden layer corresponding to the initial word of each word and the output of the forward hidden layer corresponding to the ending word to obtain a second word vector corresponding to each word;
    将每个词分别对应的第一词向量和第二词向量输入至所述命名实体识别层,得到所述目标语句中的命名实体。The first word vector and the second word vector corresponding to each word are input into the named entity recognition layer to obtain the named entity in the target sentence.
  12. 如权利要求11所述的计算机设备,其中,所述处理器在实现将每个词分别对应的第一词向量和第二词向量输入至所述命名实体识别层,得到所述目标语句中的命名实体时,用于实现:The computer device according to claim 11, wherein the processor realizes that the first word vector and the second word vector corresponding to each word are input into the named entity recognition layer to obtain the target sentence When naming an entity, it is used to achieve:
    以词为单位,将每个词对应的第一词向量和第二词向量依次输入至所述命名实体识别层中的向量拼接子层,得到每个词对应的拼接词向量;In units of words, input the first word vector and the second word vector corresponding to each word to the vector splicing sub-layer in the named entity recognition layer in order to obtain the spliced word vector corresponding to each word;
    将每个词对应的拼接词向量输入至所述命名实体识别层中的命名实体识别子层,得到所述目标语句中的命名实体。The spliced word vector corresponding to each word is input to the named entity recognition sub-layer in the named entity recognition layer to obtain the named entity in the target sentence.
  13. 如权利要求11所述的计算机设备,其中,所述处理器在实现将所述目标语句输入所述字编码层,得到所述目标语句中的每个字分别对应的目标字向量时,用于实现:The computer device according to claim 11, wherein the processor is configured to input the target sentence into the word encoding layer to obtain the target word vector corresponding to each word in the target sentence. achieve:
    将所述目标语句输入至所述字编码层中的字向量编码子层,得到所述目标语句中每个字分别对应的字向量;Input the target sentence to the word vector coding sublayer in the word coding layer to obtain a word vector corresponding to each word in the target sentence;
    将所述目标语句输入至所述字编码层中的拼音向量编码子层,得到所述目标语句中每个字分别对应的拼音向量;Inputting the target sentence into the pinyin vector coding sublayer in the word coding layer to obtain a pinyin vector corresponding to each word in the target sentence;
    以字为单位,将所述目标语句中每个字分别对应的字向量以及拼音向量依次输入至所述字编码层中的向量拼接子层,得到所述目标语句中每个字分别对应的目标字向量。In units of words, the word vector and pinyin vector corresponding to each word in the target sentence are sequentially input into the vector splicing sublayer in the word encoding layer to obtain the target corresponding to each word in the target sentence. Word vector.
  14. 如权利要求13所述的计算机设备,其中,所述处理器在实现将所述目标语句输入至所述字编码层中的字向量编码子层,得到所述目标语句中每个字分别对应的字向量时,用于实现:The computer device according to claim 13, wherein the processor implements the input of the target sentence into the word vector coding sublayer in the word coding layer to obtain the corresponding word in the target sentence. When a word vector is used, it is used to achieve:
    将所述目标语句输入至所述字编码层中的字向量编码子层;Inputting the target sentence into the word vector coding sublayer in the word coding layer;
    通过所述字向量编码子层中的字向量矩阵,获取所述目标语句中每个字分别对应的字向量。Through the word vector matrix in the word vector encoding sublayer, the word vector corresponding to each word in the target sentence is obtained.
  15. 如权利要求13所述的计算机设备,其中,所述处理器在实现将所述目标语句输入至所述字编码层中的拼音向量编码子层,得到所述目标语句中每个字分别对应的拼音向量时,用于实现:The computer device according to claim 13, wherein the processor implements the input of the target sentence into the pinyin vector coding sublayer in the word coding layer to obtain the corresponding corresponding to each word in the target sentence. When pinyin vectors are used to achieve:
    将所述目标语句输入至所述字编码层中的拼音向量编码子层;Inputting the target sentence into the pinyin vector coding sublayer in the word coding layer;
    通过所述拼音向量编码子层中的字符向量矩阵,获取所述目标语句中的每个字包含的各拼音字符对应的字符向量;Obtaining a character vector corresponding to each pinyin character contained in each word in the target sentence through the character vector matrix in the pinyin vector encoding sublayer;
    将每个字包含的各拼音字符对应的字符向量进行拼接,得到所述目标语句中每个字分别对应的拼音向量。The character vectors corresponding to the pinyin characters contained in each word are spliced to obtain the pinyin vectors corresponding to each word in the target sentence.
  16. 一种计算机可读存储介质,其中,所述计算机可读存储介质上存储有计算机程序,其中所述计算机程序被处理器执行时,实现如下步骤:A computer-readable storage medium, wherein a computer program is stored on the computer-readable storage medium, and when the computer program is executed by a processor, the following steps are implemented:
    当监测到命名实体识别请求时,根据所述命名实体识别请求,确定待识别的目标语句;When a named entity recognition request is monitored, determine the target sentence to be recognized according to the named entity recognition request;
    获取命名实体识别模型,其中,所述命名实体识别模型至少包括词编码层、字编码层、双向长短期记忆网络层和命名实体识别层,所述双向长短期记忆网络层包括正向循环神经网络和逆向循环神经网络;Obtain a named entity recognition model, where the named entity recognition model includes at least a word encoding layer, a word encoding layer, a bidirectional long and short-term memory network layer, and a named entity recognition layer, and the bidirectional long and short-term memory network layer includes a forward loop neural network And reverse loop neural network;
    将所述目标语句输入至所述词编码层,得到所述目标语句中的每个词分别对应的第一词向量;Inputting the target sentence into the word coding layer to obtain a first word vector corresponding to each word in the target sentence;
    将所述目标语句输入所述字编码层,得到所述目标语句中的每个字分别对应的目标字向量;Input the target sentence into the word encoding layer to obtain a target word vector corresponding to each word in the target sentence;
    以词为单位,将每个词中各个字的目标字向量依次输入至所述双向长短期记忆网络层,得到每个词中的各个字的正向隐含层输出和逆向隐含层输出,并将每个词的词首字对应的所述逆向隐含层输出与词尾字对应的所述正向隐含层输出进行拼接,得到每个词分别对应的第二词向量;In units of words, the target word vectors of each word in each word are sequentially input to the bidirectional long- and short-term memory network layer to obtain the forward hidden layer output and the reverse hidden layer output of each word in each word, And concatenate the output of the reverse hidden layer corresponding to the initial word of each word and the output of the forward hidden layer corresponding to the ending word to obtain a second word vector corresponding to each word;
    将每个词分别对应的第一词向量和第二词向量输入至所述命名实体识别层,得到所述目标语句中的命名实体。The first word vector and the second word vector corresponding to each word are input into the named entity recognition layer to obtain the named entity in the target sentence.
  17. 如权利要求16所述的计算机可读存储介质,其中,所述处理器在实现将每个词分别对应的第一词向量和第二词向量输入至所述命名实体识别层,得到所述目标语句中的命名实体时,用于实现:The computer-readable storage medium according to claim 16, wherein the processor realizes that the first word vector and the second word vector corresponding to each word are input into the named entity recognition layer to obtain the target The named entity in the statement is used to achieve:
    以词为单位,将每个词对应的第一词向量和第二词向量依次输入至所述命名实体识别层中的向量拼接子层,得到每个词对应的拼接词向量;In units of words, input the first word vector and the second word vector corresponding to each word to the vector splicing sub-layer in the named entity recognition layer in order to obtain the spliced word vector corresponding to each word;
    将每个词对应的拼接词向量输入至所述命名实体识别层中的命名实体识别子层,得到所述目标语句中的命名实体。The spliced word vector corresponding to each word is input to the named entity recognition sub-layer in the named entity recognition layer to obtain the named entity in the target sentence.
  18. 如权利要求16所述的计算机可读存储介质,其中,所述处理器在实现将所述目标语句输入所述字编码层,得到所述目标语句中的每个字分别对应的目标字向量时,用于实现:The computer-readable storage medium of claim 16, wherein the processor implements inputting the target sentence into the word encoding layer to obtain a target word vector corresponding to each word in the target sentence To achieve:
    将所述目标语句输入至所述字编码层中的字向量编码子层,得到所述目标语句中每个字分别对应的字向量;Input the target sentence to the word vector coding sublayer in the word coding layer to obtain a word vector corresponding to each word in the target sentence;
    将所述目标语句输入至所述字编码层中的拼音向量编码子层,得到所述目标语句中每个字分别对应的拼音向量;Inputting the target sentence into the pinyin vector coding sublayer in the word coding layer to obtain a pinyin vector corresponding to each word in the target sentence;
    以字为单位,将所述目标语句中每个字分别对应的字向量以及拼音向量依次输入至所述字编码层中的向量拼接子层,得到所述目标语句中每个字分别对应的目标字向量。In units of words, the word vector and pinyin vector corresponding to each word in the target sentence are sequentially input into the vector splicing sublayer in the word encoding layer to obtain the target corresponding to each word in the target sentence. Word vector.
  19. 如权利要求18所述的计算机可读存储介质,其中,所述处理器在实现将所述目标语句输入至所述字编码层中的字向量编码子层,得到所述目标语句中每个字分别对应的字向量时,用于实现:The computer-readable storage medium according to claim 18, wherein the processor implements the input of the target sentence into the word vector coding sublayer in the word coding layer to obtain each word in the target sentence When corresponding to the word vector, it is used to realize:
    将所述目标语句输入至所述字编码层中的字向量编码子层;Inputting the target sentence into the word vector coding sublayer in the word coding layer;
    通过所述字向量编码子层中的字向量矩阵,获取所述目标语句中每个字分别对应的字向量。Through the word vector matrix in the word vector encoding sublayer, the word vector corresponding to each word in the target sentence is obtained.
  20. 如权利要求18所述的计算机可读存储介质,其中,所述处理器在实现将所述目标语句输入至所述字编码层中的拼音向量编码子层,得到所述目标语句中每个字分别对应的拼音向量时,用于实现:The computer-readable storage medium according to claim 18, wherein the processor realizes that the target sentence is input to the pinyin vector coding sublayer in the word coding layer to obtain each word in the target sentence When the corresponding pinyin vectors are respectively used to achieve:
    将所述目标语句输入至所述字编码层中的拼音向量编码子层;Inputting the target sentence into the pinyin vector coding sublayer in the word coding layer;
    通过所述拼音向量编码子层中的字符向量矩阵,获取所述目标语句中的每个字包含的各拼音字符对应的字符向量;Obtaining a character vector corresponding to each pinyin character contained in each word in the target sentence through the character vector matrix in the pinyin vector encoding sublayer;
    将每个字包含的各拼音字符对应的字符向量进行拼接,得到所述目标语句中每个字分别对应的拼音向量。The character vectors corresponding to the pinyin characters contained in each word are spliced to obtain the pinyin vectors corresponding to each word in the target sentence.
PCT/CN2019/103141 2019-05-20 2019-08-28 Named entity recognition method and apparatus, device, and computer readable storage medium WO2020232882A1 (en)

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
CN201910420794.X 2019-05-20
CN201910420794.XA CN110298019B (en) 2019-05-20 2019-05-20 Named entity recognition method, device, equipment and computer readable storage medium

Publications (1)

Publication Number Publication Date
WO2020232882A1 true WO2020232882A1 (en) 2020-11-26

Family

ID=68026983

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2019/103141 WO2020232882A1 (en) 2019-05-20 2019-08-28 Named entity recognition method and apparatus, device, and computer readable storage medium

Country Status (2)

Country Link
CN (1) CN110298019B (en)
WO (1) WO2020232882A1 (en)

Cited By (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN113011186A (en) * 2021-01-25 2021-06-22 腾讯科技(深圳)有限公司 Named entity recognition method, device, equipment and computer readable storage medium
CN113743120A (en) * 2021-09-07 2021-12-03 湖北亿咖通科技有限公司 Statement processing method and device
CN114357177A (en) * 2021-12-08 2022-04-15 中国长城科技集团股份有限公司 Knowledge hypergraph generation method and device, terminal device and storage medium
CN114943229A (en) * 2022-04-15 2022-08-26 西北工业大学 Software defect named entity identification method based on multi-level feature fusion

Families Citing this family (14)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN110837737A (en) * 2019-11-11 2020-02-25 中国电子科技集团公司信息科学研究院 Method for recognizing ability word entity
CN111160033B (en) * 2019-12-18 2024-02-27 车智互联(北京)科技有限公司 Named entity identification method based on neural network, computing equipment and storage medium
CN111124350B (en) * 2019-12-20 2023-10-27 科大讯飞股份有限公司 Skill determination method and related equipment
CN111079854B (en) * 2019-12-27 2024-04-23 联想(北京)有限公司 Information identification method, equipment and storage medium
CN111444719B (en) * 2020-03-17 2023-10-20 车智互联(北京)科技有限公司 Entity identification method and device and computing equipment
CN113761922A (en) * 2020-06-05 2021-12-07 北京金山数字娱乐科技有限公司 Word processing method and device based on multitask model
CN111897929B (en) * 2020-08-04 2021-05-14 腾讯科技(深圳)有限公司 Method and device for processing multiple rounds of questions, storage medium and electronic equipment
CN112800769A (en) * 2021-02-20 2021-05-14 深圳追一科技有限公司 Named entity recognition method and device, computer equipment and storage medium
CN113011141A (en) * 2021-03-17 2021-06-22 平安科技(深圳)有限公司 Buddha note model training method, Buddha note generation method and related equipment
CN113139385B (en) * 2021-05-12 2024-05-14 北京化工大学 Electronic medical record named entity recognition method based on character and word pronunciation fusion feature model
CN113673247A (en) * 2021-05-13 2021-11-19 江苏曼荼罗软件股份有限公司 Entity identification method, device, medium and electronic equipment based on deep learning
CN113392648B (en) * 2021-06-02 2022-10-18 北京三快在线科技有限公司 Entity relationship acquisition method and device
CN113283240B (en) * 2021-06-18 2023-07-07 竹间智能科技(上海)有限公司 Co-reference digestion method and electronic equipment
CN113673245A (en) * 2021-07-15 2021-11-19 北京三快在线科技有限公司 Entity identification method and device, electronic equipment and readable storage medium

Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN107908614A (en) * 2017-10-12 2018-04-13 北京知道未来信息技术有限公司 A kind of name entity recognition method based on Bi LSTM
CN108763542A (en) * 2018-05-31 2018-11-06 中国华戎科技集团有限公司 A kind of Text Intelligence sorting technique, device and computer equipment based on combination learning
CN108768824A (en) * 2018-05-15 2018-11-06 腾讯科技(深圳)有限公司 Information processing method and device
US20180357220A1 (en) * 2017-05-10 2018-12-13 Oracle International Corporation Enabling chatbots by detecting and supporting argumentation
CN109190120A (en) * 2018-08-31 2019-01-11 第四范式(北京)技术有限公司 Neural network training method and device and name entity recognition method and device

Family Cites Families (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US11593558B2 (en) * 2017-08-31 2023-02-28 Ebay Inc. Deep hybrid neural network for named entity recognition
CN108536679B (en) * 2018-04-13 2022-05-20 腾讯科技(成都)有限公司 Named entity recognition method, device, equipment and computer readable storage medium
CN109165384A (en) * 2018-08-23 2019-01-08 成都四方伟业软件股份有限公司 A kind of name entity recognition method and device
CN109117472A (en) * 2018-11-12 2019-01-01 新疆大学 A kind of Uighur name entity recognition method based on deep learning

Patent Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20180357220A1 (en) * 2017-05-10 2018-12-13 Oracle International Corporation Enabling chatbots by detecting and supporting argumentation
CN107908614A (en) * 2017-10-12 2018-04-13 北京知道未来信息技术有限公司 A kind of name entity recognition method based on Bi LSTM
CN108768824A (en) * 2018-05-15 2018-11-06 腾讯科技(深圳)有限公司 Information processing method and device
CN108763542A (en) * 2018-05-31 2018-11-06 中国华戎科技集团有限公司 A kind of Text Intelligence sorting technique, device and computer equipment based on combination learning
CN109190120A (en) * 2018-08-31 2019-01-11 第四范式(北京)技术有限公司 Neural network training method and device and name entity recognition method and device

Cited By (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN113011186A (en) * 2021-01-25 2021-06-22 腾讯科技(深圳)有限公司 Named entity recognition method, device, equipment and computer readable storage medium
CN113011186B (en) * 2021-01-25 2024-04-26 腾讯科技(深圳)有限公司 Named entity recognition method, named entity recognition device, named entity recognition equipment and computer readable storage medium
CN113743120A (en) * 2021-09-07 2021-12-03 湖北亿咖通科技有限公司 Statement processing method and device
CN113743120B (en) * 2021-09-07 2023-07-11 亿咖通(湖北)技术有限公司 Statement processing method and device
CN114357177A (en) * 2021-12-08 2022-04-15 中国长城科技集团股份有限公司 Knowledge hypergraph generation method and device, terminal device and storage medium
CN114943229A (en) * 2022-04-15 2022-08-26 西北工业大学 Software defect named entity identification method based on multi-level feature fusion
CN114943229B (en) * 2022-04-15 2024-03-12 西北工业大学 Multi-level feature fusion-based software defect named entity identification method

Also Published As

Publication number Publication date
CN110298019A (en) 2019-10-01
CN110298019B (en) 2023-04-18

Similar Documents

Publication Publication Date Title
WO2020232882A1 (en) Named entity recognition method and apparatus, device, and computer readable storage medium
WO2022105122A1 (en) Answer generation method and apparatus based on artificial intelligence, and computer device and medium
US11948058B2 (en) Utilizing recurrent neural networks to recognize and extract open intent from text inputs
CN111581976B (en) Medical term standardization method, device, computer equipment and storage medium
CN109670163B (en) Information identification method, information recommendation method, template construction method and computing device
JP6909832B2 (en) Methods, devices, equipment and media for recognizing important words in audio
WO2021164231A1 (en) Official document abstract extraction method and apparatus, and device and computer readable storage medium
WO2021159733A1 (en) Medical attribute knowledge graph construction method and apparatus, and device and medium
WO2020233131A1 (en) Question-and-answer processing method and apparatus, computer device and storage medium
WO2022174496A1 (en) Data annotation method and apparatus based on generative model, and device and storage medium
CN112651236B (en) Method and device for extracting text information, computer equipment and storage medium
US11790174B2 (en) Entity recognition method and apparatus
WO2022142011A1 (en) Method and device for address recognition, computer device, and storage medium
CN112686049A (en) Text auditing method, device, equipment and storage medium
WO2023240878A1 (en) Resource recognition method and apparatus, and device and storage medium
CN111459977B (en) Conversion of natural language queries
CN116383412B (en) Functional point amplification method and system based on knowledge graph
CN113761923A (en) Named entity recognition method and device, electronic equipment and storage medium
CN115544214B (en) Event processing method, device and computer readable storage medium
WO2023137903A1 (en) Reply statement determination method and apparatus based on rough semantics, and electronic device
CN115481599A (en) Document processing method and device, electronic equipment and storage medium
CN112069267A (en) Data processing method and device
WO2022078348A1 (en) Mail content extraction method and apparatus, and electronic device and storage medium
CN114691716A (en) SQL statement conversion method, device, equipment and computer readable storage medium
CN115017256A (en) Power data processing method and device, electronic equipment and storage medium

Legal Events

Date Code Title Description
121 Ep: the epo has been informed by wipo that ep was designated in this application

Ref document number: 19929460

Country of ref document: EP

Kind code of ref document: A1

NENP Non-entry into the national phase

Ref country code: DE

122 Ep: pct application non-entry in european phase

Ref document number: 19929460

Country of ref document: EP

Kind code of ref document: A1