NLP Compromise- Programming With Text

Oct. 14, 2017, 8:01 a.m. By: Kirti Bakshi

NLP Compromise

NLP (Natural Language Processing), is the branch of computer science, that is focused on developing systems that allow computers to communicate with people using everyday language and is used in applications like Apple Siri, Google Voice, and Microsoft Cortana.

The technology for statistical NLP comes mainly from machine learning and data mining, and both of these are fields of artificial intelligence that involve learning from data.

Now, the challenges we face in NLP are many. And the major challenge being faced is Ambiguity that comes with sentences that are long or Words with multiple definitions.

There are also a number of Open Source projects available for NLP:

  1. NLTK (Python)

  2. Spacey.io (python)

  3. NLP Compromise (NodeJS)

Now, What is NLP Compromise?

NLP Compromise, also described as "A cool way to use a natural language in JavaScript", is a fast, lightweight NLP library with a very intuitive API(application program interface) that supports a variety of useful text parsing and manipulation functionalities and does Natural Language Processing in the Browser. It has no Dependencies, training, configuration or prolog.

NLP Compromise is available on CDNJS and that allows you to use it immediately just by simply adding a tag to your HTML document. It operates on a few concepts like Text(), Noun(), Date() etc. Every class can be called directly from the API and the prototype along with its class are surfaced in the API itself for augmenting or overloading. Any sort of procedure or analysis can be applied, and then further shared as a plug-in. (Multiple plug-ins can also be applied, and coordinated.)

Once you start experimenting with the Library, you can now frame a grammatically correct sentence by conjugating the verbs, convert a noun to its plural or singular form, Create Random Sentences and can Toss in text, even if it's just a word. It is, therefore, a handy and not an overly-expensive tool for changing, understanding and playing with English.

This library also allows you to handle an entire sentence at once. And that means you can convert a statement in the present tense to one in the future tense all in one go. The sentences it generates are usually correct with a handy output, although minor errors in sentences that have future and past tenses might be encountered. You can even replace a specific part-of- speech(POS), of a sentence with another word using a specific method in this library.

NLP Compromise is, therefore, increasingly becoming popular these days among JavaScript Developers and fortunately also has many JavaScript libraries that facilitate it. You might now realize how powerful this library is but there is always something more that keeps adding to it.

More Information: Github