This expert system uses a set of rules and forward chaining to diagnose diseases based on input symptoms. It defines a class that inherits from KnowledgeEngine and takes arguments to map symptoms, handle non-matches, and retrieve treatment and detail information. Rules check symptoms and store user input, executing in salience order until a disease matches or no match is found. Once diagnosed, the disease name is added as a fact and treatment and detail functions are called to provide output.
"I see eyes in my soup": How Delivery Hero implemented the safety system for ...
Medical Diagnosis Expert System Report.docx
1. Medical Diagnosis Expert System Report
This Project is a simple expert system for diagnosing diseases based on a set of symptoms using the
experta library. It defines a Greetings class, which inherits from the KnowledgeEngine class, and takes
four arguments during initialization - symptom_map, if_not_matched, get_treatments, and get_details.
The class defines a set of rules for each symptom using the @Rule decorator, which checks whether the
symptom is present or not and stores the user input in a Fact object. The rules are executed in order of
their salience value, with lower values being executed first. If no disease matches the symptoms, the
if_not_matched function is executed, which is passed as an argument during initialization.
The system uses a forward chaining inference engine, which means that the rules are executed in the
order in which they are defined until a conclusion is reached. Once a disease is diagnosed based on the
symptoms, the corresponding disease_X rule is executed, which adds the disease name as a Fact object.
The system then calls the get_treatments and get_details functions, which are passed as arguments
during initialization, to retrieve the treatment and details of the diagnosed disease.