Method and system for inquiring diseases of livestock

文档序号:9937 发布日期:2021-09-17 浏览:70次 中文

1. The method for inquiring the diseases of the livestock is characterized by comprising the following steps of:

s1: inputting conversation content by a user through a dialog box;

s2: the background receives the user conversation content, analyzes the user conversation content based on a natural language understanding technology, and provides information supplement for the user through a dialog box if the information in the user conversation content is incomplete until the user intention and symptom description information are complete;

the method for providing symptom supplement for the user through the dialog box specifically comprises the following steps: expanding the symptom description of the user by calling a disease knowledge base to generate a symptom list, and confirming whether the symptoms in the symptom list exist or not to the user until the disease possibly suffered by the livestock can be diagnosed according to the symptoms in the symptom list;

the construction method of the disease knowledge base comprises the following steps:

disease data are obtained from a livestock professional website by using a crawler technology, symptoms and symptom examples in the disease data are extracted, and a disease knowledge base is constructed, wherein the disease knowledge base comprises: a disease-symptom relationship table, a disease-symptom type relationship table, and a symptom-symptom type relationship table;

s3: returning to the user via the dialog a disease that the poultry may have suffered from.

2. The method of claim 1, wherein the symptom information described by the user is symptom-augmented by a disease knowledge base in step S2, comprising the steps of:

synonym generalization is carried out on the symptoms described by the user, and diseases possibly corresponding to the symptoms after synonym generalization are matched through a disease-symptom relation table in a disease knowledge base;

matching the symptom type corresponding to the possible corresponding disease through a disease-symptom type relation table in a disease knowledge base; and matching all symptoms under the symptom type through a symptom-symptom type relation table in a disease knowledge base to generate a symptom list.

3. The method for disease interrogation of livestock according to claim 2, wherein said step S2 is performed by confirming to the user the presence or absence of each symptom in the symptom list through a dialog box, and the dialog strategy adopted comprises the steps of:

performing disease matching on all symptoms in the symptom list based on a disease knowledge base to generate a candidate disease-symptom two-dimensional list, and specifically, when any one or more symptoms in the symptom list belong to symptoms generated by a certain disease, considering that the disease is matched, and sequentially listing the matched disease and all corresponding symptoms to generate the candidate disease-symptom two-dimensional list;

counting the quantity of each symptom of the symptom dimension in the candidate disease-symptom two-dimensional table, and using the counted symptom with a median as an inquiry question to confirm whether the symptom exists or not to a user;

and receiving the reply of the user, updating the candidate disease-symptom two-dimensional list after confirming whether the symptoms exist, repeating the previous step, and determining the inquiry question to be put forward to the user until the symptoms of all candidate diseases in the candidate disease-symptom two-dimensional list are confirmed.

4. The method for disease interrogation of livestock according to claim 3, wherein said analyzing dialog contents of user based on natural language understanding in step S2 is specifically performed by:

the background analyzes the user intention, the content entity and the entity type in the user dialogue content based on a natural language understanding technology;

unifying the entities under the same entity type, specifically, calculating a weighted average value according to the text editing distance similarity and the word embedding similarity between every two entities under the same entity type, and considering that the two entities are the same when the weighted average value exceeds a threshold value.

5. The method according to claim 4, wherein the disease inquiry information is used as disease data of a disease knowledge base, and the disease knowledge base is expanded after learning.

6. The method of claim 5, wherein after receiving the user dialog content in the background of step S2, the method further comprises: recording and storing the current background calling algorithm library condition, the executed action condition and the current number of conversation rounds.

7. The method of disease interrogation in livestock according to claim 6, wherein said disease knowledge base construction method further comprises the steps of:

and extracting symptoms and symptom examples in the disease data, classifying and inducing the symptom examples, normalizing the symptoms, and generating a csv table as a disease knowledge base.

8. The method as claimed in claim 7, wherein the user inputs the contents of the dialog through an internet dialog box, and the input form of the dialog is text input or voice input.

9. The method of any one of claims 1 to 8, wherein the livestock is a pig and the site specific to the livestock is a site specific to the pig.

10. A livestock disease interrogation robot system, comprising:

the scheduling management unit is used for receiving the conversation content of the user, inputting the conversation content into the semantic understanding unit for semantic analysis, and receiving the symptom description returned by the semantic understanding unit; calling a disease knowledge base unit, carrying out symptom expansion on symptom information described by a user to generate a symptom list, returning a disease diagnosis result to the user if the disease possibly suffered by the livestock can be diagnosed according to the symptom description and the symptom list, and outputting the symptom description and the symptom list to a conversation management unit to generate conversation contents for confirming the symptoms in the symptom list if the disease diagnosis result cannot be diagnosed; after receiving the conversation content which is output by the conversation management unit and is confirmed about symptoms, returning the conversation content to the user and waiting for the reply of the user;

the semantic understanding unit analyzes the user intention, the content entity and the entity type in the user dialogue content based on a natural language understanding technology and extracts symptom information described by the user from the content;

the disease knowledge base unit is used for storing an information set constructed by acquiring disease data from a livestock professional website by using a crawler technology and extracting symptoms and symptom examples in the disease data, and comprises the following steps: a disease-symptom relationship table, a disease-symptom type relationship table, and a symptom-symptom type relationship table;

and the dialogue management unit is used for generating and outputting dialogue contents for confirming whether the symptoms exist in the symptom list to the user according to a preset dialogue strategy after receiving the symptom description and the symptom list.

Background

In recent years, with the development of the internet of things, the intelligent industry is continuously rising, various intelligent applications begin to appear in the production and life of people, many industries have new intelligent technology breakthroughs, the breeding industry is no exception, the artificial intelligence and the internet of things are always followed, and the intelligent breeding industry is a new era which is the intelligent breeding industry.

A large amount of expert knowledge exists in each large breeding website platform in daily life, but the fact that breeding problems encountered by a plurality of farmers are not solved in time is also found, a problem sent by a general farmer can be answered within hours or days, and through researching the problem of daily inquiry of pig farmers, the inventor finds that generally the farmer throws symptoms of sick pigs, the symptoms are common, and meanwhile, pictures under the symptoms are also given to inquire about authority of the farmer or veterinarian, or inquire the experts about solutions or develop medicines to solve the current situation, but the following problems exist in the methods that 1, the professional knowledge level of a responder is not uniform, and the authenticity is not proved; 2. generally, a more comprehensive professional solution cannot be obtained, and generally, the solution is relatively simple; 3. the real-time nature of the response is not high, and this drawback is fatal, especially in some acute symptoms.

Disclosure of Invention

In order to solve the technical problems, the invention provides a livestock disease interrogation method and a livestock disease interrogation system which are supported by a professional knowledge base, can implement and reply the interrogation problems of a user, can reduce the number of conversation rounds and improve the interrogation efficiency, and the technical scheme of the invention is as follows:

a method for diagnosing diseases of livestock comprises the following steps:

s1: inputting conversation content by a user through a dialog box;

s2: the background receives the user conversation content, analyzes the user conversation content based on a natural language understanding technology, and provides information supplement for the user through a dialog box if the information in the user conversation content is incomplete until the user intention and symptom description information are complete;

the method for providing symptom supplement for the user through the dialog box specifically comprises the following steps: expanding the symptom description of the user by calling a disease knowledge base to generate a symptom list, and confirming whether the symptoms in the symptom list exist or not to the user until the disease possibly suffered by the livestock can be diagnosed according to the symptoms in the symptom list;

the construction method of the disease knowledge base comprises the following steps:

disease data are obtained from a livestock professional website by using a crawler technology, symptoms and symptom examples in the disease data are extracted, and a disease knowledge base is constructed, wherein the disease knowledge base comprises: a disease-symptom relationship table, a disease-symptom type relationship table, and a symptom-symptom type relationship table;

s3: returning to the user via the dialog a disease that the poultry may have suffered from.

Wherein, the method of symptom expansion of the symptom information described by the user through the disease knowledge base in the step S2 includes the following steps:

synonym generalization is carried out on the symptoms described by the user, and diseases possibly corresponding to the symptoms after synonym generalization are matched through a disease-symptom relation table in a disease knowledge base;

matching the symptom type corresponding to the possible corresponding disease through a disease-symptom type relation table in a disease knowledge base; and matching all symptoms under the symptom type through a symptom-symptom type relation table in a disease knowledge base to generate a symptom list.

In step S2, the dialog strategy adopted in the step S2 is to confirm to the user whether each symptom in the symptom list exists separately, and includes the following steps:

performing disease matching on all symptoms in the symptom list based on a disease knowledge base to generate a candidate disease-symptom two-dimensional list, and specifically, when any one or more symptoms in the symptom list belong to symptoms generated by a certain disease, considering that the disease is matched, and sequentially listing the matched disease and all corresponding symptoms to generate the candidate disease-symptom two-dimensional list;

counting the quantity of each symptom of the symptom dimension in the candidate disease-symptom two-dimensional table, and using the counted symptom with a median as an inquiry question to confirm whether the symptom exists or not to a user;

and receiving the reply of the user, updating the candidate disease-symptom two-dimensional list after confirming whether the symptoms exist, repeating the previous step, and determining the inquiry question to be put forward to the user until the symptoms of all candidate diseases in the candidate disease-symptom two-dimensional list are confirmed.

The method for analyzing the user dialog content based on the natural language understanding technology in step S2 specifically includes:

the background analyzes the user intention, the content entity and the entity type in the user dialogue content based on a natural language understanding technology;

unifying the entities under the same entity type, specifically, calculating a weighted average value according to the text editing distance similarity and the word embedding similarity between every two entities under the same entity type, and considering that the two entities are the same when the weighted average value exceeds a threshold value.

The disease inquiry information is used as disease data of a disease knowledge base, and the disease knowledge base is expanded after the disease inquiry information is used for learning.

After receiving the user dialog content in the background of step S2, the method further includes: recording and storing the current background calling algorithm library condition, the executed action condition and the current number of conversation rounds.

The construction method of the disease knowledge base further comprises the following steps:

and extracting symptoms and symptom examples in the disease data, classifying and inducing the symptom examples, normalizing the symptoms, and generating a csv table as a disease knowledge base.

The user inputs dialogue contents through an internet dialogue box, and the input form of the dialogue is character input or voice input.

The livestock is pigs, and the livestock professional website is a pig professional knowledge website.

A livestock disease interrogation robot system comprising:

the scheduling management unit is used for receiving the conversation content of the user, inputting the conversation content into the semantic understanding unit for semantic analysis, and receiving the symptom description returned by the semantic understanding unit; calling a disease knowledge base unit, carrying out symptom expansion on symptom information described by a user to generate a symptom list, returning a disease diagnosis result to the user if the disease possibly suffered by the livestock can be diagnosed according to the symptom description and the symptom list, and outputting the symptom description and the symptom list to a conversation management unit to generate conversation contents for confirming the symptoms in the symptom list if the disease diagnosis result cannot be diagnosed; after receiving the conversation content which is output by the conversation management unit and is confirmed about symptoms, returning the conversation content to the user and waiting for the reply of the user;

the semantic understanding unit analyzes the user intention, the content entity and the entity type in the user dialogue content based on a natural language understanding technology and extracts symptom information described by the user from the content;

the disease knowledge base unit is used for storing an information set constructed by acquiring disease data from a livestock professional website by using a crawler technology and extracting symptoms and symptom examples in the disease data, and comprises the following steps: a disease-symptom relationship table, a disease-symptom type relationship table, and a symptom-symptom type relationship table;

and the dialogue management unit is used for generating and outputting dialogue contents for confirming whether the symptoms exist in the symptom list to the user according to a preset dialogue strategy after receiving the symptom description and the symptom list.

Compared with the prior art, the invention has the following beneficial effects:

the disease knowledge base (knowledge map of diseases and symptoms) is constructed as a knowledge support based on the related knowledge of various diseases acquired by the breeding websites of major professionals, and the intention classification is carried out on the problems of farmers in the forum for the intention understanding of the question-answering system; professional recovery can be performed on most of livestock diseases, on the other hand, symptoms are expanded, possible diseases and possible symptoms are comprehensively considered, the expanded symptom list is used for asking questions, and the diseases are purposefully investigated;

the user is asked with the median symptom of the symptom number in the symptom dimension, the condition of the symptom is confirmed, and half of diseases can be eliminated no matter whether the answer of the user is yes or no, so that the effect of reducing the number of conversation turns is achieved;

compared with the prior art, the method has the advantages that the real-time performance is strong, the precision is high, the content is complete, and the inquiry system is more and more clever by iterating the model according to the real feedback.

Drawings

FIG. 1 is a flow chart of a method for diagnosing diseases in livestock according to the present invention;

fig. 2 is a schematic diagram of labeled disease data acquired in the embodiment of the present invention;

FIG. 3 is a representation of a pig disease-symptom relationship in a disease knowledge base in accordance with an embodiment of the present invention;

FIG. 4 is a representation of the relationship between disease and symptom type in pigs in a disease knowledge base according to an embodiment of the present invention;

FIG. 5 is a representation of the symptom-symptom type relationship in a disease knowledge base according to an embodiment of the present invention;

FIG. 6 is a schematic diagram of an example of pig disease interrogation chat;

FIG. 7 is a block diagram of a pig disease interrogation session;

FIG. 8 is a block diagram of the disease interrogation system for livestock.

In the figure, 1 is a scheduling management unit, 2 is a semantic understanding unit, 3 is a disease knowledge base unit, and 4 is a dialogue management unit.

Detailed Description

The following further describes embodiments of the present invention with reference to the drawings. It should be noted that the description of the embodiments is provided to help understanding of the present invention, but the present invention is not limited thereto. In addition, the technical features involved in the embodiments of the present invention described below may be combined with each other as long as they do not conflict with each other.

Referring to fig. 1, the present invention provides a method for diagnosing diseases of livestock, comprising the steps of:

s1: inputting conversation content by a user through a dialog box;

s2: the background receives the user conversation content, analyzes the user conversation content based on a natural language understanding technology, and provides information supplement for the user through a dialog box if the information in the user conversation content is incomplete until the user intention and symptom description information are complete;

the method for providing symptom supplement for the user through the dialog box specifically comprises the following steps: expanding the symptom description of the user by calling a disease knowledge base to generate a symptom list, and confirming whether the symptoms in the symptom list exist or not to the user until the disease possibly suffered by the livestock can be diagnosed according to the symptoms in the symptom list;

the invention analyzes the dialogue content based on the natural language understanding technology, and the adopted method comprises the steps of processing the dialogue content input by the user by using an algorithm of word2vec and Minimum Edit Distance, and improving the understanding ability of spoken language understanding ability and symptom understanding ability.

The construction method of the disease knowledge base comprises the following steps:

disease data are obtained from a livestock professional website by using a crawler technology, symptoms and symptom examples in the disease data are extracted, and a disease knowledge base is constructed, wherein the disease knowledge base comprises: a disease-symptom relationship table, a disease-symptom type relationship table, and a symptom-symptom type relationship table;

s3: returning to the user via the dialog a disease that the poultry may have suffered from.

The livestock interrogation method is suitable for all cultured poultry and livestock, in one embodiment of the invention, the livestock type is pigs, and the data source is a knowledge website of pig specialties;

in this embodiment, the method for constructing the disease knowledge base further includes the following steps:

extracting symptoms and symptom examples in the disease data, classifying and summarizing the symptom examples, and normalizing the symptoms, for example, eye redness and swelling become eye redness after normalization, a list formed after the disease data is processed is shown in fig. 2 (only partial data), and manual labeling is performed, wherein the label comprises: and marking the diseases of the pigs, the classification of the diseases, texts under the diseases, the classification of symptoms and the names of the symptoms, training the models as training data, and finally generating csv tables as a disease knowledge base by using the models.

Referring to fig. 3 to 5, the disease knowledge base is shown in fig. 3, which is a pig disease-symptom relationship table, wherein the first column is a pig disease, the second column to the last column are symptoms corresponding to the disease, fig. 4 is a pig disease-symptom type relationship table, the first column is a pig disease, the second column to the last column are symptoms corresponding to the disease, and the type of the symptoms is abbreviated as english, and fig. 5 is a pig symptom-symptom type relationship table, wherein the first value is a pig symptom, and the second value is the type of the symptoms, abbreviated as english; the common pig disease problem of 135 is recorded, and the symptoms of 1300+ basically cover the needs of most farmers.

Preferably, the information generated in the disease inquiry process is used as the disease data of the disease knowledge base, and the disease knowledge base is expanded after the information is used for learning.

Referring to fig. 6, the pig disease inquiry chat example confirms disease consultation of boars and piglets which users intend through conversation, and then confirms the symptoms of inappetence, diarrhea and mental depression to the users respectively, and diagnoses that the pigs possibly suffer from influenza according to the symptoms.

Preferably, the method for symptom expansion of the symptom information described by the user through a disease knowledge base in step S2 includes the following steps:

synonym generalization is carried out on the symptoms described by the user, and diseases possibly corresponding to the symptoms after synonym generalization are matched through a disease-symptom relation table in a disease knowledge base; when a disease may cause the symptom, the disease is considered as a disease to which the symptom may correspond;

matching the symptom type corresponding to the possible corresponding disease through a disease-symptom type relation table in a disease knowledge base; a disease may correspond to a plurality of symptom types, for example, piglet hypoglycemia, and the corresponding symptom types include body temperature symptoms, diet symptoms, eye symptoms, skin symptoms and the like, so that the matched symptom types are various;

and matching all symptoms under the symptom type through a symptom-symptom type relation table in a disease knowledge base to generate a symptom list. There may be a plurality of symptoms under one symptom type, for example, referring to fig. 5, there are a plurality of symptoms of "abdominal contraction", "abdominal enlargement", "abdominal erosion", "abdominal pucking", and the like under the symptom type 'abdomen _ sym'. Therefore, the expanded symptom list comprehensively lists possible symptoms for subsequent diagnosis.

Preferably, the method for confirming to the user whether each symptom in the symptom list exists through the dialog box in step S2 specifically includes:

performing disease matching on all symptoms in the symptom list based on a disease knowledge base to generate a candidate disease-symptom two-dimensional list, and specifically, when any one or more symptoms in the symptom list belong to symptoms generated by a certain disease, considering that the disease is matched, and sequentially listing the matched disease and all corresponding symptoms to generate the candidate disease-symptom two-dimensional list;

disease matching was performed for all symptoms in the symptom list, using one of the approaches: assuming that there are 10 symptoms in the expanded symptom list, performing permutation and combination on the 10 symptoms, and performing disease matching on all combinations after permutation and combination, that is, when the group of symptoms is any one or more of symptoms which may be caused by a certain disease, considering the disease as a disease which may be corresponding to the group of symptoms, then completely supplementing the disease name and the symptom name, and after treatment such as removing repeated items, the supplemented symptoms and the corresponding disease list are a candidate disease-symptom two-dimensional table which comprises two dimensions of a candidate disease and a symptom.

Carrying out symptom confirmation through conversation based on the candidate disease-symptom two-dimensional table, counting the quantity of each symptom of symptom dimensions in the candidate disease-symptom two-dimensional table, and using the counted symptom with a median as an inquiry question to confirm whether the symptom exists or not to a user;

and receiving the reply of the user, updating the candidate disease-symptom two-dimensional list after confirming whether the symptoms exist, repeating the previous step, and determining the inquiry question to be put forward to the user until the symptoms of all candidate diseases in the candidate disease-symptom two-dimensional list are confirmed.

The user is asked with the median symptom of the symptom number in the symptom dimension, the condition of the symptom is confirmed, half of diseases can be eliminated no matter whether the answer of the user is yes or no, and therefore the effect of reducing the conversation wheel speed is achieved, and through multiple experiments, the original 1/4 can be reduced by the method.

Referring to fig. 7, after the consultation task is completed, the background may recommend the information of the relevant disease to the user, so that the user can know the condition of the disease and some countermeasures.

Preferably, in step S2 of the embodiment of the present invention, the method for analyzing the user dialog content based on the natural language understanding technology specifically includes that the background analyzes the user intention, the content entity, and the entity type in the user dialog content based on the natural language understanding technology;

unifying the entities under the same entity type, specifically, calculating a weighted average value according to the text editing distance similarity and the word embedding similarity between every two entities under the same entity type, and considering that the two entities are the same when the weighted average value exceeds a threshold value.

Preferably, after the step S2 background receives the user dialog content, the method further includes: recording and storing the current background calling algorithm library condition, the executed action condition and the current number of conversation rounds.

Preferably, the user inputs the dialog content through an internet dialog box, and the input form of the dialog is text input or voice input.

In another aspect, referring to fig. 8, the present invention also provides a livestock disease interrogation system comprising:

the scheduling management unit 1 is used for receiving conversation contents of a user, inputting the conversation contents into the semantic understanding unit 2 for semantic analysis, and receiving symptom descriptions returned by the semantic understanding unit; calling a disease knowledge base unit 3, carrying out symptom expansion on symptom information described by a user to generate a symptom list, returning a disease diagnosis result to the user if the disease possibly suffered by the livestock can be diagnosed according to the symptom description and the symptom list, and outputting the symptom description and the symptom list to a conversation management unit to generate 4 conversation contents for confirming the symptoms in the symptom list if the disease diagnosis result cannot be diagnosed by the livestock; after receiving the conversation content which is output by the conversation management unit 4 and is about symptom confirmation, returning the conversation content to the user and waiting for the reply of the user;

the semantic understanding unit 2 analyzes the user intention, the content entity and the entity type in the user dialogue content based on a natural language understanding technology and extracts symptom information described by the user from the content;

the disease knowledge base unit 3 is used for storing an information set constructed by acquiring disease data from a livestock professional website by using a crawler technology and extracting symptoms and symptom examples in the disease data, and comprises the following steps: a disease-symptom relationship table, a disease-symptom type relationship table, and a symptom-symptom type relationship table;

and the dialogue management unit 4 receives the symptom description and the symptom list, generates dialogue contents for confirming whether the symptoms exist in the symptom list to the user according to a preset dialogue strategy, and outputs the dialogue contents.

The embodiments of the present invention have been described in detail with reference to the accompanying drawings, but the present invention is not limited to the described embodiments. It will be apparent to those skilled in the art that various changes, modifications, substitutions and alterations can be made in these embodiments without departing from the principles and spirit of the invention, and the scope of protection is still within the scope of the invention.

完整详细技术资料下载
上一篇:石墨接头机器人自动装卡簧、装栓机
下一篇:用于辅助疾病推理的系统及存储介质

网友询问留言

已有0条留言

还没有人留言评论。精彩留言会获得点赞!

精彩留言,会给你点赞!