Rasa NLU never returns fallback intent - rasa-nlu

I was experimenting with the NLU parts of Rasa. In my config.yml I have a Fallback Policy with a 70% threshold.
When I either run a server or try the NLU only shell, I never get a Fallback Intent on the response even if the confidence is way below 70%. It does not make sense for the NLU only mode to use the Fallback policy, so I understand why this might happen.
But I am migrating from Dialogflow, so I would like the NLU response to return a Fallback Intent if the sent message does not fall under any defined intent. How may I do this?
Alternatively, if it is possible to get the NLU data along with the Core's response, that would also work.
N.B: I am using rasa 1.10.3 and rasa-sdk 1.10.1
Here's the config.yml file, I'm mostly using the default settings generated by rasa init,
# Configuration for Rasa NLU.
# https://rasa.com/docs/rasa/nlu/components/
language: en
pipeline:
- name: WhitespaceTokenizer
- name: RegexFeaturizer
- name: LexicalSyntacticFeaturizer
- name: CountVectorsFeaturizer
- name: CountVectorsFeaturizer
analyzer: "char_wb"
min_ngram: 1
max_ngram: 4
- name: DIETClassifier
epochs: 100
- name: EntitySynonymMapper
epochs: 100
# Configuration for Rasa Core.
# https://rasa.com/docs/rasa/core/policies/
policies:
- name: MappingPolicy
- name: "FallbackPolicy"
nlu_threshold: 0.7
core_threshold: 0.7
fallback_action_name: "utter_Default Fallback Intent"

the tracker inside core should have all the information about which intent was triggered with what confidence. So if you are using the capabilities of core as well then you can make use of the tracker. Let me know how that goes.

Related

Set up CloudWatch email alert with Serverless Framwork for errors, invocations, etc

I'm trying to set up email alerts for my Lambda errors. I can update my .yml file to create a new topic and this works OK:
custom:
alerts:
stages:
- production
- dev
- development
dashboards: true
topics:
alarm:
topic: ${self:service}-${sls:stage}-alerts-alarm
notifications:
- protocol: email
endpoint: myemail#domain.com
alarms:
- functionErrors
- functionThrottles
- functionInvocations
- functionDuration
I receive emails as expected.
But when I try to use an existing SNS Topic, by following the SLS docs, nothing seems to happen. I've:
Created a Topic in the SNS console
Updated the .yml as per the docs:
custom:
alerts:
stages:
- production
- dev
- development
topics:
alarm:
topic: arn:aws:sns:${aws:region}:${aws:accountId}:myp-${sls:stage}-alerts
alarms:
- functionErrors
- functionThrottles
- functionInvocations
- functionDuration
The deploy works fine, but I don't get any emails when I trigger errors. What do I need to do?
I got it working, though I don't really know what I'm doing differently.
Successful methodology:
Create a Topic in the SNS console. Click 'Create Topic' after entering the following:
When taken to your new Topic summary screen, click the orange 'Create Subscription' Button. Select 'Email' from the Protocol dropdown. Enter your email address. Click the orange 'Create Subscription' button below:
Deploy Lambda with the command: sls deploy --stage dev and the following code in serverless.yml:
plugins:
- serverless-plugin-aws-alerts
# ... your function code, etc
custom:
alerts:
topics:
alarm:
topic: arn:aws:sns:${aws:region}:${aws:accountId}:myp-${sls:stage}-alerts
alarms:
- functionErrors
- functionThrottles
- functionInvocations
- functionDuration
nameTemplate: $[functionName]-$[metricName]-Alarm
prefixTemplate: $[stackName]
That should get it working. You can trouble shoot by going over to your Cloudwatch Console. Click All Alarms:
You should be able to see that your alarms have been created here, like this:
The names follow the instruction in the above serverless.yml file: nameTemplate: $[functionName]-$[metricName]-Alarm
Click the alarm name and in the top right of the next screen click Actions>Edit:
You can see that the FunctionName refers to your Lambda function:
Scroll down and click the 'Next' button. You can see at the bottom of the Notifications section of the next screen which Topic the Alert is sending to:
It says 'myp-dev-alerts'. So we know that this matches the Topic I created.

Error while creating custom resource trigger for lambda

I created a lambda via ts file with the following specifications:
description: 'Lambda request handler to automate the DDL commands',
name: LAMBDA_NAME,
timeout: Duration.minutes(10),
memorySize: 512,
componentName: 'DdlLambda',
runtime: Runtime.JAVA_11,
handler: 'handler.ddllambda',
packageName: 'DDLManagementLambda-1.0',
deadLetterQueueEnabled: false,
tracing: Tracing.ACTIVE,
profiling: false,
logRetention: RetentionDays.FOUR_MONTHS
Created a custom resource with
import {CustomResource} from "monocdk";
const customResource = new CustomResource(this, 'CustomResource', {
serviceToken: ddllambda.functionArn,
properties: {
version: "version_0"
}
But I am getting the error
CloudFormation did not receive a response from your Custom Resource.
Please check your logs for requestId [c634da01-9c4d-4f8e-a2fc-a28724aa8206].
If you are using the Python cfn-response module, you may need to update your
Lambda function code so that CloudFormation can attach the updated version.
I am not able to find the logs for the given requestId. What am I missing here?
You should use cfn-response.send in your custom resource to notify CloudFormation.
Find logs in the console:
For the logs, you can access them from the console in the lambda page, click Monitor then View logs in CloudWatch:
Once in CloudWatch click Search all:
Then in the search box paste your Request ID in double quotes:
Find logs using aws-cli: See this answer
I was not sending the response back from lambda, hence was getting the error. Referring this code helped https://github.com/stelligent/cloudformation-custom-resources/blob/master/lambda/java/src/main/java/com/stelligent/customresource/CustomResourceHandler.java.

D365 WS-Trust deprecation - Microsoft.Xrm.Client

I have a legacy application connected to cloud d365 that uses:
XrmServiceContext : Microsoft.Xrm.Client.CrmOrganizationServiceContext
from Microsoft.Xrm.Client namespace. It was downloaded from there back then. The connetion string looks like this:
"Url=https://org.api.crm4.dynamics.com/XRMServices/2011/Organization.svc;Username=unm;Password=pwd"
is the code affected by WS-Trust deprecation announced by MSFT?
Yes, definitely. You should switch to the following pattern:
targetString = string.Format("AuthType=OAuth;Username={0}; Password={1};Url={2};AppId=51f81489-12ee-4a9e-aaae-a2591f45987d; RedirectUri=app://58145B91-0C36-4500-8554-080854F2AC97;LoginPrompt=Disabled;RequireNewInstance=true", CRMUsername, CRMPassword, CRMAddress);
ServicePointManager.SecurityProtocol = SecurityProtocolType.Tls12;
Note that those are the "default" AppId and RedirectURI and that in production environments you should register your app and use production values.

Filter AWS resources using regex in aws-sdk-go

So I have some different types of aws resources tagged as xxx/yyy/<generated_id>. I need to fetch them using go-sdk.
Here is a sample code for subnets, the filters look the same for every other resource.
This doesn't work.
var resp *ec2.DescribeSubnetsOutput
resp, err = d.ec2Client().DescribeSubnets(&ec2.DescribeSubnetsInput{
Filters: []*ec2.Filter{
{
Name: aws.String("vpc-id"),
Values: []*string{&d.VpcId},
},
{
Name: aws.String(fmt.Sprintf(`tag:"xxx/yyy.[*]"`),
Values: []*string{aws.String("owned")},
},
},
})
This does:
aws ec2 describe-subnets --filters `Name=tag:"xxx/yyy.[*]",Values=owned`
I'm obviously doing something wrong, can someone point out what?
There is nothing in the API documentation to suggest that DescribeSubnets accepts a regular expression in filter names: https://docs.aws.amazon.com/AWSEC2/latest/APIReference/API_DescribeSubnets.html
If it works in the CLI, that's likely something the CLI is doing on top of what the SDK offers. The Go SDK is like any other AWS SDK; it exposes the AWS API in a language-specific way. The AWS CLI adds convenience features on top of the API to make it more useful on the command line, but that doesn't mean those features are exposed by the API or any published SDK.
I stepped with this problem recently, my issue was the version of the sdk I was using;
Filters: [ ]*ec2.Filter{
is for v1 sdk mod and it was not working as I was importing github.com/aws/aws-sdk-go-v2/aws, while
Filters: [ ]types.Filter{
is for v2 and this one worked in my case.
https://aws.amazon.com/blogs/developer/aws-sdk-for-go-version-2-general-availability/

Alfresco 5.0 Community unable to create folders within share

I am trying to deploy Alfresco Community 5.0 on Windows Server 2012 R2, with IIS 8 and I have run into a little bit of a pickle. Currently, everything seems to be functioning as expected except for the creation of folders. I can add files and users, so I'm not really sure where to start.
When I try to create a new folder within the share site I am prompted with "Could not create 'new folder'. Duplicate folder name?" and I am entering a random name.
I checked the alfresco.log file and there is nothing in there.
If you need any extra information let me know.
IIS threw this exception.
Event code: 3005
Event message: An unhandled exception has occurred.
Event time: 3/10/2015 9:13:17 AM
Event time (UTC): 3/10/2015 3:13:17 PM
Event ID: 2a27fe7511504646bdc5cf85b4f428c1
Event sequence: 90
Event occurrence: 5
Event detail code: 0
Application information:
Application domain: /LM/W3SVC/1/ROOT-1-130704715600439291
Trust level: Full
Application Virtual Path: /
Application Path: C:\inetpub\wwwroot\
Machine name: WEDNESDAY
Process information:
Process ID: 3352
Process name: w3wp.exe
Account name: IIS APPPOOL\DefaultAppPool
Exception information:
Exception type: HttpException
Exception message: A potentially dangerous Request.Path value was detected from the client (:).
at System.Web.HttpRequest.ValidateInputIfRequiredByConfig()
at System.Web.HttpApplication.PipelineStepManager.ValidateHelper(HttpContext context)
Request information:
Request URL: http://wednesday/share/proxy/alfresco/api/type/cm:folder/formprocessor
Request path: /share/proxy/alfresco/api/type/cm:folder/formprocessor
User host address: 10.000.00.00
User:
Is authenticated: False
Authentication Type:
Thread account name: IIS APPPOOL\DefaultAppPool
Thread information:
Thread ID: 8
Thread account name: IIS APPPOOL\DefaultAppPool
Is impersonating: False
Stack trace: at System.Web.HttpRequest.ValidateInputIfRequiredByConfig()
at System.Web.HttpApplication.PipelineStepManager.ValidateHelper(HttpContext context)
asp.net 4.0 has quite extensive url validation. When Alfresco creates a folder it uses alfresco/api/type/cm:folder/formprocessor as the url. The validation rejects the use of : in url's so I added a regex function within my asp.net web.config file.
system.web>
httpRuntime requestPathInvalidCharacters="<,>,%,&,\,?" />
/system.web>
All of the other special characters are still getting validated, but I did not include ":" so now the url is allowed through.

Resources