Closed ngeiswei closed 5 years ago
I've labeled it as good first issue
because it is fairly well defined and self-contained, but it does require some amount of understanding of the pattern matcher and pattern miner to be addressed, so it is a hard good first issue.
A bit more details: it is expected that the fix will be to generalize the first conditional of support
(if (equal? pat (top))
so that not only the top
pattern but any one containing one or more clauses as single variables would return the cardinality of texts.
Perhaps an even better solution would be to create some scheme binding for Miner::freq
https://github.com/singnet/opencog/blob/master/opencog/learning/miner/Miner.h#L247 (which would require that a version without any heuristic be made public and static), and have support
call it.
Fix
Issue description
The URE pattern miner easily produces warnings such as
That happens when the pattern has an unconstrained variable like
Variable "$X-1"
inNot only that but such a count is trivially equal to the size of the texts. The URE pattern miner code should be inspected to clean and optimize these inefficiencies. It is expected that the fix would occur in
support
inminer-utils.scm
https://github.com/singnet/opencog/blob/master/opencog/learning/miner/miner-utils.scm#L183How to reproduce
Run
MinerUTest
in particular
MinerUTest::test_2conjuncts_3()
, and more specifically the URE pattern miner run, should produce these warnings.