LISP

Using Function Calls in the Grammar

Written by on October 14, 2017 in LISP, Natural Language Processing, Programming with 0 Comments
Using Function Calls in the Grammar

One of the advanced features of iLangGen is the ability to embed arbitrary function calls on the RHS of grammar rules. Such functions impart interesting dynamic behaviour to the generated data. For convenience and flexibility, iLangGen supports two types of function calls – Direct and Indirect. In the case of the Direct function call, the […]

Continue Reading

Composition of Grammars

Written by on September 27, 2017 in LISP, Natural Language Processing with 0 Comments
Composition of Grammars

In the last post, we saw how iLangGen text generation framework supports reuse of grammars through inheritance, akin to object-oriented languages. The good news is that we can achieve reuse through composition as well. The following is a simple grammar, nothing fancy to elaborate. Here is the output when you traverse the grammar without AST. […]

Continue Reading

Reuse of Grammars Through Inheritance

Written by on September 13, 2017 in LISP, Natural Language Processing, Programming with 0 Comments
Reuse of Grammars Through Inheritance

We are familiar with the advantages of class inheritance in object-oriented languages such as C++, C#, Java, and Python. The ability to reuse functionality via inheritance allows us to express our software design optimally, without having to write redundant code. iLangGen encourages the reuse of grammars by supporting Grammar Inheritance, where a grammar can explicitly […]

Continue Reading

Repetition in Grammar Rules

Written by on August 18, 2017 in LISP, Natural Language Processing, Programming with 0 Comments
Repetition in Grammar Rules

Many times, we need to repeatedly generate an element, or in general, have a way to control the number times one or more elements get generated. iLangGen supports all the standard cases: – Zero or once – Zero or more times (unbounded) – Zero or more times (bounded) – One or more times (unbounded) – […]

Continue Reading

Text Generation Using iLangGen Framework

Written by on August 6, 2017 in LISP, Natural Language Processing, Programming with 0 Comments
Text Generation Using iLangGen Framework

The two primary areas in Natural Language processing are Natural Language Understanding and Natural Language Generation. The former is concerned with processing and making sense of natural language text, whereas the latter is concerned with synthesizing text, possibly from some deep representation. Both are fascinating and at the same time, challenging, areas of research. The […]

Continue Reading

CLPython: Python in Common Lisp – Part 2

Written by on July 22, 2017 in LISP, Programming, Python with 0 Comments

We looked at the basic features of CLPython in our last blog. In today’s post let us look at the support for Python classes. PYTEST 130 > (defun pyclass ()   (run  “class Employee:    def __init__(self, name, dept):      self.name = name      self.dept = dept    def dump(self):      print ‘Name […]

Continue Reading

CLPython – Python in Common Lisp

Written by on July 7, 2017 in LISP, Python with 0 Comments

My work in the area of NLP requires me to work with several frameworks across multiple languages such as Java, Python and Lisp. Sometime ago I got a chance to experiment with CLPython, an open-source implementation of Python in Common Lisp. Although CLPython is not under active development now, I found it quite usable. In fact […]

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