【发布时间】:2014-04-04 18:52:27
【问题描述】:
我想构建一个物品分类机器,创建规则并使用重量。可能没有明确的细节来定义一个项目,只有高分。 一个例子。
If item A has x part then A.set(Category.A, 5) //weigth 5
If item A has y part then A.set(Category.B,3) //weigth 3
If item A has z part then A.set(Category.B,2) //weigth 2
...
在执行完所有规则之后,你就有了每个类别的分数,所以最后项目 A 是类别什么的。
这可以使用 DROOLS 吗?这有什么例子吗? 非常感谢。
根据需要添加更多信息: 我想对新闻进行分类(例如)。
If NewsA has in title "won" then NewsA is likely SportNews as 20%
If NewsA is writen by MisterX then NewsA is likely InternationalNews as 60%
If NewsA has more than 2 times word "football" then NewsA is likely SportNews as 50%
所以,这样的一条新闻:
巴塞罗那昨天赢了
bla,bla,bla...足球,bla,...足球,bla,bla,bla ...足球...
由 MisterX 编写
此新闻将被归类为 SportNews,因为 20+50 是 InternationalNews 类别的 60 多个。我想在门中实现类似的东西,有多种规则和重量。
再次感谢!
【问题讨论】:
标签: java classification drools