You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: articles/search/search-synapseml-cognitive-services.md
+22-18Lines changed: 22 additions & 18 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -10,7 +10,7 @@ ms.service: azure-ai-search
10
10
ms.custom:
11
11
- ignite-2023
12
12
ms.topic: tutorial
13
-
ms.date: 04/22/2024
13
+
ms.date: 01/30/2025
14
14
---
15
15
16
16
# Tutorial: Index large data from Apache Spark using SynapseML and Azure AI Search
@@ -24,7 +24,7 @@ In this Azure AI Search tutorial, learn how to index and query large data loaded
24
24
> + Write the output to a search index hosted in Azure AI Search
25
25
> + Explore and query over the content you created
26
26
27
-
This tutorial takes a dependency on [SynapseML](https://www.microsoft.com/research/blog/synapseml-a-simple-multilingual-and-massively-parallel-machine-learning-library/), an open source library that supports massively parallel machine learning over big data. In SynapseML, search indexing and machine learning are exposed through *transformers* that perform specialized tasks. Transformers tap into a wide range of AI capabilities. In this exercise, use the **AzureSearchWriter** APIs for analysis and AI enrichment.
27
+
This tutorial takes a dependency on [SynapseML](https://microsoft.github.io/SynapseML/), an open source library that supports massively parallel machine learning over big data. In SynapseML, search indexing and machine learning are exposed through *transformers* that perform specialized tasks. Transformers tap into a wide range of AI capabilities. In this exercise, use the **AzureSearchWriter** APIs for analysis and AI enrichment.
28
28
29
29
Although Azure AI Search has native [AI enrichment](cognitive-search-concept-intro.md), this tutorial shows you how to access AI capabilities outside of Azure AI Search. By using SynapseML instead of indexers or skills, you're not subject to data limits or other constraints associated with those objects.
30
30
@@ -35,18 +35,18 @@ Although Azure AI Search has native [AI enrichment](cognitive-search-concept-int
35
35
36
36
You need the `synapseml` library and several Azure resources. If possible, use the same subscription and region for your Azure resources and put everything into one resource group for simple cleanup later. The following links are for portal installs. The sample data is imported from a public site.
+[Azure AI Search](search-create-service-portal.md) (any tier), with an **API Kind** of `AIServices` <sup>2</sup>
40
+
+[Azure AI multi-service account](/azure/ai-services/multi-service-resource?pivots=azportal) (any tier) <sup>3</sup>
41
+
+[Azure Databricks](/azure/databricks/scenarios/quickstart-create-databricks-workspace-portal?tabs=azure-portal) (any tier) with Apache Spark 3.3.0 runtime<sup>4</sup>
42
42
43
43
<sup>1</sup> This link resolves to a tutorial for loading the package.
44
44
45
45
<sup>2</sup> You can use the free search tier to index the sample data, but [choose a higher tier](search-sku-tier.md) if your data volumes are large. For billable tiers, provide the [search API key](search-security-api-keys.md#find-existing-keys) in the [Set up dependencies](#step-2-set-up-dependencies) step further on.
46
46
47
-
<sup>3</sup> This tutorial uses Azure AI Document Intelligence and Azure AI Translator. In the instructions that follow, provide a [multi-service](/azure/ai-services/multi-service-resource?pivots=azportal) key and the region. The same key works for both services.
47
+
<sup>3</sup> This tutorial uses Azure AI Document Intelligence and Azure AI Translator. In the instructions that follow, provide a [multi-service account](/azure/ai-services/multi-service-resource?pivots=azportal) key and the region. The same key works for both services. **It's important that you use an Azure AI multiservice account of API kind of `AIServices` for this tutorial**. You can check the API kind in the Azure portal on the Overview section of your Azure AI multiservice account page. For more information about API kind, see [Attach an Azure AI multi-service resource in Azure AI Search](cognitive-search-attach-cognitive-services.md).
48
48
49
-
<sup>4</sup> In this tutorial, Azure Databricks provides the Spark computing platform. We used the [portal instructions](/azure/databricks/scenarios/quickstart-create-databricks-workspace-portal?tabs=azure-portal) to set up the workspace.
49
+
<sup>4</sup> In this tutorial, Azure Databricks provides the Spark computing platform. We used the [portal instructions](/azure/databricks/scenarios/quickstart-create-databricks-workspace-portal?tabs=azure-portal) to set up the cluster and workspace.
50
50
51
51
> [!NOTE]
52
52
> All of the above Azure resources support security features in the Microsoft Identity platform. For simplicity, this tutorial assumes key-based authentication, using endpoints and keys copied from the Azure portal pages of each service. If you implement this workflow in a production environment, or share the solution with others, remember to replace hard-coded keys with integrated security or encrypted keys.
@@ -63,6 +63,10 @@ In this section, create a cluster, install the `synapseml` library, and create a
63
63
64
64
1. Accept the default configuration. It takes several minutes to create the cluster.
65
65
66
+
1. Verify the cluster is operational and running. A green dot by the cluster name confirms its status.
67
+
68
+
:::image type="content" source="media/search-synapseml-cognitive-services/cluster-green-dot.png" alt-text="Screenshot of a Data Bricks compute page with a green dot by the cluster name.":::
69
+
66
70
1. Install the `synapseml` library after the cluster is created:
67
71
68
72
1. Select **Libraries** from the tabs at the top of the cluster's page.
@@ -73,7 +77,7 @@ In this section, create a cluster, install the `synapseml` library, and create a
73
77
74
78
1. Select **Maven**.
75
79
76
-
1. In Coordinates, enter `com.microsoft.azure:synapseml_2.12:1.0.4`
80
+
1. In Coordinates, search for or type `com.microsoft.azure:synapseml_2.12:1.0.9`
77
81
78
82
1. Select **Install**.
79
83
@@ -85,15 +89,15 @@ In this section, create a cluster, install the `synapseml` library, and create a
85
89
86
90
1. Give the notebook a name, select **Python** as the default language, and select the cluster that has the `synapseml` library.
87
91
88
-
1. Create seven consecutive cells. Paste code into each one.
92
+
1. Create seven consecutive cells. You use these to paste in code in the following sections.
89
93
90
94
:::image type="content" source="media/search-synapseml-cognitive-services/create-seven-cells.png" alt-text="Screenshot of the notebook with placeholder cells." border="true":::
91
95
92
96
## Step 2: Set up dependencies
93
97
94
98
Paste the following code into the first cell of your notebook.
95
99
96
-
Replace the placeholders with endpoints and access keys for each resource. Provide a name for a new search index. No other modifications are required, so run the code when you're ready.
100
+
Replace the placeholders with endpoints and access keys for each resource. Provide a name for a new search index that's created for you. No other modifications are required, so run the code when you're ready.
97
101
98
102
This code imports multiple packages and sets up access to the Azure resources used in this workflow.
Paste the following code into the third cell. No modifications are required, so run the code when you're ready.
143
147
144
-
This code loads the [AnalyzeInvoices transformer](https://mmlspark.blob.core.windows.net/docs/0.11.2/pyspark/synapse.ml.cognitive.form.html#module-synapse.ml.cognitive.form.AnalyzeInvoices) and passes a reference to the data frame containing the invoices. It calls the prebuilt [invoice model](/azure/ai-services/document-intelligence/concept-invoice) of Azure AI Document Intelligence to extract information from the invoices.
148
+
This code loads the [AnalyzeInvoices transformer](https://mmlspark.blob.core.windows.net/docs/1.0.9/pyspark/synapse.ml.services.form.html#module-synapse.ml.services.form.AnalyzeInvoices) and passes a reference to the data frame containing the invoices. It calls the prebuilt [invoice model](/azure/ai-services/document-intelligence/concept-invoice) of Azure AI Document Intelligence to extract information from the invoices.
0 commit comments