After the Deadline

Grammar Checkers – Not so much magic

Posted in NLP Research by rsmudge on August 31, 2009

I once read a quote where an early pioneer of computerized grammar checkers expressed disappointment about how little the technology has evolved.  It’s amazing to me how grammar checking is simultaneously simple (rule-based) and complicated.  The complicated part is the technologies that make the abstractions about the raw text possible.

It helps to start with, what is a grammar checker?  When I write grammar checker here I’m really referring to a writing checker that looks for phrases that represent an error.  Despite advances in AI, complete understanding of unstructured text is still beyond the reach of computers.   Grammar checkers work by finding patterns that a human created and flagging text that matches these patterns.

Patterns can be as simple as always flagging “your welcome” and suggesting “you’re welcome”.  While these patterns are simple to make a checker for, they don’t offer much power.  A grammar checker with any kind of coverage would need tens or hundreds of thousands  of rules to be useful to anyone.

Realizing this, NLP researchers decided to come up with ways to infer information about text at a higher level and write rules that take  advantage of this higher level information.  One example is part-of-speech tagging.  In elementary school you may have learned grammar by labeling words in a sentence with verb, noun, adjective, etc.  Most grammar checkers do this too and the process is called tagging.  With part-of-speech information, one rule can capture many writing errors.  In After the Deadline, I use part-of-speech tags to find errors where a plural noun is used with a determiner that expects a singular noun e.g. “There is categories”

While tagging gives extra information about each word, the rules we can write are still limited.  Some words should be grouped together, for example proper nouns like “New York”.  The process of grouping words that belong together is known as chunking.  Through chunking rule writers can have more confidence that what follows a tagged word (or chunk) really has the characteristics (plural, singular) assumed by the rule.  For example “There is many categories” should be flagged and a decent chunker makes it easier for a rule to realize the phrase following “There is” represents a plural noun phrase.

The next abstraction is the full parse.  A full-parse is where the computer tries to infer the subject, object, and verbs in a sentence.  The structure of the sentence is placed into a tree-like data structure that the rules can refer to at will.  With a full-parse a grammar checker can offer suggestions that drastically restructure the sentence (e.g. reword passive voice), decide which sentences make no sense, and find errors that are multiple words apart (subject verb agreement errors).

Regardless of the abstraction level used, grammar checkers are still rule-based.  The techniques that back these abstractions can become very sophisticated.  It seems much research has focused on improving these abstractions.

To move grammar checking to a new level, I expect we will need new abstractions one can use when writing rules.  I also expect developing techniques to automatically mine rules will be a valuable research subject.

6 Responses

Subscribe to comments with RSS.

  1. Dug Song said, on September 1, 2009 at 2:35 am

    I like that the possibly related post is “Monkeys Sense Poor Grammar”… who needs parse trees, part-of-speech tagging, and all that NLP mumbo-jumbo when you can put a room full of trained monkeys to work? Automation != computerization

    • rsmudge said, on September 1, 2009 at 3:42 am

      Hah, thanks for the comment love Bishop Song. I’ll work on injecting more of my personality into this blog once I get the past years worth of NLP self-study off my chest and dumped into this blog. Something in there has to be new 🙂

  2. sanjeev sharma said, on November 18, 2009 at 4:54 am

    hi
    i agree with this that we should think in a different way. now the researches are just to accelerate the pre developed grammar checker but i think we should think about the new techniques that can be used to improvr the grammat checker.

    • rsmudge said, on November 18, 2009 at 10:14 am

      I think it’s feasible to do some rule mining by developing structures that capture patterns of language use from a good data set and then finding the difference between this structure and one taken from a set of mixed good and bad data. I probably won’t be the one to look further into this though. The approach AtD takes has limitations and they limit what I can catch but it works well enough that I haven’t been drawn to investigate this more.

  3. flashrash said, on December 9, 2009 at 2:54 pm

    you just found a new daily reader

    • rsmudge said, on December 9, 2009 at 3:15 pm

      Welcome, always glad to have readers. Writing stuff is more fun that way.


Comments are closed.

%d