{"id":20786001,"url":"https://github.com/thomassuedbroecker/watson-nlp-example-code-engine","last_synced_at":"2026-04-11T16:05:22.966Z","repository":{"id":127030674,"uuid":"580744063","full_name":"thomassuedbroecker/watson-nlp-example-code-engine","owner":"thomassuedbroecker","description":"This is example how to use Watson NLP based on the official example documentation.","archived":false,"fork":false,"pushed_at":"2024-03-25T12:55:09.000Z","size":18,"stargazers_count":1,"open_issues_count":0,"forks_count":1,"subscribers_count":2,"default_branch":"main","last_synced_at":"2025-01-18T09:52:42.740Z","etag":null,"topics":["bash-script","code-engine","ibm-cloud","watson-nlp-embed"],"latest_commit_sha":null,"homepage":"","language":"Shell","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/thomassuedbroecker.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2022-12-21T10:38:30.000Z","updated_at":"2022-12-25T14:42:42.000Z","dependencies_parsed_at":null,"dependency_job_id":"6ab12d83-cfa1-4f46-95c3-0958f129ff9b","html_url":"https://github.com/thomassuedbroecker/watson-nlp-example-code-engine","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/thomassuedbroecker%2Fwatson-nlp-example-code-engine","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/thomassuedbroecker%2Fwatson-nlp-example-code-engine/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/thomassuedbroecker%2Fwatson-nlp-example-code-engine/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/thomassuedbroecker%2Fwatson-nlp-example-code-engine/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/thomassuedbroecker","download_url":"https://codeload.github.com/thomassuedbroecker/watson-nlp-example-code-engine/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":243129570,"owners_count":20241037,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["bash-script","code-engine","ibm-cloud","watson-nlp-embed"],"created_at":"2024-11-17T14:50:01.626Z","updated_at":"2025-12-24T16:48:17.345Z","avatar_url":"https://github.com/thomassuedbroecker.png","language":"Shell","readme":"# Run Watson NLP for Embed with Code Engine on IBM Cloud\n\nThis is an example how to use Watson NLP based on the official example documentation:[`IBM Watson Libraries for Embed`](https://www.ibm.com/docs/en/watson-libraries?topic=watson-natural-language-processing-library-embed-home).\n\nRelated blog post [`Run Watson NLP for Embed on IBM Cloud Code Engine`](https://suedbroecker.net/2022/12/21/run-watson-nlp-for-embed-on-ibm-cloud-code-engine/).\n\n### Step 1: Clone the example project to your local computer\n\n```sh\ngit clone https://github.com/thomassuedbroecker/watson-nlp-example-code-engine\ncd watson-nlp-example-code-engine/code\n```\n\n### Step 2:  Set your IBM_ENTITLEMENT_KEY in the `.env` file\n\n```sh\ncat .env-template \u003e .env\n```\n\nEdit the `.env` file.\n\n```sh\n# used as 'environment' variables\nIBMCLOUD_ENTITLEMENT_KEY=\"YOUR_KEY\"\nIBMCLOUD_APIKEY=\"YOUR_KEY\"\nCR_NAMESPACE=\"custom-watson-nlp-YOUR_NAME\"\nCE_EMAIL=\"YOUR_EMAIL\"\nCE_PROJECT_NAME=\"custom-watson-nlp-YOURNAME\"\n```\n\n### Step 3: Execute the `run-watson-nlp-with-docker.sh` bash script\n\n```sh\nsh run-watson-nlp-with-code-engine.sh\n```\n\n* Example output:\n\n```sh\n# ******\n# Create custom Watson NLP container imager \n# ******\n\n\n# ******\n# Connect to IBM Cloud Container Image Registry: cp.icr.io/cp/ai\n# ******\n\nCONTAINER_ENTITLEMENT_KEY: XXXX\n\nWARNING! Using --password via the CLI is insecure. Use --password-stdin.\nLogin Succeeded\n\n# ******\n# List model array content\n# ******\n\nModel 0 : watson-nlp_syntax_izumo_lang_en_stock:1.0.7\nModel 1 : watson-nlp_syntax_izumo_lang_fr_stock:1.0.7\n\n# ******\n# Download the models\n# ******\n\n# 1. Run a container in an interactive mode to set the permissions\n# 2. Put models into the file share\nArchive:  /app/model.zip\n  inflating: config.yml              \n1 watson-nlp-models cp.icr.io/cp/ai/watson-nlp_syntax_izumo_lang_en_stock:1.0.7\nArchive:  /app/model.zip\n  inflating: config.yml              \n2 watson-nlp-models cp.icr.io/cp/ai/watson-nlp_syntax_izumo_lang_fr_stock:1.0.7\n\n# ******\n# Create container image\n# ******\n\nImage name: watson-nlp-runtime-with-models\n[+] Building 0.1s (7/7) FINISHED                                                \n =\u003e [internal] load build definition from Dockerfile                       0.0s\n =\u003e =\u003e transferring dockerfile: 126B                                       0.0s\n ...\n =\u003e =\u003e writing image sha256:da130d25dbcf3eaa5d8ad7f47c6d4fdb9e460ae2de931  0.0s\n =\u003e =\u003e naming to docker.io/library/watson-nlp-runtime-with-models:1.0.0    0.0s\n\nUse 'docker scan' to run Snyk tests against images to find vulnerabilities and learn how to fix them\n\n# ******\n# Upload image to IBM Cloud container registry \n# ******\n\n\n# ******\n# Log in to IBM Cloud\n# ******\n\nAPI endpoint: https://cloud.ibm.com\nRegion: us-south\nAuthenticating...\nOK\n\nTargeted account XXX\n\n                   \nAPI endpoint:      https://cloud.ibm.com\nRegion:            us-south\nUser:              XXXX\nAccount:           XXXX\nResource group:    No resource group targeted, use 'ibmcloud target -g RESOURCE_GROUP'\nCF API endpoint:   \nOrg:               \nSpace:             \nTargeted resource group default\n\n\n                   \nAPI endpoint:      https://cloud.ibm.com\nRegion:            us-south\nUser:              XXXX\nAccount:           XXXX\nResource group:    default\nCF API endpoint:   \nOrg:               \nSpace:             \nSwitched to region us-south\n\n\n                   \nAPI endpoint:      https://cloud.ibm.com\nRegion:            us-south\nUser:              XXXX\nAccount:           XXXX\nResource group:    default\nCF API endpoint:   \nOrg:               \nSpace:             \n\n# ******\n# Configure IBM Cloud Registry\n# ******\n\nThe region is set to 'us-south', the registry is 'us.icr.io'.\n\nOK\nAdding namespace 'custom-watson-nlp-tsued' in resource group 'default' for account XXXX Account in registry us.icr.io...\n\nThe requested namespace is already owned by your account.\n\nOK\nLogging 'docker' in to 'us.icr.io'...\nLogged in to 'us.icr.io'.\n\nOK\nContainer image: us.icr.io/custom-watson-nlp-tsued/watson-nlp-runtime-with-models:1.0.0\nThe push refers to repository [us.icr.io/custom-watson-nlp-tsued/watson-nlp-runtime-with-models]\n2de7f9fb3378: Pushed \n...\n9aaca8eae7c0: Pushed \n1.0.0: digest: sha256:8ad1b4bdd6a89b0686c48fc2325900018a1ddfec0ffb1689457b5c433300d61c size: 4290\n\n# ******\n# Create Code Engine project\n# ******\n\n**********************************\n Create Code Engine project: custom-watson-nlp-tsued\n**********************************\nTargeted resource group default\n                 \nAPI endpoint:      https://cloud.ibm.com\nRegion:            us-south\nUser:              XXXX\nAccount:           XXXX\nResource group:    default\nCF API endpoint:   \nOrg:               \nSpace:             \nSwitched to region us-south\n\n\n                   \nAPI endpoint:      https://cloud.ibm.com\nRegion:            us-south\nUser:              XXXX\nAccount:           XXXX\nResource group:    default\nCF API endpoint:   \nOrg:               \nSpace:             \n\nCreating project 'custom-watson-nlp-tsued'...\nID for project 'custom-watson-nlp-tsued' is 'b879a212-XXXX'.\nWaiting for project 'custom-watson-nlp-tsued' to be active...\nNow selecting project 'custom-watson-nlp-tsued'.\nOK\n**********************************\n Configure IBM Cloud Container Registry Access (us.icr.io) for (custom-watson-nlp-tsued)\n**********************************\n**********************************\n Create Code Engine project: custom-watson-nlp-tsued\n**********************************\nAPI key: \nCreating API key cliapikey_custom-watson-nlp-tsued under 641ebfXXXXXXb45279e as XXXXX...\nOK\nAPI key cliapikey_custom-watson-nlp-tsued was created\nSuccessfully save API key information to cli_key.json\nCreating image registry access secret 'custom.watson.nlp.cr.sec'...\nOK\n\n# ******\n# Create Code Engine application custom-watson-nlp-application\n# ******\n\nCreating application 'custom-watson-nlp-application'...\nConfiguration 'custom-watson-nlp-application' is waiting for a Revision to become ready.\nIngress has not yet been reconciled.\nWaiting for load balancer to be ready.\nRun 'ibmcloud ce application get -n custom-watson-nlp-application' to check the application status.\nOK\n\nSet CE_APPLICATION_NAME URL: https://custom-watson-nlp-application.wqtmqy9e03u.us-south.codeengine.appdomain.cloud\n\n# ******\n# Verify the custom image\n# ******\n\n\n# ******\n# Verify the application custom-watson-nlp-application\n# ******\n\n{\"text\":\"This is a test sentence.\", \"producerId\":{\"name\":\"Izumo Text Processing\", \"version\":\"0.0.1\"}, \"tokens\":[{\"span\":{\"begin\":0, \"end\":4, \"text\":\"This\"}, \n...\n\"features\":[]}], \"sentences\":[{\"span\":{\"begin\":0, \"end\":24, \"text\":\"This is a test sentence.\"}}], \"paragraphs\":[{\"span\":{\"begin\":0, \"end\":24, \"text\":\"This is a test sentence.\"}}]}\n```\n\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fthomassuedbroecker%2Fwatson-nlp-example-code-engine","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fthomassuedbroecker%2Fwatson-nlp-example-code-engine","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fthomassuedbroecker%2Fwatson-nlp-example-code-engine/lists"}