NLP++

From Natural Philosophy Wiki
Jump to navigation Jump to search
NLP++
NLPppLogo-150x150.png
The NLP++ Logo
Paradigms Natural Language Processing
Designed by Amnon Meyers David de Hilster
Developer Text Analysis International
First appeared Template:Start date and age
Template:Infobox software/simple
Platform Cross Platform
OS Most major
Filename extensions .nlp, .pat, .seq, .txxt, .kb
Website www.visualtext.com

NLP++ is a computer language for natural language processing created by Amnon Meyers and David de Hilster in 1998. It includes the NLP++ language, an internal syntactic tree structure, and a hierarchical knowledge base called the Conceptual Grammar. NLP++ works in conjunction with the Integrated Development Environment VisualText which affords rapid development of text analyzers that mimic human readers. It is the only computer language that is dedicated exclusively to natural language processing.

Overview

NLP++ is a computer language specifically dedicated for building natural language processors of text. It allows programmers to capture linguistic and world knowledge along with the process by which humans read and understand text. NLP++ combines bottom up, island-driven sequential processing in conjunction with a dynamic hierarchical knowledge base called the conceptual grammar. NLP++ can dynamically build knowledge and use stored knowledge in order to aid in the task of understanding written text. It's scope in processing text runs from simple syntactic processing and matching to full-blown natural language understanding. NLP++ is a language, not a toolkit so all analyzers must be created from scratch for each application.

NLP++

NLP++ is a computer language that takes text, breaks it down into tokens, builds up those tokens into syntactic trees, and builds and uses knowledge stored in the conceptual grammar. The language includes functions, rules, local variables specific to its internal representations of text and knowledge.

Variables

Variables are written with a single letter and a string name. There are special variable types in NLP++ that are used in specific contexts.

Variable Description Example Scope
N Specific node N("$text",2) Rules
S Suggested node S("count") Rules
X Context node and level X("concept",3) Rules
G Global variable G("People") Rules & Functions
L Local variable L("num") Rules & Functions

Regions

There are numerous regions in NLP++ files:

Region Description Position and Scope
@NODES Specifies the nodes to be matched in the @RULES region Comes before the @RULES region
@PATH Specifies a specific path in the syntax tree to match Comes before the @RULES region
@CODE Specifies a region where NLP++ code is executed outside of a @RULES region Region ends with @@CODE
@DECL Declarative area for functions Region ends with @@DECL
@POST Specifies a region of post processing for a rule or rules Comes right before the @RULES region
@PRE Specifies a region of post processing for a rule or rules Comes right before the @RULES region
@CHECK Specifies certain conditions on rule nodes before trying to make the rule Comes right before the @POST or @RULES region
@RULES Specifies a region for rules Region ends with @@

Rules

NLP++ has rules for pattern matching. A rule is written in the form of "@RULES _node <- a b c @@" where "<-" where a, b, and c are match and put under the new node "_node". Here is an example of a rule.

@POST
S("count") = N("$text",2);
S("concept") = makeconcept(G("Counts"),N("$text",1));
single();

@RULES
_count <-
    _xALPHA [s]  ### (1)
    _xNUM [s]    ### (2)
    @@

Built In Functions

NLP++ has built in functions for the following areas:

  • Database Functions
  • Formatting and I/O Functions
  • Knowledge Base Functions
  • Math Functions
  • Parse Tree Functions
  • Special Functions
  • Spelling Functions
  • String Functions
  • Web Functions

User Functions

NLP++ allows the user to create their own functions in the @@DECL area. These functions can access the syntactic tree and any part of the knowledge base, as well as files on the system.

Conceptual Grammar

The conceptual grammar is a hierarchical knowledge base that can be imported and used by NLP++ and also created by NLP++ code and pattern matching. The hierarchy contains concepts and concepts can have attributes and phrases attached to them.

VisualText

VisualText version 2 for Windows

VisualText is an IDE that is specifically built to edit, run, and debug NLP++ text analyzers. It includes a text director of texts to process, a special editor for NLP++, text highlighting of matching rules for each sequential pass of rule patterns, and tree visualizations for the syntactic tree as well as the hierarchical knowledge base. It also has the ability to quickly generate rules directly from text.

History

The roots of NLP++ come from its two creators, Amnon Meyers and David de Hilster who are computer programmers working in the area of natural language processing since the early 1980s.

Amnon Meyers

Amnon Meyers worked on previous systems including Vox and the conceptual grammar ... blah blah blah

David de Hilster

David de Hilster first developed island-driven pattern matching rules first in LISP on Xerox 1108 machines at Battelle Memorial Institute in their artificial intelligence group. He then worked in C for the commercial product called NLQuery from Battelle Memorial Institute. In the late 1980s, de Hilster developed Verbo, a natural language query system for databases in Portuguese while living in working in Rio de Janeiro Brazil.

Collaboration

In 1990, David de Hilster was hired into the Artificial Intelligence group at McDonnell Douglas in Huntington Beach California where he met Amnon and was tasked to move Amnon's Vox program to C++. The two collaborated, combining the island-driven parsing with the conceptual grammar and coming up with TexUS. Their system was used in the Message Understanding Conferences sponsored by Darp in the early 1990s and they placed third among the participants which included MIT, SRI, Carnegie Mellon among others.

In the mid 1990s, the two moved to the Aritifical Intelligence Group at Space Park at TRW where the two continued their collaboration, with de Hilster's work inspiring the creation of a new company ISearch which electronically processed resumes. In 1997, de Hilster was hired by ISearch to move their text processing system to the C language.

In 1998, Meyers secured funding from friends and family to start Text Analysis International which eventually lured de Hilster to join where the two created and formalized NLP++ and VisualText. The idea was to formalize a computer language that incorporated the pattern matching of de Hilster's, with the Conceptual Grammar knowledge base from Meyers, along with an integrated development environment specifically tailored to NLP++, its tree structures, and its knowledge base.

For the two decades, the technology was privately owned and was licensed by private companies to process medial, social media, historical documents, and real estate text.

Open Source

VSCode NLP++ Language Extension

In December of 2018, NLP++ and VisualText went open source. The company Text Analysis International was dissolved by and it was moved to an open source MIT licensed repository by creators Amnon Meyers and David de Hilster.

NLP Engine

The NLP engine is a C++ class and executable that can called by other languages that can call c++ libraries the nlp.exe executable. It currently compiles on Linux and will be available on windows and Mac Os in the near future. The nlp.exe executable is called by the NLP++ Language Extension for VScode.

VisualText

Version 2 of the VisualText IDE written for Microsoft's Windows and is available as a free download from the VisualText website. Version 3 is also available but was never completed and is not 100 percent functional. The windows Version 2 and 3 of VisualText are no longer developed or supported although they are still in use today.

VSCode Language Extension

VisualText IDE is now ported to VSCode as a language extension which runs cross platform. This is now considered to be the current version of the IDE and will continue to be developed and enhanced. It is planned to be officially released as a Microsoft VSCode Language Extension sometime in the first quarter of 2021. It is currently available as a beta IDE in the VisualText repository on GitHub.

The output of the nlp.exe engine and the NLP++ Language Extension for VSCode produce a number of special files for analyzer development. Those files are:

File Extension Description
.nlp or .pat Files containing NLP++ code
.seq The analyzer sequence file that store the calling order of the sequence of nlp++ files
.txxt Rules matching highlight files containing double square brackets around matched words and phrases (new to the VSCode NLP++ Language Extension)
.kb Conceptual Grammar files with the knowledge pretty-printed for inspection during develpment

External links