Skip to content

Machine Learning Grammars

February 11, 2014

I have completed a program that uses system of grammars that learn from input, and using what they learn to parse a set of unknown words to see if they check against the original set. 

There are 3 files needed:

Learn set: containing words, letters, numbers, names etc. 
Rule Set: empty until filled with automatically written rules. 
Test Set: containing words, letters, numbers, names etc. 

The algorithm is roughly as follows using as simple as possible examples as I can muster. 

1) First grammar reads a learn.txt file using rule::= (“%^[+’a-zA-Z’#%’word’^”)
e.g. the learn file contains the word “hello” 
and casts that into “word”

2) At the same time print the head of the new rule: (“%^[‘
The body of the new rule: hello
And the tail of the new rule: ‘$%’x’^”)
and store that result into x e.g rule::= (“%^[‘hello’$%’x’^”)

3) The 3rd grammar then reads the new rule from rules.txt 
and parses a test.txt file in which it either matches or doesn’t match-
placing the result into a file called results.txt 

In other words, the grammars read a file of words, forms a set of rules from what it reads such that another grammar uses the new rules to parse a set of test words.

Advertisements

From → Uncategorized

Leave a Comment

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: