WO2021139329A1 - 实体识别方法、装置、计算机设备及计算机可读存储介质 - Google Patents

实体识别方法、装置、计算机设备及计算机可读存储介质 Download PDF

Info

Publication number
WO2021139329A1
WO2021139329A1 PCT/CN2020/124330 CN2020124330W WO2021139329A1 WO 2021139329 A1 WO2021139329 A1 WO 2021139329A1 CN 2020124330 W CN2020124330 W CN 2020124330W WO 2021139329 A1 WO2021139329 A1 WO 2021139329A1
Authority
WO
WIPO (PCT)
Prior art keywords
word
words
english text
target
character
Prior art date
Application number
PCT/CN2020/124330
Other languages
English (en)
French (fr)
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 WO2021139329A1 publication Critical patent/WO2021139329A1/zh

Links

Images

Classifications

    • 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
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/30Information retrieval; Database structures therefor; File system structures therefor of unstructured textual data
    • G06F16/33Querying

Definitions

  • This application relates to the field of entity recognition technology, and in particular to an entity recognition method, device, computer equipment, and computer-readable storage medium.
  • the first aspect of the present application provides an entity identification method, and the entity identification method includes:
  • a second aspect of the present application provides an entity identification device, which includes:
  • the word segmentation module is used to segment the English text to obtain multiple first words
  • the first calculation module is configured to calculate the first positions of the plurality of first words
  • a conversion module configured to perform root conversion on the plurality of first words to obtain a plurality of second words corresponding to the plurality of first words one-to-one;
  • the combination module is used to combine the multiple second words into a target English text
  • a second calculation module configured to calculate the second positions of the plurality of second words based on the target English text
  • a generating module configured to generate a mapping relationship between the first positions of the plurality of first words and the second positions of the plurality of second words
  • the recognition module is configured to recognize the target entity in the English text according to the target English text and the mapping relationship.
  • a third aspect of the present application provides a computer device, the computer device includes a processor, and the processor is configured to execute the following steps when executing computer-readable instructions stored in a memory:
  • a fourth aspect of the present application provides a computer-readable storage medium having computer-readable instructions stored thereon, and when the computer-readable instructions are executed by a processor, the following steps are implemented:
  • This application preprocesses the English text to obtain the target English text and the mapping relationship, so that when the target English text and the mapping relationship are used for entity recognition, it can be based on the target English text and the mapping relationship.
  • the relationship accurately locates the entities in the English text, avoiding a decrease or failure in the accuracy of entity recognition, and improving the accuracy of entity recognition based on the target English text obtained by preprocessing and the mapping relationship.
  • Fig. 1 is a flowchart of an entity identification method provided by an embodiment of the present application.
  • Fig. 2 is a structural diagram of an entity recognition device provided by an embodiment of the present application.
  • Fig. 3 is a schematic diagram of a computer device provided by an embodiment of the present application.
  • the entity identification method of the present application is applied to one or more computer devices.
  • the computer device is a device that can automatically perform numerical calculation and/or information processing in accordance with pre-set or stored instructions.
  • Its hardware includes, but is not limited to, a microprocessor and an application specific integrated circuit (ASIC) , Programmable Gate Array (Field-Programmable Gate Array, FPGA), Digital Processor (Digital Signal Processor, DSP), embedded equipment, etc.
  • ASIC application specific integrated circuit
  • FPGA Field-Programmable Gate Array
  • DSP Digital Processor
  • embedded equipment etc.
  • the computer device may be a computing device such as a desktop computer, a notebook, a palmtop computer, and a cloud server.
  • the computer device can interact with the user through a keyboard, a mouse, a remote control, a touch panel, or a voice control device.
  • FIG. 1 is a flowchart of an entity identification method provided in Embodiment 1 of the present application.
  • the entity recognition method is applied to computer equipment to preprocess the English text, and identify the target entity in the English text according to the target English text obtained by the preprocessing and the mapping relationship, so as to improve the accuracy of entity recognition.
  • the entity recognition method includes:
  • the obtaining of the English text includes:
  • the English text input by the user is “He has three apples”.
  • the English text read from the local database is "Diabetic patient has a high risk of having GIST cancer”.
  • the English text can be segmented by word segmentation tools such as spacy. While segmenting the English text through spacy, the positions of the multiple first words in the English text are reserved.
  • the calculating the first positions of the plurality of first words includes:
  • the serial number of the first character of the corresponding word and the serial number of the last character of the corresponding word are determined as the first position of the first word.
  • the determining the corresponding word of the first word in the English text includes:
  • the middle corresponding word and the space after the middle corresponding word in the English text are connected, and the word obtained by the connection is determined as the corresponding word.
  • the English text is "Diabetic patient has a high risk of having GIST cancer".
  • the serial number of the first character "D" is 0
  • the serial number of the second character "i” is 1
  • the serial number of the third character "a” is 2, and so on .
  • spaces are also characters.
  • the number of the ninth character "" is 8.
  • the first first word is "Diabetic", the first corresponding word is “Diabetic”, the corresponding word is one more space than the first word.
  • the second first word is "patient”, the second corresponding word is “patient”, and so on.
  • the first character number of the first corresponding word "Diabetic” is 0, and the last character number is 8.
  • the first position of the first first word “Diabetic” is (Diabetic, 0, 8).
  • the first character number of the second corresponding word "patient” is 9 and the last character number is 16, and the first position of the second first word “patient” is (patient, 9, 16).
  • the first positions of the remaining first words are (has, 17, 20), (a, 21, 22), (high, 23, 27), (risk, 28, 32), (of, 33, 35), (having, 36, 42), (GIST, 43, 47), (cancer, 48, 54).
  • the determining the corresponding word of the first word in the English text includes:
  • the word consistent with the first word in the English text is determined as the corresponding word.
  • Each word has a different form, such as “apple”, “apples”, and “Diabetes” and “Diabetic”. Words need to be transformed into their original form through root transformation.
  • the performing root conversion on the plurality of first words includes:
  • Root conversion is performed on the first word after the case conversion to obtain a second word corresponding to the first word.
  • the lemma conversion method may be used to perform root conversion on the first word after the case conversion.
  • the case of the first word "Diabetic” is converted to obtain “diabetic”; the root conversion of “diabetic” is used to obtain the second word “diabetes” corresponding to the first word.
  • the performing case conversion on the plurality of first words includes:
  • For each first word determine whether the first character of the first word is an uppercase character
  • the uppercase characters in the first word are converted into lowercase characters to obtain the first word after the case conversion.
  • the performing case conversion on the plurality of first words includes:
  • For each first word determine whether the first character of the first word is an uppercase character
  • the first word is “Diabetic”
  • the first word is converted to “diabetic”
  • the first word is "GIST”
  • the first word "GIST” "Case conversion.
  • the first words are "Diabetic”, "patient”, “has”, “a”, “high”, “risk”, “of”, “having”, “GIST”, “cancer”; Transform the roots of multiple first words, and get multiple second words corresponding to the multiple first words as “diabetes", “patient”, “have”, “a”, “high”, and “risk”. ", "of”, "have”, “GIST”, “cancer”.
  • the plurality of first words and the plurality of second words are in one-to-one correspondence, and the plurality of second words are combined according to the word order of the plurality of first words to obtain the target English text.
  • the plurality of second words are respectively “diabetes”, “patient”, “have”, “a”, “high”, “risk”, “of”, “have”, “GIST”, “cancer” ;
  • the target English text obtained by the combination is “diabetes patient have a high risk of have GIST cancer”.
  • the calculating the second positions of the plurality of second words based on the target English text includes:
  • the second position of the first second word is calculated as (diabetes, 0, 8).
  • 0 is the preset value, which represents the sequence number of the first character of the first second word
  • 8 represents the sequence number d of the last character of the first second word
  • e represents the first character The character length of a second word.
  • the second positions of the remaining second words are (a, 22, 23), (high, 24, 28), (risk, 29, 33), (of, 34, 36), (have, 37, 41), (GIST, 42, 46), (cancer, 47, 53).
  • the calculating the second positions of the plurality of second words based on the target English text includes:
  • the sequence number of the first character of the target word and the sequence number of the last character of the target word are calculated to obtain the second position of the second word.
  • mapping relationship between the first positions of the plurality of first words and the second positions of the plurality of second words includes:
  • serial number of the first character of the second word and the serial number of the first character of the target first word are stored in association, and the serial number of the last character of the second word and the serial number of the last character of the target first word are stored in association.
  • a plurality of first words correspond to a plurality of second words one-to-one
  • the target first word "Diabetic” corresponding to the second word "diabetes” is obtained from the plurality of first words.
  • the sequence number of the first character of the second word and the sequence number of the first character of the target first word are stored associatively, and the sequence number of the last character of the second word and the sequence number of the last character of the target first word are stored in association to obtain the mapping relationship (diabetes-diabetic, 0-0, 8-8), where the first 0 represents the sequence number of the first character of the second word, the second 0 represents the sequence number of the first character of the first word, and the first 8 represents the last character of the second word The second 8 represents the serial number of the last character of the first word.
  • the last character is a space.
  • the obtained mapping relationship can be (diabetes-Diabetic, 0-0, 7-7), the first 7 represents the sequence number of the last character of the second word, and the second 7 represents the sequence number of the last character of the first word ,
  • the end characters in this example are "s" and "c" respectively.
  • the first position where the plurality of first words are generated The mapping relationship with the second positions of the plurality of second words further includes:
  • serial number of the middle character of the second word and the serial number of the middle character of the target first word are associated and stored.
  • the first word is "has”, and the second word corresponding to the first word is "have".
  • the mapping relationship between the first position (has, 17, 20) of the first word and the second position (have, 17, 21) of the second word is (have-has, 17-17, 18-18, 19-19, 20-20, 21-20), the trailing character in this example is a space.
  • the mapping relationship between the first position (has, 17, 19) of the first word and the second position (have, 17, 20) of the second word is (have-has, 17-17, 18-18, 19-19, 20-19), the last characters in this example are the corresponding letters "e” and "s".
  • the entity recognition method before the associating and storing the serial number of the middle character of the second word and the serial number of the middle character of the target first word, the entity recognition method further includes:
  • the first word is "has”, and the second word corresponding to the first word is "have".
  • the mapping relationship of is (have-has, 17-17, 18-17, 19-17, 20-19), and the trailing characters in this example are the corresponding letters "e” and "s".
  • the identifying the target entity in the English text according to the target English text and the mapping relationship includes:
  • the target English text is "diabetes patient have a high risk of have GIST cancer”
  • entity recognition is performed on the target English text
  • the third word is "GIST”.
  • the second position of the third word is (GIST, 42, 46), and the first position is found to be (43, 47) based on the mapping relationship according to the second position of the third word, that is, the physical position. Identify the target entity GIST from the English text based on the entity location.
  • the target entity in the English text may also be stored in a node of a blockchain.
  • the entity recognition method of the first embodiment preprocesses the English text to obtain the target English text and the mapping relationship.
  • the target English text and the mapping relationship are used for entity recognition
  • the target English text can be used for entity recognition.
  • the text and the mapping relationship accurately locate the entities in the English text, avoiding the reduction or failure of entity recognition accuracy, and improving the accuracy of entity recognition based on the target English text obtained by preprocessing and the mapping relationship .
  • FIG. 2 is a structural diagram of an entity identification device provided in Embodiment 2 of the present application.
  • the entity recognition device 20 is applied to computer equipment.
  • the entity recognition device 20 is used to preprocess the English text, and identify the target entity in the English text according to the target English text obtained by the preprocessing and the mapping relationship, so as to improve the accuracy of entity recognition.
  • the entity recognition device 20 may include an acquisition module 201, a word segmentation module 202, a first calculation module 203, a conversion module 204, a combination module 205, a second calculation module 206, a generation module 207, and an identification module 208.
  • the obtaining module 201 is used to obtain English text.
  • the obtaining of the English text includes:
  • the English text input by the user is “He has three apples”.
  • the English text read from the local database is "Diabetic patient has a high risk of having GIST cancer”.
  • the word segmentation module 202 is used to segment the English text to obtain multiple first words.
  • the English text can be segmented by word segmentation tools such as spacy. While segmenting the English text through spacy, the positions of the multiple first words in the English text are reserved.
  • the first calculation module 203 is configured to calculate the first positions of the plurality of first words.
  • the calculating the first positions of the plurality of first words includes:
  • the serial number of the first character of the corresponding word and the serial number of the last character of the corresponding word are determined as the first position of the first word.
  • the determining the corresponding word of the first word in the English text includes:
  • the middle corresponding word and the space after the middle corresponding word in the English text are connected, and the word obtained by the connection is determined as the corresponding word.
  • the English text is "Diabetic patient has a high risk of having GIST cancer".
  • the serial number of the first character "D" is 0
  • the serial number of the second character "i” is 1
  • the serial number of the third character "a” is 2, and so on .
  • spaces are also characters.
  • the number of the ninth character "" is 8.
  • the first first word is "Diabetic", the first corresponding word is “Diabetic”, the corresponding word is one more space than the first word.
  • the second first word is "patient”, the second corresponding word is “patient”, and so on.
  • the first character number of the first corresponding word "Diabetic” is 0, and the last character number is 8.
  • the first position of the first first word “Diabetic” is (Diabetic, 0, 8).
  • the first character number of the second corresponding word "patient” is 9 and the last character number is 16, and the first position of the second first word “patient” is (patient, 9, 16).
  • the first positions of the remaining first words are (has, 17, 20), (a, 21, 22), (high, 23, 27), (risk, 28, 32), (of, 33, 35), (having, 36, 42), (GIST, 43, 47), (cancer, 48, 54).
  • the determining the corresponding word of the first word in the English text includes:
  • the word consistent with the first word in the English text is determined as the corresponding word.
  • the conversion module 204 is configured to perform root conversion on the plurality of first words to obtain a plurality of second words corresponding to the plurality of first words one-to-one.
  • Each word has a different form, such as “apple”, “apples”, and “Diabetes” and “Diabetic”. Words need to be transformed into their original form through root transformation.
  • the performing root conversion on the plurality of first words includes:
  • Root conversion is performed on the first word after the case conversion to obtain a second word corresponding to the first word.
  • the lemma conversion method may be used to perform root conversion on the first word after the case conversion.
  • the performing case conversion on the plurality of first words includes:
  • For each first word determine whether the first character of the first word is an uppercase character
  • the uppercase characters in the first word are converted into lowercase characters to obtain the first word after the case conversion.
  • the performing case conversion on the plurality of first words includes:
  • For each first word determine whether the first character of the first word is an uppercase character
  • the first word is “Diabetic”
  • the first word is converted to “diabetic”
  • the first word is "GIST”
  • the first word "GIST” "Case conversion.
  • the first words are "Diabetic”, "patient”, “has”, “a”, “high”, “risk”, “of”, “having”, “GIST”, “cancer”; Transform the roots of multiple first words, and get multiple second words corresponding to the multiple first words as “diabetes", “patient”, “have”, “a”, “high”, and “risk”. ", "of”, "have”, “GIST”, “cancer”.
  • the combining module 205 is configured to combine the multiple second words into a target English text.
  • the plurality of first words and the plurality of second words are in one-to-one correspondence, and the plurality of second words are combined according to the word order of the plurality of first words to obtain the target English text.
  • the plurality of second words are respectively “diabetes”, “patient”, “have”, “a”, “high”, “risk”, “of”, “have”, “GIST”, “cancer” ;
  • the target English text obtained by the combination is “diabetes patient have a high risk of have GIST cancer”.
  • the second calculation module 206 is configured to calculate the second positions of the plurality of second words based on the target English text.
  • the calculating the second positions of the plurality of second words based on the target English text includes:
  • the second position of the first second word is calculated as (diabetes, 0, 8).
  • 0 is the preset value, which represents the sequence number of the first character of the first second word
  • 8 represents the sequence number d of the last character of the first second word
  • e represents the first character of the second word.
  • the second positions of the remaining second words are (a, 22, 23), (high, 24, 28), (risk, 29, 33), (of, 34, 36), (have, 37, 41), (GIST, 42, 46), (cancer, 47, 53).
  • the calculating the second positions of the plurality of second words based on the target English text includes:
  • the sequence number of the first character of the target word and the sequence number of the last character of the target word are calculated to obtain the second position of the second word.
  • the generating module 207 is configured to generate a mapping relationship between the first positions of the plurality of first words and the second positions of the plurality of second words.
  • mapping relationship between the first positions of the plurality of first words and the second positions of the plurality of second words includes:
  • serial number of the first character of the second word and the serial number of the first character of the target first word are stored in association, and the serial number of the last character of the second word and the serial number of the last character of the target first word are stored in association.
  • a plurality of first words correspond to a plurality of second words one-to-one
  • the target first word "Diabetic” corresponding to the second word "diabetes” is obtained from the plurality of first words.
  • the sequence number of the first character of the second word and the sequence number of the first character of the target first word are stored in association, and the sequence number of the last character of the second word is stored in association with the sequence number of the last character of the target first word to obtain the mapping relationship (diabetes-diabetic, 0-0, 8-8), where the first 0 represents the sequence number of the first character of the second word, the second 0 represents the sequence number of the first character of the first word, and the first 8 represents the last character of the second word The second 8 represents the serial number of the last character of the first word.
  • the last character is a space.
  • the obtained mapping relationship can be (diabetes-Diabetic, 0-0, 7-7), the first 7 represents the sequence number of the last character of the second word, and the second 7 represents the sequence number of the last character of the first word ,
  • the end characters in this example are "s" and "c" respectively.
  • the first position where the plurality of first words are generated The mapping relationship with the second positions of the plurality of second words further includes:
  • serial number of the middle character of the second word and the serial number of the middle character of the target first word are associated and stored.
  • the first word is "has”, and the second word corresponding to the first word is "have".
  • the mapping relationship between the first position (has, 17, 20) of the first word and the second position (have, 17, 21) of the second word is (have-has, 17-17, 18-18, 19-19, 20-20, 21-20), the trailing character in this example is a space.
  • the mapping relationship between the first position (has, 17, 19) of the first word and the second position (have, 17, 20) of the second word is (have-has, 17-17, 18-18, 19-19, 20-19), the last characters in this example are the corresponding letters "e” and "s".
  • the entity recognition device further includes a modification module for storing the sequence number of the middle character of the second word and the sequence number of the middle character of the target first word before the associated storage.
  • the serial number of the middle character of the first word is modified to the serial number of the first character of the first word.
  • the first word is "has”, and the second word corresponding to the first word is "have".
  • the mapping relationship of is (have-has, 17-17, 18-17, 19-17, 20-19), and the trailing characters in this example are the corresponding letters "e” and "s".
  • the recognition module 208 is configured to recognize a target entity in the English text according to the target English text and the mapping relationship.
  • the identifying the target entity in the English text according to the target English text and the mapping relationship includes:
  • the target English text is "diabetes patient have a high risk of have GIST cancer”
  • entity recognition is performed on the target English text
  • the third word is "GIST”.
  • the second position of the third word is (GIST, 42, 46), and the first position is found to be (43, 47) based on the mapping relationship according to the second position of the third word, that is, the physical position. Identify the target entity GIST from the English text based on the entity location.
  • the target entity in the English text may also be stored in a node of a blockchain.
  • the entity recognition device 20 of the second embodiment preprocesses the English text to obtain the target English text and the mapping relationship, so that when the target English text and the mapping relationship are used for entity recognition, it can be based on the target
  • the English text and the mapping relationship accurately locate the entities in the English text, avoiding the reduction or failure of entity recognition accuracy, and improving the accuracy of entity recognition based on the preprocessed target English text and the mapping relationship rate.
  • This embodiment provides a computer-readable storage medium with computer-readable instructions stored on the computer-readable storage medium, and when the computer-readable instructions are executed by a processor, the steps in the embodiment of the entity recognition method described above are implemented, as shown in FIG. 1 Steps 101-108 shown:
  • the computer-readable instruction realizes the functions of the modules in the foregoing device embodiment when executed by the processor, for example, modules 201-208 in Figure 2:
  • the obtaining module 201 is used to obtain English text
  • the word segmentation module 202 is used to segment the English text to obtain multiple first words
  • the first calculation module 203 is configured to calculate the first positions of the plurality of first words
  • the conversion module 204 is configured to perform root conversion on the plurality of first words to obtain a plurality of second words corresponding to the plurality of first words one-to-one;
  • the combination module 205 is configured to combine the plurality of second words into a target English text
  • the second calculation module 206 is configured to calculate the second positions of the plurality of second words based on the target English text
  • a generating module 207 configured to generate a mapping relationship between the first positions of the plurality of first words and the second positions of the plurality of second words;
  • the recognition module 208 is configured to recognize a target entity in the English text according to the target English text and the mapping relationship.
  • FIG. 3 is a schematic diagram of a computer device provided in Embodiment 3 of this application.
  • the computer device 30 includes a memory 301, a processor 302, and computer-readable instructions 303 stored in the memory 301 and running on the processor 302, such as an entity recognition program.
  • the processor 302 executes the computer-readable instruction 303, the steps in the above embodiment of the entity recognition method are implemented, for example, 101-108 shown in FIG. 1:
  • each module in the above-mentioned device embodiment is realized, for example, the modules 201-208 in FIG. 2:
  • the obtaining module 201 is used to obtain English text
  • the word segmentation module 202 is used to segment the English text to obtain multiple first words
  • the first calculation module 203 is configured to calculate the first positions of the plurality of first words
  • the conversion module 204 is configured to perform root conversion on the plurality of first words to obtain a plurality of second words corresponding to the plurality of first words one-to-one;
  • the combination module 205 is configured to combine the plurality of second words into a target English text
  • the second calculation module 206 is configured to calculate the second positions of the plurality of second words based on the target English text
  • a generating module 207 configured to generate a mapping relationship between the first positions of the plurality of first words and the second positions of the plurality of second words;
  • the recognition module 208 is configured to recognize a target entity in the English text according to the target English text and the mapping relationship.
  • the computer-readable instruction 303 may be divided into one or more modules, and the one or more modules are stored in the memory 301 and executed by the processor 302 to complete the method .
  • the one or more modules may be a series of computer-readable instruction segments capable of completing specific functions, and the instruction segments are used to describe the execution process of the computer-readable instructions 303 in the computer device 30.
  • the computer-readable instruction 303 can be divided into the acquisition module 201, the word segmentation module 202, the first calculation module 203, the conversion module 204, the combination module 205, the second calculation module 206, the generation module 207, and the recognition module shown in FIG. Module 208, see the second embodiment for specific functions of each module.
  • the schematic diagram 3 is only an example of the computer device 30, and does not constitute a limitation on the computer device 30. It may include more or less components than those shown in the figure, or combine certain components, or different components.
  • the computer device 30 may also include input and output devices, network access devices, buses, and so on.
  • the so-called processor 302 may be a central processing unit (Central Processing Unit, CPU), other general processors, digital signal processors (Digital Signal Processor, DSP), application specific integrated circuits (Application Specific Integrated 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 can be a microprocessor or the processor 302 can also be any conventional processor, etc.
  • the processor 302 is the control center of the computer device 30, which uses various interfaces and lines to connect the entire computer device 30 Various parts.
  • the memory 301 may be used to store the computer-readable instructions 303, and the processor 302 executes or executes the computer-readable instructions or modules stored in the memory 301 and calls the data stored in the memory 301 to implement Various functions of the computer device 30.
  • the memory 301 may mainly include a storage program area and a storage data area, where the storage program area may store an operating system, an application program required by at least one function (such as a sound playback function, an image playback function, etc.); the storage data area may Data and the like created in accordance with the use of the computer device 30 are stored.
  • the memory 301 may include volatile and/or non-volatile memory, such as a hard disk, a memory, a plug-in hard disk, a Smart Media Card (SMC), a Secure Digital (SD) card, and a flash memory. Flash Card, at least one magnetic disk storage device, flash memory device, or other storage device.
  • volatile and/or non-volatile memory such as a hard disk, a memory, a plug-in hard disk, a Smart Media Card (SMC), a Secure Digital (SD) card, and a flash memory.
  • SMC Smart Media Card
  • SD Secure Digital
  • Flash Card at least one magnetic disk storage device, flash memory device, or other storage device.
  • the integrated module of the computer device 30 is implemented in the form of a software function module and sold or used as an independent product, it may be stored in a computer readable storage medium.
  • this application implements all or part of the processes in the above-mentioned embodiments and methods, and can also be completed by instructing relevant hardware through computer-readable instructions, and the computer-readable instructions can be stored in a computer-readable storage medium.
  • the computer-readable instruction when executed by the processor, it can implement the steps of the foregoing method embodiments.
  • the computer-readable instruction includes computer-readable instruction code
  • the computer-readable instruction code may be in the form of source code, object code, executable file, or some intermediate form.
  • the computer-readable medium may include: any entity or device capable of carrying the computer-readable instruction code, recording medium, U disk, mobile hard disk, magnetic disk, optical disk, computer memory, read-only memory (ROM, Read-Only Memory), random access memory, etc.
  • the computer-readable storage medium may mainly include a storage program area and a storage data area, where the storage program area may store an operating system, an application program required by at least one function, etc.; the storage data area may store Data created by the use of nodes, etc.
  • the blockchain referred to in this application is a new application mode of computer technology such as distributed data storage, point-to-point transmission, consensus mechanism, and encryption algorithm.
  • Blockchain essentially a decentralized database, is a series of data blocks associated with cryptographic methods. Each data block contains a batch of network transaction information for verification. The validity of the information (anti-counterfeiting) and generation of the next block.
  • the blockchain can include the underlying platform of the blockchain, the platform product service layer, and the application service layer.
  • modules described as separate components may or may not be physically separated, and the components displayed as modules may or may not be physical modules, that is, they may be located in one place, or they may be distributed on multiple network units. Some or all of the modules can be selected according to actual needs to achieve the objectives of the solutions of the embodiments.
  • the functional modules in the various embodiments of the present application may be integrated into one processing module, or each module may exist alone physically, or two or more modules may be integrated into one module.
  • the above-mentioned integrated modules can be implemented in the form of hardware, or in the form of hardware plus software functional modules.
  • the above-mentioned integrated modules implemented in the form of software functional modules may be stored in a computer readable storage medium.
  • the above-mentioned software function module is stored in a storage medium and includes a number of instructions to make a computer device (which can be a personal computer, a server, or a network device, etc.) or a processor to perform the entity recognition described in the various embodiments of this application Part of the method.

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • Computational Linguistics (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Audiology, Speech & Language Pathology (AREA)
  • General Health & Medical Sciences (AREA)
  • Health & Medical Sciences (AREA)
  • Artificial Intelligence (AREA)
  • Data Mining & Analysis (AREA)
  • Databases & Information Systems (AREA)
  • Document Processing Apparatus (AREA)
  • Character Discrimination (AREA)

Abstract

本申请涉及人工智能技术领域,提供实体识别方法、装置、计算机设备及计算机可读存储介质,该实体识别方法,包括:获取英文文本;对英文文本进行分词,得到多个第一词语;计算多个第一词语的第一位置;对多个第一词语进行词根转化,得到与多个第一词语一一对应的多个第二词语;将多个第二词语组合成目标英文文本;基于目标英文文本计算多个第二词语的第二位置;生成多个第一词语的第一位置与多个第二词语的第二位置的映射关系;根据所述目标英文文本和所述映射关系识别所述英文文本中的目标实体。本申请提升了根据预处理得到的目标英文文本和映射关系进行实体识别的准确率。同时,本申请还涉及区块链。

Description

实体识别方法、装置、计算机设备及计算机可读存储介质
本申请要求于2020年07月28日提交中国专利局,申请号为202010740626.1申请名称为“实体识别方法、装置、计算机设备及计算机可读存储介质”的中国专利申请的优先权,其全部内容通过引用结合在本申请中。
技术领域
本申请涉及实体识别技术领域,具体涉及一种实体识别方法、装置、计算机设备及计算机可读存储介质。
背景技术
通常,在对英文文本进行实体识别时,需要对英文文本进行预处理。
发明人意识到,在对英文文本进行预处理,得到目标英文文本的过程中,目标英文文本中的词语的位置相对于英文文本中的词语的位置发生改变。导致对目标英文文本进行实体识别时,根据识别出的实体位置不能得到对应的实体,降低了根据预处理后的目标英文文本进行实体识别的准确性。
发明内容
鉴于以上内容,有必要提出一种实体识别方法、装置、计算机设备及计算机可读存储介质,其可以对英文文本进行预处理,提升了根据预处理得到的目标英文文本和所述映射关系进行实体识别的准确率。
本申请的第一方面提供一种实体识别方法,所述实体识别方法包括:
获取英文文本;
对所述英文文本进行分词,得到多个第一词语;
计算所述多个第一词语的第一位置;
对所述多个第一词语进行词根转化,得到与所述多个第一词语一一对应的多个第二词语;
将所述多个第二词语组合成目标英文文本;
基于所述目标英文文本计算所述多个第二词语的第二位置;
生成所述多个第一词语的第一位置与所述多个第二词语的第二位置的映射关系;
根据所述目标英文文本和所述映射关系识别所述英文文本中的目标实体。
本申请的第二方面提供一种实体识别装置,所述实体识别装置包括:
获取模块,用于获取英文文本;
分词模块,用于对所述英文文本进行分词,得到多个第一词语;
第一计算模块,用于计算所述多个第一词语的第一位置;
转化模块,用于对所述多个第一词语进行词根转化,得到与所述多个第一词语一一对应的多个第二词语;
组合模块,用于将所述多个第二词语组合成目标英文文本;
第二计算模块,用于基于所述目标英文文本计算所述多个第二词语的第二位置;
生成模块,用于生成所述多个第一词语的第一位置与所述多个第二词语的第二位置的映射关系;
识别模块,用于根据所述目标英文文本和所述映射关系识别所述英文文本中的目标实体。
本申请的第三方面提供一种计算机设备,所述计算机设备包括处理器,所述处理器用于执行存储器中存储的计算机可读指令时实现以下步骤:
获取英文文本;
对所述英文文本进行分词,得到多个第一词语;
计算所述多个第一词语的第一位置;
对所述多个第一词语进行词根转化,得到与所述多个第一词语一一对应的多个第二词语;
将所述多个第二词语组合成目标英文文本;
基于所述目标英文文本计算所述多个第二词语的第二位置;
生成所述多个第一词语的第一位置与所述多个第二词语的第二位置的映射关系;
根据所述目标英文文本和所述映射关系识别所述英文文本中的目标实体。
本申请的第四方面提供一种计算机可读存储介质,其上存储有计算机可读指令,所述计算机可读指令被处理器执行时实现以下步骤:
获取英文文本;
对所述英文文本进行分词,得到多个第一词语;
计算所述多个第一词语的第一位置;
对所述多个第一词语进行词根转化,得到与所述多个第一词语一一对应的多个第二词语;
将所述多个第二词语组合成目标英文文本;
基于所述目标英文文本计算所述多个第二词语的第二位置;
生成所述多个第一词语的第一位置与所述多个第二词语的第二位置的映射关系;
根据所述目标英文文本和所述映射关系识别所述英文文本中的目标实体。
本申请对所述英文文本进行预处理得到所述目标英文文本和所述映射关系,使所述目标英文文本和所述映射关系用于实体识别时,能够根据所述目标英文文本和所述映射关系准确定位到所述英文文本中的实体,避免实体识别的准确率降低或失败,提升了根据预处理得到的所述目标英文文本和所述映射关系进行实体识别的准确率。
附图说明
图1是本申请实施例提供的实体识别方法的流程图。
图2是本申请实施例提供的实体识别装置的结构图。
图3是本申请实施例提供的计算机设备的示意图。
具体实施方式
为了能够更清楚地理解本申请的上述目的、特征和优点,下面结合附图和具体实施例对本申请进行详细描述。需要说明的是,在不冲突的情况下,本申请的实施例及实施例中的特征可以相互组合。
在下面的描述中阐述了很多具体细节以便于充分理解本申请,所描述的实施例仅仅是本申请一部分实施例,而不是全部的实施例。
除非另有定义,本文所使用的所有的技术和科学术语与属于本申请的技术领域的技术人员通常理解的含义相同。本文中在本申请的说明书中所使用的术语只是为了描述具体的实施例的目的,不是旨在于限制本申请。
优选地,本申请的实体识别方法应用在一个或者多个计算机设备中。所述计算机设备是一种能够按照事先设定或存储的指令,自动进行数值计算和/或信息处理的设备,其硬件包括但不限于微处理器、专用集成电路(Application Specific Integrated Circuit,ASIC)、可编程门阵列(Field-Programmable Gate Array,FPGA)、数字处理器(Digital Signal Processor,DSP)、嵌入式设备等。
所述计算机设备可以是桌上型计算机、笔记本、掌上电脑及云端服务器等计算设备。 所述计算机设备可以与用户通过键盘、鼠标、遥控器、触摸板或声控设备等方式进行人机交互。
实施例一
图1是本申请实施例一提供的实体识别方法的流程图。所述实体识别方法应用于计算机设备,用于对英文文本进行预处理,根据预处理得到的目标英文文本和映射关系识别英文文本中的目标实体,提升实体识别的准确率。
如图1所示,所述实体识别方法包括:
101,获取英文文本。
具体地,所述获取英文文本包括:
接收用户输入的英文文本;或
接收网络传输的英文文本;或
从本地数据库中读取英文文本。
例如,接收用户输入的英文文本为“He has three apples”。从本地数据库中读取的英文文本为“Diabetic patient has a high risk of having GIST cancer”。
102,对所述英文文本进行分词,得到多个第一词语。
具体地,可以通过spacy等分词工具对所述英文文本进行分词。通过spacy对所述英文文本进行分词的同时,保留所述多个第一词语在所述英文文本中的位置。
对英文文本“Diabetic patient has a high risk of having GIST cancer”进行分词,得到的多个第一词语为“Diabetic”、“patient”、“has”、“a”、“high”、“risk”、“of”、“having”、“GIST”、“cancer”。
103,计算所述多个第一词语的第一位置。
在一具体实施例中,所述计算所述多个第一词语的第一位置包括:
依所述英文文本的字符顺序生成所述英文文本中每个字符的序号;
对于每个第一词语,在所述英文文本中确定所述第一词语的对应词语;
将所述对应词语的首字符的序号和所述对应词语的尾字符的序号确定为所述第一词语的第一位置。
在一具体实施例中,所述在所述英文文本中确定所述第一词语的对应词语包括:
从所述英文文本中查找与所述第一词语一致的中间对应词语;
将所述中间对应词语和所述英文文本中的中间对应词语后的空格连接,将连接得到的词语确定为所述对应词语。
例如,英文文本为“Diabetic patient has a high risk of having GIST cancer”。其中,从英文文本的第一个字符开始,第一个字符“D”的序号为0,第二个字符“i”的序号为1,第三个字符“a”的序号为2,依次类推。特别地,空格也为字符,如第九个字符“”的序号为8。
第一个第一词语为“Diabetic”,第一个对应词语为“Diabetic”,对应词语比第一词语多一个空格。第二个第一词语为“patient”,第二个对应词语为“patient”,以此类推。
第一个对应词语“Diabetic”的首字符序号为0,尾字符序号为8,得到第一个第一词语“Diabetic”的第一位置为(Diabetic,0,8)。第二个对应词语“patient”的首字符序号为9,尾字符序号为16,得到第二个第一词语“patient”的第一位置为(patient,9,16)。依次类推,得到剩余的第一词语的第一位置分别为(has,17,20)、(a,21,22)、(high,23,27)、(risk,28,32)、(of,33,35)、(having,36,42)、(GIST,43,47)、(cancer,48,54)。
在另一实施例中,所述在所述英文文本中确定所述第一词语的对应词语包括:
将所述英文文本中的与所述第一词语一致的词语确定为所述对应词语。
104,对所述多个第一词语进行词根转化,得到与所述多个第一词语一一对应的多个第二词语。
每个词语存在不同的形态,如“apple”、“apples”,再如,“Diabetes”、“Diabetic”。需要通过词根转化将词语转化为原始形态。
在一具体实施例中,所述对所述多个第一词语进行词根转化包括:
对所述多个第一词语进行大小写转化;
对所述大小写转化后的第一词语进行词根转化,得到与所述第一词语对应的第二词语。
具体地,可以采用lemma转化方法对所述大小写转化后的第一词语进行词根转化。
例如,对第一词语“Diabetic”进行大小写转化,得到“diabetic”;对“diabetic”进行词根转化,得到与第一词语对应的第二词语“diabetes”。
在一具体实施例中,所述对所述多个第一词语进行大小写转化包括:
对于每个第一词语,判断所述第一词语的首字符是否为大写字符;
当所述第一词语的首字符是大写字符时,判断所述第一词语中是否存在小写字符;
当所述第一词语中存在小写字符时,将所述第一词语中的大写字符转化为小写字符,得到大小写转化后的第一词语。
在另一实施例中,所述对所述多个第一词语进行大小写转化包括:
对于每个第一词语,判断所述第一词语的首字符是否为大写字符;
当所述第一词语的首字符是大写字符时,判断所述第一词语的除所述首字符外的字符是否为大写字符;
当所述第一词语的除所述首字符外的字符不是大写字符,将所述第一词语中的大写字符转化为小写字符,得到大小写转化后的第一词语。
例如,当第一词语为“Diabetic”时,将第一词语转化为“diabetic”;当第一词语为“GIST”时,第一词语“GIST”中不存在小写字符,不对第一词语“GIST”进行大小写转化。
再如,多个第一词语分别为“Diabetic”、“patient”、“has”、“a”、“high”、“risk”、“of”、“having”、“GIST”、“cancer”;对多个第一词语进行词根转化,得到与多个第一词语一一对应的多个第二词语分别为“diabetes”、“patient”、“have”、“a”、“high”、“risk”、“of”、“have”、“GIST”、“cancer”。
对所述多个第一词语进行大小写转化时,将只有首字符大写的词语转化为小写,避免将英文缩写的词语(即全部大写的词语)转化为小写,防止出现歧义,提高了将转化后的词语用于实体识别的准确率。例如,“GIST”是胃肠道间质瘤的缩写,当将“GIST”转化为小写形式时,得到“gist”;“gist”表示“要点、重点”的意思,与原意不同,不利于实体识别。
105,将所述多个第二词语组合成目标英文文本。
所述多个第一词语与所述多个第二词语一一对应,按照所述多个第一词语的词序对所述多个第二词语进行组合,得到目标英文文本。
例如,所述多个第二词语分别为“diabetes”、“patient”、“have”、“a”、“high”、“risk”、“of”、“have”、“GIST”、“cancer”;组合得到的目标英文文本为“diabetes patient have a high risk of have GIST cancer”。
106,基于所述目标英文文本计算所述多个第二词语的第二位置。
在一具体实施例中,所述基于所述目标英文文本计算所述多个第二词语的第二位置包括:
根据所述英文文本中的第一个第一词语的第一位置计算词间空白字符数量;
获取每个第二词语的字符长度;
根据所述词间空白字符数量和所述目标英文文本中的第一个第二词语的字符长度,计算所述第一个第二词语的第二位置;
从所述目标英文文本中的第二个第二词语起,依次确定当前第二词语,根据所述词间空白字符数量和所述当前第二词语的前一个第二词语的第二位置计算所述当前第二词 语的第二位置。
例如,根据英文文本中的第一个第一词语的第一位置(Diabetic,0,8),计算词间空白字符数量为1;计算公式为a=b+1-c,a表示所述词间空白字符数量,b表示第一个第一词语的尾字符序号,c表示第一个第一词语的字符长度。
获取第一个第二词语“diabetes”的字符长度为8,获取第二个第二词语“patient”的字符长度为7,以此类推。
根据词间空白字符数量1和第一个第二词语的字符长度8,计算第一个第二词语的第二位置为(diabetes,0,8)。其中,0为预设值,表示第一个第二词语的首字符的序号;8表示第一个第二词语的尾字符的序号d,计算公式为d=a+e-1,e表示第一个第二词语的字符长度。
将第二个第二词语“patient”确定为当前第二词语,根据词间空白字符数量1和第一个第二词语的第二位置(diabetes,0,8)计算当前第二词语“patient”的第二位置为(patient,9,16)。其中9表示当前第二词语的首字符的序号(用f表示),计算公式为f=g+1,g表示当前第二词语的前一个第二词语的尾字符的序号,当前第二词语“patient”的前一个第二词语为“diabetes”,“diabetes”的尾字符的序号为8。其中16表示当前第二词语的尾字符的序号(用h表示),计算公式为h=f+i+a,i表示当前第二词语的字符长度,当前第二词语“patient”的字符长度为7。
将第三个第二词语“have”确定为当前第二词语,根据词间空白字符数量1和第二个第二词语的第二位置(patient,9,16)计算当前第二词语“have”的第二位置为(have,17,21)。依次类推,得到剩余的第二词语的第二位置分别为(a,22,23)、(high,24,28)、(risk,29,33)、(of,34,36)、(have,37,41)、(GIST,42,46)、(cancer,47,53)。
在一具体实施例中,所述基于所述目标英文文本计算所述多个第二词语的第二位置包括:
依所述目标英文文本的字符顺序生成所述目标英文文本中每个字符的序号;
对于每个第二词语,在所述目标英文文本中确定所述第二词语的目标词语;
计算所述目标词语的首字符的序号和所述目标词语的尾字符的序号,得到所述第二词语的第二位置。
107,生成所述多个第一词语的第一位置与所述多个第二词语的第二位置的映射关系。
在一具体实施例中,所述生成所述多个第一词语的第一位置与所述多个第二词语的第二位置的映射关系包括:
对于每个第二词语,从所述多个第一词语中获取与所述第二词语对应的目标第一词语;
从所述第二词语的第二位置中查找所述第二词语的首字符的序号和所述第二词语的尾字符的序号,从所述目标第一词语的第一位置中查找所述目标第一词语的首字符的序号和所述目标第一词语的尾字符的序号;
关联存储所述第二词语的首字符的序号和所述目标第一词语的首字符的序号,关联存储所述第二词语的尾字符的序号和所述目标第一词语的尾字符的序号。
例如,对于第二词语“diabetes”,多个第一词语与多个第二词语一一对应,从多个第一词语中获取与第二词语“diabetes”对应的目标第一词语“Diabetic”。
从第二词语的第二位置(diabetes,0,8)中查找第二词语的首字符的序号0和第二词语的尾字符的序号8,从目标第一词语的第一位置(Diabetic,0,8)中查找目标第一词语的首字符的序号0和目标第一词语的尾字符的序号8;
关联存储第二词语的首字符的序号和目标第一词语的首字符的序号,关联存储第二词语的尾字符的序号和目标第一词语的尾字符的序号,得到映射关系(diabetes-Diabetic,0-0,8-8),其中,第一个0表示第二词语的首字符的序号,第二个0表示第一词语的首 字符的序号,第一个8表示第二词语的尾字符的序号,第二个8表示第一词语的尾字符的序号,本例的尾字符为空格。可选地,得到映射关系可以为(diabetes-Diabetic,0-0,7-7),第一个7表示第二词语的尾字符的序号,第二个7表示第一词语的尾字符的序号,本例的尾字符分别为“s”、“c”。
在另一实施例中,在所述关联存储所述第二词语的尾字符的序号和所述目标第一词语的尾字符的序号之后,所述生成所述多个第一词语的第一位置与所述多个第二词语的第二位置的映射关系还包括:
关联存储所述第二词语的中间字符的序号和所述目标第一词语的中间字符的序号。
例如,第一词语为“has”,与第一词语对应的第二词语为“have”。第一词语的第一位置(has,17,20)与第二词语的第二位置(have,17,21)的映射关系为(have-has,17-17,18-18,19-19,20-20,21-20),本例的尾字符为空格。可选地,第一词语的第一位置(has,17,19)与第二词语的第二位置(have,17,20)的映射关系为(have-has,17-17,18-18,19-19,20-19),本例的尾字符是相应的字母“e”、“s”。
在另一实施例中,在所述关联存储所述第二词语的中间字符的序号和所述目标第一词语的中间字符的序号之前,所述实体识别方法还包括:
将所述第一词语的中间字符的序号修改为所述第一词语的首字符的序号。
例如,第一词语为“has”,与第一词语对应的第二词语为“have”。将第一词语的中间字符的序号修改为第一词语的首字符的序号17,第一词语的第一位置(has,17,19)与第二词语的第二位置(have,17,20)的映射关系为(have-has,17-17,18-17,19-17,20-19),本例的尾字符是相应的字母“e”、“s”。
108,根据所述目标英文文本和所述映射关系识别所述英文文本中的目标实体。
在一具体实施例中,所述根据所述目标英文文本和所述映射关系识别所述英文文本中的目标实体包括:
对所述目标英文文本进行实体识别,以从所述多个第二词语中确定第三词语;
基于所述映射关系根据所述第三词语的第二位置查找第一位置,将查找到的第一位置确定为实体位置;
根据所述实体位置从所述英文文本中识别出目标实体。
例如,目标英文文本为“diabetes patient have a high risk of have GIST cancer”,对目标英文文本进行实体识别,得到第三词语为“GIST”。第三词语的第二位置为(GIST,42,46),基于映射关系根据第三词语的第二位置查找到第一位置为(43,47),即实体位置。根据实体位置从英文文本中识别出目标实体GIST。
需要强调的是,为进一步保证所述英文文本中的目标实体的私密和安全性,所述英文文本中的目标实体还可以存储于一区块链的节点中。
实施例一的实体识别方法对所述英文文本进行预处理得到所述目标英文文本和所述映射关系,使所述目标英文文本和所述映射关系用于实体识别时,能够根据所述目标英文文本和所述映射关系准确定位到所述英文文本中的实体,避免实体识别的准确率降低或失败,提升了根据预处理得到的所述目标英文文本和所述映射关系进行实体识别的准确率。
实施例二
图2是本申请实施例二提供的实体识别装置的结构图。所述实体识别装置20应用于计算机设备。所述实体识别装置20用于对英文文本进行预处理,根据预处理得到的目标英文文本和映射关系识别英文文本中的目标实体,提升实体识别的准确率。
如图2所示,所述实体识别装置20可以包括获取模块201、分词模块202、第一计算模块203、转化模块204、组合模块205、第二计算模块206、生成模块207、识别模块208。
获取模块201,用于获取英文文本。
具体地,所述获取英文文本包括:
接收用户输入的英文文本;或
接收网络传输的英文文本;或
从本地数据库中读取英文文本。
例如,接收用户输入的英文文本为“He has three apples”。从本地数据库中读取的英文文本为“Diabetic patient has a high risk of having GIST cancer”。
分词模块202,用于对所述英文文本进行分词,得到多个第一词语。
具体地,可以通过spacy等分词工具对所述英文文本进行分词。通过spacy对所述英文文本进行分词的同时,保留所述多个第一词语在所述英文文本中的位置。
对英文文本“Diabetic patient has a high risk of having GIST cancer”进行分词,得到的多个第一词语为“Diabetic”、“patient”、“has”、“a”、“high”、“risk”、“of”、“having”、“GIST”、“cancer”。
第一计算模块203,用于计算所述多个第一词语的第一位置。
在一具体实施例中,所述计算所述多个第一词语的第一位置包括:
依所述英文文本的字符顺序生成所述英文文本中每个字符的序号;
对于每个第一词语,在所述英文文本中确定所述第一词语的对应词语;
将所述对应词语的首字符的序号和所述对应词语的尾字符的序号确定为所述第一词语的第一位置。
在一具体实施例中,所述在所述英文文本中确定所述第一词语的对应词语包括:
从所述英文文本中查找与所述第一词语一致的中间对应词语;
将所述中间对应词语和所述英文文本中的中间对应词语后的空格连接,将连接得到的词语确定为所述对应词语。
例如,英文文本为“Diabetic patient has a high risk of having GIST cancer”。其中,从英文文本的第一个字符开始,第一个字符“D”的序号为0,第二个字符“i”的序号为1,第三个字符“a”的序号为2,依次类推。特别地,空格也为字符,如第九个字符“”的序号为8。
第一个第一词语为“Diabetic”,第一个对应词语为“Diabetic”,对应词语比第一词语多一个空格。第二个第一词语为“patient”,第二个对应词语为“patient”,以此类推。
第一个对应词语“Diabetic”的首字符序号为0,尾字符序号为8,得到第一个第一词语“Diabetic”的第一位置为(Diabetic,0,8)。第二个对应词语“patient”的首字符序号为9,尾字符序号为16,得到第二个第一词语“patient”的第一位置为(patient,9,16)。依次类推,得到剩余的第一词语的第一位置分别为(has,17,20)、(a,21,22)、(high,23,27)、(risk,28,32)、(of,33,35)、(having,36,42)、(GIST,43,47)、(cancer,48,54)。
在另一实施例中,所述在所述英文文本中确定所述第一词语的对应词语包括:
将所述英文文本中的与所述第一词语一致的词语确定为所述对应词语。
转化模块204,用于对所述多个第一词语进行词根转化,得到与所述多个第一词语一一对应的多个第二词语。
每个词语存在不同的形态,如“apple”、“apples”,再如,“Diabetes”、“Diabetic”。需要通过词根转化将词语转化为原始形态。
在一具体实施例中,所述对所述多个第一词语进行词根转化包括:
对所述多个第一词语进行大小写转化;
对所述大小写转化后的第一词语进行词根转化,得到与所述第一词语对应的第二词语。
具体地,可以采用lemma转化方法对所述大小写转化后的第一词语进行词根转化。
例如,对第一词语“Diabetic”进行大小写转化,得到“diabetic”;对“diabetic”进行词根 转化,得到与第一词语对应的第二词语“diabetes”。
在一具体实施例中,所述对所述多个第一词语进行大小写转化包括:
对于每个第一词语,判断所述第一词语的首字符是否为大写字符;
当所述第一词语的首字符是大写字符时,判断所述第一词语中是否存在小写字符;
当所述第一词语中存在小写字符时,将所述第一词语中的大写字符转化为小写字符,得到大小写转化后的第一词语。
在另一实施例中,所述对所述多个第一词语进行大小写转化包括:
对于每个第一词语,判断所述第一词语的首字符是否为大写字符;
当所述第一词语的首字符是大写字符时,判断所述第一词语的除所述首字符外的字符是否为大写字符;
当所述第一词语的除所述首字符外的字符不是大写字符,将所述第一词语中的大写字符转化为小写字符,得到大小写转化后的第一词语。
例如,当第一词语为“Diabetic”时,将第一词语转化为“diabetic”;当第一词语为“GIST”时,第一词语“GIST”中不存在小写字符,不对第一词语“GIST”进行大小写转化。
再如,多个第一词语分别为“Diabetic”、“patient”、“has”、“a”、“high”、“risk”、“of”、“having”、“GIST”、“cancer”;对多个第一词语进行词根转化,得到与多个第一词语一一对应的多个第二词语分别为“diabetes”、“patient”、“have”、“a”、“high”、“risk”、“of”、“have”、“GIST”、“cancer”。
对所述多个第一词语进行大小写转化时,将只有首字符大写的词语转化为小写,避免将英文缩写的词语(即全部大写的词语)转化为小写,防止出现歧义,提高了将转化后的词语用于实体识别的准确率。例如,“GIST”是胃肠道间质瘤的缩写,当将“GIST”转化为小写形式时,得到“gist”;“gist”表示“要点、重点”的意思,与原意不同,不利于实体识别。
组合模块205,用于将所述多个第二词语组合成目标英文文本。
所述多个第一词语与所述多个第二词语一一对应,按照所述多个第一词语的词序对所述多个第二词语进行组合,得到目标英文文本。
例如,所述多个第二词语分别为“diabetes”、“patient”、“have”、“a”、“high”、“risk”、“of”、“have”、“GIST”、“cancer”;组合得到的目标英文文本为“diabetes patient have a high risk of have GIST cancer”。
第二计算模块206,用于基于所述目标英文文本计算所述多个第二词语的第二位置。
在一具体实施例中,所述基于所述目标英文文本计算所述多个第二词语的第二位置包括:
根据所述英文文本中的第一个第一词语的第一位置计算词间空白字符数量;
获取每个第二词语的字符长度;
根据所述词间空白字符数量和所述目标英文文本中的第一个第二词语的字符长度,计算所述第一个第二词语的第二位置;
从所述目标英文文本中的第二个第二词语起,依次确定当前第二词语,根据所述词间空白字符数量和所述当前第二词语的前一个第二词语的第二位置计算所述当前第二词语的第二位置。
例如,根据英文文本中的第一个第一词语的第一位置(Diabetic,0,8),计算词间空白字符数量为1;计算公式为a=b+1-c,a表示所述词间空白字符数量,b表示第一个第一词语的尾字符序号,c表示第一个第一词语的字符长度。
获取第一个第二词语“diabetes”的字符长度为8,获取第二个第二词语“patient”的字符长度为7,以此类推。
根据词间空白字符数量1和第一个第二词语的字符长度8,计算第一个第二词语的第二位置为(diabetes,0,8)。其中,0为预设值,表示第一个第二词语的首字符的序号; 8表示第一个第二词语的尾字符的序号d,计算公式为d=a+e-1,e表示第一个第二词语的字符长度。
将第二个第二词语“patient”确定为当前第二词语,根据词间空白字符数量1和第一个第二词语的第二位置(diabetes,0,8)计算当前第二词语“patient”的第二位置为(patient,9,16)。其中9表示当前第二词语的首字符的序号(用f表示),计算公式为f=g+1,g表示当前第二词语的前一个第二词语的尾字符的序号,当前第二词语“patient”的前一个第二词语为“diabetes”,“diabetes”的尾字符的序号为8。其中16表示当前第二词语的尾字符的序号(用h表示),计算公式为h=f+i+a,i表示当前第二词语的字符长度,当前第二词语“patient”的字符长度为7。
将第三个第二词语“have”确定为当前第二词语,根据词间空白字符数量1和第二个第二词语的第二位置(patient,9,16)计算当前第二词语“have”的第二位置为(have,17,21)。依次类推,得到剩余的第二词语的第二位置分别为(a,22,23)、(high,24,28)、(risk,29,33)、(of,34,36)、(have,37,41)、(GIST,42,46)、(cancer,47,53)。
在一具体实施例中,所述基于所述目标英文文本计算所述多个第二词语的第二位置包括:
依所述目标英文文本的字符顺序生成所述目标英文文本中每个字符的序号;
对于每个第二词语,在所述目标英文文本中确定所述第二词语的目标词语;
计算所述目标词语的首字符的序号和所述目标词语的尾字符的序号,得到所述第二词语的第二位置。
生成模块207,用于生成所述多个第一词语的第一位置与所述多个第二词语的第二位置的映射关系。
在一具体实施例中,所述生成所述多个第一词语的第一位置与所述多个第二词语的第二位置的映射关系包括:
对于每个第二词语,从所述多个第一词语中获取与所述第二词语对应的目标第一词语;
从所述第二词语的第二位置中查找所述第二词语的首字符的序号和所述第二词语的尾字符的序号,从所述目标第一词语的第一位置中查找所述目标第一词语的首字符的序号和所述目标第一词语的尾字符的序号;
关联存储所述第二词语的首字符的序号和所述目标第一词语的首字符的序号,关联存储所述第二词语的尾字符的序号和所述目标第一词语的尾字符的序号。
例如,对于第二词语“diabetes”,多个第一词语与多个第二词语一一对应,从多个第一词语中获取与第二词语“diabetes”对应的目标第一词语“Diabetic”。
从第二词语的第二位置(diabetes,0,8)中查找第二词语的首字符的序号0和第二词语的尾字符的序号8,从目标第一词语的第一位置(Diabetic,0,8)中查找目标第一词语的首字符的序号0和目标第一词语的尾字符的序号8;
关联存储第二词语的首字符的序号和目标第一词语的首字符的序号,关联存储第二词语的尾字符的序号和目标第一词语的尾字符的序号,得到映射关系(diabetes-Diabetic,0-0,8-8),其中,第一个0表示第二词语的首字符的序号,第二个0表示第一词语的首字符的序号,第一个8表示第二词语的尾字符的序号,第二个8表示第一词语的尾字符的序号,本例的尾字符为空格。可选地,得到映射关系可以为(diabetes-Diabetic,0-0,7-7),第一个7表示第二词语的尾字符的序号,第二个7表示第一词语的尾字符的序号,本例的尾字符分别为“s”、“c”。
在另一实施例中,在所述关联存储所述第二词语的尾字符的序号和所述目标第一词语的尾字符的序号之后,所述生成所述多个第一词语的第一位置与所述多个第二词语的第二位置的映射关系还包括:
关联存储所述第二词语的中间字符的序号和所述目标第一词语的中间字符的序号。
例如,第一词语为“has”,与第一词语对应的第二词语为“have”。第一词语的第一位置(has,17,20)与第二词语的第二位置(have,17,21)的映射关系为(have-has,17-17,18-18,19-19,20-20,21-20),本例的尾字符为空格。可选地,第一词语的第一位置(has,17,19)与第二词语的第二位置(have,17,20)的映射关系为(have-has,17-17,18-18,19-19,20-19),本例的尾字符是相应的字母“e”、“s”。
在另一实施例中,所述实体识别装置还包括修改模块,用于在所述关联存储所述第二词语的中间字符的序号和所述目标第一词语的中间字符的序号之前,将所述第一词语的中间字符的序号修改为所述第一词语的首字符的序号。
例如,第一词语为“has”,与第一词语对应的第二词语为“have”。将第一词语的中间字符的序号修改为第一词语的首字符的序号17,第一词语的第一位置(has,17,19)与第二词语的第二位置(have,17,20)的映射关系为(have-has,17-17,18-17,19-17,20-19),本例的尾字符是相应的字母“e”、“s”。
识别模块208,用于根据所述目标英文文本和所述映射关系识别所述英文文本中的目标实体。
在一具体实施例中,所述根据所述目标英文文本和所述映射关系识别所述英文文本中的目标实体包括:
对所述目标英文文本进行实体识别,以从所述多个第二词语中确定第三词语;
基于所述映射关系根据所述第三词语的第二位置查找第一位置,将查找到的第一位置确定为实体位置;
根据所述实体位置从所述英文文本中识别出目标实体。
例如,目标英文文本为“diabetes patient have a high risk of have GIST cancer”,对目标英文文本进行实体识别,得到第三词语为“GIST”。第三词语的第二位置为(GIST,42,46),基于映射关系根据第三词语的第二位置查找到第一位置为(43,47),即实体位置。根据实体位置从英文文本中识别出目标实体GIST。
需要强调的是,为进一步保证所述英文文本中的目标实体的私密和安全性,所述英文文本中的目标实体还可以存储于一区块链的节点中。
实施例二的实体识别装置20对所述英文文本进行预处理得到所述目标英文文本和所述映射关系,使所述目标英文文本和所述映射关系用于实体识别时,能够根据所述目标英文文本和所述映射关系准确定位到所述英文文本中的实体,避免实体识别的准确率降低或失败,提升了根据预处理得到的所述目标英文文本和所述映射关系进行实体识别的准确率。
实施例三
本实施例提供一种计算机可读存储介质,该计算机可读存储介质上存储有计算机可读指令,该计算机可读指令被处理器执行时实现上述实体识别方法实施例中的步骤,例如图1所示的步骤101-108:
101,获取英文文本;
102,对所述英文文本进行分词,得到多个第一词语;
103,计算所述多个第一词语的第一位置;
104,对所述多个第一词语进行词根转化,得到与所述多个第一词语一一对应的多个第二词语;
105,将所述多个第二词语组合成目标英文文本;
106,基于所述目标英文文本计算所述多个第二词语的第二位置;
107,生成所述多个第一词语的第一位置与所述多个第二词语的第二位置的映射关系;
108,根据所述目标英文文本和所述映射关系识别所述英文文本中的目标实体。
或者,该计算机可读指令被处理器执行时实现上述装置实施例中各模块的功能,例 如图2中的模块201-208:
获取模块201,用于获取英文文本;
分词模块202,用于对所述英文文本进行分词,得到多个第一词语;
第一计算模块203,用于计算所述多个第一词语的第一位置;
转化模块204,用于对所述多个第一词语进行词根转化,得到与所述多个第一词语一一对应的多个第二词语;
组合模块205,用于将所述多个第二词语组合成目标英文文本;
第二计算模块206,用于基于所述目标英文文本计算所述多个第二词语的第二位置;
生成模块207,用于生成所述多个第一词语的第一位置与所述多个第二词语的第二位置的映射关系;
识别模块208,用于根据所述目标英文文本和所述映射关系识别所述英文文本中的目标实体。
实施例四
图3为本申请实施例三提供的计算机设备的示意图。所述计算机设备30包括存储器301、处理器302以及存储在所述存储器301中并可在所述处理器302上运行的计算机可读指令303,例如实体识别程序。所述处理器302执行所述计算机可读指令303时实现上述实体识别方法实施例中的步骤,例如图1所示的101-108:
101,获取英文文本;
102,对所述英文文本进行分词,得到多个第一词语;
103,计算所述多个第一词语的第一位置;
104,对所述多个第一词语进行词根转化,得到与所述多个第一词语一一对应的多个第二词语;
105,将所述多个第二词语组合成目标英文文本;
106,基于所述目标英文文本计算所述多个第二词语的第二位置;
107,生成所述多个第一词语的第一位置与所述多个第二词语的第二位置的映射关系;
108,根据所述目标英文文本和所述映射关系识别所述英文文本中的目标实体。
或者,该计算机可读指令被处理器执行时实现上述装置实施例中各模块的功能,例如图2中的模块201-208:
获取模块201,用于获取英文文本;
分词模块202,用于对所述英文文本进行分词,得到多个第一词语;
第一计算模块203,用于计算所述多个第一词语的第一位置;
转化模块204,用于对所述多个第一词语进行词根转化,得到与所述多个第一词语一一对应的多个第二词语;
组合模块205,用于将所述多个第二词语组合成目标英文文本;
第二计算模块206,用于基于所述目标英文文本计算所述多个第二词语的第二位置;
生成模块207,用于生成所述多个第一词语的第一位置与所述多个第二词语的第二位置的映射关系;
识别模块208,用于根据所述目标英文文本和所述映射关系识别所述英文文本中的目标实体。
示例性的,所述计算机可读指令303可以被分割成一个或多个模块,所述一个或者多个模块被存储在所述存储器301中,并由所述处理器302执行,以完成本方法。所述一个或多个模块可以是能够完成特定功能的一系列计算机可读指令段,该指令段用于描述所述计算机可读指令303在所述计算机设备30中的执行过程。例如,所述计算机可读指令303可以被分割成图2中的获取模块201、分词模块202、第一计算模块203、转化 模块204、组合模块205、第二计算模块206、生成模块207、识别模块208,各模块具体功能参见实施例二。
本领域技术人员可以理解,所述示意图3仅仅是计算机设备30的示例,并不构成对计算机设备30的限定,可以包括比图示更多或更少的部件,或者组合某些部件,或者不同的部件,例如所述计算机设备30还可以包括输入输出设备、网络接入设备、总线等。
所称处理器302可以是中央处理单元(Central Processing Unit,CPU),还可以是其他通用处理器、数字信号处理器(Digital Signal Processor,DSP)、专用集成电路(Application Specific Integrated Circuit,ASIC)、现场可编程门阵列(Field-Programmable Gate Array,FPGA)或者其他可编程逻辑器件、分立门或者晶体管逻辑器件、分立硬件组件等。通用处理器可以是微处理器或者该处理器302也可以是任何常规的处理器等,所述处理器302是所述计算机设备30的控制中心,利用各种接口和线路连接整个计算机设备30的各个部分。
所述存储器301可用于存储所述计算机可读指令303,所述处理器302通过运行或执行存储在所述存储器301内的计算机可读指令或模块,以及调用存储在存储器301内的数据,实现所述计算机设备30的各种功能。所述存储器301可主要包括存储程序区和存储数据区,其中,存储程序区可存储操作系统、至少一个功能所需的应用程序(比如声音播放功能、图像播放功能等)等;存储数据区可存储根据计算机设备30的使用所创建的数据等。此外,存储器301可以包括易失性及/或非易失性存储器,例如硬盘、内存、插接式硬盘,智能存储卡(Smart Media Card,SMC),安全数字(Secure Digital,SD)卡,闪存卡(Flash Card)、至少一个磁盘存储器件、闪存器件、或其他存储器件。
所述计算机设备30集成的模块如果以软件功能模块的形式实现并作为独立的产品销售或使用时,可以存储在一个计算机可读取存储介质中。基于这样的理解,本申请实现上述实施例方法中的全部或部分流程,也可以通过计算机可读指令来指令相关的硬件来完成,所述的计算机可读指令可存储于一计算机可读存储介质中,该计算机可读指令在被处理器执行时,可实现上述各个方法实施例的步骤。其中,所述计算机可读指令包括计算机可读指令代码,所述计算机可读指令代码可以为源代码形式、对象代码形式、可执行文件或某些中间形式等。所述计算机可读介质可以包括:能够携带所述计算机可读指令代码的任何实体或装置、记录介质、U盘、移动硬盘、磁碟、光盘、计算机存储器、只读存储器(ROM,Read-Only Memory)、随机存储器等。
进一步地,所述计算机可读存储介质可主要包括存储程序区和存储数据区,其中,存储程序区可存储操作系统、至少一个功能所需的应用程序等;存储数据区可存储根据区块链节点的使用所创建的数据等。
本申请所指区块链是分布式数据存储、点对点传输、共识机制、加密算法等计算机技术的新型应用模式。区块链(Blockchain),本质上是一个去中心化的数据库,是一串使用密码学方法相关联产生的数据块,每一个数据块中包含了一批次网络交易的信息,用于验证其信息的有效性(防伪)和生成下一个区块。区块链可以包括区块链底层平台、平台产品服务层以及应用服务层等。
在本申请所提供的几个实施例中,应该理解到,所揭露的系统,装置和方法,可以通过其它的方式实现。例如,以上所描述的装置实施例仅仅是示意性的,例如,所述模块的划分,仅仅为一种逻辑功能划分,实际实现时可以有另外的划分方式。
所述作为分离部件说明的模块可以是或者也可以不是物理上分开的,作为模块显示的部件可以是或者也可以不是物理模块,即可以位于一个地方,或者也可以分布到多个网络单元上。可以根据实际的需要选择其中的部分或者全部模块来实现本实施例方案的目的。
另外,在本申请各个实施例中的各功能模块可以集成在一个处理模块中,也可以是各个模块单独物理存在,也可以两个或两个以上模块集成在一个模块中。上述集成的模 块既可以采用硬件的形式实现,也可以采用硬件加软件功能模块的形式实现。
上述以软件功能模块的形式实现的集成的模块,可以存储在一个计算机可读取存储介质中。上述软件功能模块存储在一个存储介质中,包括若干指令用以使得一台计算机设备(可以是个人计算机,服务器,或者网络设备等)或处理器(processor)执行本申请各个实施例所述实体识别方法的部分步骤。
对于本领域技术人员而言,显然本申请不限于上述示范性实施例的细节,而且在不背离本申请的精神或基本特征的情况下,能够以其他的具体形式实现本申请。因此,无论从哪一点来看,均应将实施例看作是示范性的,而且是非限制性的,本申请的范围由所附权利要求而不是上述说明限定,因此旨在将落在权利要求的等同要件的含义和范围内的所有变化涵括在本申请内。不应将权利要求中的任何附关联图标记视为限制所涉及的权利要求。此外,显然“包括”一词不排除其他模块或步骤,单数不排除复数。本申请中陈述的多个模块或装置也可以由一个模块或装置通过软件或者硬件来实现。第一,第二等词语用来表示名称,而并不表示任何特定的顺序。
最后应说明的是,以上实施例仅用以说明本申请的技术方案而非限制,尽管参照较佳实施例对本申请进行了详细说明,本领域的普通技术人员应当理解,可以对本申请的技术方案进行修改或等同替换,而不脱离本申请技术方案的精神和范围。

Claims (20)

  1. 一种实体识别方法,其中,所述实体识别方法包括:
    获取英文文本;
    对所述英文文本进行分词,得到多个第一词语;
    计算所述多个第一词语的第一位置;
    对所述多个第一词语进行词根转化,得到与所述多个第一词语一一对应的多个第二词语;
    将所述多个第二词语组合成目标英文文本;
    基于所述目标英文文本计算所述多个第二词语的第二位置;
    生成所述多个第一词语的第一位置与所述多个第二词语的第二位置的映射关系;
    根据所述目标英文文本和所述映射关系识别所述英文文本中的目标实体。
  2. 如权利要求1所述的实体识别方法,其中,所述计算所述多个第一词语的第一位置包括:
    依所述英文文本的字符顺序生成所述英文文本中每个字符的序号;
    对于每个第一词语,在所述英文文本中确定所述第一词语的对应词语;
    将所述对应词语的首字符的序号和所述对应词语的尾字符的序号确定为所述第一词语的第一位置。
  3. 如权利要求1所述的实体识别方法,其中,所述对所述多个第一词语进行词根转化包括:
    对所述多个第一词语进行大小写转化;
    对所述大小写转化后的第一词语进行词根转化,得到与所述第一词语对应的第二词语。
  4. 如权利要求3所述的实体识别方法,其中,所述对所述多个第一词语进行大小写转化包括:
    对于每个第一词语,判断所述第一词语的首字符是否为大写字符;
    当所述第一词语的首字符是大写字符时,判断所述第一词语中是否存在小写字符;
    当所述第一词语中存在小写字符时,将所述第一词语中的大写字符转化为小写字符,得到大小写转化后的第一词语。
  5. 如权利要求1所述的实体识别方法,其中,所述基于所述目标英文文本计算所述多个第二词语的第二位置包括:
    根据所述英文文本中的第一个第一词语的第一位置计算词间空白字符数量;
    获取每个第二词语的字符长度;
    根据所述词间空白字符数量和所述目标英文文本中的第一个第二词语的字符长度,计算所述第一个第二词语的第二位置;
    从所述目标英文文本中的第二个第二词语起,依次确定当前第二词语,根据所述词间空白字符数量和所述当前第二词语的前一个第二词语的第二位置计算所述当前第二词语的第二位置。
  6. 如权利要求1所述的实体识别方法,其中,所述生成所述多个第一词语的第一位置与所述多个第二词语的第二位置的映射关系包括:
    对于每个第二词语,从所述多个第一词语中获取与所述第二词语对应的目标第一词语;
    从所述第二词语的第二位置中查找所述第二词语的首字符的序号和所述第二词语的尾字符的序号,从所述目标第一词语的第一位置中查找所述目标第一词语的首字符的序号和所述目标第一词语的尾字符的序号;
    关联存储所述第二词语的首字符的序号和所述目标第一词语的首字符的序号,关联存储所述第二词语的尾字符的序号和所述目标第一词语的尾字符的序号。
  7. 如权利要求1所述的实体识别方法,其中,所述根据所述目标英文文本和所述映射关系识别所述英文文本中的目标实体包括:
    对所述目标英文文本进行实体识别,以从所述多个第二词语中确定第三词语;
    基于所述映射关系根据所述第三词语的第二位置查找第一位置,将查找到的第一位置确定为实体位置;
    根据所述实体位置从所述英文文本中识别出目标实体。
  8. 一种实体识别装置,其中,所述实体识别装置包括:
    获取模块,用于获取英文文本;
    分词模块,用于对所述英文文本进行分词,得到多个第一词语;
    第一计算模块,用于计算所述多个第一词语的第一位置;
    转化模块,用于对所述多个第一词语进行词根转化,得到与所述多个第一词语一一对应的多个第二词语;
    组合模块,用于将所述多个第二词语组合成目标英文文本;
    第二计算模块,用于基于所述目标英文文本计算所述多个第二词语的第二位置;
    生成模块,用于生成所述多个第一词语的第一位置与所述多个第二词语的第二位置的映射关系;
    识别模块,用于根据所述目标英文文本和所述映射关系识别所述英文文本中的目标实体。
  9. 一种计算机设备,其中,所述计算机设备包括处理器,所述处理器用于执行存储器中存储的计算机可读指令以实现以下步骤:
    获取英文文本;
    对所述英文文本进行分词,得到多个第一词语;
    计算所述多个第一词语的第一位置;
    对所述多个第一词语进行词根转化,得到与所述多个第一词语一一对应的多个第二词语;
    将所述多个第二词语组合成目标英文文本;
    基于所述目标英文文本计算所述多个第二词语的第二位置;
    生成所述多个第一词语的第一位置与所述多个第二词语的第二位置的映射关系;
    根据所述目标英文文本和所述映射关系识别所述英文文本中的目标实体。
  10. 如权利要求9所述的计算机设备,其中,所述处理器执行所述存储器中存储的计算机可读指令以实现所述计算所述多个第一词语的第一位置时,包括:
    依所述英文文本的字符顺序生成所述英文文本中每个字符的序号;
    对于每个第一词语,在所述英文文本中确定所述第一词语的对应词语;
    将所述对应词语的首字符的序号和所述对应词语的尾字符的序号确定为所述第一词语的第一位置。
  11. 如权利要求9所述的计算机设备,其中,所述处理器执行所述存储器中存储的计算机可读指令以实现所述对所述多个第一词语进行词根转化时,包括:
    对所述多个第一词语进行大小写转化;
    对所述大小写转化后的第一词语进行词根转化,得到与所述第一词语对应的第二词语。
  12. 如权利要求11所述的计算机设备,其中,所述处理器执行所述存储器中存储的计算机可读指令以实现所述对所述多个第一词语进行大小写转化时,包括:
    对于每个第一词语,判断所述第一词语的首字符是否为大写字符;
    当所述第一词语的首字符是大写字符时,判断所述第一词语中是否存在小写字符;
    当所述第一词语中存在小写字符时,将所述第一词语中的大写字符转化为小写字符,得到大小写转化后的第一词语。
  13. 如权利要求9所述的计算机设备,其中,所述处理器执行所述存储器中存储的计算机可读指令以实现所述基于所述目标英文文本计算所述多个第二词语的第二位置时,包括:
    根据所述英文文本中的第一个第一词语的第一位置计算词间空白字符数量;
    获取每个第二词语的字符长度;
    根据所述词间空白字符数量和所述目标英文文本中的第一个第二词语的字符长度,计算所述第一个第二词语的第二位置;
    从所述目标英文文本中的第二个第二词语起,依次确定当前第二词语,根据所述词间空白字符数量和所述当前第二词语的前一个第二词语的第二位置计算所述当前第二词语的第二位置。
  14. 如权利要求9所述的计算机设备,其中,所述处理器执行所述存储器中存储的计算机可读指令以实现所述生成所述多个第一词语的第一位置与所述多个第二词语的第二位置的映射关系时,包括:
    对于每个第二词语,从所述多个第一词语中获取与所述第二词语对应的目标第一词语;
    从所述第二词语的第二位置中查找所述第二词语的首字符的序号和所述第二词语的尾字符的序号,从所述目标第一词语的第一位置中查找所述目标第一词语的首字符的序号和所述目标第一词语的尾字符的序号;
    关联存储所述第二词语的首字符的序号和所述目标第一词语的首字符的序号,关联存储所述第二词语的尾字符的序号和所述目标第一词语的尾字符的序号。
  15. 如权利要求9所述的计算机设备,其中,所述处理器执行所述存储器中存储的计算机可读指令以实现所述根据所述目标英文文本和所述映射关系识别所述英文文本中的目标实体时,包括:
    对所述目标英文文本进行实体识别,以从所述多个第二词语中确定第三词语;
    基于所述映射关系根据所述第三词语的第二位置查找第一位置,将查找到的第一位置确定为实体位置;
    根据所述实体位置从所述英文文本中识别出目标实体。
  16. 一种计算机可读存储介质,所述计算机可读存储介质上存储有计算机可读指令,其中,所述计算机可读指令被处理器执行时实现以下步骤:
    获取英文文本;
    对所述英文文本进行分词,得到多个第一词语;
    计算所述多个第一词语的第一位置;
    对所述多个第一词语进行词根转化,得到与所述多个第一词语一一对应的多个第二词语;
    将所述多个第二词语组合成目标英文文本;
    基于所述目标英文文本计算所述多个第二词语的第二位置;
    生成所述多个第一词语的第一位置与所述多个第二词语的第二位置的映射关系;
    根据所述目标英文文本和所述映射关系识别所述英文文本中的目标实体。
  17. 如权利要求16所述的计算机可读存储介质,其中,所述计算机可读指令被所述处理器执行以实现所述计算所述多个第一词语的第一位置时,包括:
    依所述英文文本的字符顺序生成所述英文文本中每个字符的序号;
    对于每个第一词语,在所述英文文本中确定所述第一词语的对应词语;
    将所述对应词语的首字符的序号和所述对应词语的尾字符的序号确定为所述第一词语的第一位置。
  18. 如权利要求16所述的计算机可读存储介质,其中,所述计算机可读指令被所述处理器执行以实现所述基于所述目标英文文本计算所述多个第二词语的第二位置时,包括:
    根据所述英文文本中的第一个第一词语的第一位置计算词间空白字符数量;
    获取每个第二词语的字符长度;
    根据所述词间空白字符数量和所述目标英文文本中的第一个第二词语的字符长度,计算 所述第一个第二词语的第二位置;
    从所述目标英文文本中的第二个第二词语起,依次确定当前第二词语,根据所述词间空白字符数量和所述当前第二词语的前一个第二词语的第二位置计算所述当前第二词语的第二位置。
  19. 如权利要求16所述的计算机可读存储介质,其中,所述计算机可读指令被所述处理器执行以实现所述生成所述多个第一词语的第一位置与所述多个第二词语的第二位置的映射关系时,包括:
    对于每个第二词语,从所述多个第一词语中获取与所述第二词语对应的目标第一词语;
    从所述第二词语的第二位置中查找所述第二词语的首字符的序号和所述第二词语的尾字符的序号,从所述目标第一词语的第一位置中查找所述目标第一词语的首字符的序号和所述目标第一词语的尾字符的序号;
    关联存储所述第二词语的首字符的序号和所述目标第一词语的首字符的序号,关联存储所述第二词语的尾字符的序号和所述目标第一词语的尾字符的序号。
  20. 如权利要求16所述的计算机可读存储介质,其中,所述计算机可读指令被所述处理器执行以实现所述根据所述目标英文文本和所述映射关系识别所述英文文本中的目标实体时,包括:
    对所述目标英文文本进行实体识别,以从所述多个第二词语中确定第三词语;
    基于所述映射关系根据所述第三词语的第二位置查找第一位置,将查找到的第一位置确定为实体位置;
    根据所述实体位置从所述英文文本中识别出目标实体。
PCT/CN2020/124330 2020-07-28 2020-10-28 实体识别方法、装置、计算机设备及计算机可读存储介质 WO2021139329A1 (zh)

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
CN202010740626.1A CN111859972B (zh) 2020-07-28 2020-07-28 实体识别方法、装置、计算机设备及计算机可读存储介质
CN202010740626.1 2020-07-28

Publications (1)

Publication Number Publication Date
WO2021139329A1 true WO2021139329A1 (zh) 2021-07-15

Family

ID=72948487

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2020/124330 WO2021139329A1 (zh) 2020-07-28 2020-10-28 实体识别方法、装置、计算机设备及计算机可读存储介质

Country Status (2)

Country Link
CN (1) CN111859972B (zh)
WO (1) WO2021139329A1 (zh)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN113962198A (zh) * 2021-10-19 2022-01-21 中国平安财产保险股份有限公司 中文文本的转换方法、装置、设备及介质

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN110413791A (zh) * 2019-08-05 2019-11-05 哈尔滨工业大学 基于cnn-svm-knn组合模型的文本分类方法
US20200065374A1 (en) * 2018-08-23 2020-02-27 Shenzhen Keya Medical Technology Corporation Method and system for joint named entity recognition and relation extraction using convolutional neural network
US20200175099A1 (en) * 2018-12-03 2020-06-04 International Business Machines Corporation Annotation Editor with Graph
CN111382570A (zh) * 2018-12-28 2020-07-07 深圳市优必选科技有限公司 文本实体识别方法、装置、计算机设备及存储介质

Family Cites Families (8)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2880601B2 (ja) * 1992-01-22 1999-04-12 シャープ株式会社 言語処理装置
CN1266235A (zh) * 1999-03-04 2000-09-13 英业达股份有限公司 自动拾取英文原形单词的方法
US7680647B2 (en) * 2005-06-21 2010-03-16 Microsoft Corporation Association-based bilingual word alignment
CN104408173B (zh) * 2014-12-11 2016-12-07 焦点科技股份有限公司 一种基于b2b平台的核心关键词自动提取方法
US10387543B2 (en) * 2015-10-15 2019-08-20 Vkidz, Inc. Phoneme-to-grapheme mapping systems and methods
CN106874256A (zh) * 2015-12-11 2017-06-20 北京国双科技有限公司 识别领域命名实体的方法及装置
CN109753555B (zh) * 2018-11-30 2023-07-07 平安科技(深圳)有限公司 词语匹配方法、装置、设备及计算机可读存储介质
CN111444720A (zh) * 2020-03-30 2020-07-24 华南理工大学 一种英文文本的命名实体识别方法

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20200065374A1 (en) * 2018-08-23 2020-02-27 Shenzhen Keya Medical Technology Corporation Method and system for joint named entity recognition and relation extraction using convolutional neural network
US20200175099A1 (en) * 2018-12-03 2020-06-04 International Business Machines Corporation Annotation Editor with Graph
CN111382570A (zh) * 2018-12-28 2020-07-07 深圳市优必选科技有限公司 文本实体识别方法、装置、计算机设备及存储介质
CN110413791A (zh) * 2019-08-05 2019-11-05 哈尔滨工业大学 基于cnn-svm-knn组合模型的文本分类方法

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN113962198A (zh) * 2021-10-19 2022-01-21 中国平安财产保险股份有限公司 中文文本的转换方法、装置、设备及介质

Also Published As

Publication number Publication date
CN111859972B (zh) 2024-03-15
CN111859972A (zh) 2020-10-30

Similar Documents

Publication Publication Date Title
WO2022222943A1 (zh) 科室推荐方法、装置、电子设备及存储介质
CN112395886B (zh) 相似文本确定方法及相关设备
WO2021174923A1 (zh) 概念词序列生成方法、装置、计算机设备及存储介质
CN111797217B (zh) 基于faq匹配模型的信息查询方法、及其相关设备
WO2021212681A1 (zh) 语义角色标注方法、装置、计算机设备及存储介质
WO2021189975A1 (zh) 机器行为识别方法、装置、设备及计算机可读存储介质
TW202123026A (zh) 資料歸檔方法、裝置、電腦裝置及存儲介質
WO2021174836A1 (zh) 差分包生成方法方法、装置、计算机设备及存储介质
US20230289734A1 (en) Apparatus and methods for creating a video record
US20230289735A1 (en) Apparatus and methods for screening users
US20200183954A1 (en) Efficiently finding potential duplicate values in data
WO2021139329A1 (zh) 实体识别方法、装置、计算机设备及计算机可读存储介质
CN112328621A (zh) Sql转换方法、装置、计算机设备及计算机可读存储介质
WO2022227171A1 (zh) 关键信息提取方法、装置、电子设备及介质
JP2010198308A (ja) 文字認識プログラム、文字認識方法および文字認識装置
CN112001158B (zh) 文书生成方法、装置、计算机设备及计算机可读存储介质
CN116468043A (zh) 嵌套实体识别方法、装置、设备及存储介质
CN111679959A (zh) 计算机性能数据确定方法、装置、计算机设备及存储介质
CN113486680B (zh) 文本翻译方法、装置、设备及存储介质
US11797942B2 (en) Apparatus and method for applicant scoring
CN116150185A (zh) 基于人工智能的数据标准提取方法、装置、设备及介质
CN112308440B (zh) 工单处理方法、装置、计算机设备及计算机可读存储介质
WO2022141867A1 (zh) 语音识别方法、装置、电子设备及可读存储介质
US20230026106A1 (en) Biometric data distributed management system, and biometric recognition method using same
JP2022153339A (ja) データベースシステムにおけるレコードマッチング(データベースシステムにおけるレコードマッチングのコンピュータ実装方法、コンピュータプログラム、コンピュータシステム)

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: 20912950

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: 20912950

Country of ref document: EP

Kind code of ref document: A1