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
!pip install azure-ai-formrecognizer | |
!pip install azure-storage-blob | |
def train_model(form_training_client, container_sas_url, container_name): | |
poller = form_training_client.begin_training( | |
container_sas_url, use_training_labels=True, model_name=container_name | |
) | |
model = poller.result() |
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
For this scenario we are going to extend the [km-aml solution accelerator](https://github.com/microsoft/solution-accelerator-km-aml) to use a custom corpus. The goal is to start with corpus of data. | |
1. Skim through the documents to identify a set of entities that should be recognized | |
2. Create a list of entities | |
3. Create a enrichment pipeline with a skill that takes in the list of entities and labels the text with IOB tags | |
4. Train a custom entity classifier on this labeled dataset | |
5. Update the enrichment pipeline to use the newly minted entity classifier | |
6. Reprocess the documents to now identify the labeled entities and other similar entities |
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
{ | |
"apiVersion": "2016-04-01", | |
"type": "Microsoft.Cache/Redis", | |
"name": "andersencache", | |
"location": "centralus", | |
"properties": { | |
"sku": { | |
"name": "Basic", | |
"family": "C", |
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
Recently I was asked the question on how to be notified when your Azure Function pushes a message into a poison queue as a result of execution errors. My approach to the problem is a little different and I thought I'd share it here. If you've got an alternate solution, please do share and lets keep the conversation going. | |
In general rather than rely on the Azure Functions runtime to write the message to a poison queue, I'm checking the dequeue count of the message and at the 5th attempt, I'm ensurig a successful completion by just writing the message out to a queue I use for exception processing. The documentation (https://docs.microsoft.com/en-us/azure/azure-functions/functions-bindings-storage) has more information on the dequeueCount and other attributes. Aagin this is not a substitute for a Try-Catch but just an additional precaution. | |
Here's an example C# Azure Function where I simply try to convert the message content to an int with no exception handling, if the message is a string, I'll endup with the |