diff --git a/docs/Explore Algorithms/AI Services/Advanced Usage - Async, Batching, and Multi-Key.ipynb b/docs/Explore Algorithms/AI Services/Advanced Usage - Async, Batching, and Multi-Key.ipynb index b990472430..4bbeef3e58 100644 --- a/docs/Explore Algorithms/AI Services/Advanced Usage - Async, Batching, and Multi-Key.ipynb +++ b/docs/Explore Algorithms/AI Services/Advanced Usage - Async, Batching, and Multi-Key.ipynb @@ -301,7 +301,7 @@ }, "outputs": [], "source": [ - "from synapse.ml.services.text import TextSentiment\n", + "from synapse.ml.services.language import AnalyzeText\n", "\n", "# Create a dataframe\n", "text_df = spark.createDataFrame(\n", @@ -314,7 +314,8 @@ ")\n", "\n", "sentiment = (\n", - " TextSentiment()\n", + " AnalyzeText()\n", + " .setKind(\"SentimentAnalysis\")\n", " .setTextCol(\"text\")\n", " .setLocation(service_loc)\n", " .setSubscriptionKey(service_key)\n", @@ -324,7 +325,7 @@ ")\n", "\n", "# Show the results of your text query\n", - "display(sentiment.transform(text_df).select(\"text\", \"sentiment.document.sentiment\"))" + "display(sentiment.transform(text_df).select(\"text\", \"sentiment.documents.sentiment\"))" ] }, { @@ -356,7 +357,6 @@ }, "outputs": [], "source": [ - "from synapse.ml.services.text import TextSentiment\n", "from pyspark.sql.functions import udf\n", "import random\n", "\n", diff --git a/docs/Explore Algorithms/AI Services/Overview.ipynb b/docs/Explore Algorithms/AI Services/Overview.ipynb index 811a3c49af..c03a77ace5 100644 --- a/docs/Explore Algorithms/AI Services/Overview.ipynb +++ b/docs/Explore Algorithms/AI Services/Overview.ipynb @@ -61,7 +61,7 @@ "\n", "\n", "### Language\n", - "[**Text Analytics**](https://azure.microsoft.com/services/cognitive-services/text-analytics/)\n", + "[**AI Language**](https://azure.microsoft.com/products/ai-services/ai-language)\n", "- Language detection: detects language of the input text ([Scala](https://mmlspark.blob.core.windows.net/docs/1.0.1/scala/com/microsoft/azure/synapse/ml/services/text/LanguageDetector.html), [Python](https://mmlspark.blob.core.windows.net/docs/1.0.1/pyspark/synapse.ml.services.text.html#module-synapse.ml.services.text.LanguageDetector))\n", "- Key phrase extraction: identifies the key talking points in the input text ([Scala](https://mmlspark.blob.core.windows.net/docs/1.0.1/scala/com/microsoft/azure/synapse/ml/services/text/KeyPhraseExtractor.html), [Python](https://mmlspark.blob.core.windows.net/docs/1.0.1/pyspark/synapse.ml.services.text.html#module-synapse.ml.services.text.KeyPhraseExtractor))\n", "- Named entity recognition: identifies known entities and general named entities in the input text ([Scala](https://mmlspark.blob.core.windows.net/docs/1.0.1/scala/com/microsoft/azure/synapse/ml/services/text/NER.html), [Python](https://mmlspark.blob.core.windows.net/docs/1.0.1/pyspark/synapse.ml.services.text.html#module-synapse.ml.services.text.NER))\n", @@ -194,7 +194,7 @@ "source": [ "## Perform sentiment analysis on text\n", "\n", - "The [Text Analytics](https://azure.microsoft.com/services/ai-services/text-analytics/) service provides several algorithms for extracting intelligent insights from text. For example, we can find the sentiment of given input text. The service will return a score between 0.0 and 1.0 where low scores indicate negative sentiment and high score indicates positive sentiment. This sample uses three simple sentences and returns the sentiment for each." + "The [AI Language](https://azure.microsoft.com/products/ai-services/ai-language/) service provides several algorithms for extracting intelligent insights from text. For example, we can find the sentiment of given input text. The service will return a score between 0.0 and 1.0 where low scores indicate negative sentiment and high score indicates positive sentiment. This sample uses three simple sentences and returns the sentiment for each." ] }, { @@ -215,7 +215,8 @@ "\n", "# Run the Text Analytics service with options\n", "sentiment = (\n", - " TextSentiment()\n", + " AnalyzeText()\n", + " .setKind(\"SentimentAnalysis\")\n", " .setTextCol(\"text\")\n", " .setLocation(service_loc)\n", " .setSubscriptionKey(service_key)\n", @@ -227,7 +228,7 @@ "# Show the results of your text query in a table format\n", "display(\n", " sentiment.transform(df).select(\n", - " \"text\", col(\"sentiment.document.sentiment\").alias(\"sentiment\")\n", + " \"text\", col(\"sentiment.documents.sentiment\").alias(\"sentiment\")\n", " )\n", ")" ] diff --git a/docs/Get Started/Quickstart - Your First Models.ipynb b/docs/Get Started/Quickstart - Your First Models.ipynb index bacd970b17..38f9a0ad63 100644 --- a/docs/Get Started/Quickstart - Your First Models.ipynb +++ b/docs/Get Started/Quickstart - Your First Models.ipynb @@ -147,25 +147,16 @@ { "cell_type": "code", "execution_count": null, - "metadata": { - "application/vnd.databricks.v1+cell": { - "inputWidgets": {}, - "nuid": "f22b1c1a-b0c9-43e9-bcb0-b29624b4a76a", - "showTitle": false, - "title": "" - }, - "pycharm": { - "name": "#%%\n" - } - }, + "metadata": {}, "outputs": [], "source": [ - "from synapse.ml.services.text import TextSentiment\n", + "from synapse.ml.services.language import AnalyzeText\n", "from synapse.ml.core.platform import find_secret\n", "\n", - "model = TextSentiment(\n", + "model = AnalyzeText(\n", " textCol=\"text\",\n", " outputCol=\"sentiment\",\n", + " kind=\"SentimentAnalysis\",\n", " subscriptionKey=find_secret(\n", " secret_name=\"ai-services-api-key\", keyvault=\"mmlspark-build-keys\"\n", " ), # Replace the call to find_secret with your key as a python string.\n",