views:

679

answers:

6

It's easy to write a grammar file for speech recognition from only 50 words because you can just do it manually. What is the easiest, most efficient way to do it if you have 10,000 or 100,000 words?

Example:
Say we have "RC cola" and "Pepsi cola". We would have grammar file consisting of 2 rules:
DRINK: (COLANAME ?[coke cola soda])
COLANAME: [rc pepsi]
It will recognizes "RC","RC Coke","RC Cola","RC Soda", "Pepsi", "Pepsi Coke", "Pepsi Cola" and "Pepsi Soda".

Edit: I'm talking about grammar for speech recognition. Speech recognition systems need an accompanying grammar file so they know what to recognize (gsl, grxml). And I was actually also thinking about not just any words but something like names where you can't classify into categories.

A: 

Totally random/vauge ideas off the top of my head:

-You could try to classify words into categories (noun, verb, etc.) and then form potentially correct forms for whole statements/sentences based on the classes of words. You could then try to fit new test data to a previously defined model based on the words and the order in which their used.

-I'd also be curious about using some sort of machine learning algorithm to learn proper use of words based off of some sort of training data or literature. Once you've trained your algorithm some you could try to classify new incoming data based off of previous results.

Pete
A: 

I assume you mean part-of-speech tagging; the fastest approach is to use an automated tagger and manually verify (and correct) the results. Even if the tagger has a hitrate as low as 60-70% it will still significantly reduce the amount of work.

Christoffer
+3  A: 

Now I see. You do mean grammars. The grammar formats you specify are cousins of context-free grammars. There exists a research field around automatic learning of context-free grammars. Probabilistic Context-free grammars are central to this field. See Roni rosenfeld's Notes (PostScript) on learning PCFGs, the Bayesian version (zipped postscript) and unsupervised PCFG learning (PDF). This is an active research fields, and has changed since these papers were written. Eugene Charniak is a prolific researcher in this field.

Yuval F
I know. I'm sorry. I'm talking more in terms of speech reco.
Hertanto Lie
A: 

I don't have an answer that will solve my problems but Yuval's answer clearly suggests that this is a subject that's still under development and it is not a mature enough subject. I understand that there's probably no easy grammar fix that exists right now (at least outside the research labs). The only solution to doing a good grammar right now is probably constant learning of user inputs and agile refactoring of the grammar files.

Hertanto Lie
You should find that for a very small set of words, then the current research as it stands will be extremely effective.What is still an unsolved research problem is machine transcription and also improved speech recognition for large words.
Arafangion
(Transcription being the situation where you open a laptop in a lecture, then without any training, it automatically transcribes the lecture for you - whereas mere speech recognition tends to require training, and the speaker has to take care to ensure that their speech is good).
Arafangion
A: 

Can anyone show here some example for how to load and form a grammar file grxml or gsl??

Actually I am working on SAPI 5.1 project and felt in very crucial deadlines, only a week and my task is to acheive and recognize names or some proper noun. I trying my approach using xml files and successfully integrated it within my script but SAPI 5.1 isn't recognizing my own words from xml files.

I tried cfg files also but did't work. Actually the names arn't in English, these are Arabic names, so Is there any support for Arabic in SAPI? But I want these names to be displayed to me in English language.

Any help will be highly appreciated. email : [email protected]. Plz send a copy for solution to my email also.

Thnx.

+1  A: 

For a 50-100 thousand word lexicon, you're almost certainly better off building a dictation grammar, rather than trying to build a context-free grammar. Microsoft has their Dictation Resource Kit available for free; I haven't used it, so I can't comment on how usable it is.

Eric Brown