forked from Ayush7-BIT/Google-Facilitator-Program-Solutions
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Perform Foundational Data, ML, and AI Tasks in Google Cloud: Challenge Lab
49 lines (25 loc) · 1.98 KB
/
Perform Foundational Data, ML, and AI Tasks in Google Cloud: Challenge Lab
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
1ST TASK ----------------
gsutil cp gs://cloud-training/gsp323/lab.csv .
cat lab.csv
gsutil cp gs://cloud-training/gsp323/lab.schema .
cat lab.schema
TASK 4 --------------------------------------------------
gcloud iam service-accounts create my-natlang-sa \
--display-name "my natural language service account"
gcloud iam service-accounts keys create ~/key.json \
--iam-account my-natlang-sa@$DEVSHELL_PROJECT_ID.iam.gserviceaccount.com
Google Cloud Speech API. --------------------------------------------------------------
wget https://raw.githubusercontent.com/guys-in-the-cloud/cloud-skill-boosts/main/Challenge-labs/Perform%20Foundational%20Data%2C%20ML%2C%20and%20AI%20Tasks%20in%20Google%20Cloud%3A%20Challenge%20Lab/speech-request.json
curl -s -X POST -H "Content-Type: application/json" --data-binary @speech-request.json \
"https://speech.googleapis.com/v1/speech:recognize?key=${API_KEY}" > speech.json
gsutil cp speech.json gs://$DEVSHELL_PROJECT_ID-marking/<changefilename>
Cloud Natural Language API -------------------------------------------------------------
gcloud ml language analyze-entities --content="Old Norse texts portray Odin as one-eyed and long-bearded, frequently wielding a spear named Gungnir and wearing a cloak and a broad hat." > language.json
gsutil cp language.json gs://$DEVSHELL_PROJECT_ID-marking/<changefilename>
Google Video Intelligence --------------------------------------------------------------
wget https://github.com/guys-in-the-cloud/cloud-skill-boosts/blob/main/Challenge-labs/Perform%20Foundational%20Data%2C%20ML%2C%20and%20AI%20Tasks%20in%20Google%20Cloud:%20Challenge%20Lab/video-intelligence-request.json
curl -s -H 'Content-Type: application/json' \
-H 'Authorization: Bearer '$(gcloud auth print-access-token)'' \
'https://videointelligence.googleapis.com/v1/videos:annotate' \
-d @video-intelligence-request.json > video.json
gsutil cp video.json gs://$DEVSHELL_PROJECT_ID-marking/<changefilename>