Can we use LUIS and Text Analytics API together - azure

i need to develop a chat bot on azure for user interaction i have used LUIS and now want the bot to perform analyze the chat and suggest user the necessary changes. So, should i use text analytic API for it and does LUIS and text analytic API can be used together?

Text analytics can determine sentiments, extract key phrases and detect the language used. If you want to find the intent of the user or extract entities from a text, you can use LUIS.
For "The hotel is the worst ever" a sentiment analysis can tell that the sentiment is negative. For the same sentence key phrase extraction extracts the key words/phrases: "hotel, worst", without any interpretation of the meaning or context.
For "Turn on the yellow light", LUIS can be trained to extract intent (Operate Light) and entities (Action: turn on, Object: Yellow Light) with a meaning and a context.
Text Analytics and LUIS expose separate APIs that just takes texts as input, so they can be used independently of each other. They have no integrations built in between them, so that's up to the consumer to implement.

Related

Azure | Form Recognizer pre selection of documents?

Does Form Recognizer has the ablity to pre-select/pre-diffrentiate documents before they get worked over by the Form Recognizer recognition tool?
E.g. It would be able to diffrentiate between bills or notes and would only use the recognition tool for bills.
As other answers had suggested, you could implement your own classifier. You could call the model, and exam the confidence score of return value, if it's too low, then it's not the document you want to process.
If you want to build 2 models, one for bills, one for notes, each model extract different sets of key/values, then Form Recognize team is working on a feature to find the most appropriate form for you, please stay tuned.
thanks
-xin (from MSFT Form Recognize Team)
Azure Form recognizer is a cognitive service that uses machine learning technology to identify and extract text, key/value pairs and table data from form documents, whether they are PNG, JPEG, TIFF or PDF.
With Form recognizer, You cannot find the type of the document or differentiate document. You need to train any type of form before the extraction of data.
For the purpose of segregation, you have to use some other service/tool. For example, Azure Computer Vision service can be used to find the type of image.
No, that's not a feature from Form Recognizer.
You can implement your own classifier (for images documents) using Custom Vision for example

Virtual Assistant -> LUIS, QnA, Dispatcher best practice

I have some question about some "best practice" for certain issues that we are facing using LUIS, QnA Maker, in particular for the Dispatcher:
1) Is there any best practice in case we have more that 15k utterances in the Dispatcher? That's looks like a limitation of the LUIS apps but the scalability of the model in the long run will be questionable.
2) Bing Spell Check for LUIS changes names and surnames for example, how to avoid this? I guess that Bing Spell Check is necessary when we are talking about ChatBots, since the typo are always behind the door, but using it for names is dangerous.
3) Cross validation is not supported out of the box, you would have split your data to folds with custom code (not difficult), use the command line to train and publish your model on your k-1/k folds, then send the k-fold utterances to the API one-by-one. Batch upload is only supported through the UI https://cognitive.uservoice.com/forums/551524-language-understanding-luis/suggestions/20082157-add-api-to-batch-test-model and is limited to a test set of 1,000 utterances. If we use the one-by-one approach, we pay $1,50 per 1k transactions https://azure.microsoft.com/de-de/pricing/details/cognitive-services/language-understanding-intelligent-services/ and this means to get cross-validation metrics for the 5 folds for example, we could be paying about 20$ for a single experiment with our current data, more if we add more data.
4) Model is a black box, which doesn't give us the ability to use custom features if needed.
I will try to address your concerns in the best possible way I can as follows:
1) As per the LUIS documentation,
Hence, you cannot exceed the limit. In case of Dispatch apps,if the total utterance exceeds 15k, then dispatch will down sample the utterances to keep it under 15k. There is an optional parameter(--doAutoActiveLearning) for CLI to do auto active learning which will down sample intelligently (remove non relevant utterances).
--doAutoActiveLearning: (optional) Default to false. LUIS limit on training-set size is 15000. When a LUIS app has much more utterances for training, Dispatch's auto active learning process can intelligently down sample the utterances.
2) Bing Spell Check helps users to correct misspelled words in utterances before LUIS predicts the score and entities of the utterance. However, if you want to avoid using Bing Spell Check API service, then you will need to add the correct and incorrect spelling which can be done in two ways:
Label example utterances that have the all the different spellings so that LUIS can learn proper spelling as well as typos. This option requires more labeling effort than using a spell checker.
Create a phrase list with all variations of the word. With this solution, you do not need to label the word variations in the example utterances.
3) As per the current documentation, a maximum of 1000 utterances are allowed per test. The data set is a JSON-formatted file containing a maximum of 1,000 labeled non-duplicate utterances. You can test up to 10 data sets in an app. If you need to test more, delete a data set and then add a new one. I would suggest you to report it as a feature request in the feedback forum.
Hope this helps.

Is there anyway to make google assistant's speech recognition better recognise words used in my dialogflow agent?

I am using Dialogflow to create a chatbot that can be used on google assistant. However the speech recognition often mis-recognizes the intended word. Example, when I say the word "seal", it recognizes the spoken word wrongly as "shield".
Is there any way to "train" or make google assistant better recognize a word?
If you have a limited amount of words that you would like to improve upon, then using Dialogflow's entities would be an option. For instance, if you are trying to recognize certain animals. You can create a set of animals as entities and set the intent to look for an animal entity in the user input.
Besides this option I don't know of any other things to improve the speech itself, you could train Dialogflow to map both "seal" and "shield" to your desired intent, but that doesn't change the actual word, it will still be shield.
For any other improvements to the speech recognition, I'm afraid you will have to wait for updates from Google to their algorithms.
Just found out there is a new beta function in dialogflow that should help.
https://cloud.google.com/dialogflow/docs/speech-adaptation
Edit:
However does not work with Actions on google.

Is it possible to use DialogFlow simply to parse text?

Is it possible to use DialogFlow to simply parse some text and return the entities within that text?
I'm not interested in a conversation or bot-like behaviour, simply text in and list of entities out.
The entity recognition seems to be better with DialogFlow than Google Natural Language Processing and the ability to train might be useful also.
Cheers.
I've never considered this... but yeah, it should be possible. You would upload the entities with synonyms. Then, remove the "Default Fallback Intent", and make a new intent, called "catchall". Procedurally generate sentences with examples of every entity being mentioned, alone or in combination (in whatever way you expect to need to extract them). In "Settings", change the "ML Settings" so the "ML Classification Threshold" is 0.
In theory, it should now classify every input as "catchall", and return all the entities it finds...
If you play around with tagging things as sys.any, this could be pretty effective...
However, you may want to look into something that is built for this. I have made cool stuff with Aylien's NLP API. They have entity extraction, and the free tier gives you 1,000 hits per day.
EDIT: If you can run some code, instead of relying on SaaS, you could check out Rasa NLU for Entity Extraction. With a SpaCy backend it would do well on recognizing pre-trained entities, and with a different backend you can use custom entities.

How to pass application specific phrases to google-nlp api?

I'm using Google NLP for executing voice commands in our application.
Scenario:
Input text: "Generate Customer Profitability Report"
Now that 'Customer Profitability' is a single entity from application perspective, Is there a way to pass set of suggestive phrases [in this case 'Customer Profitability'] to NLP api and NLP will treat it as a single phrase and respond ?
This is possible in speech api, where i can pass suggestive phrases.
Any pointers on these lines are much appreciated!

Resources