Explore text analytics Learn Module giving errors

Lawrence Magee 0 Reputation points
2023-05-09T09:22:38.8433333+00:00

I am working on the Explore text analytics Lab in Learn and I was following the numbers: Create a Cognitive Services resource

Run Cloud Shell

Configure and run a client application

It should be reviewing a block of text and output sentiment scores

However when I ran ./analyze-text.ps1 review1.txt, which was given to me from the Lab exercise i got this error: help me Obi-wan, you're my only hope.

PS /home/lawrence/ai-900> ./analyze-text.ps1 review1.txt
***Detecting Language***                                                                                                
Invoke-RestMethod: /home/lawrence/ai-900/analyze-text.ps1:30
Line |
  30 |  $result = Invoke-RestMethod -Method Post `
     |            ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
     | Name or service not known
ConvertFrom-Json: /home/lawrence/ai-900/analyze-text.ps1:35
Line |
  35 |  $analysis = ($result | ConvertFrom-Json)
     |                         ~~~~~~~~~~~~~~~~
     | Cannot bind argument to parameter 'InputObject' because it is null.
  - Language: 
  - Code: 
  - Score: 


***Finding Key Phrases***
Invoke-RestMethod: /home/lawrence/ai-900/analyze-text.ps1:54
Line |
  54 |  $result = Invoke-RestMethod -Method Post `
     |            ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
     | Name or service not known
ConvertFrom-Json: /home/lawrence/ai-900/analyze-text.ps1:59
Line |
  59 |  $analysis = ($result | ConvertFrom-Json)
     |                         ~~~~~~~~~~~~~~~~
     | Cannot bind argument to parameter 'InputObject' because it is null.
  - Key Phrases: 


***Analyzing Sentiment***
Invoke-RestMethod: /home/lawrence/ai-900/analyze-text.ps1:80
Line |
  80 |  $result = Invoke-RestMethod -Method Post `
     |            ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
     | Name or service not known
ConvertFrom-Json: /home/lawrence/ai-900/analyze-text.ps1:85
Line |
  85 |  $analysis = ($result | ConvertFrom-Json)
     |                         ~~~~~~~~~~~~~~~~
     | Cannot bind argument to parameter 'InputObject' because it is null.
  - A  sentiment based on these scores:
    - Positive: 
    - Neutral: 
    - Negative: 


***Identifying known entities***
Invoke-RestMethod: /home/lawrence/ai-900/analyze-text.ps1:106
Line |
 106 |  $result = Invoke-RestMethod -Method Post `
     |            ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
     | Name or service not known
ConvertFrom-Json: /home/lawrence/ai-900/analyze-text.ps1:111
Line |
 111 |  $analysis = ($result | ConvertFrom-Json)
     |                         ~~~~~~~~~~~~~~~~
     | Cannot bind argument to parameter 'InputObject' because it is null.
InvalidOperation: /home/lawrence/ai-900/analyze-text.ps1:113
Line |
 113 |  $entities = $analysis.documents[0].entities
     |  ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
     | Cannot index into a null array.
Azure AI Search
Azure AI Search
An Azure search service with built-in artificial intelligence capabilities that enrich information to help identify and explore relevant content at scale.
720 questions
Azure AI Language
Azure AI Language
An Azure service that provides natural language capabilities including sentiment analysis, entity extraction, and automated question answering.
358 questions
Azure AI services
Azure AI services
A group of Azure services, SDKs, and APIs designed to make apps more intelligent, engaging, and discoverable.
2,394 questions
{count} votes