Tag: DCG

Definite Clause Grammars in Lisp – Part 4

Written by on June 12, 2022 in LISP, Natural Language Processing, Programming, Prolog with 0 Comments
Definite Clause Grammars in Lisp – Part 4

In a series of articles written earlier, I had shown how it is possible to model Definite Clause Grammars (DCG) in LispWorks Lisp (Enterprise Edition). We use defgrammar in Common Prolog (available as part of KnowledgeWorks package) to define our grammar rules. Here is a toy English grammar represented using defgrammar: This corresponds to the following Prolog […]

Continue Reading

Using Definite Clause Grammars (DCG) for Information Extraction

Written by on December 8, 2019 in Natural Language Processing, Programming, Prolog with 0 Comments
Using Definite Clause Grammars (DCG) for Information Extraction

In the previous article, I showed how we can use ATNs for extracting key information from natural language text. I also pointed out in that article that Definite Clause Grammars (DCG) are a more compact formalism for doing this. That will be the focus of today’s article. For a nice introduction to DCG, read this. […]

Continue Reading

Definite Clause Grammars in Lisp – Part 3

Written by on June 23, 2017 in LISP, Natural Language Processing, Programming with 0 Comments
Definite Clause Grammars in Lisp – Part 3

In today’s post, let us see how we can enhance the grammar representation discussed so far to include both Number constraint and Parse Tree. Fortunately, this turns out to be quite straightforward. Just as we do in Prolog, we need to include additional parameters, as needed, to each grammar rule. In the earlier two posts, […]

Continue Reading

Definite Clause Grammars in Lisp – Part 2

Written by on June 4, 2017 in LISP, Natural Language Processing, Programming with 0 Comments
Definite Clause Grammars in Lisp – Part 2

In the last post, I showed how we can implement DCGs in LispWorks using the KnowledgeWorks package. The grammar discussed in that post did not take into account subject/predicate number agreement. This is one of the basic constraints in English grammar. Today I will show how easy it is to encode this constraint. Here is […]

Continue Reading

Definite Clause Grammars (DCG) in Lisp

Written by on May 22, 2017 in LISP, Natural Language Processing, Programming with 0 Comments
Definite Clause Grammars (DCG) in Lisp

Definite Clause Grammars (DCG) are an elegant formalism for specifying context free grammars, and part of their popularity is due to their support in the Prolog language. Most books on Natural Language processing usually include a brief coverage of DCGs, even though Natural languages are not context-free. Because of the ability to attach arbitrary actions […]

Continue Reading

Top