Skip to content
Knowledge representation and expert systems examples
Python JavaScript Shell
Branch: master
Clone or download
Fcmam5 Merge pull request #1 from nilp0inter/master
Better usage of PyKnow. Requires version 1.2.0.
Latest commit 5cba2e4 Mar 28, 2018
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
expert-system-children_diabetes Better usage of PyKnow. Requires version 1.2.0. Mar 27, 2018
symantic-network-nodejs-home_accidents initial commit Jan 7, 2018
.gitignore clean and add Node web API Jan 28, 2018
README.md clean and add Node web API Jan 28, 2018

README.md

Knowledge representation examples

This repository contains some programming exercises for Ontologies and Knowledge representation class in University. It contains until the moment two examples:

Expert System for children Diabetes Diagnosis

Built with Python, using PyKnow library. And there's a tiny Node/Express server for offering a Web api

Usage

  • First install pyknow Python package, and Express and python-shell for Node.js, then lunch the server (main.js) in order to use the Web API. All this could be done with this command: pip install pyknow && npm install && node main.js
  • Then open your browser, and past this URL for example.
localhost:3000/res/api?age=3
                        &glycemie=2
                        &shakiness=True
                        &hunger=True
                        &sweating=True
                        &headach=True
                        &diabetic_parents=False
                        &pale=False
                        &urination=False
                        &thirst=False
                        &blurred_vision=False
                        &dry_mouth=False
                        &smelling_breath=False
                        &shortness_of_breath=False

Now you can play with each parameter

  • age = [int from 0 to 5]
  • glycemie= [ int mmol/l ]
  • Signs, like shakiness, hunger, sweating..= [Boolean: True/False]

Or You can use the python file directly just introduce your facts manually

Change

# ligne 102
engine.declare(Personne(age= int(sys.argv[1]),
                        glycemie=int(sys.argv[2]),
                        shakiness= bool(sys.argv[3]),
                        hunger= bool(sys.argv[4]),
                        sweating= bool(sys.argv[5]),
                        headach= bool(sys.argv[6]),
                        diabetic_parents = bool(sys.argv[7]),
                        pale= bool(sys.argv[8]),
                        urination = bool(sys.argv[9]),
                        thirst = bool(sys.argv[10]),
                        blurred_vision = bool(sys.argv[11]),
                        dry_mouth = bool(sys.argv[12]),
                        smelling_breath = bool(sys.argv[13]),
                        shortness_of_breath = bool(sys.argv[14]),
                        ))

To (for example)

# ligne 102
engine.declare(Personne(age= 2,
                        glycemie=True,
                        shakiness=True,
                        hunger= True,
                        sweating= True,
                        headach= True,
                        diabetic_parents = False,
                        pale= False,
                        urination = False,
                        thirst = False,
                        blurred_vision = False,
                        dry_mouth = False,
                        smelling_breath = False,
                        shortness_of_breath = False,
                        ))
You can’t perform that action at this time.