问题标签 [expert-system]

For questions regarding programming in ECMAScript (JavaScript/JS) and its various dialects/implementations (excluding ActionScript). Note JavaScript is NOT the same as Java! Please include all relevant tags on your question; e.g., [node.js], [jquery], [json], [reactjs], [angular], [ember.js], [vue.js], [typescript], [svelte], etc.

0 投票
2 回答
2774 浏览

python - 使用 Clips 专家系统中的 Python 函数

使用 PyClips,我试图在 Clips 中构建规则,从 Python 解释器动态检索数据。为此,我按照手册中的说明注册了一个外部函数。

下面的代码是该问题的一个玩具示例。我这样做是因为我有一个包含大量数据的应用程序,以 SQL 数据库的形式,我想使用 Clips 进行推理。但是,如果我可以简单地将 Clips 直接“插入”到 Python 的命名空间中,我不想浪费时间将所有这些数据转换为 Clips 断言。

但是,当我尝试创建规则时,出现错误。我究竟做错了什么?

0 投票
1 回答
357 浏览

machine-learning - 取消引用剪辑中匹配事实中的插槽

您如何取消引用规则 LHS 中匹配的事实中的插槽?如果变量与事实匹配,我找不到如何创建与该事实中的插槽匹配的进一步条件。

例如,在下面的代码中,如果存在“(do(action ?action))”形式的事实,我想打印一些文本。但是, ?action 本身就是一个事实,我只希望规则在该事实的“名称”槽是“运行”时触发。我将如何做到这一点?

0 投票
4 回答
6150 浏览

lisp - 编写专家系统的最佳语言是什么?

LISP 或 Jess 之类的东西是最佳选择吗?我有兴趣编写一个根据用户的回答提出建议的程序。计算考虑并不是一个真正的因素,这几乎是一个模式匹配引擎。我也想为此制作一个应用程序并将其放在网络上。

更新:我想把它放在博客或网站上,让人们从那里使用它。我想我的问题是有一个特定的推理引擎可以与.NET 系列、PHP 或类似的东西一起使用吗?每个选项的优缺点是什么等。

0 投票
1 回答
1551 浏览

artificial-intelligence - 计算剪辑规则 RHS 中的现有事实

您如何测试Clips规则 RHS 中的事实存在?我正在尝试设计一个规则,通过计算存在多少目标事实来“评分”当前状态。如何在 LHS 中测试事实很明显,但我找不到如何在 RHS 中进行等效测试。

我想做这样的事情,尽管这不是有效的剪辑代码:

因此,如果不存在任何目标状态,那么就会存在事实(分数(值 0))。相反,如果所有目标状态都存在,那么就会存在事实(分数(值 3))。

参考手册中提到了 fact-existp 函数,但这似乎需要传递一个事实地址。我尝试像 (fact-existp (goal-1)) 一样使用它,但 Clips 给了我一个语法错误。

0 投票
1 回答
552 浏览

python - 在 PyClips 中传播剪辑错误消息

我发现使用 PyClips 开发非常困难,因为它似乎用通用的“语法错误”消息替换了 Clips 抛出的有用错误消息。这使得在使用 PyClips 时在大型代码库上进行调试非常费力并且几乎不可能。

考虑以下示例。我写了一个非常大的表达式,其中包含乘法运算符,但我错误地忘记添加第二个参数。PyClips 没有简单地告诉我缺少参数,而是告诉我存在语法错误。本来应该花 1 秒来纠正的事情,却花了 5 分钟来纠正,因为我在我的大表情中寻找错误,寻找错误。

这是一个精简版:

在 Clips 中,带有有用的错误消息:

在 PyClips 中,出现无用的错误消息:

如何让 PyC​​lips 告诉我 Clips 抛出的真正错误?

0 投票
5 回答
2018 浏览

algorithm - 专家系统 (?) 算法

我有一个算法问题可以简化为这个任务:

假设我们有一份n疾病和m症状列表。
对于每种疾病d和症状s,我们有以下三种选择之一:

  • 症状与疾病呈正相关:s => d
  • 症状与疾病呈负相关:s => ~d
  • 症状与疾病无关

该算法的目标是创建一个关于症状的是/否问题的列表(或者甚至更好 - 问题的二叉树),它可以根据症状推断出确切的疾病。

任何对特定算法、相关软件工具甚至特定领域行话的引用都将不胜感激。

0 投票
3 回答
3545 浏览

drools - What are the myths about rules engine?

I'm writing a presentation about rule engine technology, specifically JBoss Drools.

What are some of the 'myths' about rule engines.

One I can think of is that it allows business users to control the rule engine, I believe it is possible, but it requires control and education - and not all business users are able to do it.

Do you agree/disagree? Does anybody else have any thoughts?

Happy to release my final 'findings' under Creative Commons...

0 投票
3 回答
2135 浏览

expert-system - 开发计算机硬件故障排除专家系统

我想开发一个专家系统(或更通用的基于知识的系统)来解决计算机硬件问题。

我选择 Python 作为我的语言,选择Pyke作为我的推理引擎。

问题是我不知道从哪里开始或如何设计我将采取行动的事实和规则。

我搜索了与该项目类似的开源,但没有找到。

任何帮助将不胜感激。

0 投票
4 回答
3127 浏览

c# - 动态调度系统使用什么算法?

我正计划开发一个专家系统,自动适应学校教员的工作量(时间、教学量等),并生成与某个部门主任想要分配的内容至少 90% 准确的班级部分某个学期的时间表。

使用什么算法?启发式?优化?非常感谢任何建议或帮助!

0 投票
3 回答
13807 浏览

java - Decision trees and rule engines (Drools)

In the application that I'm working on right now, I need to periodically check eligibility of tens of thousands of objects for some kind of a service. The decision diagram itself is in the following form, just way larger: Decision diagram

In each of the end nodes (circles), I need to run an action (change an object's field, log information etc). I tried using Drool Expert framework, but in that case I'd need to write a long rule for every path in the diagram leading to an end node. Drools Flow doesn't seem to be built for such a use case either - I take an object and then, depending on the decisions along the way, I end up in one of the end nodes; and then again for another object. Or is it? Could you give me some examples/links to such solutions?

UPDATE:

Drools Flow calls might look like this:

That is: I'd take an Application object, start a new process for it, when the process is finished (the final, action node would modify the application somehow), I'd remove the object from working memory and repeat the process for a new App object. What do you think about this solution?

SOLUTION:
I've ended up using Drools Flow and it has been working quite fine. My decision process isn't as straightforward as Drools Expert asks for and depending on where in the decision tree the process is it needs to load lists of objects from the database, transform them, make decisions, log everything etc. I use a Process object that is passed to the process as a parameter and stores all my global variables (for the process) and some convenience methods that are repeated at different points in the tree (as writing Java code in the Script Task nodes isn't very convenient itself). I also ended up using Java to make decisions (and not mvel or rules) - it's faster and I'd say easier to control. All objects that I work with are passed as parameters and used as normal Java variables in the code.