Pyke (Python Knowledge Engine) is a metaprogramming engine for Python which introduces a form of logic programming by providing a knowledge-based inference engine (expert system) written in 100% Python.
Questions tagged [pyke]
15 questions
6
votes
1 answer
Should a use a Knowledge Engine for Expert System in Python?
I need to program an expert system in Python (this is the first time I do both). I have to implement a big flow diagram which depends on progressive user input, i. e. the user provides inputs at many points of the flow diagram. In python, I have…

Rafael Angarita
- 777
- 10
- 27
5
votes
1 answer
How to assert a negative fact in Pyke?
Let's say I have fact file:
code_in_git(a)
code_in_git(b)
code_in_git(c)
build_on_disk(a)
build_on_disk(c)
I want to assert the rule "if code_in_git($branch) and not build_on_disk($branch), create fact needs_build($branch)". How can I do that?

Kuroki Kaze
- 8,161
- 4
- 36
- 48
2
votes
0 answers
invalid syntax in rules file in pyke
I'm totally new to Pyke and I'm trying to run a simple code but it gives me a syntax error.
I installed pyke3 from source code from sourceforge.com and I use python 3.10, python 3.97 and both give the same error.
Here is the code of all the…

Mohamed Yahya
- 473
- 1
- 4
- 13
2
votes
0 answers
Assertion Error: PYKE
I am very very new to PYKE, I have installed PYKE from github.
I am trying to run a piece of code, I face an error.
The files and the underlying code are as below:
1> fc_example.krb
direct_father_son
foreach
family.son_of($son, $father)
…

Sam
- 2,545
- 8
- 38
- 59
2
votes
0 answers
How to use a rule inside another rule on pyke?
I am using pyke3-1.1.1, how do you write a rule whose 'assert' contains another rule defined before? I want to do this in the forward chaining type.
Example:
Rule1
foreach
questions.test_question(True)
Assert
Python print("rule 1…

user3382175
- 21
- 3
1
vote
1 answer
How to compile different python files into one exe in python 3.6?
picture of files
I am using python3.6 and i successfully compile single python file into single exe using cx_freeze but now i wish to compile different files(shown at the picture above) into one exe file. May i know is there any way to do it?

John
- 21
- 3
1
vote
1 answer
fuzzy logic for query-based document summarisation in Python
I am trying to use fuzzy logic to weight and extract the best sentences for the query. I have extracted the following features which they can be used in fuzzy logic:
Each sentence has cosine value.
How many proper-noun is in the sentence.
the…

elyon
- 37
- 6
1
vote
1 answer
PYKE rules to add the count of similar statements
I am very new to PYKE, I have a small problem with writing rules in PYKE.
I have following statement in my kfb file.
ent_rel(1, sam, helsen,2)
ent_rel(1, sam, dunkin,1)
ent_rel(1, pirate, sam,2)
ent_rel(2, van, helsen,2)
ent_rel(2, sam,…

Sam
- 2,545
- 8
- 38
- 59
0
votes
0 answers
cannot use question from pyke question file
I am new to pyke and I am trying to build a minimal system that poses a question. I tried many variants, but none of them shows me the question "Do you have a sharpening machine?". I would expect, that I have to answer this question at least once.…

Richard Zillmann
- 31
- 2
0
votes
0 answers
pyke saying duplicate rule name but there is not
I made updates to my krb files but pyke is not regenerating the ,py files. I found that it's throwing an exception:
CardiovascularRisk___pathologies rule_base: duplicate rule name: lesion_of
However that rule is not defined more than once in that…

Larry Martell
- 3,526
- 6
- 40
- 76
0
votes
1 answer
Failed to install scitools-iris using pip: ImportError No module named target_pkg (in pyke)
I am trying to get the python package, scitools-iris, installed on my Debian 9 system and I ran into this problem where scitools-iris fails to install due to an ImportError, ImportError: No module named target_pkg.
I am using python 2.7 and all…

RogUE
- 321
- 2
- 16
0
votes
0 answers
"cannot import name knowledge_engine" in PyKE
I am using PyKE package for building a Rule Engine in python using this tutorial
http://pyke.keplerscience.org/install.html
After installing successfully, I wrote a sample python script, but am getting this error.
>> from pyke import…

Bhimasen
- 677
- 3
- 8
- 19
0
votes
1 answer
install python package on heroku without pypi support
I am trying install a Django app on Heroku. My app needs pyke3. The recommended way for installing pyke3 is to download pyke3-1.1.1.zip https://sourceforge.net/projects/pyke/files/pyke/1.1.1/ and then install (into a virtualenv if desired) using the…

Pankaj Jain
- 11
0
votes
1 answer
Expert system (used for database access) vs. ORM
I have recently discovered PyKE, and noticed that one of the given examples of a potential use (actually, the use for which it was originally built) was to compile SELECT statements to query a database, and map the result to a dictionary. The author…

Vivian
- 1,539
- 14
- 38
-1
votes
1 answer
How to create .krb and .kfb fipes in PYKE
I am new to pyke, hence i don't know how to create these files. Can such files be made in notepad++ and also can PYKE be used to create and dietician expert system

Anushka Shrestha
- 1
- 1