pocketsphinx how to determine out of grammar words - cmusphinx

I am currently using pocketsphix demo (android and visual studio 2010) and I have configured a jsgf grammer
like this
#JSGF V1.0;
grammar Names;
public <popular> = muhammad | ahmed | maria | john | kelley | peter | jacob | jason;
Whenever I say correct name, it detects it right in most cases but when I say a name not in the list, it still matches something and I do not want that or atleast be able to detect if something was said that was not in Grammar (may be through some score or api of pocketsphinx)
I am sure pocketsphinx has it somewhere which I don't know. Please advise.
Thanks,
Ahmed

No, this feature is not implemented. For more details see
http://cmusphinx.sourceforge.net/wiki/faq#qcan_pocketsphinx_reject_out-of-grammar_words_and_noises
You can use keyword spotting mode instead to look for a list of keyphrases. You can configure activation threshold for every phrase.

Related

webdriverio cucumber outline // play all scenarios even if one is having a failure

I am using an outline examples in my test,
something like :
Feature: feature name
Scenario Outline: outline scenario
Given I go to
When I click on button
Then I should have
Examples:
| website | title |
| google | google welcome|
| yahoo | yahoo welcome |
| Astalavista | altalavista hello I m dead |
so far it is great !!! but if the first one is doing okay and the second one is having an issue the third is not played ...
do you know how to continue all the test in case of outline scenario ?
thanks a lot for your help !
There is something called failFast in the cucumberOpts.
If the value is true then it means fail at the first failure and do not proceed.
If the value is false then the execution will continue for all the scenario in the feature file even if one scenario fails.
So try by making it as false.
Thanks,
Naveen

How can I display multiple line scenario text in extend reports?

In my feature file, using the same scenario I am checking more than one requirements. I have written the scenario like below:
Scenario: My first requirement ID
My second requirement ID
My third requirement ID
Etc
After execution, the extend report shows only the result as
Scenario: My first requirement ID
How can I get all the three I D,s in extent report.
NOTE:Each of my scenario title is lengthy.
Can you explain your scenario text a little bit more? According to the documentation, the scenario should describe in human terms what we expect the software to do. It is quite unusual to include expected data in that scenario text. Are you using the ID from an enum? If that is the case, it would be better to spell out the enum in human readable terms. Scenario: UserType is Administrator for example. Another option would be to use a Scenario Outline, something like
Scenario Outline: My generic requirement statement
Given Id <whateverId> is provided
When I do <activity>
Then I expect to see <result>
Examples:
| whateverId | activity | result |
| 12 | firstMethod | MyResult |
| 20 | secondActivity | anotherResult |
| 42 | thirdExample | thirdResult |
The variable names provided in the outline in angle brackets become the column headers in the examples grid. Just be sure to indent the grid below the Examples: line and also include the pipe | on both the left and right boundaries of the grid. Hopefully that helps.

Configure sphinx to rank exact matching higher with morphology enabled

I'm having sphinx index to search users by names.
I'm using soundex morphology to show more relevant results for case searcher doesn't exactly know how the name spells. Consider following table:
+----+--------------------+
| id | name |
+----+--------------------+
| 1 | Maciej Makuszewski |
| 2 | Dane Massey |
| 3 | Lionel Messi |
| 4 | Mr. No Matches |
+----+--------------------+
With soundex enabled sphinx suggests 1, 2, 3 rows as a relevant result for query messi. Anyway I'd like to show the exact matching first. I mean that if user types messi he wants to see Lionel Messi the first with great probability.
My problem is I don't know how to do that. I tried to set different rankers but it gives nothing.
I also tried to add
index_exact_words = 1
to index but it gives nothing.
I'm using sphinx API with node.js sphinxapi module if it matters.
What is the common way of solving such issue?
You want, index_exact_words, but should also add expand_keywords
This will cause sphinx to search for the fuzzy (via morphology) AND the exact word (via index_exact_words) automatically. So an exact match, matches both, and ranks higher.
Can do the same manually by searching for say
messi | =messi
(which is similar to what expand_keywords does internally)

Manipulating Strings that are inside Text Files

Here's my situation:
We depend on users to click some .bat and do the daily-backup.
I did some batching programming, now when they (are forced to) back-up, it leaves a log file in it's own the server folder. And yes, they need to be forced otherwise they just won't do the g.damn backup... Welcome to my company.
Then, after some more research, I developed another bat which checks if the file is outdated and prints it on a text file.
This is the kind of files that I have now:
File: DailyBkp
Content:
".\John\log.log"
".\Department1\Andy\log.log"
".\Department1\Nicole\log.log"
".\Department2\Ann\log.log"
File: Departments
Content:
Department1
Department2
...
Great, after some string treatment in PowerShell I managed to get DailyBkp content to be this:
John
Department1 Andy
...
Note that it has a space at beginning and another at the end which won't go away no matter what trim I use...
So now I have this setup: SERVER > E:\Backup\
Inside backup we have i.e. "Department 1" ... "Dep.-N"
Inside each one: "User-Lastname1" .. "User-lastname-N"
What I need, or what I do want to is use PowerShell to get the contents of DailyBkp containing "Dept_User" string, and export entries to a csv file like this:
COLUMN_Name COLUMN_Dept
Andy Department1
So, how do I do this? I can't find anything on internet that uses text files.
so assuming I am reading your question correctly you have a DailyBkp file that looks like this:
Department1 Andy
Dpeartment2 Jim
...
to get what you want you could read each line in split it out then spit it back out in a csv like this:
"COLUMN_Name,COLUMN_Dept" | out-file <path>\outfile.csv
$bkpFile = get-content $dailyBkpFile
$bkpFile | ForEach-Object {$line = $_.split(" ")
"$($line[1]),$($line[0])" | out-file <path>\outfile.csv -Append}
output should look like this:
COLUMN_Name,COLUMN_Dept
Andy,Department1
Jim,Department2
just doind a quick post here.
My question was answered, thanks.
And, if anyone is interested in Powershell programming, google Mastering Powershell by Tobias Weltner; this is a free book with lots of explanations.

Identifying and comparing syntactic structure of questio-sentence

I am getting question from user and trying to understand syntactically.
My goal is to identify the exact question sentence from user entered question. Like
Obama is president of USA, who is his wife?
So I am able to apply anaphora resolution and get his pointing to Obama and can convert above sentence to
Obama is president of USA, who is Obama wife?
but how can I syntactically identify exact question sentence i.e. Who is obama wife? from above entire question
I am trying with pylinkgrammar which give 54 linkage for above sentence, like
linkparser>
Linkage 54, cost vector = (UNUSED=0 DIS= 8.05 LEN=24)
+------------------------------Xp------------------------------+
+---------------------->WV---------------------->+ |
+-------------------Xx-------------------+-->WV->+---SIs---+ |
+----Wd---+--Ss--+--Oum--+---Mp--+-Js+ +Wq+--Q-+ +Ds**c+ |
| | | | | | | | | | | |
LEFT-WALL Obama[!] is.v president.t of USA.l , who is.v his wife.n ?
What I want to do it defining pattern for different question type like W5H1, conjunction based question etc.
But I dont find how to write rule for these pattern, any suggestion and reference would be much appreciable?
You can try to extract different possible sub-questions (hypotheses) from your original text and test for textual entailment between your text and hypotheses. Check out http://hltfbk.github.io/Excitement-Open-Platform/#Recognizing_Textual_Entailment

Resources