Abbreviation extraction method and electronic device

By analyzing the character types in the full name text and using a learning algorithm to obtain the abbreviation, the problem of low abbreviation extraction accuracy and high maintenance cost in the existing technology is solved, and abbreviation extraction with high accuracy and low maintenance cost is achieved.

CN113705194BActive Publication Date: 2024-09-06TENCENT TECHNOLOGY (SHENZHEN) CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202110389648.2
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2021-04-12
Publication Date
2024-09-06
Estimated Expiration
2041-04-12

AI Technical Summary

Technical Problem

In the existing technology, the abbreviation extraction method has low accuracy and high maintenance cost, and is difficult to adapt to full name texts with different composition structures.

Method used

By obtaining and parsing the type of each character in the full name text, and using a learning algorithm to determine the final type of the character, the abbreviation of the target subject is obtained. It relies on the type of character rather than preset rules, reducing maintenance costs.

Benefits of technology

It improves the accuracy of abbreviation extraction, adapts to full name texts with different composition structures, reduces maintenance costs, and avoids dependence on preset rules.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN113705194B
    Figure CN113705194B
Patent Text Reader

Abstract

The embodiment of the present application relates to the field of artificial intelligence technology, and provides a method for extracting abbreviations based on a learning algorithm and an electronic device. After obtaining a text of abbreviations to be extracted, the electronic device parses the specific type of each word in the text. Among them, the types involved in this technology include at least one target type and at least one non-target type. The target type includes a type related to the abbreviation of the target subject. Furthermore, the electronic device obtains the abbreviation of the target subject based on the words in the text that are of the target type. In this way, the accuracy of the extracted abbreviations can be ensured.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The embodiments of the present application relate to the field of artificial intelligence (AI), and in particular to a method for extracting abbreviations and an electronic device. Background Art

[0002] In the process of expressing information, people usually use names to refer to entities such as organizations, institutions, and documents. Among them, the full name of the entity usually contains relatively more characters. For the convenience of expression, people use relatively fewer characters related to the entity to refer to the corresponding entity. The following describes "the full name of the entity" as the full name of the entity, and "relatively fewer characters related to the entity" as the abbreviation of the entity. Based on this, when performing information processing services related to the subject name, such as crawlers, organization matching, and other services, it is necessary to extract the abbreviation of the subject in order to clarify the relevant subject based on the abbreviation of the subject.

[0003] A commonly used method for extracting abbreviations is to preset multiple templates that represent the full name structure and the abbreviation extraction rules corresponding to each template. Then, the abbreviation of a subject is extracted from the full name according to the extraction rules corresponding to the template matched by the full name of the subject. For example, the template of the company's full name is "address information + company identification information + company general information", and the corresponding abbreviation extraction rule can be "use 'company identification information' as the company abbreviation". In actual implementation, it is difficult for existing templates to cover all the full name structures required by the business, which leads to a low accuracy rate of the extracted abbreviations. In addition, the correspondence between templates and rules needs to be maintained, which increases the maintenance cost. Summary of the invention

[0004] The embodiments of the present application provide a method for extracting abbreviations and an electronic device to solve the problem of low accuracy and high maintenance cost of abbreviations obtained based on the correspondence between templates and rules.

[0005] In a first aspect, an embodiment of the present application provides a method for extracting abbreviations, the method comprising:

[0006] Get the first text;

[0007] Parsing the type of each word in the first text, wherein the type of each word is one of at least one target type and at least one non-target type, and the target type includes a type related to the abbreviation of the target subject;

[0008] The abbreviation of the target subject is obtained according to the characters of the target type in the first text.

[0009] In some feasible implementations, parsing the type of each word in the first text includes:

[0010] Obtaining a semantic representation of each word in the first text;

[0011] Obtain the initial probability of each character corresponding to each type based on the semantic representation of each character;

[0012] The final type of the corresponding word is obtained according to the initial probability corresponding to each word.

[0013] In some feasible implementations, obtaining the final type of the corresponding word according to the initial probability corresponding to each word includes:

[0014] The type corresponding to the maximum initial probability of each word is taken as the final type of the corresponding word; or,

[0015] The final type of each word is determined according to the initial probability of each word corresponding to each type and the type transition probability, wherein the type transition probability represents the probability of each type being combined with any one of at least one target type and at least one non-target type.

[0016] In some feasible implementations, determining the final type of each word according to the initial probability of each word corresponding to each type and the type transition probability includes:

[0017] Determine at least one combination probability corresponding to each character in the first text according to the initial probability and type transition probability of each character corresponding to each type, wherein the type combination corresponding to each combination probability is obtained by combining each character in the first text in one type, and for any combination, the combination probability is the sum of a first probability and a second probability, wherein the first probability is the sum of the initial probabilities of the types corresponding to each character in the corresponding type combination, and the second probability is the sum of the type transition probabilities between adjacent types in each type included in the combination;

[0018] The type combination corresponding to the largest combination probability in at least one combination probability is determined as the target type combination, and the type corresponding to each character in the target type combination is determined as the final type of each character.

[0019] In some feasible implementations, obtaining the abbreviation of the target subject according to the characters of the target type in the first text includes:

[0020] Combining characters of the target type according to at least one rule to obtain at least one abbreviation of the target subject, or,

[0021] At least one target rule is selected from at least one rule according to the target type corresponding to the characters included in the recognized first text; and characters of the target type are combined according to the at least one target rule to obtain at least one abbreviation of the target subject.

[0022] In some feasible implementations, the method further comprises:

[0023] Acquire a second text set, the second text set including at least one full text and at least one abbreviation corresponding to each of the at least one full text;

[0024] At least one rule is obtained according to the types of characters contained in each abbreviation in the full name text corresponding to the abbreviation.

[0025] In some feasible implementations, at least one rule indicates that the elements constituting the abbreviation include a target type representing a target subject identifier.

[0026] In some possible implementations,

[0027] If the target subject is an organization, at least one target type includes a secondary place name, an organization logo, and an organization industry information.

[0028] At least one non-target type includes a primary place name, organization type information, and organization branch information.

[0029] In some possible implementations,

[0030] The short name of the target entity includes a word whose type is the organization identifier and a word corresponding to at least one of the following target types:

[0031] The characters corresponding to the secondary place name type or the characters corresponding to the organization type information.

[0032] In a second aspect, an embodiment of the present application provides a device for extracting a short name, the device comprising:

[0033] An acquisition module, used for acquiring a first text;

[0034] A parsing module, configured to parse the type of each word in the first text, wherein the type of each word is one of at least one target type and at least one non-target type, and the target type includes a type related to the abbreviation of the target subject;

[0035] The abbreviation extraction module is used to obtain the abbreviation of the target subject according to the characters of the target type in the first text.

[0036] In some feasible implementations, the parsing module is further used to obtain a semantic representation of each word in the first text; and obtain an initial probability of each word corresponding to each type according to the semantic representation of each word;

[0037] The final type of the corresponding word is obtained according to the initial probability corresponding to each word.

[0038] In some feasible implementations, the parsing module is further used to take the type corresponding to the maximum initial probability corresponding to each character as the final type of the corresponding character; the parsing module is further used to determine the final type of each character based on the initial probability of each type corresponding to each character and the type transition probability, wherein the type transition probability represents the probability of each type being combined with any one of at least one target type and at least one non-target type.

[0039] In some feasible implementations, the parsing module is further used to determine at least one combination probability corresponding to each character in the first text according to the initial probability and type transition probability of each character corresponding to each type, the type combination corresponding to each combination probability is obtained by combining each character in the first text in one type, and for any combination, the combination probability is the sum of a first probability and a second probability, the first probability is the sum of the initial probabilities of the types corresponding to each character in the corresponding type combination, and the second probability is the sum of the type transition probabilities between adjacent types in each type included in the combination;

[0040] The parsing module is further used to determine the type combination corresponding to the largest combination probability in at least one combination probability as the target type combination, and determine the type corresponding to each character in the target type combination as the final type of each character.

[0041] In some feasible implementations, the abbreviation extraction module is further used to obtain at least one abbreviation of the target subject according to at least one rule combination type of characters of the target type;

[0042] The abbreviation extraction module is also used to select at least one target rule from at least one rule according to the target type corresponding to the characters contained in the identified first text; and to obtain at least one abbreviation of the target subject by combining characters of the target type according to at least one target rule.

[0043] In some feasible implementations, the acquisition module is further used to acquire a second text set, the second text set including at least one full text and at least one abbreviation corresponding to each of the at least one full text;

[0044] The parsing module is also used to obtain at least one rule according to the type of the characters contained in each abbreviation in the full name text corresponding to the abbreviation.

[0045] In some feasible implementations, at least one rule indicates that the elements constituting the abbreviation include a target type representing a target subject identifier.

[0046] In some feasible implementations, if the target subject is an organization, at least one target type includes a secondary place name, an organization identifier, and organization industry information.

[0047] At least one non-target type includes a primary place name, organization type information, and organization branch information.

[0048] In some feasible implementations, the abbreviation of the target entity includes a word whose type is an organization identifier and a word corresponding to at least one of the following target types:

[0049] The characters corresponding to the secondary place name type or the characters corresponding to the organization type information.

[0050] In a third aspect, an electronic device is provided, comprising: the electronic device comprises a memory and one or more processors; wherein the memory is used to store a computer program; when the computer program is executed by the processor, the electronic device executes the abbreviation extraction method described in the first aspect or any possible implementation of the first aspect.

[0051] In a fourth aspect, an embodiment of the present application provides a computer-readable storage medium, which stores instructions. When the instructions are executed on a computer, the computer executes part or all of the steps of the abbreviation extraction method described in the first aspect or any possible implementation of the first aspect.

[0052] In a fifth aspect, an embodiment of the present application provides a computer program product, which includes a computer program code. When the computer program code runs on a computer, the computer implements the method in the first aspect or any possible implementation of the first aspect.

[0053] In the implementation of the embodiment of the present application, the electronic device parses each word in the full name text according to the preset candidate type, and then obtains at least one abbreviation of the target subject based on the word of the target type in the full name text. In this way, the abbreviation is obtained based on the type of the word, which can not only ensure the accuracy of the extracted abbreviation, but also adapt to the full name texts of different composition structures, and the electronic device does not need to maintain the preset abbreviation extraction rules, which can reduce the maintenance cost. BRIEF DESCRIPTION OF THE DRAWINGS

[0054] In order to more clearly illustrate the technical solutions in the embodiments of the present application, the following briefly introduces the drawings required for use in the embodiments of the present application. It should be understood that for ordinary technicians in this field, other drawings can be obtained based on these drawings without creative labor.

[0055] Figure 1 A method flow chart of the abbreviation extraction method 10 provided in an embodiment of the present application;

[0056] Figure 2 A data flow diagram of the abbreviation extraction method 20 provided in an embodiment of the present application;

[0057] Figure 2AAn exemplary operation flow chart of the Bert model provided in the embodiment of the present application;

[0058] Figure 2B An exemplary operation flow chart of a bidirectional Transformer layer provided in an embodiment of the present application;

[0059] Figure 2C An exemplary operation flow chart of the LSTM model provided in the embodiment of the present application;

[0060] Figure 3 Provided in the embodiments of this application Figure 2 An exemplary operation flow chart of the full name parsing model in FIG.

[0061] Figure 4A A schematic diagram of an exemplary scenario of full name resolution output provided in an embodiment of the present application;

[0062] Figure 4B A schematic diagram of an exemplary scenario for extracting abbreviations provided in an embodiment of the present application;

[0063] Figure 5A An exemplary schematic diagram of the composition of the abbreviated extraction device 50 provided in the embodiment of the present application;

[0064] Figure 5B This is a schematic diagram of an exemplary structure of an electronic device 51 provided in an embodiment of the present application. DETAILED DESCRIPTION

[0065] The technical solution of the embodiment of the present application is described below in conjunction with the drawings in the embodiment of the present application.

[0066] The terms used in the following embodiments of the present application are for the purpose of describing specific embodiments, and are not intended to be used as limitations on the technical solutions of the present application. As used in the specification and the appended claims of the present application, the singular expressions "one", "a kind of", "said", "above", "the" and "this" are intended to also include plural expressions, unless there is a clear contrary indication in the context. It should also be understood that although the terms first, second, etc. may be used to describe a certain class of objects in the following embodiments, the objects should not be limited to these terms. These terms are used to distinguish the specific implementation objects of this class of objects. For example, the terms first, second, etc. are used to describe probabilities in the following embodiments, but probabilities are not limited to these terms. These terms are only used to distinguish the probabilities of different implementations. The same is true for other classes of objects that may be described in the following embodiments using the terms first, second, etc., which will not be repeated here.

[0067] The embodiment of the present application relates to a technology for extracting the abbreviation of a subject from the full name of the subject based on artificial intelligence (AI). The technical solution of the embodiment of the present application is that after obtaining the full name text, the electronic device parses the type of each word in the text, and then obtains the abbreviation of the subject according to the word corresponding to the target type in the type. In this way, based on the type of each word in the text, the type of each word in the text is known through a learning algorithm, and the abbreviation of the subject is obtained according to the type, which not only ensures the accuracy of the extracted abbreviation, but also does not require the maintenance of extraction rules, which can reduce maintenance costs.

[0068] Among them, AI is the theory, method, technology and application system that uses digital computers or machines controlled by digital computers to simulate, extend and expand human intelligence, perceive the environment, acquire knowledge and use knowledge to obtain the best results. In other words, artificial intelligence is a comprehensive technology in computer science that attempts to understand the essence of intelligence and produce a new intelligent machine that can respond in a similar way to human intelligence. Artificial intelligence is to study the design principles and implementation methods of various intelligent machines so that machines have the functions of perception, reasoning and decision-making.

[0069] AI technology is a comprehensive discipline that covers a wide range of fields, including both hardware-level and software-level technologies. AI basic technologies generally include sensors, dedicated artificial intelligence chips, cloud computing, distributed storage, big data processing technology, operation / interaction systems, mechatronics and other technologies. AI software technology mainly includes computer vision (CV) technology, speech processing (Speech Technology) technology, natural language processing (NLP) technology, and machine learning / deep learning.

[0070] A learning algorithm is a training method that uses multiple learning data to train a predetermined target device (e.g., a robot) to trigger, allow, or control the target device to make a determination or prediction. Examples of learning algorithms include, but are not limited to, supervised learning, unsupervised learning, semi-supervised learning, or reinforcement learning.

[0071] The technical solution of this application mainly involves NLP technology, which is an important direction in the fields of computer science and artificial intelligence. It studies various theories and methods that can achieve effective communication between people and computers using natural language. Natural language processing is a science that integrates linguistics, computer science, and mathematics. Therefore, research in this field will involve natural language, that is, the language people use in daily life, so it is closely related to the study of linguistics. Natural language processing technology usually includes text processing, semantic understanding, machine translation, robot question answering, etc.

[0072] An embodiment of the present application provides a method for extracting short names. This method for extracting short names can be executed by an electronic device or by a computer cluster. The computer cluster includes at least two electronic devices that support the method for extracting short names in the embodiment of the present application. Any electronic device can implement the function of extracting short names described in the embodiment of the present application by deploying an algorithm model.

[0073] Optionally, in a scenario where the method for extracting short names is executed by a computer cluster, the computer cluster can be implemented as a blockchain. Correspondingly, each electronic device in the computer cluster serves as a node in the blockchain. That is, in this scenario, the method for extracting short names in the embodiment of the present application is executed by at least one node on the blockchain.

[0074] Any electronic device involved in the embodiment of the present application can be an electronic device such as a mobile phone, a tablet computer, a wearable device (e.g., a smart watch, a smart bracelet, etc.), a laptop computer, a desktop computer, and a vehicle-mounted device. It can be understood that the embodiment of the present application does not impose any restrictions on the specific type of the electronic device.

[0075] The "subject" involved in the embodiment of the present application can be an organization, an institution, a document, etc. Organizations can include companies, enterprises, institutions, and associations, etc. Institutions can include government departments and scientific research units, etc. Documents can include official documents, papers, etc. Taking a company as an example of the subject, the full name of a company is "Shenzhen TX Computer System Co., Ltd.", and the short names of this company include, for example, "TX" and "TX Technology".

[0076] It should be noted that the text involved in the embodiment of the present application can include at least two characters, which are arranged in a certain order to form a sequence. Among them, the "character" described in the embodiment of the present application can be implemented as a Chinese character or an English word, such as "cloud", "teng", "calculate", or "tencent", etc. For the convenience of describing the technical solution, this specification takes the name text composed of Chinese characters as an example for illustration. It should be noted here that although the illustrative examples mentioned in this specification are all texts composed of Chinese characters, these texts do not correspond to any actual organizations, etc. Therefore, for the convenience of description, in the examples involved in this specification, some contents are represented by English letters. In actual implementation, these English letters can be replaced by actual Chinese characters.

[0077] It is understandable that the embodiments of the present application can also be applied to the extraction technology of target characters in future texts. The learning algorithm and business scenario described in this application are for the purpose of more clearly illustrating the technical solution of this application, and do not constitute a limitation on the technical solution provided by this application. It is known to those skilled in the art that with the evolution of the learning algorithm and the emergence of new business scenarios, the technical solution provided by this application is also applicable to similar technical problems.

[0078] The following describes several exemplary implementations to illustrate the technical solutions of the embodiments of the present application and the technical effects produced by the technical solutions of the present application.

[0079] like Figure 1 As shown, the embodiment of the present application provides a method 10 for extracting a short name (hereinafter referred to as method 10), and method 10 includes the following steps:

[0080] Step S101: Obtain a first text.

[0081] The first text includes the full name of the target subject to be identified. The target subject to be identified may be any of the aforementioned subjects, such as the full name of a company. In some implementations, the first text is implemented as the full name of the target subject. In other implementations, the first text may include the full name of at least one subject, and the full name of the at least one subject includes the full name of the target subject.

[0082] It should be noted that, in the scenario where the first text contains the full name of at least one subject, in an optional implementation, the at least one subject may include subjects with different attributes, for example, the at least one subject includes at least one company and at least one institution, such as "Shenzhen TX Computer System Co., Ltd." and "China IP Bureau". In another optional implementation, the at least one subject may include different subjects with the same attributes, for example, the at least one subject is a company, such as "Shenzhen TX Computer System Co., Ltd." and "Guangzhou WY Computer System Co., Ltd.".

[0083] The first text may be a full text input by a user received by the electronic device, or a full text pre-stored by the electronic device. The electronic device may receive the first text typed by the user in characters, or may receive audio input by the user, and then convert the audio into text to obtain the first text. In addition, the electronic device may also respond to the user's operation instructions and download the first text from other devices through the network. The specific acquisition method may be determined based on the actual application scenario requirements and is not limited here.

[0084] Step S102: parsing the type of each character in the first text, wherein the type of each character is one of at least one target type and at least one non-target type.

[0085] Among them, the target type includes a type related to the abbreviation of the target subject. "Type related to the abbreviation of the target subject" refers to a type that can be used to constitute the abbreviation of the target subject. Correspondingly, the non-target type refers to a type that does not constitute the abbreviation of the target subject. Both the target type and the non-target type can be pre-configured by relevant technical personnel.

[0086] Exemplarily, taking the target subject as an organization, the relevant technical personnel can pre-configure the types: first-level place name, second-level place name, organization identification, organization industry information, organization type information and organization branch information. Among them, the organization identification is used to distinguish the organization corresponding to the target subject from other organizations of the same type. Organization industry information refers to the information in the first text that represents the industry in which the organization is engaged. For example, the "media" in the text "A Media Company" indicates that the organization is engaged in the media industry, and "media" is the organization industry information in the text. For another example, the "Internet" in the text "B Internet Company" indicates that the organization is engaged in the Internet industry, and "Internet" is the organization industry information in the text. Organization type information refers to the information in the first text that represents the organizational form, for example, the "limited company" in the text "AA Co., Ltd.", and for another example, the "limited company" in the text "B Co., Ltd.". Organization branch information refers to the information in the first text that represents the branch, branch office and other branches of the organization. For example, the "Hebei Branch" in the text "A Bank Hebei Branch", and for another example, the "Hainan Branch" in the text "B Company Hainan Branch". In this example, at least one target type may include a secondary place name, an organization identifier, and organizational industry information, and at least one non-target type may include a primary place name, organizational type information, and organizational branch information. That is, the type is a word of a secondary place name, an organization identifier, and organizational industry information, and is a word related to the abbreviation of the target subject.

[0087] It is to be understood that the above type examples are only schematic descriptions and do not constitute a limitation on the embodiments of the present application. In some other embodiments, if the target subject is other, such as a file, the specific implementation of the types, target types and non-target types involved in the embodiments of the present application can be content that matches the scene corresponding to the file. The embodiments of the present application are not described in detail here.

[0088] It should be noted that after obtaining the aforementioned candidate types, the electronic device can use a priori full name and abbreviation corpus to obtain a model of the type of parsed word based on a learning algorithm. The embodiment of the present application may name the model "full name parsing model". The relevant implementation methods of the full name parsing model are described in detail below.

[0089] Further, after obtaining the first text, the electronic device may use the aforementioned full name parsing model to parse the final type of each character in the first text. The electronic device may obtain the semantic representation of each character in the first text. After that, based on the semantic representation of each character, the initial probability of each character corresponding to each type is obtained, so as to obtain the final type of the corresponding character according to the initial probability of each character.

[0090] Among them, the semantic representation of a character refers to the characteristics of the character represented from multiple dimensions such as the character itself and the relationship between the character and the text semantics. Based on this, the electronic device can calculate the initial probability of each character in the first text corresponding to each of the aforementioned candidate types, so as to quantify the possibility that each character in the first text is each candidate type. Furthermore, the electronic device can determine the final type of each character according to the quantified data (i.e., the initial probability).

[0091] In some embodiments, the aforementioned initial probability may be implemented as the probability that each character is each candidate type, that is, the probability distribution of each character in the first text corresponding to each candidate type. In this example, for each of the aforementioned characters, the electronic device may determine the candidate type corresponding to the maximum value in the initial probability corresponding to the character as the final type of the character.

[0092] For example, the initial probability that the character "科" corresponds to the type of first-level place name is 0.05, the initial probability that it corresponds to the type of second-level place name is 0.05, the initial probability that it corresponds to the type of organization identifier is 0.15, the initial probability that it corresponds to the type of organization industry information is 0.45, the initial probability that it corresponds to the type of organization type information is 0.2, and the initial probability that it corresponds to the type of organization branch information is 0.1. In this example, the electronic device may determine the type of "科" as organization industry information.

[0093] In some other embodiments, in order to ensure the accuracy of the final type of each character obtained, the electronic device determines the final type of each character according to the initial probability of each character corresponding to each type and the type transition probability. Among them, the type transition probability represents the probability of the combination of each type with any type in at least one target type and at least one non-target type. The type transition probability may be obtained by training with a large amount of corpus and is used to represent the correlation between characters. Based on this, after obtaining the initial probability of each character, the electronic device may combine each character according to the scenarios where each character corresponds to different types to obtain at least one type combination, so as to obtain the combinations of different types corresponding to each character with other types. Furthermore, for each type combination, the electronic device obtains the combination probability of the combination, and the combination probability is the sum of the first probability and the second probability. Among them, the first probability is the sum of the initial probabilities of the types corresponding to the characters in the combination, and the second probability is the sum of the type transition probabilities between adjacent characters in the combination. Furthermore, the electronic device may determine the types corresponding to the characters in the type combination corresponding to the maximum combination probability as the final types of each character.

[0094] The following is an example of the first text being "ABC" and each character corresponding to three candidate types. Among them, the initial probabilities of "A" corresponding to the three candidate types are P A1 , P A2 and P A3 , and the initial probabilities of “B” corresponding to the three candidate types are P B1 ,P B2 and P B3 , and the initial probabilities of the three candidate types corresponding to “C” are P C1 ,P C2 and P C3 . The type transition probability may include, for example, state transition matrices such as P(A1, A1), P(A1, A2), P(A1, A3), P(A1, B1), P(A1, B2), ... P(C3, C3). Among them, taking P(A1, B1) as an example, P(A1, B1) represents the type transition probability corresponding to the combination of type A1 and type B1. Furthermore, the electronic device can be based on the candidate type combinations "A", "B" and "C", for example, to obtain type combination A1B1C1, type combination A1B1C2, type combination A1B2C1, type combination A2B1C1, etc. Exemplarily, the electronic device can combine each word in a permutation and combination manner based on the three candidate types of each word, and examples are not given here one by one. Among them, in the type combination A1B1C2, the word "A" corresponds to the candidate type A1, the word "B" corresponds to the candidate type B1, and the word "C" corresponds to the candidate type C2. Furthermore, the combination probability of this type combination can be expressed as: P A1B1C2 =P A1 +P B1 +P C2 +P(A1,B1)+P(B1,C2),P A1 It refers to the initial probability when the character "A" corresponds to candidate type A1, P B1 It refers to the initial probability when the character "B" corresponds to the candidate type B1, P C2 It refers to the initial probability when the character "C" corresponds to the candidate type C2, P(A1, B1) refers to the type transition probability of the combination of candidate type A1 and candidate type B1, and P(B1, C2) refers to the type transition probability of the combination of candidate type B1 and candidate type C2. The implementation process of the electronic device obtaining other type combinations and the combination probability of other type combinations, please refer to the above description, which will not be repeated here. Furthermore, the electronic device can use the type of each character in the type combination corresponding to the maximum combination probability as the final type of each character. For example, the combination probability corresponding to A1B1C2 is the largest, then the final type of the character "A" is A1, the final type of the character "B" is B1, and the final type of the character "C" is C2.

[0095] Step S103: Obtain the abbreviation of the target subject according to the characters of the target type in the first text.

[0096] The electronic device may obtain at least one abbreviation of the target subject according to characters of the target type in the first text.

[0097] Exemplarily, after obtaining the target type of characters, the electronic device can combine the characters of the same type to obtain words of the corresponding target type according to the positional relationship of each character in the first text. Furthermore, the words of the target type can be used to obtain at least one abbreviation of the target subject. For example, the electronic device can combine characters to obtain words based on Named Entity Recognition (NER) technology, and the relevant implementation methods are described in detail below.

[0098] In actual implementation, relevant technicians can obtain at least one rule for obtaining abbreviations through a learning algorithm based on an existing corpus. For example, the electronic device can obtain a second text set, which includes at least one full text and at least one abbreviation corresponding to the at least one full text. Afterwards, the electronic device obtains at least one rule based on the type of words contained in each abbreviation in the full text corresponding to the abbreviation.

[0099] For example, an example of the second text set is shown in Table 1.

[0100] Table 1

[0101]

[0102] As shown in Table 1, the full name of the organization "Beijing XYZ Technology Co., Ltd." corresponds to three abbreviations, namely "XYZ", "XYZ Technology" and "Beijing XYZ". The full name of the organization "Wuhan MN Information Technology Co., Ltd." corresponds to two abbreviations, namely "MN" and "MN Information Technology". The relationship between the information in other rows in Table 1 is similar and will not be repeated here.

[0103] Based on the corpus provided in Table 1, the electronic device can obtain the type of each abbreviation in the corresponding full name text, and then, the electronic device can obtain the combination form of the type corresponding to the abbreviation. For example, the abbreviation "XYZ Technology" includes the word "XYZ" and the word "technology". After obtaining "X", "Y" and "Z", and the types of "X", "Y" and "Z", the electronic device can, for example, combine "X", "Y" and "Z" to obtain the word "XYZ" and the type of the word "XYZ" in the full name text "Beijing XYZ Technology Co., Ltd." is the organization identification. Similarly, it can be obtained that the type of the word "technology" in the full name text "Beijing XYZ Technology Co., Ltd." is the organization industry information. Furthermore, the electronic device can, for example, obtain the combination form of the abbreviation "XYZ Technology" as "a combination of a word whose type is an organization identification and a word whose type is an organization industry information". The composition forms of other abbreviations in Table 1 are similar, and they are not described one by one here. Based on this, the electronic device can use the combination forms in which the total number is in the top three as the rule for obtaining the abbreviation according to the type.

[0104] For the sake of simplicity, the following text will express "a combination of a word of type organization identification and a word of type organization industry information" in the form of "organization identification + organization industry information". The "+" here means the combination of a word of the type before the "+" and a word of the type before the "+". In addition, "+" also indicates the positional relationship of the words combined together. For example, "A+B" indicates that the text sequence after the combination is "AB" instead of "BA". This type of description that appears below in this specification is of the same meaning and will not be repeated below.

[0105] Exemplarily, a possible design of the present application may include the following three rules: first rule: organization identification; second rule: organization identification + organization industry information; third rule: second place name + organization identification + organization industry information.

[0106] It is understandable that the above rules are only schematic descriptions and do not constitute a limitation on the embodiments of the present application. In some other implementations, the abbreviation obtaining rules may also be other, or may also be more or fewer rules. The embodiments of the present application are not limited to this.

[0107] Furthermore, in some implementations, the electronic device may combine characters of the target type according to at least one of the aforementioned rules to obtain at least one abbreviation of the target entity.

[0108] It should be pointed out that at least one of the aforementioned rules is obtained based on a corpus, which contains a large number of target type characters involved in the rules. However, in actual implementation, the full name text of the target subject does not necessarily contain all target type characters involved in the rules. For example, the full name text of the target subject is "CC Chemical Group", which contains the character "C" corresponding to the target type organization identification and the characters "Chemical" and "Industry" corresponding to the organizational industry information, but does not contain the characters corresponding to the target type secondary place name. Based on this, the electronic device can also obtain the abbreviation according to the rule matching the first text.

[0109] Correspondingly, in some other implementations, the electronic device can select at least one target rule from at least one rule based on the target type corresponding to the characters contained in the identified first text, and then obtain at least one abbreviation of the target entity by combining characters of the target type according to the at least one target rule.

[0110] For example, after obtaining the character "C" corresponding to the organization identification and the characters "Chemistry" and "Industry" corresponding to the organization industry information, the electronic device can obtain the rules that include the target types "organization identification" and "organization industry information" but do not include the target type "secondary place name" from the aforementioned three rules, namely the aforementioned first rule (organization identification) and second rule (organization identification + organization industry information). Afterwards, the electronic device can obtain the abbreviation corresponding to "CC Chemical Group" according to the first rule and the second rule respectively, and obtain the abbreviations "CC" and "CC Chemical".

[0111] In a possible implementation, the function of the aforementioned at least one rule can be implemented by an abbreviation extraction model. The relevant implementation of the abbreviation extraction model is described in detail below.

[0112] By adopting this implementation method, the abbreviations are obtained through different combination rules, which can increase the number of the obtained abbreviations.

[0113] According to the above examples, the target subject's identifier is usually a significant identifier that distinguishes the target subject from other similar subjects. Therefore, in an optional design, at least one of the above rules can indicate that the elements constituting the abbreviation include the target type that characterizes the target subject identifier. Exemplarily, if the target subject is an organization, the target subject's abbreviation includes a character whose type is the organization identifier and a character corresponding to at least one of the following target types: a character corresponding to a secondary place name type or a character corresponding to the organization type information.

[0114] It is to be understood that the above full text and abbreviation examples are only illustrative descriptions and do not constitute limitations on the embodiments of the present application. In some other implementations, the first text involved in the embodiments of the present application may also be the full text of other subjects, and the corresponding abbreviations may also change with the implementation scenario. The embodiments of the present application are not limited to this.

[0115] It can be seen that, with this implementation, the electronic device uses a learning algorithm to parse each word in the full name text according to the preset candidate type, and then obtains at least one abbreviation of the target subject based on the word of the target type in the full name text. In this way, the abbreviation is obtained based on the type of the word, which can not only ensure the accuracy of the extracted abbreviation, but also adapt to the full name text of different composition structures, and the electronic device does not need to maintain the preset abbreviation extraction rules, which can reduce the maintenance cost.

[0116] Method 10 is a description of the abbreviation extraction method of the embodiment of the present application from the perspective of an electronic device. The abbreviation extraction method of the present application is explained below in combination with the learning algorithm involved in the embodiment of the present application.

[0117] For example, Figure 2 As shown, the embodiments of the present application may involve a data preprocessing module, a full name parsing model and an abbreviation extraction model. Among them, the data preprocessing module is used to filter the input text sequence to obtain the aforementioned first text. The full name parsing model is used to parse and obtain the candidate types of each word in the first text based on a pre-learning algorithm. The abbreviation extraction model can obtain the type of words based on the full name parsing model based on a pre-learning algorithm, and the combination type is the abbreviation of the target type of words.

[0118] According to the description of the above embodiments, the full name parsing model is mainly used to achieve three functions: obtaining the semantic representation of each word in the first text, obtaining the probability of each word corresponding to each type, and determining the type of each word according to the probability. In one possible implementation, the full name parsing model can use a neural network mechanism to achieve the above three functions.

[0119] For example, the model for obtaining the semantic representation of each word in the first text may include: a bidirectional encoder representation (Bidirectional Encoder Representations from Transformers, Bert) model based on a transformer, a lightweight version of Bert (A Lite BERT, ALBERT) model, a neural network structure based on an attention mechanism, an NLP model based on self-attention, etc. The model for obtaining the probability of each word corresponding to each type may include: a long short-term memory neural network (Long Short-Term Memory, LSTM) model, a bidirectional LSTM (Bi-directional Long Short-Term Memory, BiLSTM) model based on a forward LSTM and a backward LSTM, a recurrent neural network (Recurrent Neural Network, RNN), a gated recurrent unit (Gated Recurrent Unit, GRU) model and other neural network models. The model for determining the type of each word according to probability may include: a random field (conditional random field, CRF) model, etc.

[0120] It should be noted that the above various models can be combined as needed to obtain the full name parsing model involved in the embodiments of the present application. In some embodiments, the full name parsing model can be implemented in the form of a combination of a Bert model, an LSTM model, and a CRF model. In other embodiments, the full name parsing model can be implemented in the form of a combination of a Bert model and a CRF model. In some further embodiments, the full name parsing model can be implemented in the form of a combination of a BiLSTM model and a CRF model.

[0121] In some implementations, parsing the type of each character in the first text can be achieved by performing a NER operation on each character through a related model. NER, also known as proper name recognition or named entity, refers to identifying entities with specific meanings in a text, such as names of people, places, organizations, institutions, file names, etc., as well as text that represents subjects such as time, quantity, currency, and proportional values. A named entity can represent an individual thing marked by a label, including a logo, a place name, etc. For example, the named entity recognition results corresponding to the name text "Beijing PQ Group" may include "Beijing (place name entity)", "PQ (organization identification entity)" and "Group (organization type information entity)".

[0122] In actual implementation, NER can mark and identify the word sequence in the first text by means of Begin Intermediate End (BIE) tags and type tags. The BIE tag is a segmentation tag, B stands for Begin, indicating the starting character of a type tag; I stands for Intermediate, indicating the middle character of a type tag; E stands for End, indicating the ending character of a type tag. The type tag indicates each type defined by relevant technicians in the field, as described in the above embodiment, which will not be described in detail here.

[0123] For example, the label of each character in the name text "Beijing PQ Group" can be expressed as: north (B-CITY), Beijing (I-CITY), city (E-CITY), have (B-ID), color (E-ID), set (B-TYP) and group (E-TYP).

[0124] The following uses the Bert model, LSTM model, and CRF model as examples to illustrate the various processing steps involved in the full name parsing model.

[0125] See also Figure 2A , Figure 2A An exemplary operation flow chart of the Bert model provided in the embodiment of the present application. The Bert model can be used to segment the input text and add labels to obtain the word vector and sentence vector of the text, and then obtain the semantic representation of each word in the text based on the word vector and sentence vector.

[0126] See again Figure 2A , the input of the Bert model is, for example, the text "my dog ​​is cute.he likes play". The Bert model tokenizes the text "my dog ​​is cute.he likes play" and cleans the punctuation "." to obtain the words "my", "dog", "is", "cute", "he", "likes" and "play". Furthermore, the Bert model adds tags [CLS] and [SEP], as well as tags token embeddings, segment embeddings, and position embeddings to the text "mydog is cute.he likes play" to represent the word vector, position vector, and sentence vector of each word in the text "my dog ​​is cute.he likes play" through these tags.

[0127] Among them, the tag [CLS] is used to indicate the first character of the text. The tag [SEP] is used to indicate the end of a sentence. For example, the text "my dog ​​is cute.he likes play" contains the sentences "my dog ​​is cute" and "he likes play". Then, add the tag [SEP] after the sentence "my dog ​​is cute" and add the tag [SEP] after the sentence "my dog ​​is cute". The tag token embeddings is used to identify each word. The tag segment embeddings is used to identify each sentence. For example, add the tag "A" to each word in the sentence "my dog ​​is cute" and add the tag "B" to each word in the sentence "he likes play". The tag position embeddings is used to identify the position of each word in each sentence in the text. For example, the position of the word "my" in the text is "1" and the position of the word "cute" in the text is "4".

[0128] Furthermore, the Bert model obtains the semantic representation of each word in the text based on the aforementioned tags.

[0129] Optionally, the Bert model may include a 12-layer bidirectional Transformer structure, which may obtain a semantic representation of each word in the text based on the aforementioned word vector, word position vector, and sentence vector.

[0130] See also Figure 2B , Figure 2B An exemplary operation flow chart of a bidirectional Transformer layer provided for an embodiment of the present application. Among them, the main functional units of the bidirectional Transformer layer include: a multi-head attention layer, a feed forward neural network layer, a linear layer and a logistic regression (softmax) layer. Multi-Head Attention is used to encode the input vector to obtain the syntactic and semantic relationship encoding of any word with other words in the text. The feed forward neural network layer is used to perform feature fusion on the input feature vector. The linear layer is used to perform a linear transformation on the input feature vector so that the feature vector corresponds to the word. The softmax layer is used to convert the feature vector into a semantic representation of the word.

[0131] See also Figure 2B, the Bert model embeds the aforementioned token embeddings, position embeddings, and segment embeddings as inputs. The bidirectional Transformer layer performs positional encoding on the token embeddings, position embeddings, and segment embeddings, that is, adding the token embeddings and position embeddings. Then, the encoded vectors and sentence vectors are input into Multi-Head Attention. Multi-Head Attention operates on the vector of each word and the vectors of other words to obtain the syntactic and semantic relationship encoding between any word and other words in the text, and obtains the contextual semantic vector of each word in multiple dimensions. After that, the semantic vector is input into the Feed Forward layer. The Feed Forward layer performs linear feature fusion on the input vector.

[0132] In order to obtain the semantic representation of each word from left to right and from right to left, the bidirectional transformer usually uses masking technology to randomly mask some words, and then predicts the masked words based on the unmasked words. The above process is the feature extraction process of the unmasked words.

[0133] See again Figure 2B , the bidirectional transformer also encodes the masked words through the masked Multi-HeadAttention layer, and then encodes the features of the unmasked words and the masked word encoding through the next Multi-Head Attention layer to obtain the semantic vector of all the encoded words. Furthermore, the semantic vectors of all the encoded words are feature fused through the next Feed Forward layer, and the fused feature vector is input into the linear layer. The linear layer performs a linear transformation on the input vector to obtain the logical vector corresponding to the number of words in the text, and inputs the logical vector into the softmax layer. The softmax layer converts the logical vector of each word into a semantic representation of each word.

[0134] Before output, the bidirectional transformer model also performs output embeddings on the data to be output, that is, a shift right operation to add start and end symbols to the data to be output, so as to facilitate the prediction of the first and last characters of the output data.

[0135] It should be pointed out that in the bidirectional transformer model, each Multi-Head Attention layer, each Feed Forward layer, and the masked Multi-Head Attention layer perform feature fusion (ADD & norm) on the processed data with the input data of the corresponding layer to obtain the data input to the next layer.

[0136] It can be understood that the above is only a schematic description of English text. In actual implementation, the input text can be Chinese text. Correspondingly, after the Chinese text is segmented, multiple characters are obtained. Then, the Bert model obtains the semantic representation of each character. The specific implementation process will not be repeated here.

[0137] See also Figure 2C , Figure 2C An exemplary operation flow chart of the LSTM model provided in the embodiment of the present application. The LSTM model can further extract features from the semantic representation of the word output by the aforementioned Bert model.

[0138] The LSTM model updates the "cell state" through three "gates" to obtain the features of the word. Among them, the cell state (C) is used to record all updated context features up to the current moment, which can be understood as a long-term memory, that is, long-term historical information. Figure 2C As shown, C t-1 is the previous cell state, C t is the current output cell state. The gate structure is used in the LSTM model to remove or add information to the cell state, providing a method for selectively passing information. Figure 2C As shown in Figure 1, the LSTM model consists of three gates: forget gate, input gate (memory gate) and output gate. The forget gate is used to decide what information to discard from the cell state, the input gate is used to determine what new information to store in the cell state, and the output gate is used to determine the hidden state h at the current moment. t What it should be.

[0139] like Figure 2C As shown, the input information of the forget gate is the hidden state h of the previous moment. t-1 and the input feature x at the current moment tThe forget gate specifically outputs a number between "0" and "1" to the cell state C t-1 , "0" means discarding the corresponding information, and "1" means retaining the corresponding information. After that, the forget gate outputs the value f t .

[0140] The input information of the input gate is also the hidden state h of the previous moment. t-1 and the input feature x at the current moment t The input gate determines how much new information is added to the previous state matrix, and the tanh layer determines how much new information is added to the previous state matrix. t-1 and x t Generate a candidate value vector, and finally multiply the data of the new information and the candidate value vector and output it.

[0141] The input information of the output gate is the hidden state h of the previous moment t-1 , the input feature x at the current moment t and the current output cell state C t The output gate determines C t Which part of the information is output, and this part of the information is multiplied by the weight, and then the value is normalized through a tanh layer to obtain the hidden layer state h t .

[0142] It can be seen that the LSTM model extracts features according to the order of the sequence (such as time order or position order). In this example, the LSTM model can extract the semantic features of the characters layer by layer based on the positional relationship of each character in the text, and then obtain the probability distribution of different labels corresponding to each character.

[0143] The CRF model is a conditional probability model that solves another set of variables given a set of variables. Optionally, the CRF model can obtain the transition probability of combining various preset types through a learning algorithm. Then, based on the transition probability, the corresponding combination probability after different types of combinations is obtained, and the probability distribution of the LSTM model output is constrained based on the combination probability.

[0144] See again Figure 2, an embodiment of the present application provides an abbreviation extraction method 20 (hereinafter referred to as method 20). Method 20 is described by taking the subject as a company as an example. In this example, the types corresponding to the company can be set to: first-level place name, second-level place name, company logo, company industry, company general information and branch information. Among them, the first-level place name indicates the information of the country to which the company belongs, such as China. The type label corresponding to the first-level place name is, for example, LOC. The second-level place name indicates the local information such as the province, city, county, town, etc. to which the company belongs, such as Beijing. The type label corresponding to the second-level place name is, for example, CIT. The company logo indicates the iconic name of the company, such as TX. The type label corresponding to the company logo is, for example, COM. The company industry indicates the company's industry attributes, such as the Internet. The type label corresponding to the company industry is, for example, PRO. The company's general information is general information of company names such as "Limited Liability Company" and "Stock Co., Ltd.". The type label corresponding to the company's general information is, for example, MON. Branch information includes, for example, branches, branches and divisions. The type label corresponding to the branch information is, for example, PAR.

[0145] The method 20 comprises the following steps:

[0146] Step S201: a data preprocessing module receives a third sample set.

[0147] In this example, the third sample set includes, for example, the full name texts of multiple companies and the initial abbreviation corresponding to each of the multiple full name texts. The initial abbreviation may be extracted according to a rule defined based on the full name template.

[0148] Step S202: the data preprocessing module filters the content in the third sample set to obtain a first text, and inputs the first text into a full name parsing model.

[0149] It should be noted that the initial abbreviations in the third sample set are obtained according to a preset fixed rule, so that the initial abbreviations generally contain noise information. Based on this, in this example, the data preprocessing module filters the content in the third sample set.

[0150] Exemplarily, the data preprocessing module may filter the content in the third sample set by performing at least one of deduplication, cleaning or denoising operations on the third sample set. "Deduplication" refers to removing repeated abbreviations in the third sample set. "Cleaning" refers to removing abbreviations that contain illegal characters or whose length does not meet preset conditions (for example, the abbreviation is one character long). "Denoising" refers to removing extra spliced ​​data and English characters, such as the symbol "-".

[0151] For example, the full name of the company "Guangzhou LKS Pizza Catering Management Co., Ltd." has an initial abbreviation "LKS Pizza y", where "y" is an additional English character. The data preprocessing module filters "LKS Pizza y" and removes "y" to get "LKS Pizza". For another example, the full name of the company "Chengche (Shanghai) Network Technology Co., Ltd." has an initial abbreviation "Cheng". The length of the initial abbreviation is one character, which does not meet the preset conditions. The data preprocessing module deletes the initial abbreviation from the third sample set.

[0152] Step S203: the full name parsing model parses the type of each character in the first text, and inputs the type of each character obtained by parsing into the abbreviation extraction model.

[0153] The type of each word in the first text is one of the types corresponding to the aforementioned company. The parsing result of the full name parsing model on the first text is shown in Table 2, for example.

[0154] Table 2

[0155]

[0156] As shown in Table 2, the full name parsing model parses each company full name in Table 2 to obtain the type of each character in each company full name. For example, the full name of the company "China JS Bank Co., Ltd. Guangdong Branch" is parsed to obtain the type of each character therein, and then, the characters of the same type are combined to obtain words, so that the type of "China" is a first-level place name, the type of "JS Bank" is a company logo, the type of "Co., Ltd." is the company's general information, and the type of "Guangdong Branch" is the branch company information. For another example, the full name of the company "Shenzhen TX Computer System Co., Ltd." is parsed to obtain that the type of "Shenzhen" is a second-level place name, the type of "TX" is a company logo, the type of "Computer System" is the company industry, and the type of "Co., Ltd." is the company's general information. The relationship between the information in other rows in Table 2 is similar and will not be repeated here.

[0157] To facilitate understanding by technical personnel related to this application, the following uses the Bert model, LSTM model and CRF model as examples, and takes the type of each word in the company name text "Shenzhen TX Computer System Co., Ltd." as an example to exemplify the implementation process of the full name parsing model.

[0158] See also Figure 3, after obtaining the text "Shenzhen TX Computer System Co., Ltd.", the full name parsing model inputs the text "Shenzhen TX Computer System Co., Ltd." into the Bert model. The Bert model performs operations such as word segmentation and embedding tags (token embeddings, segment embeddings, position embeddings) on the text "Shenzhen TX Computer System Co., Ltd.". Furthermore, the Bert model can obtain the bidirectional semantic representations of each character in "Shenzhen TX Computer System Co., Ltd." through bidirectional transformers. After that, the Bert model inputs the semantic representations of each segmented character into the lstm model. After obtaining the aforementioned semantic representations, the lstm model calculates the probability distribution of each character in the aforementioned 6 types based on the positional relationship of each character in "Shenzhen TX Computer System Co., Ltd.". Then, the lstm model inputs the probability distribution of each character in the aforementioned 6 types into the CRF model.

[0159] It should be noted that the lstm model obtains the initial probability of each character corresponding to the aforementioned 6 types by performing NER on each of the aforementioned characters. Taking "深" as an example, the lstm model, for instance, obtains that the initial probability of "深" corresponding to (B-LOC, that is, the character starting a first-level place name) is 0.9, the initial probability corresponding to (B-CIT, that is, the character starting a second-level place name) is 0.85, the initial probability corresponding to (B-COM, that is, the character starting a company identifier) is 0.5, the initial probability corresponding to (B-PRO, that is, the character starting a company industry) is 0.3, the initial probability corresponding to (B-MON, that is, the character starting general company information) is 0.1, and the initial probability corresponding to (B-PAR, that is, the character starting branch company information) is 0.2.

[0160] It should be understood that in actual implementation, the lstm model can also obtain the initial probability of "深" corresponding to (I-LOC, that is, the character in the middle of a first-level place name), and the initial probability corresponding to (I-PRO, that is, the character in the middle of a company industry), etc., for each of the other scenarios. Additionally, the lstm model can also obtain the initial probabilities of other characters in "Shenzhen TX Computer System Co., Ltd." corresponding to the aforementioned various types, which will not be listed one by one here.

[0161] Among them, in some implementations, corresponding to each word, the LSTM model can determine the maximum initial probability corresponding to the word as the type of each word, for example, the type of "deep" is determined as (B-LOC, i.e., the character starting with the first-level place name). However, the type determined by the LSTM model may be inaccurate. Based on this, the CRF model can obtain the type transition probability of the aforementioned various type combinations based on corpus learning through a learning algorithm, and then, based on the type transition probability, the corresponding combination probability of the aforementioned various words after being combined in different types can be determined. Afterwards, the CRF model can obtain the final type of each of the aforementioned words according to the maximum combination probability and output it.

[0162] For example, the CRF model can obtain a type combination, which uses "+" as a combination connector: I-CIT (Shenzhen) + I-PRO (Shenzhen) + B-COM (city) + B-PRO (T) + I-MON (X) + B-CIT (calculation) + E-COM (calculation) + E-MON (machine) + I-MON (system) + I-PRO (system) + B-PRO (property) + I-PRO (limited) + I-MON (public) + B-PRO (company) + E-PRO, after which the CRF model can calculate the sum of the initial probabilities of each character in the type combination corresponding to the corresponding type (i.e., the first probability), and the initial probability of each character corresponding to the corresponding type includes, for example, the probability of "Shenzhen" corresponding to I-CIT, the probability of "Shenzhen" corresponding to I-PRO, etc. The CRF model also obtains the transition probability between every two adjacent types in the type combination from the type transition probability, and calculates the sum of the transition probabilities (i.e., the second probability). The transition probability between every two adjacent types, for example, includes the transition probability of I-CIT (deep) and I-PRO (Shenzhen), the transition probability of I-PRO (Shenzhen) and B-COM (city), etc. The CRF model can also obtain the combination probability of other types and other types, and then, the type of each word in the type combination corresponding to the maximum combination probability determines the final type of each word, for example, obtain deep (B-CIT), Shenzhen (I-CIT), city (E-CIT), Teng (B-COM), information (E-COM), plan (B-PRO), calculate (I-PRO), machine (I-PRO), system (I-PRO), system (E-PRO), have (B-MON), limit (I-MON), public (I-MON) and company (E-MON). That is, the final type of "deep" is B-CIT, the final type of "Shenzhen" is I-CIT, and the final types of other words are deduced by analogy, which will not be described in detail here.

[0163] Furthermore, based on the principle of NER, according to the BIE tag of each word, the words can be combined in order to obtain the target type of words. Figure 4AAs shown, the words "Shenzhen City" are obtained by combining "Shen", "Zhen", and "City" according to the BIE identifier combination. The type label of the word "Shenzhen City" is (CIT), that is, the type of "Shenzhen City" is a secondary place name. The word "TX" is obtained by combining "T" and "X" according to the BIE identifier combination. The type label of "TX" is (COM), that is, the type of "TX" is a company identifier. The word "computer system" is obtained by combining "computer", "system", "department", and "system" according to the BIE identifier combination. The type label of the word "computer system" is (PRO), that is, the type of "computer system" is a company industry. The word "limited company" is obtained by combining "limited", "company", and "corporation" according to the BIE identifier combination. The type label of the word "limited company" is (MON), that is, the type of "limited company" is general company information.

[0164] It should be noted that the combination coefficients between the foregoing types can be obtained by training based on a large amount of vocabulary corpus using the hidden Markov model (HMM).

[0165] It can be understood that the above is a description of the parsing process of the full name parsing model by taking the parsing of "Shenzhen TX Computer System Co., Ltd." as an example. The parsing process of the types of characters in the full names of other companies in Table 2 by the full name parsing model involved in the embodiments of the present application can refer to the above description and will not be elaborated here.

[0166] In addition, Figure 3 This is only a schematic description and does not constitute a limitation on the full name parsing model described in the present application. In some other embodiments, the full name parsing model involved in the embodiments of the present application can also be implemented as a combination of a BiLSTM model and a CRF model or a combination of a Bert model and a CRF model. The embodiments of the present application do not limit this.

[0167] It can be seen that by adopting this implementation method, parsing the types of characters in the text based on the learning algorithm is not only not limited by the composition structure of the text, but also the learning algorithm can automatically learn semantic knowledge and iterate the parsing model, which can not only optimize the performance of abbreviation extraction, but also does not require maintenance, thereby reducing the maintenance cost.

[0168] Step S204, the abbreviation extraction model obtains at least one abbreviation of each company in the first text according to at least one preset rule.

[0169] In this example, for example, three types, namely secondary place names, company identifiers, and company industries, are configured as target types, and first-level place names, general company information, and branch company information are configured as non-target types. And it can be configured that the abbreviation at least contains characters of the type of company identifier. Combining Figure 4BAs shown, the rules for the abbreviation extraction model to obtain the abbreviation according to the target type may include: Rule 1, company logo; Rule 2, secondary place name + company logo; Rule 3, company logo + company industry; Rule 4, secondary place name + company logo + company industry.

[0170] Furthermore, the abbreviation extraction model can obtain the abbreviation of each company involved in the first text according to the above four rules, and obtain the corresponding relationship between the full name and the abbreviation of each company in the first text.

[0171] For example, still taking "Shenzhen TX Computer System Co., Ltd." as an example, the secondary place name is "Shenzhen City", the company logo is "TX", and the company industry is "Computer System". According to the above four rules, the abbreviation extraction model can obtain the abbreviation "TX", the abbreviation "Shenzhen TX", the abbreviation "TX Computer System" and the abbreviation "Shenzhen TX Computer System".

[0172] Understandably, Figure 2 and Figure 3 This is only a schematic description and does not limit the embodiments of the present application. In other embodiments, the learning algorithm involved in the embodiments of the present application may also be other algorithms, for example, any combination of ALBERT models, neural network models based on attention or self-attention, and neural network models such as RNN models as required. The embodiments of the present application are not limited to this.

[0173] In addition, although the above embodiments all take the full name text and the company abbreviation as examples, the embodiments of the present application are not limited thereto, and the technical solutions of the embodiments of the present application can also be applied to the scenario of extracting the abbreviation of an organization based on the full name of the organization, the scenario of extracting the abbreviation of a file based on the full name of a file, etc. This will not be described in detail here.

[0174] In summary, in the implementation of the embodiment of the present application, the electronic device adopts a learning algorithm to parse each word in the full name text according to a preset candidate type, and then obtains at least one abbreviation of the target subject based on the word of the target type in the full name text. In this way, obtaining the abbreviation based on the type of the word can not only ensure the accuracy of the extracted abbreviation, but also adapt to the full name text of different composition structures. In addition, the type of words in the text parsed based on the learning algorithm is not only not limited to the composition structure of the text, but also the learning algorithm can automatically learn semantic knowledge and iterate the parsing model, which can not only optimize the performance of abbreviation extraction, but also does not require maintenance, thereby reducing maintenance costs.

[0175] The above embodiments introduce various implementation methods of the abbreviation extraction method provided by the embodiments of the present application from the perspective of the actions performed by the electronic device such as the parsing of the type of words, the combination of the target type of words, and the processing of the learning algorithm. It should be understood that the processing steps of the parsing of the type of words, the combination of the target type of words, etc., the embodiments of the present application can implement the above functions in the form of hardware or a combination of hardware and computer software. Whether a function is executed in the form of hardware or computer software driving hardware depends on the specific application and design constraints of the technical solution. Professional and technical personnel can use different methods to implement the described functions for each specific application, but such implementation should not be considered to be beyond the scope of this application.

[0176] For example, if the above implementation steps implement the corresponding functions through software modules. Figure 5A As shown, the abbreviation extraction device 50 may include an acquisition module 501, a parsing module 502 and an abbreviation extraction module 503. The abbreviation extraction device 50 may be used to perform part or all of the operations of any of the methods 10 to 30 above.

[0177] For example: an acquisition module 501 is used to acquire a first text. A parsing module 502 is used to parse the type of each word in the first text, wherein the type of each word is one of at least one target type and at least one non-target type, and the target type includes a type related to the abbreviation of the target subject. An abbreviation extraction module 503 is used to obtain the abbreviation of the target subject according to the words of the target type in the first text.

[0178] It can be seen that the abbreviation extraction device 50 provided in the embodiment of the present application can parse the type of each word in the first text after obtaining the full name text of the target subject (i.e., the first text), and then obtain the abbreviation of the target subject according to the word corresponding to the target type in the type. In this way, based on the type of each word in the first text, the type of each word in the first text is known through a learning algorithm, and the abbreviation of the subject is obtained according to the type, which not only ensures the accuracy of the extracted abbreviation, but also does not require the maintenance of extraction rules, which can reduce maintenance costs.

[0179] Optionally, the parsing module 502 is further used to obtain a semantic representation of each character in the first text; obtain an initial probability of each character corresponding to each type according to the semantic representation of each character, and obtain a final type of the corresponding character according to the initial probability corresponding to each character.

[0180] Optionally, the parsing module 502 is further used to use the type corresponding to the maximum initial probability corresponding to each character as the final type of the corresponding character. In another example, the parsing module 502 is further used to determine the final type of each character according to the initial probability of each character corresponding to each type and the type transition probability, wherein the type transition probability represents the probability of each type being combined with any type of at least one target type and at least one non-target type.

[0181] Optionally, the parsing module 502 is further used to determine at least one combination probability corresponding to each character in the first text according to the initial probability and type transition probability of each character corresponding to each type, the type combination corresponding to each combination probability is obtained by combining each character in the first text in one type, and for any combination, the combination probability is the sum of the first probability and the second probability, the first probability is the sum of the initial probabilities of the types corresponding to each character in the corresponding type combination, and the second probability is the sum of the type transition probabilities between adjacent types in each type included in the combination. In this example, the parsing module 502 is also used to determine the type combination corresponding to the largest combination probability in at least one combination probability as the target type combination, and determine the type corresponding to each character in the target type combination as the final type of each character.

[0182] Optionally, the abbreviation extraction module 503 is further used to obtain at least one abbreviation of the target subject by combining characters of the target type according to at least one rule. In this embodiment, the abbreviation extraction module 503 is further used to select at least one target rule from at least one rule according to the target type corresponding to the characters included in the identified first text; and to obtain at least one abbreviation of the target subject by combining characters of the target type according to at least one target rule.

[0183] Optionally, in another embodiment of the present application, the acquisition module 501 is further used to acquire a second text set, the second text set including at least one full text and at least one abbreviation corresponding to the at least one full text. The parsing module 502 is further used to obtain at least one rule according to the type of the characters contained in each abbreviation in the full text corresponding to the abbreviation.

[0184] Optionally, at least one rule indicates that the elements constituting the abbreviation include a target type representing a target subject identifier.

[0185] Optionally, if the target entity is an organization, at least one target type includes a secondary place name, an organization logo, and organization industry information, and at least one non-target type includes a primary place name, organization type information, and organization branch information.

[0186] Optionally, the abbreviation of the target subject includes a character whose type is an organization identification and a character corresponding to at least one of the following target types: a character corresponding to a secondary place name type or a character corresponding to organization type information.

[0187] It should be noted that the parsing module 502 can implement the "parsing model" and "full name parsing model" involved in the aforementioned embodiments. Accordingly, the function of the parsing module 502 can be implemented based on a learning algorithm of a Bert model, a combination of an LSTM model and a CRF model, or a combination of a BILSTM model and a CRF model, or a combination of a Bert model and a CRF model.

[0188] It can be understood that the division of the above modules / units is only a division of logical functions. In actual implementation, the functions of the above modules can be integrated into hardware entities. For example, the functions of the parsing module 502 and the abbreviation extraction module 503 can be integrated into the processor, and the function of the acquisition module 501 can be integrated into the transceiver. The programs and instructions for implementing the functions of the above modules can be maintained in the memory. For example, Figure 5B An electronic device 51 is provided, which may include a processor 511, a transceiver 512 and a memory 513. The transceiver 512 is used to execute the acquisition of text in methods 10 to 30. The memory 513 can be used to store the program / code pre-installed in the aforementioned abbreviation extraction device 50, and can also store the code for execution by the processor 301. When the processor 511 runs the code stored in the memory 513, the electronic device 51 executes part or all of the operations of the abbreviation extraction method in methods 10 to 30.

[0189] For example, processor 511 can be used to parse the type of each word in the first text, wherein the type of each word is one of at least one target type and at least one non-target type, the target type includes a type related to the abbreviation of the target subject, and the abbreviation of the target subject is obtained based on the word of the target type in the first text.

[0190] The specific implementation process is detailed in the embodiments illustrated in the above methods 10 to 30, which will not be described in detail here.

[0191] In a specific implementation, corresponding to the aforementioned electronic device, an embodiment of the present application further provides a computer storage medium, wherein the computer storage medium provided in the electronic device may store a program, and when the program is executed, some or all of the steps in each embodiment of the abbreviated extraction method including method 10 to method 3 may be implemented. The storage medium may be a magnetic disk, an optical disk, a read-only memory (ROM) or a random access memory (RAM), etc.

[0192] One or more of the above modules or units can be implemented by software, hardware or a combination of the two. When any of the above modules or units is implemented by software, the software exists in the form of computer program instructions and is stored in a memory, and the processor can be used to execute the program instructions and implement the above method flow. The processor may include but is not limited to at least one of the following: a central processing unit (CPU), a microprocessor, a digital signal processor (DSP), a microcontroller unit (MCU), or an artificial intelligence processor and other types of computing devices that run software, each of which may include one or more cores for executing software instructions to perform operations or processing. The processor may be built into an SoC (system on chip) or an application specific integrated circuit (ASIC), or it may be an independent semiconductor chip. In addition to the core used to execute software instructions for operations or processing in the processor, it may further include necessary hardware accelerators, such as field programmable gate arrays (FPGA), PLDs (programmable logic devices), or logic circuits that implement dedicated logic operations.

[0193] When the above modules or units are implemented in hardware, the hardware can be any one or any combination of a CPU, a microprocessor, a DSP, an MCU, an artificial intelligence processor, an ASIC, a SoC, an FPGA, a PLD, a dedicated digital circuit, a hardware accelerator or a non-integrated discrete device, which can run the necessary software or not rely on the software to execute the above method flow.

[0194] Furthermore, Figure 5B The bus interface may also include a bus interface, which may include any number of interconnected buses and bridges, specifically linking various circuits of one or more processors represented by the processor and memory represented by the memory. The bus interface may also link various other circuits such as peripherals, voltage regulators, and power management circuits together, which are all well known in the art and are therefore not further described herein. The bus interface provides an interface. The transceiver provides a unit for communicating with various other devices over a transmission medium. The processor is responsible for managing the bus architecture and general processing, and the memory may store data used by the processor when performing operations.

[0195] When the above modules or units are implemented using software, they can be implemented in whole or in part in the form of a computer program product. The computer program product includes one or more computer instructions. When the computer program instructions are loaded and executed on a computer, the process or function described in the embodiment of the present invention is generated in whole or in part. The computer can be a general-purpose computer, a special-purpose computer, a computer network, or other programmable devices. The computer instructions can be stored in a computer-readable storage medium, or transmitted from one computer-readable storage medium to another computer-readable storage medium. For example, the computer instructions can be transmitted from a website site, computer, server or data center to another website site, computer, server or data center by wired (e.g., coaxial cable, optical fiber, digital subscriber line (DSL)) or wireless (e.g., infrared, wireless, microwave, etc.) mode. The computer-readable storage medium can be any available medium that a computer can access or a data storage device such as a server or data center that includes one or more available media integration. The available medium can be a magnetic medium (e.g., a floppy disk, a hard disk, a tape), an optical medium (e.g., a DVD), or a semiconductor medium (e.g., a solid-state hard disk Solid State Disk (SSD)), etc.

[0196] It should be understood that in various embodiments of the present application, the size of the sequence number of each process does not mean the order of execution. The execution order of each process should be determined by its function and internal logic, and should not constitute any limitation on the implementation process of the embodiment.

[0197] Each part of this specification is described in a progressive manner, and the same or similar parts between the various embodiments can be referred to each other, and each embodiment focuses on the differences from other embodiments. In particular, for the device and system embodiments, since they are basically similar to the method embodiments, the description is relatively simple, and the relevant parts can be referred to the description of the method embodiment part.

[0198] Although the optional embodiments of the present application have been described, those skilled in the art, once informed of the basic creative concept, may make additional changes and modifications to these embodiments. Therefore, the appended claims are intended to be interpreted as including the preferred embodiment and all changes and modifications falling within the scope of the present application.

[0199] The specific implementation methods described above further illustrate the purpose, technical solutions and beneficial effects of the present application in detail. It should be understood that the above description is only the specific implementation method of the present application and is not intended to limit the scope of protection of the present application. Any modifications, equivalent substitutions, improvements, etc. made on the basis of the technical solutions of the present application should be included in the scope of protection of the present invention.

Claims

1. A method for extracting abbreviated names, characterized in that: include: Get the first text associated with the name of the target subject; Parsing the type of each word in the first text, including: obtaining the type of each word in the first text and the segmentation tags of each word corresponding to different entities; wherein the segmentation tags include a start tag, a middle tag and an end tag, which are used to indicate the positional relationship of the word in the corresponding entity; the type of each word is one of at least one target type and at least one non-target type, and the target type includes a type related to the abbreviation of the target subject; if the target subject includes an organization, the type of each word includes at least one of a primary place name, a secondary place name, an organization identifier, an organization industry information, an organization type information and an organization branch information; The abbreviation of the target subject is obtained based on the characters of the target type in the first text, including: according to the positional relationship of each character in the first text, the characters of the same type are combined to obtain words of the corresponding target type, and at least one abbreviation of the target subject is obtained based on the words of the target type.

2. The method according to claim 1, characterized in that The step of analyzing the type of each word in the first text includes: Obtaining a semantic representation of each word in the first text; Obtaining an initial probability of each character corresponding to each type according to the semantic representation of each character; The final type of the corresponding word is obtained according to the initial probability corresponding to each word.

3. The method according to claim 2, characterized in that The step of obtaining the final type of the corresponding word according to the initial probability corresponding to each word comprises: The type corresponding to the maximum initial probability corresponding to each word is used as the final type of the corresponding word; or, The final type of each character is determined based on the initial probability that each character corresponds to each type and the type transition probability, wherein the type transition probability represents the probability that each type combined with any one of the at least one target type and the at least one non-target type corresponds to the first text.

4. The method according to claim 3, characterized in that Determining the final type of each word according to the initial probability and type transition probability of each word corresponding to each type includes: Determine at least one combination probability corresponding to each character in the first text according to the initial probability of each character corresponding to each type and the type transition probability, wherein the type combination corresponding to each combination probability is obtained by combining each character in the first text in one type, and for any combination, the combination probability is the sum of a first probability and a second probability, wherein the first probability is the sum of the initial probabilities of the types corresponding to each character in the corresponding type combination, and the second probability is the sum of the type transition probabilities between adjacent types in each type included in the combination; The type combination corresponding to the largest combination probability among the at least one combination probability is determined as the target type combination, and the type corresponding to each character in the target type combination is determined as the final type of each character.

5. The method according to claim 1, characterized in that The step of obtaining the abbreviation of the target subject according to the characters of the target type in the first text includes: Combining characters of the target type according to at least one rule to obtain at least one abbreviation of the target subject; or, According to the target type corresponding to the characters included in the first identified text, at least one target rule is selected from at least one rule; and the characters of the target type are combined according to the at least one target rule to obtain at least one abbreviation of the target subject.

6. The method according to claim 5, characterized in that The method further comprises: Acquire a second text set, the second text set comprising at least one full text and at least one abbreviation corresponding to the at least one full text; The at least one rule is obtained according to the type of the characters contained in each of the abbreviations in the full name text corresponding to the abbreviation.

7. The method according to claim 5, characterized in that The at least one rule indicates that the elements constituting the abbreviation include a target type that characterizes the target subject identifier.

8. The method according to claim 1, characterized in that If the target subject is an organization, the at least one target type includes a secondary place name, an organization identifier, and organization industry information. The at least one non-target type includes a primary place name, organization type information, and organization branch information.

9. The method according to claim 8, characterized in that The abbreviation of the target entity includes a word whose type is the organization identifier and a word corresponding to at least one of the following target types: The word corresponding to the secondary place name type or the word corresponding to the organization type information.

10. A short extraction device, characterized in that: include: An acquisition module, used for acquiring a first text related to the name of a target subject; A parsing module, for parsing the type of each word in the first text, comprising: obtaining the type of each word in the first text and segmentation tags of each word corresponding to different entities; wherein the segmentation tags include a start tag, a middle tag and an end tag, which are used to indicate the positional relationship of the word in the corresponding entity; the type of each word is one of at least one target type and at least one non-target type, wherein the target type includes a type related to the abbreviation of the target subject; if the target subject includes an organization, the type of each word includes at least one of a primary place name, a secondary place name, an organization identifier, an organization industry information, an organization type information and an organization branch information; The abbreviation extraction module is used to obtain the abbreviation of the target entity based on the characters of the target type in the first text, including: combining the characters of the same type to obtain words of the corresponding target type according to the positional relationship of each character in the first text, and obtaining at least one abbreviation of the target entity based on the words of the target type.

11. An electronic device, characterized in that: The electronic device comprises a memory and one or more processors; wherein the memory is used to store a computer program; when the computer program is executed by the processor, the electronic device executes the abbreviation extraction method as described in any one of claims 1 to 9.

12. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores a computer program, and when the computer program is executed on a computer, the computer is enabled to execute the abbreviation extraction method according to any one of claims 1 to 9.