-
Notifications
You must be signed in to change notification settings - Fork 254
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
update documentation for 4.7.0 release.
- Loading branch information
Bob Potterveld
committed
Jun 6, 2021
1 parent
941ac35
commit e5ad7da
Showing
59 changed files
with
341 additions
and
3,172 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,53 @@ | ||
# New Connect Callback Example | ||
|
||
New example demonstrating how QnABot can be asked by a user for a live agent based phone callback. The | ||
implementation provides a new LambdaHook example as well as four sample questions that ask a user for | ||
their name and phone number prior to handing off to an Amazon Connect instance to initiate the callback. | ||
|
||
**Two configuration updates are required to use this example with Amazon Connect.** | ||
|
||
The IAM Role/Policy used by the ConnectCallback Lambda must include a new policy that allows | ||
the action "connect:StartOutboundVoiceContact" to be used with the resource | ||
`"arn:aws:connect:*:*:instance/<YourConnectInstanceId>/*"`. The following is an example of this policy | ||
|
||
```json | ||
{ | ||
"Version": "2012-10-17", | ||
"Statement": [ | ||
{ | ||
"Sid": "VisualEditor0", | ||
"Effect": "Allow", | ||
"Action": "connect:StartOutboundVoiceContact", | ||
"Resource": "arn:aws:connect:*:*:instance/<YourConnectInstanceId>/*" | ||
} | ||
] | ||
} | ||
``` | ||
|
||
1) Find the Lambda ConnectCallback Function in the AWS Lambda Console | ||
2) Open the AWS Console and select the Lambda Service | ||
3) In the Console's filter enter 'ConnectCallback' and press enter | ||
4) The displayed function will start with `<stackname>-ExamplePYTHONLambdaConne...` If you have multiple QnABot stacks | ||
installed you'll see multiple functions listed | ||
5) Open the Lambda function by clicking on the function | ||
6) Select the Permissions tab | ||
7) Click on the Role name to open this Role in a new tab | ||
8) Click on + Add inline policy | ||
9) Select the JSON tab | ||
10) Copy the sample text above, paste as JSON, and change `<YourConnectInstanceId>` to the Instance ID identified in the Connect Console. | ||
11) Click on Review policy | ||
12) Enter a name for the policy and click Create policy | ||
|
||
You've now enabled Lambda functions using this role to start outbound calls via the connect instance | ||
|
||
Lambda Hook Arguments need to be updated. Before being used, the item with qid CONNECT_TO_AGENT.04 | ||
should have its Arguments field adjusted to reflect identifiers from the Connect instance: | ||
|
||
```bash | ||
"AWS_connect_instance_id": "<your-connect-instance-id >", | ||
"AWS_connect_contact_flow_id": "<your-connect-contact-flow-id>", | ||
"AWS_connect_queue_id": "<your-connect-queue-id>", | ||
``` | ||
|
||
Once these configuration changes are in place, QnABot can be successfully use Amazon Connect to place | ||
outbound calls. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,105 @@ | ||
# MultiLanguage Support | ||
|
||
QnABot version 2.6.0 supports use of multiple languages with these limitations: | ||
|
||
- MultiLanguage support for voice is limited to use with Alexa skills only. (Amazon Lex currently supports voice recognition in English only) | ||
- MutiLanguage support for text is available via all text clients (e.g. Lex Web UI, SMS, etc.) | ||
|
||
####Lex (text mode only): | ||
|
||
If the user enters a question in a language other than english, QnABot will attempt to return an answer in the other language. | ||
It does this by using Amazon Comprehend to identify the language typed. If Comprehend can identify the language based on a configured minimum confidence, | ||
QnABot will serve up content based on that locale. | ||
|
||
Users can also set a preferred language whereby QnABot will always attempt to respond with content in the chosen | ||
locale. If the user sets the preferred language to be Spanish, QnABot will always try and serve up content using | ||
Spanish when possible. | ||
|
||
## Alexa (voice) | ||
|
||
You will need to add each language you want to use to your QnABot skill using the Alexa Developer console. The intent schema for each | ||
language will be identical except for the skill invocation name. Give the skill a unique invocation name for each language that you add. | ||
|
||
QnABot will use the language setting provided by Alexa, and will attempt to respond in that language. | ||
|
||
## How it works | ||
|
||
QnABot converts the question posed by the user to English, using Amazon Translate, and performs a lookup of the answer in Elastic Search | ||
just as it normally does, using the English translation of the question. ElasticSearch searches are done in English only since QnABot documents | ||
are indexed using the English text analyzer (stemming, stop words, etc.) | ||
|
||
To ensure good matching of translated questions, you can use the Amazon Translate console to see the English translation of your local language question. Use QnABot content designer | ||
to ensure your QnA item has the right sample questions to ensure a match. | ||
|
||
Once it finds the question, QnABot will serve up the configured answer. | ||
|
||
You can use Handlebar blocks to define explicit answers in each different language you want to support. OR, if you do not | ||
explicitly define an answer in the user's language, QnABot will automatically use Amazon Translate to convert the default English. | ||
answer to the target language. | ||
|
||
## Configuration | ||
|
||
By default this feature is disabled. Use the following three steps to enable and configure this feature. Step 1 enables the feature. Step 2 loads in two questions from this extension that allow the user to select a preferred language. The defaults supplied in this question are English, Spanish, French, German, and Italian. You can extend this list to | ||
support other languages. | ||
|
||
Step 1) Enable multi language support | ||
|
||
a) QnABot uses a property named ENABLE_MULTI_LANGUAGE_SUPPORT, default value of "false". | ||
You can change this setting using the Content Designer Settings page. Set it to "true" to enable multi language support. | ||
|
||
Step 2) Use the Designer UI to import the Sample/Extension named Language / Multiple Language Support. | ||
|
||
This will add two questions to the system: Language.000 and Language.001. When using Lex text clients, these questions will allow you to set your preferred language. | ||
The preferred language, if set, will take precedence over | ||
the auto detected language. | ||
|
||
_When using Alexa, the language is automatically set by the skill. You will not be able to override the preferred language when using Alexa._ | ||
|
||
Language.000 provides a question that allows the user to set the current sessions preferred output saying a simple word | ||
such as French, German, or Spanish, or Italian. | ||
|
||
Language.001 resets the preferred language. This can be performed by saying or typing 'reset language' or 'detect language'. | ||
You can also input using your language of choice assuming AWS Translate can translate the input back to English. | ||
|
||
Once you've imported this extension question try typing the question 'Spanish'. You should see a Spanish response. | ||
|
||
Next enter 'English' and you will have switched your preference back to English. | ||
|
||
Next enter 'reset language' and your preference will be reset and language auto detection will occur again. | ||
|
||
The answer for Language.000 uses the following handlebar syntax | ||
|
||
```handlebars | ||
{{#setLang 'fr' false}} D'accord. J'ai défini votre langue préférée sur l'anglais. {{/setLang}} | ||
{{#setLang 'es' false}} Okay. He configurado tu idioma preferido al inglés. {{/setLang}} | ||
{{#setLang 'de' false}} In Ordnung. Ich habe Ihre bevorzugte Sprache auf Englisch eingestellt. {{/setLang}} | ||
{{#setLang 'it' false}} Ok. Ho impostato la tua lingua preferita sull'inglese.{{/setLang}} | ||
{{#setLang 'en' true}} Ok. I've set your preferred language to English. {{/setLang}} | ||
``` | ||
|
||
The helper function setLang performs the necessary processing to set the preferred language/locale for the session. To | ||
add support for other languages just extend the answer in Language.000 with additional locales. | ||
|
||
Step 3) In order to serve up content that is locale specific you can | ||
|
||
- allow QnABot to automatically translate your english answers to the session language using Amazon Translate. | ||
- OR provide explicitly curated answers in QnA items, in multiple languages, using handlebars, as shown below. | ||
|
||
Lets modify the question sun.1. The following would be an example where the handlebar function ifLang is used to specify a response for Spanish. | ||
|
||
Use the handlebar template defaultLang to specify the response QnABot should provide when the language is unknown. By | ||
default this is typically in English but could be in any language as needed. | ||
|
||
`{{#defaultLant}}{{/defaultLang}}` must be the last element in the answer block. | ||
|
||
```handlebars | ||
{{#ifLang 'es'}} | ||
Nuestro sol tiene 4.600 millones de años. Se considera una enana amarilla con un diámetro de 1,392,684 kilómetros y una circunferencia de 4,370,005 kilómetros. Tiene una masa que es igual a 333,060 tierras y una temperatura superficial de 5,500 grados centígrados. ¡Muy caliente! | ||
{{/ifLang}} | ||
{{#defaultLang}} | ||
Our sun is 4.6 billion years old. Its considered a yellow dwarf with a diameter of 1,392,684 kilometers and a circumference of 4,370,005 kilometers. It has a mass that is equal to 333,060 earths and a surface temperature of 5,500 degrees celsius. Really Hot! | ||
{{/defaultLang}} | ||
``` | ||
|
||
The handlebar function ifLang takes locale as a quoted parameter. This tells QnABot which locale to associate with the subsequent | ||
text. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
# Overview | ||
|
||
Chatbots are a great way to make information available for your users. With QnABot you can deploy a chatbot in just a few steps and have a fully functional chat experience setup in under an hour. | ||
|
||
|
||
Once the solution is deployed, you have a QnABot designer console where you can build and manage your question and answer bank. The question and answer bank become your knowledge base and the main source of information for QnABot to interact with to provide users' with relevant answers. | ||
|
||
## Solution architecture and how It works | ||
|
||
Three key AWS services are at the core of the solution: | ||
|
||
- **Amazon Lex** is a service for building conversational interfaces into any application using voice and text. Amazon Lex provides the advanced deep learning functionalities of automatic speech recognition (ASR) for converting speech to text, and natural language understanding (NLU) to recognize the intent of the text to enable you to build applications with highly engaging user experiences and lifelike conversational interactions. | ||
- **Amazon ElasticSearch** is an open-source search and analytics engine for use cases such as log analytics, real-time application monitoring, and clickstream analysis. Amazon ElasticSearch is a managed service that makes it simple to deploy, operate, and scale Elasticsearch clusters in the AWS Cloud. The service offers open-source Amazon ElasticSearch APIs, managed Kibana, and integrations with Logstash and other AWS services, enabling you to securely ingest data from any source and search, analyze, and visualize it in real time. | ||
- **Amazon Kendra** is an intelligent search service powered by machine learning. Kendra reimagines enterprise search for your websites and applications so your employees and customers can easily find the content they are looking for, even when it’s scattered across multiple locations and content repositories within your organization. | ||
|
||
Let's take a closer look at these three services and how they help power | ||
the QnABot solution. | ||
|
||
![Solution architecture and data flow](image2.png) | ||
|
||
When you ask QnABot a question, a few things happen: | ||
|
||
1. The question gets processed and transcribed by Amazon Lex using a Natural Language Understanding (NLU) and Processing (NLP) engine. | ||
- QnABot initially trains the NLP to match a wide variety of possible questions and statements, so that the Amazon Lex bot can accept just about any question a user might ask. The Amazon Lex interaction model is setup with: | ||
- **Intents**: An intent represents an action that fulfills a user's spoken request. Intents can optionally have arguments called **slots**. The QnABot uses **slots** to capture user input and fulfills the Intent via Lambda function. | ||
- **Sample utterances**: A set of likely spoken phrases mapped to the intents. This should include as many representative phrases as possible. The sample utterances specify the words and phrases users can say to invoke your intents. QnABot updates the **Sample utterances** with the various questions to train the chatbot to understand different user input | ||
2. The Bot fulfillment Lambda function generates an ElasticSearch query containing the transcribed question. The query attempts to find the best match from all the questions and answers you’ve previously provided. | ||
3. This request is then sent to Amazon ElasticSearch. QnABot attempts to match a user's question to the list of questions and answers (created in the QnABot content designer) stored in Amazon ElasticSearch. | ||
4. (Optional) If an answer is not found in ElasticSearch and Amazon Kendra is configured, QnABot will search documents or web pages in your Kendra index. | ||
|
||
## Monitoring Usage | ||
|
||
![Kibana Dashboard](image9.png) | ||
|
||
QnABot includes a visualization tool (using Kibana) to analyze QnABot usage. Kibana is an open-source data visualization and exploration tool used for log and time-series analytics, application monitoring, and operational intelligence use cases. It offers powerful and easy-to-use features such as histograms, line graphs, pie charts, heat maps, and built-in geospatial support. Also, it provides tight integration with Elasticsearch, which makes Kibana the default choice for visualizing data stored in Elasticsearch. | ||
|
||
The Kibana dashboard can be used to view usage history, logged utterances, no hits utterances, positive user feedback, and negative user feedback and also provides the ability to create custom reports. |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
# Optional Redact feature for log and metric output | ||
|
||
QnABot can be configured to redact information written to CloudWatch logs, S3 metrics, and Kibana metrics logs. | ||
This feature is disabled by default. Use the Designer UI Settings form to enable this feature. One can configure | ||
the RegEx applied to strings as they are logged. If RegEx matches are found, the match is replaced with the string | ||
'XXXXXX'. | ||
|
||
The initial RegEx is | ||
|
||
```regex | ||
\b\d{4}\b(?![-])|\b\d{9}\b|\b\d{3}-\d{2}-\d{4}\b | ||
``` | ||
|
||
This replaces 4 digit numbers not followed by a hyphen, a 9 digit number (SSN without hyphens), and a typical | ||
SSN using nnn-nn-nnnn syntax with hyphens. |
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.