GATE, NLTK: Basic Components of a Machine Learning System
Join the DZone community and get the full member experience.Join For Free
I am currently building a Machine Learning system. In this blog I want to captures the elements of a machine learning system.
My definition of a Machine Learning System is to take voice or text inputs from a user and provide relevant information. And over a period of time, learn the user behavior and provides him better information. Let us hold on to this comment and dissect apart each element.
In the below example, we will consider only text input. Let us also assume that the text input will be a freeflowing English text.
- As a 1st step, when someone enters a freeflowing text, we need to understand what is the noun, what is the verb, what is the subject and what is the predicate. For doing this we need a Parts of Speech analyzer (POS), for example “I want a Phone”. One of the components of Natural Language Processing (NLP) is POS.
- For associating relationship between a noun and a number, like “Phone greater than 20 dollers”, we need to run the sentence thru a rule engine. The terminology used for this isSemantic Rule Engine
- The 3rd aspect is the Ontology, where in each noun needs to translate to a specific product or a place. For example, if someone says “I want a Bike” it should translate as “I want a Bicycle” and it should interpret that the company that manufacture a bicycle is BSA, or a Trac. We typically need to build a Product Ontology
- Finally if you have buying pattern of a user and his friends in the system, we need aRecommendation Engine to give the user a proper recommendation
2 programming language which have good support of these capabilities are Python and Java. Python has a framework called Natural Language Tool Kit (NLTK). To understand more about NLTK, please refer the Cookbook. Java has a framework called GATE, Stanford NLP andOpenNLP .
For this discussion, we will consider GATE and related frameworks.
- For Parts of Speech analyzer, GATE has a set of tools called ANNIE: a Nearly-New Information Extraction System.
- For Semantic Rule Engine it has JAPE: Regular Expressions over Annotations.
- For Ontology building you have Apache JENA
- To query Ontology you need a querylanguage called SPARQL
- There is a Ontology client software called Protege
- For recommendation engine we can use WEKA or Mahout
In my subsequent blogs I will talk more in details.
Published at DZone with permission of Krishna Prasad, DZone MVB. See the original article here.
Opinions expressed by DZone contributors are their own.