Home > Archive > Prolog > March 2005 > Newbie: From Sentences to Grammar
You are viewing an archived Text-only version of the thread.
To view this thread in it's original format and/or if you want to reply to
this thread please [click here]
| Author |
Newbie: From Sentences to Grammar
|
|
|
| Hello,
How do I extract the grammar from a set of sentences? Any pointer to a
simple system, or code, or article in Prolog on how to accomplish this
goal? Thanks.
basi
| |
| tmp123 2005-03-28, 3:59 pm |
| basi wrote:
> Hello,
> How do I extract the grammar from a set of sentences? Any pointer to
a
> simple system, or code, or article in Prolog on how to accomplish
this
> goal? Thanks.
> basi
One posibilty is, first, convert the minimal sentence items (words and
symbols?) to tokens, and second, use a "sintactic pattern recongnition"
algorithm with its "supervised"/"unsupervised learning"? (in quotes,
the terms you can google for).
However, things are easier if you do not need to extract the grammar
(you know or write manually it), but just analize the sentences versus
the grammar (="parse" it).
| |
| Matthew Huntbach 2005-03-29, 8:58 pm |
| "basi" <basiibarra@yahoo.com> wrote
> How do I extract the grammar from a set of sentences? Any pointer to a
> simple system, or code, or article in Prolog on how to accomplish this
> goal? Thanks.
> basi
It isn't a simple problem. What you're essentially saying is "how do I
do inductive logic programming?", which has become a whole academic
field to itself.
A good paper which applies ILP to the problem of finding a grammar
from examples is:
www.clp.ox.ac.uk/people/staff/pulma...ing_papers2.pdf
Matthew Huntbach
| |
| Martin Sondergaard 2005-03-29, 8:58 pm |
| Its not easy to do this with the ordinary features of Prolog,
so Prolog has special features to deal with grammar.
Look for the terms "DCG" and "Definite Clause Grammar".
If you have a good book on Prolog, look up these terms in the index.
There is a tutorial (i.e. website) which introduces
Prolog's DCG features. Its called "Learn Prolog Now!".
You can find this by using Google, or you can find its URL
in the FAQ for comp.lang.prolog .
--
Martin Sondergaard.
The website you s
cannot be located
but endless others exist.
-- A poem.
| |
|
| Thank you for your reply. Yes, I now realize that this is not a simple
subject. I goggled "grammar generator", which led me to many many
sites, and realized quickly the complexity.
I am working on the "grammar" of prefixation of a concatenative
language. As I was doing the "manual" induction, I had thought that for
a small set of vocabulary, there must be an interactive system out
there that the user can "nudged" into the right direction to come up
with the rules.
Sigh.
Thanks for the reference.
basi
Matthew Huntbach wrote:
> "basi" <basiibarra@yahoo.com> wrote
>
to a[color=darkred]
this[color=darkred]
>
> It isn't a simple problem. What you're essentially saying is "how do
I
> do inductive logic programming?", which has become a whole academic
> field to itself.
>
> A good paper which applies ILP to the problem of finding a grammar
> from examples is:
>
> www.clp.ox.ac.uk/people/staff/pulma...ing_papers2.pdf
>
> Matthew Huntbach
|
|
|
|
|