Re: Heuristic backtrack in Prolog?
- From: "Neng-Fa Zhou" <nzhou@xxxxxxx>
- Date: Mon, 11 Jun 2007 10:42:24 -0400
I
"Panu Kalliokoski" <panu.kalliokoski@xxxxxxxxxxx> wrote in message
news:5A8bi.37$M32.16@xxxxxxxxxxxxxxxx
Another execution environment I've needed is a heuristic parser where each
alternative parse has a probability. When we are making a parse in a
branch whose current probability is, say, 0.6, and we have an alternative
whose probability is, say, 0.3, we give the alternative a combined
probability of 0.18 and jump to some other branch of execution if its
probability is higher. Ordinary Prolog backtracking is a special case of
such an environment where fail :- probability(0). Code would look
something like:
np(In, Parse, Out) :-
article(In, Art, Out1),
probability(0.9),
attribute(Out1, Attr, Out2),
np(Out2, Rest, Out),
Parse = np(Attr, Rest).
np(In, Parse, Out) :-
attribute(In, Attr, Out1),
probability(0.3),
np(Out1, Rest, Out),
Parse = np(Attr, Rest).
np(In, Parse, Out) :-
probability(0.2),
noun(In, Parse, Out).
I know approximately how to do this in Scheme using continuations, but how
do I write the probability/1 predicate in Prolog, or something similar?
Please take a look at PRISM (http://sato-www.cs.titech.ac.jp/prism/), which
is an extension of Prolog with support of probabilistic reasoning and
learning. You can not only do probabilistic parsing using given probability
distributions, but also learning to estimate probability distributions from
given data. I am sure your life will be much easier if you use PRISM instead
of Scheme.
Cheers,
Neng-Fa
.
- Follow-Ups:
- Re: Heuristic backtrack in Prolog?
- From: rupertlssmith@xxxxxxxxxxxxxx
- Re: Heuristic backtrack in Prolog?
- From: Panu Kalliokoski
- Re: Heuristic backtrack in Prolog?
- References:
- Heuristic backtrack in Prolog?
- From: Panu Kalliokoski
- Heuristic backtrack in Prolog?
- Prev by Date: Heuristic backtrack in Prolog?
- Next by Date: Re: Prolog module system
- Previous by thread: Heuristic backtrack in Prolog?
- Next by thread: Re: Heuristic backtrack in Prolog?
- Index(es):
Relevant Pages
|
|