Synonym mining method, device, computer readable medium and electronic device
By obtaining question and answer corpus and using graph neural network training, the problem of low efficiency and incomplete coverage of existing synonym mining methods is solved, and efficient and accurate synonym mining is achieved, especially the coverage of colloquial synonyms.
Patent Information
- Application Number
- CN202210827670.5
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-07-14
- Publication Date
- 2024-09-17
- Estimated Expiration
- 2042-07-14
AI Technical Summary
Existing synonym mining methods are inefficient, costly and incomplete, especially unable to effectively mine colloquial synonyms.
By obtaining the question and answer corpus, we generate the question and answer corpus nodes and entity word nodes, establish the entity word graph of weight edges, and use the graph neural network for training, and extract the entity word vector representation to mine synonyms.
It improves the efficiency and accuracy of synonym mining, can cover more colloquial synonyms, and enhances the comprehensive coverage of synonyms.
Smart Images

Figure CN115238679B
Abstract
Description
Technical Field
[0001] The present application relates to the technical field of machine learning, and in particular to a synonym mining method, device, computer-readable medium and electronic device. Background Art
[0002] At present, with the advancement of the information age, many text processing scenarios require the use of synonyms.
[0003] However, most of the existing methods for mining synonyms are to collect synonyms manually, which is not only inefficient and costly, but also overly dependent on the professional ability of the collectors. At the same time, the coverage of the collected synonyms is not very comprehensive. Summary of the invention
[0004] The embodiments of the present application provide a synonym mining method, device, computer-readable medium and electronic device, which can further improve the comprehensiveness of synonym coverage while ensuring the efficiency and accuracy of synonym mining, at least to a certain extent.
[0005] Other features and advantages of the present application will become apparent from the following detailed description, or may be learned in part by the practice of the present application.
[0006] According to one aspect of an embodiment of the present application, a method for mining synonyms is provided, the method comprising: obtaining multiple question and answer corpora and entity words contained in each question and answer corpus, and determining the category to which each question and answer corpus belongs; generating a question and answer corpus node corresponding to each question and answer corpus and an entity word node corresponding to each entity word; adding edges with weights between the multiple nodes to obtain a first question and answer entity word graph, the weight being used to measure the correlation between two nodes connected by the edge with the weight; training an original graph neural network for text classification according to the first question and answer entity word graph and the category to which each question and answer corpus belongs to obtain a target graph neural network for text classification; extracting a vector representation corresponding to each entity word node in a second question and answer entity word graph based on the target graph neural network for text classification, and mining synonyms according to the vector representation corresponding to each entity word node.
[0007] According to one aspect of an embodiment of the present application, a synonym mining device is provided, the device comprising: an acquisition and determination unit, used to acquire multiple question and answer corpora and entity words contained in each question and answer corpus, and determine the category to which each question and answer corpus belongs; a generation unit, used to generate a question and answer corpus node corresponding to each question and answer corpus and an entity word node corresponding to each entity word; an adding unit, used to add edges with weights between the multiple nodes to obtain a first question and answer entity word graph, wherein the weights are used to measure the correlation between two nodes connected by the edges with the weights; a training unit, used to train an original graph neural network for text classification according to the first question and answer entity word graph and the category to which each question and answer corpus belongs, to obtain a target graph neural network for text classification; an extraction and mining unit, used to extract the vector representation corresponding to each entity word node in the second question and answer entity word graph based on the target graph neural network for text classification, and mine synonyms according to the vector representation corresponding to each entity word node.
[0008] In some embodiments of the present application, based on the aforementioned scheme, the extraction and mining unit is configured to: determine the semantic distance between the vector representations corresponding to each entity word node; and determine synonyms in the entity words corresponding to each entity word node based on the semantic distance.
[0009] In some embodiments of the present application, based on the aforementioned scheme, the adding unit is configured to: add an edge between the entity word node corresponding to the target entity word and the question and answer corpus node corresponding to the target question and answer corpus according to the target entity word belonging to the target question and answer corpus; add an edge between the entity word node corresponding to the first entity word and the entity word node corresponding to the second entity word according to the first question and answer corpus to which the first entity word belongs and the second question and answer corpus to which the second entity word belongs belonging to the same category; determine the correlation between the nodes as the weight of the edge between the nodes.
[0010] In some embodiments of the present application, based on the aforementioned scheme, the adding unit is configured to: determine the term frequency-inverse document frequency between the target entity word and the target question and answer corpus as the weight of the edge between the entity word node corresponding to the target entity word and the question and answer corpus node corresponding to the target question and answer corpus; determine the point-by-point mutual information between the first entity word and the second entity word as the weight of the edge between the entity word node corresponding to the first entity word and the entity word node corresponding to the second entity word.
[0011] In some embodiments of the present application, based on the aforementioned scheme, the acquisition and determination unit is configured to: acquire a number of question and answer corpora on the question and answer platform; remove the question and answer corpora whose total browsing times are less than a predetermined number of times or whose text length is less than a predetermined length threshold from the several question and answer corpora to obtain multiple question and answer corpora; and extract entity words from each of the question and answer corpora.
[0012] In some embodiments of the present application, based on the aforementioned scheme, the generation unit is configured to: generate a corresponding question and answer corpus node for each question and answer corpus; perform deduplication processing on all entity words to obtain deduplicated entity words; and generate a corresponding entity word node for each deduplicated entity word.
[0013] In some embodiments of the present application, based on the aforementioned scheme, the training unit is configured to: input the first question-and-answer entity word graph into the original graph neural network for text classification, and obtain the classification result of the question-and-answer corpus corresponding to the question-and-answer corpus node in the first question-and-answer entity word graph by the original graph neural network for text classification; update the parameters of the original graph neural network for text classification according to the category to which each question-and-answer corpus belongs and the classification result corresponding to each question-and-answer corpus, and obtain the target graph neural network for text classification.
[0014] In some embodiments of the present application, based on the aforementioned scheme, after synonyms are mined out according to the vector representation corresponding to each entity word node, the extraction and mining unit is also used to: when receiving query information, determine the target synonyms that match the words in the query information among the mined synonyms; determine the target corpus containing the target synonyms, and return the target corpus to the sender of the query information.
[0015] In some embodiments of the present application, based on the aforementioned scheme, the question and answer corpus is a medical question and answer corpus, and the category to which the question and answer corpus belongs is the department or disease to which the medical question and answer corpus belongs.
[0016] According to one aspect of an embodiment of the present application, a computer-readable medium is provided, on which a computer program is stored. When the computer program is executed by a processor, the synonym mining method described in the above embodiment is implemented.
[0017] According to one aspect of an embodiment of the present application, an electronic device is provided, comprising: one or more processors; a storage device for storing one or more programs, which, when the one or more programs are executed by the one or more processors, enables the one or more processors to implement the synonym mining method as described in the above embodiments.
[0018] According to one aspect of an embodiment of the present application, a computer program product is provided, which includes computer instructions, the computer instructions are stored in a computer-readable storage medium, a processor of a computer device reads the computer instructions from the computer-readable storage medium, and the processor executes the computer instructions, so that the computer device executes the synonym mining method described in the above embodiment.
[0019] In the technical solutions provided in some embodiments of the present application, the question and answer corpus and the entity words contained in the question and answer corpus are first obtained, and the category to which each question and answer corpus belongs is determined. Then, a question and answer corpus node corresponding to each question and answer corpus and an entity word node corresponding to each entity word are generated, and a first question and answer entity word graph is obtained by adding edges with weights between the nodes. Since the weights are used to measure the correlation between the nodes, the first question and answer entity word graph is a co-occurrence graph that expresses the co-occurrence relationship between entity words or between entity words and question and answer corpus. On this basis, the original graph neural network for text classification is trained according to the first question and answer entity word graph and the category to which each question and answer corpus belongs to obtain a graph neural network for text classification. The target graph neural network of this classification is used to extract the vector representation corresponding to the entity words through the target graph neural network to perform synonym mining. Since the category to which each question and answer corpus belongs is additional supervisory information, by simultaneously training the neural network according to the first question and answer entity word graph and the category to which each question and answer corpus belongs, the trained target graph neural network for text classification can more accurately extract the vector representation corresponding to the entity words, thereby improving the efficiency and accuracy of synonym mining. At the same time, since the entity words contained in the question and answer corpus are pre-set, the entity words can be freely defined, so that the colloquial entity words can be covered during synonym mining, which can improve the comprehensiveness of synonym coverage.
[0020] It should be understood that the foregoing general description and the following detailed description are exemplary and explanatory only and are not restrictive of the present application. BRIEF DESCRIPTION OF THE DRAWINGS
[0021] The drawings herein are incorporated into the specification and constitute a part of the specification, showing embodiments consistent with the present application, and together with the specification, are used to explain the principles of the present application. Obviously, the drawings described below are only some embodiments of the present application, and for ordinary technicians in this field, other drawings can be obtained based on these drawings without creative work. In the drawings:
[0022] Figure 1 A schematic diagram showing an exemplary application scenario to which the technical solution of the embodiments of the present application can be applied;
[0023] Figure 2 A flowchart of a synonym mining method according to an embodiment of the present application is shown;
[0024] Figure 3 An embodiment according to the present application is shown. Figure 2 A flowchart of the details of step 210 in an embodiment;
[0025] Figure 4 A schematic diagram showing a page containing question-answer corpus according to an embodiment of the present application is shown;
[0026] Figure 5 A schematic diagram showing a page containing question-answer corpus according to another embodiment of the present application is shown;
[0027] Figure 6 An embodiment according to the present application is shown. Figure 2 A flowchart of the details of step 220 in an embodiment;
[0028] Figure 7 A schematic diagram of a co-occurrence network in the medical field according to an embodiment of the present application is shown;
[0029] Figure 8 A flowchart of adding edges with weights between multiple nodes according to an embodiment of the present application is shown;
[0030] Fig. 9 An embodiment according to the present application is shown. Figure 8 A flowchart of the details of step 830 in an embodiment;
[0031] Fig.10 An embodiment according to the present application is shown. Figure 2 A flowchart of the details of step 240 in an embodiment;
[0032] Fig.11 A schematic diagram showing the principle of training an original graph neural network for text classification according to an embodiment of the present application is shown;
[0033] Fig.12 An embodiment according to the present application is shown. Figure 2 A flowchart of the details of step 250 in an embodiment;
[0034] Fig.13 An embodiment according to the present application is shown. Figure 2 A flowchart of the steps after step 250 in the embodiment;
[0035] Fig.14 A schematic diagram of a product effect according to an embodiment of the present application is shown;
[0036] Fig.15 A block diagram of a synonym mining device according to an embodiment of the present application is shown;
[0037] Fig.16 A schematic diagram of the structure of a computer system suitable for implementing an electronic device of an embodiment of the present application is shown. DETAILED DESCRIPTION
[0038] Example embodiments will now be described more fully with reference to the accompanying drawings. However, example embodiments can be implemented in a variety of forms and should not be construed as limited to the examples set forth herein; rather, these embodiments are provided so that this application will be more comprehensive and complete and fully convey the concept of the example embodiments to those skilled in the art.
[0039] In addition, described feature, structure or characteristic can be combined in one or more embodiments in any suitable manner. In the following description, many specific details are provided to provide a full understanding of the embodiments of the present application. However, those skilled in the art will appreciate that the technical scheme of the present application can be put into practice without one or more of the specific details, or other methods, components, devices, steps, etc. can be adopted. In other cases, known methods, devices, realizations or operations are not shown or described in detail to avoid blurring the various aspects of the application.
[0040] The block diagrams shown in the accompanying drawings are merely functional entities and do not necessarily correspond to physically independent entities. That is, these functional entities may be implemented in software form, or in one or more hardware modules or integrated circuits, or in different networks and / or processor devices and / or microcontroller devices.
[0041] The flowcharts shown in the accompanying drawings are only exemplary and do not necessarily include all the contents and operations / steps, nor must they be executed in the order described. For example, some operations / steps can be decomposed, and some operations / steps can be combined or partially combined, so the actual execution order may change according to actual conditions.
[0042] There are two main synonym mining methods in related technologies:
[0043] Method 1: Professionals manually collect, organize and annotate professional synonym dictionaries.
[0044] Method 2: Use some machine learning or deep learning methods to automatically mine massive question and answer corpora. For example, build an entity co-occurrence graph based on the question and answer corpus, and then use unsupervised graph mining algorithms such as deepwalk to learn the graph embedding representations of these entities. Finally, calculate the similarity of the embedding representations of different medical entities to determine whether different entity pairs are candidate synonym pairs.
[0045] However, both of the above two synonym mining methods have certain defects and cannot meet the current demand for synonym mining.
[0046] For method 1, although the method of manually organizing synonym dictionaries can obtain synonym pairs with high accuracy, there are also obvious problems of high manual annotation costs, low efficiency and over-specialization. Moreover, it can only cover written synonyms such as low back pain->low back pain, eye tremor->nystagmus, etc., and cannot cover the rich and diverse synonym pairs related to user-defined spoken expressions. For example, synonym pairs related to colloquial expressions such as always wanting to urinate->frequent urination, hair loss->hair loss, thirsty mouth->dry mouth cannot be covered by existing technologies. Based on the medical synonyms in the previous traditional manual dictionary, the inventors have statistically analyzed the coverage in the existing online medical search system as shown in Table 1:
[0047]
[0048] Table 1
[0049] As can be seen, query is the query. The recall survey results show that for the 265 queries requested to the current online medical search system, a total of 332 synonym pairs are involved. However, only 132 synonym pairs are covered. That is, when the current online medical search system returns results based on the traditional manual dictionary, the returned results only involve about 40% of all synonym pairs, and the number of uncovered synonym pairs reaches 200, that is, the results returned by the current online medical search system cannot cover about 60% of all synonym pairs. Therefore, a large number of medical synonyms, especially colloquial medical synonyms, are not covered in medical question and answer text search.
[0050] For method 2, the graph embedding mining method based on graph walking deepWalk is unsupervised and only uses the structural information of the graph to learn the vector representation of the nodes. This results in its graph walking path being random and lacks supervised signal constraints. Ultimately, it is unable to obtain higher vector representation accuracy and iteration efficiency, which directly leads to the low accuracy of synonym mining.
[0051] To this end, the present application first provides a method for mining synonyms. The method for mining synonyms provided by the embodiments of the present application can overcome the above-mentioned defects. The method for mining synonyms can not only improve the efficiency and accuracy of mining synonyms, but also further mine synonyms expressed in colloquial forms that are difficult to cover by traditional manual sorting methods, thereby further improving the comprehensiveness of synonym coverage and thus improving the performance of mining synonyms as a whole.
[0052] Figure 1 A schematic diagram showing an exemplary application scenario to which the technical solution of the embodiment of the present application can be applied. Figure 1As shown, the system architecture 100 includes a management terminal 110, a server 120, multiple user terminals 130, a cloud 150 and a database 140. The multiple user terminals 130 specifically include a first user terminal 131, a second user terminal 132 and a third user terminal 133. Each user terminal and the cloud 150, the database 140 and the server 120 and the cloud are all connected via a communication link. A communication connection is also established between the management terminal 110 and the server 120. The cloud 150 is deployed with a server of the medical information retrieval system, and each user terminal has a client of the medical information retrieval system. The client here can be a small program, an App, an application, a Web page, etc. The server 120 is deployed with an original graph neural network for text classification. In the embodiment of the present application, the server 120 is an implementation terminal. When a synonym mining method provided in the embodiment of the present application is applied to Figure 1 In the system architecture shown, a process may be as follows: first, the management terminal 110 sends the medical entity dictionary that has been manually collected in advance to the server 120; then, the server 120 retrieves all the medical question and answer text data indexed by it, and extracts the medical entity words from each medical question and answer text data according to the medical entity dictionary. In addition, the server 120 automatically obtains the category to which the medical question and answer text data belongs according to the organizational form of the medical question and answer text data; then, the server 120 generates question and answer corpus nodes corresponding to the medical question and answer text data and entity word nodes corresponding to the medical entity words, and adds weighted edges between the nodes, thereby obtaining a question and answer entity word graph; next, the server 120 inputs the question and answer entity word graph into the original graph neural network for text classification, and performs text classification on the original graph neural network according to the category to which the medical question and answer text data belongs. The server 120 performs supervised training to obtain a target graph neural network for text classification; next, the server 120 inputs the question-answer entity word graph into the target graph neural network for text classification, obtains the vector representation corresponding to each medical entity word output by the target graph neural network for text classification, and determines the synonym pairs according to the vector representation corresponding to each medical entity word; next, the server 120 sends the mined synonym pairs to the cloud 150, and the cloud 150 stores these synonym pairs in the database 140; finally, when a user of a certain user terminal uses the client on his user terminal to send a medical question-answer request to the server 120, the server 120 will find the medical entity words carried in the medical question-answer request, find the synonyms of the medical entity words by searching the database 140, and finally return the medical question-answer information containing the medical entity words and / or the synonyms of the medical entity words to the user terminal.
[0053] In some embodiments of the present application, the server 120 determines the synonym pairs based on the similarity between the vector representations corresponding to the medical entity words.
[0054] In some embodiments of the present application, the medical entity words extracted from the medical question and answer text data include colloquial medical entity words.
[0055] It should be understood that Figure 1 The number of management terminals, servers, user terminals, cloud and databases in the embodiment is only illustrative. According to the implementation requirements, there may be any number of management terminals, servers, user terminals, cloud and databases. For example, the number of user terminals may be more than three, the number of management terminals, servers and databases may be multiple, and the servers, databases and cloud may be server clusters composed of multiple servers.
[0056] It should be noted that Figure 1 The embodiment shown is only one embodiment of the present application. Figure 1 The solution of the embodiment is used to extract synonyms in the medical field and provide medical question and answer information to users. However, in other embodiments of the present application, the solution can also be applied to various other fields, such as the e-commerce field, extracting product synonyms, providing product question and answer information to users, and the legal field, providing legal knowledge question and answer information to users; although Figure 1 The solution of the embodiment is specifically applied to the server, but in other embodiments of the present application, the synonym mining method can also be applied to various types of terminal devices such as smart phones, desktop computers, workstations, tablet computers, and vehicle-mounted terminals; although in Figure 1 In the scheme of the embodiment, the target graph neural network for text classification is trained on the server, and the synonyms mined based on the target graph neural network for text classification are used in the cloud. However, in other embodiments of the present application, both the deployment of the target graph neural network for text classification and the further use of the mined synonyms can be implemented on the same terminal device. Figure 1 In the solution of the embodiment, the medical entity words are automatically extracted by the server from each medical question and answer text data, but in other embodiments of the present application, the medical entity words can also be extracted manually, for example, the medical entity words can be manually marked in the medical question and answer text data. The embodiment of the present application does not make any limitation to this, and the protection scope of the present application should not be limited in any way.
[0057] It is easy to understand that the synonym mining method provided in the embodiment of the present application is generally executed by a server, and accordingly, the synonym mining device is generally set in the server. However, in other embodiments of the present application, the terminal device can also have similar functions as the server, so as to execute the synonym mining solution provided in the embodiment of the present application.
[0058] Therefore, the embodiments of the present application can be applied to a terminal or a server. The server can be an independent physical server, or a server cluster or distributed system composed of multiple physical servers, or a cloud server that provides basic cloud computing services such as cloud services, cloud databases, cloud computing, cloud functions, cloud storage, network services, cloud communications, middleware services, domain name services, security services, CDN, and big data and artificial intelligence platforms. The terminal can be a smart phone, a tablet computer, a laptop computer, a desktop computer, a smart speaker, a smart watch, etc., but is not limited to this. The terminal and the server can be directly or indirectly connected via wired or wireless communication, and this application is not limited here.
[0059] The implementation details of the technical solution of the embodiment of the present application are described in detail below:
[0060] Figure 2 The flowchart of a synonym mining method according to an embodiment of the present application is shown. The synonym mining method can be executed by various devices capable of computing and processing, such as user terminals or cloud servers. User terminals include but are not limited to mobile phones, computers, intelligent voice interaction devices, smart home appliances, vehicle terminals, aircraft, portable devices, etc. The embodiment of the present application can be applied to various scenarios, including but not limited to cloud technology, artificial intelligence, smart transportation, assisted driving, etc. Please refer to Figure 2 As shown, the synonym mining method at least includes the following steps:
[0061] In step 210, a plurality of question-answer corpora and entity words contained in each question-answer corpus are obtained, and the category to which each question-answer corpus belongs is determined.
[0062] Question and answer corpus can also be called documents. Question and answer corpus can be text data containing various question and answer contents. Question and answer corpus can belong to various specific fields, such as medical question and answer information in the medical field, or popular science question and answer information in the popular science field. Question and answer corpus can be pre-set, for example, it can be manually written; of course, question and answer corpus can also be crawled or retrieved from the Internet. The entity words contained in the question and answer corpus can be words or phrases that describe various objects. For example, in the medical field, entity words can be the name of the disease, the name of the drug, the name of the symptom, the description information of the examination method, the description information of the treatment measure, etc.
[0063] In one embodiment of the present application, the entity words contained in the question-answer corpus include colloquial entity words.
[0064] Specifically, the colloquial entity word is a colloquial expression corresponding to the written entity word. For example, the written entity word may be "indigestion", and the corresponding colloquial entity word may be "diarrhea".
[0065] In one embodiment of the present application, the question-answering corpus includes a question corpus and an answer corpus that solves the question corpus.
[0066] Entity words can be extracted from question corpus and answer corpus respectively. In question and answer corpus, question corpus usually exists in the form of title, while answer corpus often exists in the form of text.
[0067] Figure 3 An embodiment according to the present application is shown. Figure 2 Flow chart of the details of step 210 in the embodiment. Figure 3 As shown, obtaining multiple question-and-answer corpora and entity words contained in each question-and-answer corpus may specifically include the following steps:
[0068] In step 211, a number of question and answer corpora on the question and answer platform are obtained.
[0069] The question-and-answer platform can be, for example, a medical information search platform, which can obtain all medical question-and-answer corpus data indexed by the medical information search platform. The medical information search platform can serve as a medical information search engine, indexing and aggregating medical question-and-answer corpus data on various other websites. When a user searches for a question on the medical information search platform, the medical information search platform can return medical question-and-answer corpus data that matches the question. Medical question-and-answer corpus data is the content in the medical question-and-answer page.
[0070] In step 212, question and answer corpora whose total browsing times are less than a predetermined number of times or whose text length is less than a predetermined length threshold are removed from the plurality of question and answer corpora to obtain a plurality of question and answer corpora.
[0071] The predetermined number of times and the predetermined length threshold can be set according to actual needs and experience. The total number of views can be the number of views of the page containing the question and answer corpus.
[0072] Specifically, medical question and answer corpus data whose total browsing times are less than 5 times, or whose question corpus length is less than the question corpus length threshold, or whose answer corpus length is less than the answer corpus length threshold can be removed from all medical question and answer corpus data indexed by the medical information search platform.
[0073] Figure 4 A schematic diagram of a page containing question-and-answer corpus according to an embodiment of the present application is shown. Figure 5 A schematic diagram of a page containing question-and-answer corpus according to another embodiment of the present application is shown.
[0074] See also Figure 4As shown in the figure, the content on this page is the question-and-answer corpus, which specifically includes the question corpus "26-day-old newborn baby has diarrhea after eating breast milk" and the answer corpus provided by the doctor to solve the problem corpus. The answer corpus includes condition analysis, guidance, etc. Figure 5 The page shown in the figure contains another question-and-answer corpus, which specifically includes the question corpus "How should babies with breast milk diarrhea be treated? Thank you" and the answer corpus provided by the doctor to solve the question corpus.
[0075] In step 213, entity words are extracted from each question and answer corpus.
[0076] One or more entity words can be extracted from each question-and-answer corpus. The entity words extracted from different question-and-answer corpora may be the same. Therefore, after the entity words are extracted, all entity words can be deduplicated, and repeated entity words can be removed, so that only one of each entity word is retained.
[0077] Entity words can be extracted from the question and answer corpus based on a manually collected medical entity dictionary. Specifically, the medical entity dictionary includes multiple medical entity words, and the medical entity words existing in the medical entity dictionary are extracted from the question and answer corpus. Of course, it is also possible to obtain entity words extracted from the question and answer corpus manually. In addition, entity words can be extracted from the question and answer corpus by combining the medical entity dictionary and manual methods. Specifically, the medical entity dictionary can be used to extract entity words from the answer corpus. Since the question corpus usually contains colloquial content, entity words can be extracted from the question corpus manually.
[0078] In the embodiment of the present application, by removing question and answer corpora with a total number of views or a small text length, it is ensured that the final question and answer corpora are of high quality and have sufficient information, thereby providing high-quality data for subsequent steps.
[0079] Figure 4 and Figure 5 The content marked in the annotation box is the entity word extracted from the question-answer corpus. Figure 4 In the question-answer corpus shown, the entity word extracted from the question corpus is "eating breast milk and having diarrhea", and the entity words extracted from the answer corpus include "diarrhea", "smecta", "indigestion", etc. Figure 5 As shown, the entity word extracted from the question corpus is "breast milk diarrhea", and the entity words extracted from the answer corpus include "diarrhea", "indigestion", "smecta", etc.
[0080] Please continue to see Figure 2As shown, in step 220, a question-answer corpus node corresponding to each question-answer corpus and an entity word node corresponding to each entity word are generated.
[0081] Specifically, a corresponding question-answer corpus vector can be generated for each question-answer corpus in a one-hot manner, and a corresponding entity word vector can be generated for each entity word. The question-answer corpus vector is used as a question-answer corpus node, and the entity word vector is used as an entity word node.
[0082] Figure 6 An embodiment according to the present application is shown. Figure 2 Flow chart of details of step 220 in the embodiment. Figure 6 As shown, generating a question-answer corpus node corresponding to each question-answer corpus and an entity word node corresponding to each entity word may specifically include the following steps:
[0083] In step 221, a corresponding question-answer corpus node is generated for each question-answer corpus.
[0084] For each question-answer corpus, a corresponding question-answer corpus node is generated.
[0085] In step 222, all entity words are deduplicated to obtain deduplicated entity words.
[0086] By retaining only one entity word in each group of repeated entity words, any two entity words in all retained entity words are different, thereby achieving deduplication of entity words.
[0087] In step 223, a corresponding entity word node is generated for each entity word after the deduplication process.
[0088] Any two entity words in the entity words after deduplication are different. The total number of generated nodes is the sum of the number of question and answer corpora and the number of entity words after deduplication.
[0089] Figure 7 FIG. 4 shows a schematic diagram of a co-occurrence network in the medical field according to an embodiment of the present application. Figure 7 As shown, the question-answer-entity word graph on the left includes square nodes and circle nodes. The square nodes represent the question-answer corpus nodes, and the circle nodes represent the entity word nodes. It can be seen that the medical entity words corresponding to each entity word node include diarrhea, shortness of breath, hemiplegia, paralysis, enteritis, abdominal pain, etc.
[0090] Please continue to see Figure 2 As shown, in step 230, edges with weights are added between multiple nodes to obtain a first question-answer entity word graph, and the weight is used to measure the correlation between two nodes connected by the edge with the weight.
[0091] Edges can be added between two entity word nodes or between an entity word node and a question-answer corpus node.
[0092] The first question-answer entity word graph can be Figure 7 In the question-answer-entity graph on the left, we can see that some nodes in the question-answer-entity graph are connected by edges. Specifically, the correlation measured by the weight can be the co-occurrence degree between two nodes connected by the edge with the weight. Therefore, Figure 7 The question-answer-entity word graph on the left can also be called the co-occurrence network of the question-answer corpus and medical entity words.
[0093] Figure 8 FIG. 1 shows a flowchart of adding edges with weights between multiple nodes according to an embodiment of the present application. Figure 8 As shown, adding edges with weights between multiple nodes may specifically include the following steps:
[0094] In step 810, based on the target entity word belonging to the target question and answer corpus, an edge is added between the entity word node corresponding to the target entity word and the question and answer corpus node corresponding to the target question and answer corpus.
[0095] Specifically, if an entity word is extracted from a question-and-answer corpus, an edge can be added between the corresponding entity word node and the question-and-answer corpus node to indicate that there is a certain co-occurrence relationship between the entity word and the question-and-answer corpus.
[0096] See also Figure 7 As shown in the figure, in the question-answer-entity word graph on the left, there is an edge between the question-answer corpus node and the entity word node. For example, there is an edge between the question-answer corpus node "Question and Answer 1" and the entity word node "Excited". In addition, each entity word node can have edges with multiple question-answer corpus nodes, for example, there is an edge between the entity word node "Enteritis" and two question-answer corpus nodes; each question-answer corpus node can have edges with multiple entity word nodes, and there is an edge between the question-answer corpus node "Question and Answer 3" and two entity word nodes.
[0097] In step 820, based on the fact that the first question-answer corpus to which the first entity word belongs and the second question-answer corpus to which the second entity word belongs belong to the same category, an edge is added between the entity word node corresponding to the first entity word and the entity word node corresponding to the second entity word.
[0098] The category to which the question-answer corpus belongs can be pre-classified by the model or generated by manual labeling. Different question-answer corpora can belong to the same category or different categories.
[0099] In one embodiment of the present application, the category to which the question and answer corpus belongs is determined based on information in the page where the question and answer corpus is located.
[0100] In one embodiment of the present application, the question and answer corpus is a medical question and answer corpus, and the category to which the question and answer corpus belongs is the department or disease to which the medical question and answer corpus belongs.
[0101] See also Figure 4 and Figure 5 As shown, the top of the page contains the classification of the problematic corpus, for example, Figure 4 The question-and-answer corpus shown specifically includes the question corpus "26-day-old newborn baby has diarrhea after eating breast milk". According to the information on the page, the category of this question corpus is pediatric internal medicine. Therefore, Figure 4 The question and answer corpus shown may belong to pediatrics.
[0102] When two entity words are extracted from two question-and-answer corpora belonging to the same category, an edge can be added between the entity word nodes corresponding to the two entity words to indicate that there is a certain co-occurrence relationship between the two entity words.
[0103] In step 830 , the correlation between the nodes is determined as the weight of the edge between the nodes.
[0104] Once edges are added between nodes, they can be further weighted to measure the degree of co-occurrence or correlation.
[0105] The weight of the edge between nodes is equivalent to the value of the adjacency matrix used to represent the relationship between nodes.
[0106] Fig. 9 An embodiment according to the present application is shown. Figure 8 For details of step 830 in the embodiment, please refer to Fig. 9 As shown, step 830 may specifically include the following steps:
[0107] In step 831, the term frequency-inverse document frequency between the target entity word and the target question and answer corpus is determined as the weight of the edge between the entity word node corresponding to the target entity word and the question and answer corpus node corresponding to the target question and answer corpus.
[0108] Term Frequency-Inverse Document Frequency (TF-IDF) can be calculated using the following formula:
[0109] TF = number of times a word appears in the document / total number of words in the document
[0110] IDF = log (total number of documents / (number of documents containing the word + 1))
[0111] Among them, document is question and answer corpus, TF is term frequency, and IDF is inverse document frequency.
[0112] In step 832, the point-by-point mutual information between the first entity word and the second entity word is determined as the weight of the edge between the entity word node corresponding to the first entity word and the entity word node corresponding to the second entity word.
[0113] The pointwise mutual information (PMI) between entity words can be calculated by the following formula:
[0114] PMI = log(word pair<a,b> Occurrence frequency / (a occurrence frequency*b occurrence frequency))
[0115] Among them, the frequency of occurrence is obtained by sliding window statistics on the question-answer corpus.<a,b> The frequency of occurrence is the ratio of the number of sliding windows that contain both word a and word b in all question and answer corpora to the number of all sliding windows, the frequency of occurrence of a is the ratio of the number of sliding windows that contain word a in all question and answer corpora to the number of all sliding windows, and the frequency of occurrence of b is the ratio of the number of sliding windows that contain word b in all question and answer corpora to the number of all sliding windows. The sliding window is a hyperparameter and can be set in advance.
[0116] like Figure 7 As shown, there are edges between question and answer corpus nodes in the question and answer-entity word graph on the left.
[0117] In one embodiment of the present application, adding edges with weights between multiple nodes also includes: adding an edge between a question and answer corpus node corresponding to the first question and answer corpus and a question and answer corpus node corresponding to the second question and answer corpus based on that the first question and answer corpus and the second question and answer corpus belong to the same category.
[0118] Specifically, an edge may or may not be set between two question-and-answer corpus nodes, and the weight of the edge may be set according to certain rules. If an edge can be set between two question-and-answer corpus nodes, then the weight of the edge between any two question-and-answer corpus nodes may be the same, for example, both may be 1; of course, different weights may be set for the edges between different question-and-answer corpus node pairs according to the different subdivision categories to which different question-and-answer corpus node pairs belong. For example, when the two question-and-answer corpus nodes in the first question-and-answer corpus node pair both belong to the subdivision category of adult internal medicine under the category of internal medicine, the weight of the edge between the first question-and-answer corpus node pair may be set to 1; when the two question-and-answer corpus nodes in the second question-and-answer corpus node pair both belong to the subdivision category of pediatric internal medicine under the category of internal medicine, the weight of the edge between the second question-and-answer corpus node pair may be set to 2.
[0119] In step 240, the original graph neural network for text classification is trained according to the first question-answer entity word graph and the categories to which each question-answer corpus belongs, to obtain a target graph neural network for text classification.
[0120] First, the question-and-answer entity word graph is equivalent to sample data, and the category to which the question-and-answer corpus belongs is the category label. Therefore, based on the sample data and category labels, the original graph neural network for text classification can be trained in a supervised manner.
[0121] Fig.10 An embodiment according to the present application is shown. Figure 2 Flow chart of details of step 240 in the embodiment. Fig.10 As shown, step 240 may specifically include the following steps:
[0122] In step 241, the first question-answer entity word graph is input into the original graph neural network for text classification to obtain the classification result of the question-answer corpus corresponding to the question-answer corpus node in the first question-answer entity word graph by the original graph neural network for text classification.
[0123] The graph neural network used for text classification can be Graph Convolutional Networks for Text Classification (TextGCN), GraphSage, etc. See Figure 7 As shown in the figure, the question-answer-entity word graph on the left is the input of the graph convolutional network for text classification. After the question-answer-entity word graph is input into TextGCN, it is processed by several hidden layers in TextGCN to obtain the question-answer vector representation corresponding to the question-answer corpus node and the entity word vector representation corresponding to the entity word node.
[0124] In step 242, according to the category to which each question and answer corpus belongs and the classification result corresponding to each question and answer corpus, the parameters of the original graph neural network used for text classification are updated to obtain the target graph neural network for text classification.
[0125] Please continue to see Figure 7 As shown in the figure, the question-answer corpus belongs to a certain category. For example, the question-answer corpus corresponding to the two nodes "Q&A 2" and "Q&A 3" both belong to the category of gastroenterology, while the question-answer corpus corresponding to the node "Q&A 3" belongs to the category of neurology. TextGCN also outputs the classification result corresponding to the question-answer vector representation of the question-answer corpus. Based on the category and classification result of the question-answer corpus, the loss function can be optimized and the model parameters can be updated.
[0126] Fig.11FIG. 1 shows a schematic diagram of the principle of training an original graph neural network for text classification according to an embodiment of the present application. Fig.11 As shown in (a), the input layer of the graph convolutional network is the aforementioned question-answer-entity word graph, which includes nodes such as X1, X2, X3, and X4. There are edges between the nodes. The question-answer-entity word graph is input into the graph convolutional network. The output result of the graph convolutional network is located in the output layer. It can be seen that the output layer includes vector representations corresponding to each node, namely Z1, Z2, Z3, and Z4. The categories corresponding to the vector representations Z1 and Z4 are Y1 and Y4, respectively. The category can be, for example, a department. The model can be trained according to the category. Fig.11 (a) The visualization diagram of the activation information of each node in the hidden layer is as follows Fig.11 (b) as shown.
[0127] The graph convolutional network for text classification can be expressed as follows:
[0128]
[0129] Among them, f is the model function of the graph convolutional network for text classification, X is the feature vector set of the node, is the scaling adjacency matrix, RELU is the convolution operation, and W (0) ∈R C×H is the weight from the input layer to the hidden layer, W (1) ∈R H×F is the weight from the hidden layer to the output layer, Softmax is the classification layer, which is used to output the category, and Z is the vector representation of the output.
[0130] Finally, the following loss function can be constructed based on the cross entropy loss, and the model can be trained by minimizing the following loss function:
[0131]
[0132] Among them, ln is the logarithm of cross entropy, l is the lth question-answer corpus, y L is the set of question-answering corpora, f is the fth category, F is all categories, Y lf is the actual probability of the lth question-answer corpus in the fth category, Z lf is the predicted probability of the lth question-answer corpus in the fth category, and L is the loss function.
[0133] In step 250, the vector representation corresponding to each entity word node in the second question-answer entity word graph is extracted based on the target graph neural network for text classification, and synonyms are mined according to the vector representation corresponding to each entity word node.
[0134] Since colloquial synonyms are usually located in the question corpus, in the specific implementation, it is possible to prioritize mining the synonyms between the question corpus and the answer corpus corresponding to the question corpus, thereby mining the synonyms corresponding to the entity words in the answer corpus from the question corpus as colloquial synonyms of the entity words in the answer corpus.
[0135] The second question-answer entity word graph may be the same as or different from the first question-answer entity word graph.
[0136] Fig.12 An embodiment according to the present application is shown. Figure 2 Flow chart of details of step 250 in the embodiment. Fig.12 As shown, mining synonyms according to the vector representation corresponding to each entity word node may specifically include the following steps:
[0137] In step 251, the semantic distance between the vector representations corresponding to each entity word node is determined.
[0138] The semantic distance between two vector representations can be calculated based on consin similarity.
[0139] In step 252, synonyms are determined in the entity words corresponding to each entity word node according to the semantic distance.
[0140] In one embodiment of the present application, synonyms are determined in the entity words corresponding to each entity word node according to semantic distance, including: taking entity word pairs whose corresponding semantic distance is greater than a predetermined semantic distance threshold as synonym pairs.
[0141] After obtaining the synonym pairs, the synonym pairs can be included in a synonym dictionary, thereby supplementing the synonym dictionary.
[0142] Fig.13 An embodiment according to the present application is shown. Figure 2 Flow chart of the steps after step 250 in the embodiment. Fig.13 As shown, after step 250, the following steps may also be included:
[0143] In step 260, when query information is received, a target synonym matching the word in the query information is determined from among the mined synonyms.
[0144] The query information may be information input by a user into a medical information retrieval system, and the query information is usually text content such as a sentence, a phrase, or a word. The mined synonyms include multiple synonym pairs, and when two words belong to the same synonym pair, the two words can be considered to match each other.
[0145] In step 270, a target corpus containing the target synonym is determined, and the target corpus is returned to the sender of the query information.
[0146] When a target corpus containing a target synonym is found, the target corpus can be returned to the user as a search result, so that the user can obtain content that accurately matches the information input by the user.
[0147] Fig.14 A schematic diagram of the product effect according to an embodiment of the present application is shown. Fig.14 As shown, in the medical question-and-answer text search scenario, when a user searches for "what to do about hair loss", the system will not only return text corpora containing hair loss, but also return content related to "hair loss", a synonym for hair loss, and these contents can be displayed in a higher position.
[0148] The inventors of this application also conducted experiments on the effects of synonym mining based on TextGCN and Deepwalk. In this experiment, 2 million medical question and answer corpora were used to train Deepwalk and TextGCN respectively. The experimental data is shown in Table 1:
[0149]
[0150] Table 1
[0151] After using two models to mine synonyms in the medical question-answering text search scenario, the medical information retrieval system returns query results corresponding to the query information based on these synonyms, and obtains the data in Table 1 by determining the proportion of the first several query results that match the query information. For example, 0.2989 corresponding to top5 represents that the medical information retrieval system uses the synonyms mined based on Deepwalk to obtain a proportion of 0.2989 of the first 5 query results that match the query information, and 0.4334 corresponding to top10 represents that the medical information retrieval system uses the synonyms mined based on TextGCN to obtain a proportion of 0.4334 of the first 10 query results that match the query information. It can be seen that the method of introducing department information as a supervisory signal and mining synonyms based on TextGCN is significantly better than the method of mining synonyms based on Deepwalk.
[0152] In summary, the synonym mining method provided by the embodiment of the present application can at least achieve the following technical effects: the embodiment of the present application assumes that synonyms should appear in the same category of question and answer corpus, that is, it assumes that disease synonyms and symptom synonyms should appear in the same department, and proposes a method of using external information in massive question and answer text corpus, such as department information of question and answer corpus as a supervised signal, learning node vector representation through a graph neural network model, and then mining medical synonyms based on the similarity of the vector representation. Compared with the original unsupervised random walk deepwalk and other mining methods, it can significantly improve the accuracy of synonym dictionary mining, and compared with the manual method, it can significantly improve the efficiency of synonym mining. Taking the medical question and answer text search scenario as an example, it can be used to supplement the insufficient overall scale of the original medical synonym dictionary, and can solve the problem of missing and non-diverse colloquial synonyms.
[0153] The following describes an apparatus embodiment of the present application, which can be used to execute the synonym mining method in the above embodiment of the present application. For details not disclosed in the apparatus embodiment of the present application, please refer to the above embodiment of the synonym mining method of the present application.
[0154] Fig.15 A block diagram of a synonym mining device according to an embodiment of the present application is shown.
[0155] Reference Fig.15 As shown, a synonym mining device 1500 according to an embodiment of the present application includes: an acquisition and determination unit 1510, a generation unit 1520, an adding unit 1530, a training unit 1540, and an extraction and mining unit 1550. Among them, the acquisition and determination unit 1510 is used to acquire multiple question and answer corpora and entity words contained in each question and answer corpus, and determine the category to which each question and answer corpus belongs; the generation unit 1520 is used to generate a question and answer corpus node corresponding to each question and answer corpus and an entity word node corresponding to each entity word; the adding unit 1530 is used to add edges with weights between multiple nodes to obtain a first question and answer entity word graph, and the weight is used to measure the correlation between two nodes connected by the edge with the weight; the training unit 1540 is used to train the original graph neural network for text classification according to the first question and answer entity word graph and the category to which each question and answer corpus belongs, and obtain a target graph neural network for text classification; the extraction and mining unit 1550 is used to extract the vector representation corresponding to each entity word node in the second question and answer entity word graph based on the target graph neural network for text classification, and mine synonyms according to the vector representation corresponding to each entity word node.
[0156] In some embodiments of the present application, based on the aforementioned scheme, the extraction and mining unit 1550 is configured to: determine the semantic distance between the vector representations corresponding to each entity word node; and determine synonyms in the entity words corresponding to each entity word node based on the semantic distance.
[0157] In some embodiments of the present application, based on the aforementioned scheme, the adding unit 1530 is configured to: add an edge between the entity word node corresponding to the target entity word and the question and answer corpus node corresponding to the target question and answer corpus according to the target entity word belonging to the target question and answer corpus; add an edge between the entity word node corresponding to the first entity word and the entity word node corresponding to the second entity word according to the first question and answer corpus to which the first entity word belongs and the second question and answer corpus to which the second entity word belongs belonging to the same category; determine the correlation between the nodes as the weight of the edge between the nodes.
[0158] In some embodiments of the present application, based on the aforementioned scheme, the adding unit 1530 is configured to: determine the term frequency-inverse document frequency between the target entity word and the target question and answer corpus as the weight of the edge between the entity word node corresponding to the target entity word and the question and answer corpus node corresponding to the target question and answer corpus; determine the point-by-point mutual information between the first entity word and the second entity word as the weight of the edge between the entity word node corresponding to the first entity word and the entity word node corresponding to the second entity word.
[0159] In some embodiments of the present application, based on the aforementioned scheme, the acquisition and determination unit 1510 is configured to: acquire a number of question and answer corpora on the question and answer platform; remove the question and answer corpora whose total browsing times are less than a predetermined number of times or whose text length is less than a predetermined length threshold from the said number of question and answer corpora to obtain multiple question and answer corpora; and extract entity words from each of the said question and answer corpora.
[0160] In some embodiments of the present application, based on the aforementioned scheme, the generation unit 1520 is configured to: generate a corresponding question and answer corpus node for each question and answer corpus; perform deduplication processing on all entity words to obtain deduplicated entity words; and generate a corresponding entity word node for each deduplicated entity word.
[0161] In some embodiments of the present application, based on the aforementioned scheme, the training unit 1540 is configured to: input the first question-and-answer entity word graph into the original graph neural network for text classification, and obtain the classification result of the question-and-answer corpus corresponding to the question-and-answer corpus node in the first question-and-answer entity word graph by the original graph neural network for text classification; update the parameters of the original graph neural network for text classification according to the category to which each question-and-answer corpus belongs and the classification result corresponding to each question-and-answer corpus, and obtain the target graph neural network for text classification.
[0162] In some embodiments of the present application, based on the aforementioned scheme, after synonyms are mined out according to the vector representation corresponding to each entity word node, the extraction and mining unit 1550 is also used to: when receiving query information, determine the target synonyms that match the words in the query information among the mined synonyms; determine the target corpus containing the target synonyms, and return the target corpus to the sender of the query information.
[0163] In some embodiments of the present application, based on the aforementioned scheme, the question and answer corpus is a medical question and answer corpus, and the category to which the question and answer corpus belongs is the department or disease to which the medical question and answer corpus belongs.
[0164] Fig.16 A schematic diagram of the structure of a computer system suitable for implementing an electronic device of an embodiment of the present application is shown.
[0165] It should be noted that Fig.16 The computer system 1600 of the electronic device shown is only an example and should not bring any limitation to the functions and scope of use of the embodiments of the present application.
[0166] like Fig.16 As shown, the computer system 1600 includes a central processing unit (CPU) 1601, which can perform various appropriate actions and processes according to the program stored in the read-only memory (ROM) 1602 or the program loaded from the storage part 1608 to the random access memory (RAM) 1603, such as executing the method described in the above embodiment. In RAM 1603, various programs and data required for system operation are also stored. CPU 1601, ROM 1602 and RAM 1603 are connected to each other through bus 1604. Input / output (I / O) interface 1605 is also connected to bus 1604.
[0167] The following components are connected to the I / O interface 1605: an input section 1606 including a keyboard, a mouse, etc.; an output section 1607 including a cathode ray tube (CRT), a liquid crystal display (LCD), etc., and a speaker, etc.; a storage section 1608 including a hard disk, etc.; and a communication section 1609 including a network interface card such as a LAN (Local Area Network) card, a modem, etc. The communication section 1609 performs communication processing via a network such as the Internet. A drive 1610 is also connected to the I / O interface 1605 as needed. A removable medium 1611, such as a magnetic disk, an optical disk, a magneto-optical disk, a semiconductor memory, etc., is installed on the drive 1610 as needed so that a computer program read therefrom is installed into the storage section 1608 as needed.
[0168] In particular, according to an embodiment of the present application, the process described above with reference to the flowchart can be implemented as a computer software program. For example, an embodiment of the present application includes a computer program product, which includes a computer program carried on a computer-readable medium, and the computer program includes a program code for executing the method shown in the flowchart. In such an embodiment, the computer program can be downloaded and installed from a network through a communication section 1609, and / or installed from a removable medium 1611. When the computer program is executed by a central processing unit (CPU) 1601, various functions defined in the system of the present application are executed.
[0169] It should be noted that the computer-readable medium shown in the embodiment of the present application may be a computer-readable signal medium or a computer-readable storage medium or any combination of the above two. The computer-readable storage medium may be, for example, - but not limited to - an electrical, magnetic, optical, electromagnetic, infrared, or semiconductor system, device or device, or any combination of the above. More specific examples of computer-readable storage media may include, but are not limited to: an electrical connection with one or more wires, a portable computer disk, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM), a flash memory, an optical fiber, a portable compact disk read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the above. In the present application, a computer-readable storage medium may be any tangible medium containing or storing a program, which may be used by an instruction execution system, device or device or used in combination with it. In the present application, a computer-readable signal medium may include a data signal propagated in a baseband or as part of a carrier wave, wherein a computer-readable program code is carried. Such propagated data signals may take a variety of forms, including but not limited to electromagnetic signals, optical signals, or any suitable combination of the above. Computer-readable signal media may also be any computer-readable medium other than computer-readable storage media, which may send, propagate, or transmit programs for use by or in conjunction with an instruction execution system, apparatus, or device. The program code contained on the computer-readable medium may be transmitted using any appropriate medium, including but not limited to: wireless, wired, etc., or any suitable combination of the above.
[0170] The flowchart and block diagram in the accompanying drawings illustrate the possible architecture, functions and operations of the system, method and computer program product according to various embodiments of the present application. Wherein, each box in the flowchart or block diagram can represent a module, a program segment, or a part of the code, and the above-mentioned module, program segment, or a part of the code contains one or more executable instructions for realizing the specified logical function. It should also be noted that in some alternative implementations, the functions marked in the box can also occur in a different order from the order marked in the accompanying drawings. For example, two boxes represented in succession can actually be executed substantially in parallel, and they can sometimes be executed in the opposite order, depending on the functions involved. It should also be noted that each box in the block diagram or flowchart, and the combination of boxes in the block diagram or flowchart can be implemented with a dedicated hardware-based system that performs a specified function or operation, or can be implemented with a combination of dedicated hardware and computer instructions.
[0171] The units involved in the embodiments described in this application may be implemented by software or hardware, and the units described may also be set in a processor. The names of these units do not, in some cases, constitute limitations on the units themselves.
[0172] As one aspect, the present application also provides a computer-readable medium, which may be included in the electronic device described in the above embodiment; or may exist independently without being assembled into the electronic device. The above computer-readable medium carries one or more programs, and when the above one or more programs are executed by an electronic device, the electronic device implements the method described in the above embodiment.
[0173] It should be noted that, although several modules or units of the equipment for action execution are mentioned in the above detailed description, this division is not mandatory. In fact, according to the embodiments of the present application, the features and functions of two or more modules or units described above can be embodied in one module or unit. On the contrary, the features and functions of one module or unit described above can be further divided into being embodied by multiple modules or units.
[0174] Through the description of the above implementation methods, it is easy for those skilled in the art to understand that the example implementation methods described here can be implemented by software or by combining software with necessary hardware. Therefore, the technical solution according to the implementation methods of the present application can be embodied in the form of a software product, which can be stored in a non-volatile storage medium (which can be a CD-ROM, a USB flash drive, a mobile hard disk, etc.) or on a network, and includes several instructions to enable a computing device (which can be a personal computer, a server, a touch terminal, or a network device, etc.) to execute the method according to the implementation methods of the present application.
[0175] It can be understood that in the specific implementation of this application, text data related to questions and answers is involved. When the above embodiments of this application are applied to specific products or technologies, user permission or consent is required, and the collection, use and processing of relevant data need to comply with relevant laws, regulations and standards of relevant countries and regions.
[0176] Those skilled in the art will readily appreciate other embodiments of the present application after considering the specification and practicing the embodiments disclosed herein. The present application is intended to cover any variations, uses or adaptations of the present application, which follow the general principles of the present application and include common knowledge or customary technical means in the art that are not disclosed in the present application.
[0177] It should be understood that the present application is not limited to the precise structures that have been described above and shown in the drawings, and that various modifications and changes may be made without departing from the scope thereof. The scope of the present application is limited only by the appended claims.
Claims
1. A synonym mining method, characterized in that: The method comprises: Acquire multiple question and answer corpora and entity words contained in each question and answer corpora, and determine the category to which the question and answer corpora belong according to information in the page where the question and answer corpora are located, wherein the question and answer corpora are medical question and answer corpora, and the category to which the question and answer corpora belong is the department or disease to which the medical question and answer corpora belong; Generate a question-answer corpus node corresponding to each question-answer corpus and an entity word node corresponding to each entity word; The first question-and-answer entity word graph is obtained by adding edges with weights between the plurality of nodes in the following manner: adding edges between the entity word node corresponding to the target entity word and the question-and-answer corpus node corresponding to the target question-and-answer corpus according to the target entity word belonging to the target question-and-answer corpus; adding edges between the entity word node corresponding to the first entity word and the entity word node corresponding to the second entity word according to the first question-and-answer corpus to which the first entity word belongs and the second question-and-answer corpus to which the second entity word belongs belonging to the same category; determining the correlation between the nodes as the weight of the edge between the nodes, the weight being used to measure the correlation between the two nodes connected by the edge with the weight; According to the first question-answer entity word graph and the category to which each question-answer corpus belongs, supervised training is performed on the original graph neural network for text classification to obtain a target graph neural network for text classification; Extracting the vector representation corresponding to each entity word node in the second question-answer entity word graph based on the target graph neural network for text classification, and mining synonyms according to the vector representation corresponding to each entity word node; When receiving query information, determining a target synonym that matches the word in the query information among the mined synonyms; A target corpus containing the target synonym is determined, and the target corpus is returned to the sender of the query information.
2. The synonym mining method according to claim 1, characterized in that: The mining of synonyms according to the vector representation corresponding to each entity word node includes: Determine the semantic distance between the vector representations corresponding to each entity word node; According to the semantic distance, synonyms are determined in the entity words corresponding to each entity word node.
3. The synonym mining method according to claim 1, characterized in that: The step of determining the correlation between the nodes as the weight of the edge between the nodes includes: Determine the term frequency-inverse document frequency between the target entity word and the target question and answer corpus as the weight of the edge between the entity word node corresponding to the target entity word and the question and answer corpus node corresponding to the target question and answer corpus; The point-by-point mutual information between the first entity word and the second entity word is determined as the weight of the edge between the entity word node corresponding to the first entity word and the entity word node corresponding to the second entity word.
4. The synonym mining method according to claim 1, characterized in that: The obtaining of multiple question-and-answer corpora and entity words contained in each question-and-answer corpus includes: Obtain some question and answer corpora on the question and answer platform; Remove the question and answer corpora whose total browsing times are less than a predetermined number of times or whose text length is less than a predetermined length threshold from the plurality of question and answer corpora to obtain multiple question and answer corpora; Entity words are extracted from each of the question-answer corpora.
5. The synonym mining method according to claim 1, characterized in that: The generating of a question-answer corpus node corresponding to each question-answer corpus and an entity word node corresponding to each entity word includes: Generate a corresponding question-answer corpus node for each question-answer corpus; Perform deduplication processing on all entity words to obtain deduplicated entity words; Generate a corresponding entity word node for each entity word after deduplication processing.
6. The synonym mining method according to claim 1, characterized in that: The method of training the original graph neural network for text classification according to the first question-answer entity word graph and the category to which each question-answer corpus belongs to, to obtain a target graph neural network for text classification, includes: Inputting the first question-answer entity word graph into an original graph neural network for text classification, and obtaining a classification result of the original graph neural network for text classification on the question-answer corpus corresponding to the question-answer corpus node in the first question-answer entity word graph; According to the category to which each question and answer corpus belongs and the classification results corresponding to each question and answer corpus, the parameters of the original graph neural network for text classification are updated to obtain a target graph neural network for text classification.
7. A synonymous excavation device, characterized in that: The device comprises: An acquisition and determination unit, used to acquire multiple question and answer corpora and entity words contained in each question and answer corpus, and determine the category to which the question and answer corpus belongs according to information in the page where the question and answer corpus is located, wherein the question and answer corpus is a medical question and answer corpus, and the category to which the question and answer corpus belongs is the department or disease to which the medical question and answer corpus belongs; A generation unit, used to generate a question-answer corpus node corresponding to each question-answer corpus and an entity word node corresponding to each entity word; An adding unit, used for adding edges with weights between the plurality of nodes to obtain a first question-answer entity word graph, wherein the weights are used to measure the correlation between two nodes connected by the edges with the weights; The adding unit is configured to: add an edge between an entity word node corresponding to the target entity word and a question and answer corpus node corresponding to the target question and answer corpus according to the target entity word belonging to the target question and answer corpus; add an edge between an entity word node corresponding to the first entity word and an entity word node corresponding to the second entity word according to the first question and answer corpus to which the first entity word belongs and the second question and answer corpus to which the second entity word belongs belong to the same category; and determine the correlation between the nodes as the weight of the edge between the nodes; A training unit, configured to perform supervised training on an original graph neural network for text classification according to the first question-answer entity word graph and the category to which each question-answer corpus belongs, to obtain a target graph neural network for text classification; The extraction and mining unit is used to extract the vector representation corresponding to each entity word node in the second question-answer entity word graph based on the target graph neural network for text classification, and mine synonyms according to the vector representation corresponding to each entity word node; when receiving query information, determine the target synonyms matching the words in the query information from the mined synonyms; determine the target corpus containing the target synonyms, and return the target corpus to the sender of the query information.
8. A computer readable medium having a computer program stored thereon, characterized in that: When the computer program is executed by a processor, the synonym mining method according to any one of claims 1 to 6 is implemented.
9. An electronic device, characterized in that: include: one or more processors; A storage device for storing one or more programs, which, when executed by the one or more processors, enables the one or more processors to implement the synonym mining method as described in any one of claims 1 to 6.
10. A computer program product, characterized in that The computer program product includes computer instructions, which are stored in a computer-readable storage medium. A processor of a computer device reads the computer instructions from the computer-readable storage medium, and the processor executes the computer instructions, so that the computer device executes the synonym mining method according to any one of claims 1 to 6.
