Skip to content

Commit

Permalink
Created using Colaboratory
Browse files Browse the repository at this point in the history
  • Loading branch information
Christine-DK committed Jun 15, 2023
1 parent dcf98eb commit 6f4c17e
Showing 1 changed file with 6 additions and 177 deletions.
183 changes: 6 additions & 177 deletions Doc_AI_test.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -55,144 +55,10 @@
"!gcloud init # Follow prompts to configure and log in. Project = \"dk-ocr-test\""
],
"metadata": {
"colab": {
"base_uri": "https://localhost:8080/"
},
"id": "AoSU4BXA4XxQ",
"outputId": "28f36222-c206-4ae6-eceb-8d289c957e60"
"id": "AoSU4BXA4XxQ"
},
"execution_count": null,
"outputs": [
{
"output_type": "stream",
"name": "stdout",
"text": [
"Welcome! This command will take you through the configuration of gcloud.\n",
"\n",
"Settings from your current configuration [default] are:\n",
"component_manager:\n",
" disable_update_check: 'True'\n",
"compute:\n",
" gce_metadata_read_timeout_sec: '0'\n",
"\n",
"Pick configuration to use:\n",
" [1] Re-initialize this configuration [default] with new settings \n",
" [2] Create a new configuration\n",
"Please enter your numeric choice: 1\n",
"\n",
"Your current configuration has been set to: [default]\n",
"\n",
"You can skip diagnostics next time by using the following flag:\n",
" gcloud init --skip-diagnostics\n",
"\n",
"Network diagnostic detects and fixes local network connection issues.\n",
"Reachability Check passed.\n",
"Network diagnostic passed (1/1 checks passed).\n",
"\n",
"You must log in to continue. Would you like to log in (Y/n)? Y\n",
"\n",
"Go to the following link in your browser:\n",
"\n",
" https://accounts.google.com/o/oauth2/auth?response_type=code&client_id=32555940559.apps.googleusercontent.com&redirect_uri=https%3A%2F%2Fsdk.cloud.google.com%2Fauthcode.html&scope=openid+https%3A%2F%2Fwww.googleapis.com%2Fauth%2Fuserinfo.email+https%3A%2F%2Fwww.googleapis.com%2Fauth%2Fcloud-platform+https%3A%2F%2Fwww.googleapis.com%2Fauth%2Fappengine.admin+https%3A%2F%2Fwww.googleapis.com%2Fauth%2Fsqlservice.login+https%3A%2F%2Fwww.googleapis.com%2Fauth%2Fcompute+https%3A%2F%2Fwww.googleapis.com%2Fauth%2Faccounts.reauth&state=Igh9u8qpWlBMoi12eHwvoibhLlHwfe&prompt=consent&access_type=offline&code_challenge=xcdqRxHCtPmHsyit3isGMl2x1p7Owlb7Ma2nPYUU_T4&code_challenge_method=S256\n",
"\n",
"Enter authorization code: 4/0AbUR2VMJlHxzUK50q46mm2k4KblOXH1ZeG6rXhO7003FgGplw69p5fzhIEydZxBJCk-yeQ\n",
"You are logged in as: [christine.amuzie@datakind.org].\n",
"\n",
"Pick cloud project to use: \n",
" [1] datakind-386320\n",
" [2] dk-mapping-engine-test\n",
" [3] dk-ocr-test\n",
" [4] Enter a project ID\n",
" [5] Create a new project\n",
"Please enter numeric choice or text value (must exactly match list item): 3\n",
"\n",
"Your current project has been set to: [dk-ocr-test].\n",
"\n",
"Do you want to configure a default Compute Region and Zone? (Y/n)? Y\n",
"\n",
"Which Google Compute Engine zone would you like to use as project default?\n",
"If you do not specify a zone via a command line flag while working with Compute \n",
"Engine resources, the default is assumed.\n",
" [1] us-east1-b\n",
" [2] us-east1-c\n",
" [3] us-east1-d\n",
" [4] us-east4-c\n",
" [5] us-east4-b\n",
" [6] us-east4-a\n",
" [7] us-central1-c\n",
" [8] us-central1-a\n",
" [9] us-central1-f\n",
" [10] us-central1-b\n",
" [11] us-west1-b\n",
" [12] us-west1-c\n",
" [13] us-west1-a\n",
" [14] europe-west4-a\n",
" [15] europe-west4-b\n",
" [16] europe-west4-c\n",
" [17] europe-west1-b\n",
" [18] europe-west1-d\n",
" [19] europe-west1-c\n",
" [20] europe-west3-c\n",
" [21] europe-west3-a\n",
" [22] europe-west3-b\n",
" [23] europe-west2-c\n",
" [24] europe-west2-b\n",
" [25] europe-west2-a\n",
" [26] asia-east1-b\n",
" [27] asia-east1-a\n",
" [28] asia-east1-c\n",
" [29] asia-southeast1-b\n",
" [30] asia-southeast1-a\n",
" [31] asia-southeast1-c\n",
" [32] asia-northeast1-b\n",
" [33] asia-northeast1-c\n",
" [34] asia-northeast1-a\n",
" [35] asia-south1-c\n",
" [36] asia-south1-b\n",
" [37] asia-south1-a\n",
" [38] australia-southeast1-b\n",
" [39] australia-southeast1-c\n",
" [40] australia-southeast1-a\n",
" [41] southamerica-east1-b\n",
" [42] southamerica-east1-c\n",
" [43] southamerica-east1-a\n",
" [44] asia-east2-a\n",
" [45] asia-east2-b\n",
" [46] asia-east2-c\n",
" [47] asia-northeast2-a\n",
" [48] asia-northeast2-b\n",
" [49] asia-northeast2-c\n",
" [50] asia-northeast3-a\n",
"Did not print [63] options.\n",
"Too many options [113]. Enter \"list\" at prompt to print choices fully.\n",
"Please enter numeric choice or text value (must exactly match list item): 1\n",
"\n",
"Your project default Compute Engine zone has been set to [us-east1-b].\n",
"You can change it by running [gcloud config set compute/zone NAME].\n",
"\n",
"Your project default Compute Engine region has been set to [us-east1].\n",
"You can change it by running [gcloud config set compute/region NAME].\n",
"\n",
"Your Google Cloud SDK is configured and ready to use!\n",
"\n",
"* Commands that require authentication will use christine.amuzie@datakind.org by default\n",
"* Commands will reference project `dk-ocr-test` by default\n",
"* Compute Engine commands will use region `us-east1` by default\n",
"* Compute Engine commands will use zone `us-east1-b` by default\n",
"\n",
"Run `gcloud help config` to learn how to change individual settings\n",
"\n",
"This gcloud configuration is called [default]. You can create additional configurations if you work with multiple accounts and/or projects.\n",
"Run `gcloud topic configurations` to learn more.\n",
"\n",
"Some things to try next:\n",
"\n",
"* Run `gcloud --help` to see the Cloud Platform services you can interact with. And run `gcloud help COMMAND` to get help on any gcloud command.\n",
"* Run `gcloud topic --help` to learn about advanced features of the SDK like arg files and output formatting\n",
"* Run `gcloud cheat-sheet` to see a roster of go-to `gcloud` commands.\n"
]
}
]
"outputs": []
},
{
"cell_type": "markdown",
Expand All @@ -209,32 +75,10 @@
"!gcloud auth application-default login"
],
"metadata": {
"colab": {
"base_uri": "https://localhost:8080/"
},
"id": "INdY4oSJ6Ca1",
"outputId": "f893c9b2-266b-4188-8ff1-464289d4a9ce"
"id": "INdY4oSJ6Ca1"
},
"execution_count": null,
"outputs": [
{
"output_type": "stream",
"name": "stdout",
"text": [
"Go to the following link in your browser:\n",
"\n",
" https://accounts.google.com/o/oauth2/auth?response_type=code&client_id=764086051850-6qr4p6gpi6hn506pt8ejuq83di341hur.apps.googleusercontent.com&redirect_uri=https%3A%2F%2Fsdk.cloud.google.com%2Fapplicationdefaultauthcode.html&scope=openid+https%3A%2F%2Fwww.googleapis.com%2Fauth%2Fuserinfo.email+https%3A%2F%2Fwww.googleapis.com%2Fauth%2Fcloud-platform+https%3A%2F%2Fwww.googleapis.com%2Fauth%2Fsqlservice.login+https%3A%2F%2Fwww.googleapis.com%2Fauth%2Faccounts.reauth&state=AMseSgvrNM0tE16AaGV3JfXMpU5fkw&prompt=consent&access_type=offline&code_challenge=CZxfUuYZpxjUhULtAwN6cKO5Ed0hRz04rKpjA8m-Uk4&code_challenge_method=S256\n",
"\n",
"Enter authorization code: 4/0AbUR2VN-h1NILGNJjfBR480G0fprermJ8jhHTeOjvg-9MDyZurpIXcyWuvmso4vTqubAIQ\n",
"\n",
"Credentials saved to file: [/content/.config/application_default_credentials.json]\n",
"\n",
"These credentials will be used by any library that requests Application Default Credentials (ADC).\n",
"\n",
"Quota project \"dk-ocr-test\" was added to ADC which can be used by Google client libraries for billing and quota. Note that some services may still bill the project owning the resource.\n"
]
}
]
"outputs": []
},
{
"cell_type": "markdown",
Expand All @@ -253,25 +97,10 @@
"!pip install google-cloud-documentai"
],
"metadata": {
"colab": {
"base_uri": "https://localhost:8080/"
},
"id": "HZzo7-S76gYQ",
"outputId": "baade0bb-f3be-406d-e14f-35c0dfc41a67"
"id": "HZzo7-S76gYQ"
},
"execution_count": null,
"outputs": [
{
"output_type": "stream",
"name": "stdout",
"text": [
"Looking in indexes: https://pypi.org/simple, https://us-python.pkg.dev/colab-wheels/public/simple/\n",
"Requirement already satisfied: google in /usr/local/lib/python3.10/dist-packages (2.0.3)\n",
"Requirement already satisfied: beautifulsoup4 in /usr/local/lib/python3.10/dist-packages (from google) (4.11.2)\n",
"Requirement already satisfied: soupsieve>1.2 in /usr/local/lib/python3.10/dist-packages (from beautifulsoup4->google) (2.4.1)\n"
]
}
]
"outputs": []
},
{
"cell_type": "code",
Expand Down

0 comments on commit 6f4c17e

Please sign in to comment.