Sparklehart
Posts: 5
Joined: Thu May 25, 2017 8:19 am

problems capturing parameters with Oscova

Fri Jun 02, 2017 5:09 am

When I pass in:
Get My Info 1234 password

into this:
[Expression("GET MY INFO @sys.text:AccountNumber @sys.text:AccountPassword")]
public void GetMyInfo(Context context, Result result)
{
var AccountNumber = result.Entities.OfType("AccountNumber").ToString();
var AccountPassword = result.Entities.OfType("AccountPassword").ToString();
}

When I try to do this, the AccountNumber is assigned "1234 password"
and AccountPassword is assigned "Get My Info 1234 password"

Where have I gone wrong? is it because both values are text?

User avatar
Fantom
Help & Support
Posts: 304
Joined: Fri Oct 25, 2013 9:20 pm

Re: problems capturing parameters with Oscova

Fri Jun 02, 2017 5:54 am

Welcome to the Forum!

yes you are right. Multiple side-by-side usage of @sys.text entity recognizer is restricted as during ML such expression may result in imprecise intent scoring.

You may try the following Expression instead:

CSharp Code

[Expression("GET MY INFO @sys.number.integer:AccountNumber @sys.text:AccountPassword")]
public void GetMyInfo(Context context, Result result)
{
	var accountNumber = result.Entities.OfType("AccountNumber");
	var accountPassword = result.Entities.OfType("AccountPassword");
	//Do something with the entities...
}
I have successfully tested the above code in version 2.1.0-beta-004.

Also please ensure that you are running the latest version of Syn.Bot framework (at the moment its version 2.1.0-beta-004) as 2.1.0 comes with great improvements and bug fixes.

To get the latest version use the following command in NuGet Package Manager under Visual Studio/Xamarin Studio.

Install-Package Syn.Bot -Pre

It is highly recommended that whenever and wherever possible you should try to use custom or pre-built entities instead of @sys.text to eliminate ambiguity. In your example code, the account number and the account password (if stored in a database) can easily be converted into known entities. Please take a look at this sample project.

Sparklehart
Posts: 5
Joined: Thu May 25, 2017 8:19 am

Re: problems capturing parameters with Oscova

Fri Jun 02, 2017 6:22 am

Ah cool! That expression didn't work well in 2.0.5, but works like a champ in 2.1.4.

Thanks!

Return to “General Discussion”

Who is online

Users browsing this forum: No registered users and 1 guest