natural speech parser?

Fernando Pereira pereira at research.att.com
Thu Nov 25 13:05:56 EST 1999


In article <81jf82$kil$1 at nnrp1.deja.com>, <moonseeker at my-deja.com>
wrote:

> Hi,
> 
> I'm looking for a command parser to parse sentences like:
> 
> enable KEY1 and write 'Hello World' to var2
> 
> I havn't done such a thing like parsers or compilers (which works with
> command trees) since yet and would welcome any suggestion.
This can be relatively easy or an open research project, depending on
what you really want. If what you want is a restricted, artificial
language that looks a bit like natural language, it's not too difficult
to build a simple parser based on an appropriate specification, along
the lines of

   <command> ::= (<clause> <conj>)* <clause>
   <clause> ::= <intransverb> | <transverb> <obj> |
      <ditransverb> <obj> <prep> <iobj>
   <conj> ::= "," | "and"
   <intransverb> ::= "help" | "stop" | ...
   <transverb> ::= "enable" | "disable" | ...
   <ditransverb> ::= "write" | "send" | "copy" | "store" | ...
   <obj> ::= <var> | <const>
   <const> ::= <string> | <number> | ...
   <iobj> ::= <var>
   <prep> ::= "to" | "into" | ...

augmented with appropriate semantic actions. There are several Python
tools around to create parsers, eg.
<http://www.csr.uvic.ca/~aycock/python/>.

However, a restricted language may be awkward to use without training,
since actual natural language is more variable than can be easily
captured by such a grammar. The situation is even more difficult if the
parser is intended to work on the output of speech recognition, for
several reasons: 1) spoken language is more variable than written, 2)
actual speech is full of disfluencies, and 3) speech recognizers make
lots of mistakes. Dealing with these problems is the subject of quite a
bit of current research, and building actual usable systems requires
limiting the scope of application to match the limitations of the
technology, and a lot of user testing.

-- F




More information about the Python-list mailing list