{"id":13800966,"url":"https://github.com/watson-developer-cloud/natural-language-classifier-nodejs","last_synced_at":"2025-05-13T10:30:51.060Z","repository":{"id":31924798,"uuid":"35494176","full_name":"watson-developer-cloud/natural-language-classifier-nodejs","owner":"watson-developer-cloud","description":"Deprecated: this demo will receive no further updates","archived":true,"fork":false,"pushed_at":"2021-09-21T18:15:37.000Z","size":4101,"stargazers_count":157,"open_issues_count":9,"forks_count":207,"subscribers_count":38,"default_branch":"master","last_synced_at":"2024-11-17T10:42:01.977Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","language":"JavaScript","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/watson-developer-cloud.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":"CONTRIBUTING.md","funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2015-05-12T14:48:57.000Z","updated_at":"2024-10-26T07:09:10.000Z","dependencies_parsed_at":"2022-08-25T05:50:26.736Z","dependency_job_id":null,"html_url":"https://github.com/watson-developer-cloud/natural-language-classifier-nodejs","commit_stats":null,"previous_names":[],"tags_count":5,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/watson-developer-cloud%2Fnatural-language-classifier-nodejs","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/watson-developer-cloud%2Fnatural-language-classifier-nodejs/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/watson-developer-cloud%2Fnatural-language-classifier-nodejs/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/watson-developer-cloud%2Fnatural-language-classifier-nodejs/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/watson-developer-cloud","download_url":"https://codeload.github.com/watson-developer-cloud/natural-language-classifier-nodejs/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":225198954,"owners_count":17437004,"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":[],"created_at":"2024-08-04T00:01:18.098Z","updated_at":"2024-11-18T15:31:25.655Z","avatar_url":"https://github.com/watson-developer-cloud.png","language":"JavaScript","funding_links":[],"categories":["Data \u0026 AI"],"sub_categories":[],"readme":"\u003ch1 align=\"center\" style=\"border-bottom: none;\"\u003eDeprecated: this repo has been archived and will not receive further updates. It is being left in read-only mode for documentation purposes, but the code should not be considered current.\u003c/h1\u003e\n\u003ch1 align=\"center\" style=\"border-bottom: none;\"\u003e🚀 Natural Language Classifier Sample Application\u003c/h1\u003e\n\u003ch3 align=\"center\"\u003eThis Node.js app demonstrates some of the Natural Language Classifier service features.\u003c/h3\u003e\n\u003cp align=\"center\"\u003e\n  \u003ca href=\"http://travis-ci.org/watson-developer-cloud/natural-language-classifier\"\u003e\n    \u003cimg alt=\"Travis\" src=\"https://travis-ci.org/watson-developer-cloud/natural-language-classifier.svg?branch=master\"\u003e\n  \u003c/a\u003e\n  \u003ca href=\"#badge\"\u003e\n    \u003cimg alt=\"semantic-release\" src=\"https://img.shields.io/badge/%20%20%F0%9F%93%A6%F0%9F%9A%80-semantic--release-e10079.svg\"\u003e\n  \u003c/a\u003e\n\u003c/p\u003e\n\u003c/p\u003e\n\nThe IBM Watson\u0026trade; Natural Language Classifier service applies deep learning techniques to make predictions about the best predefined classes for short sentences or phrases. The classes can trigger a corresponding action in an application, such as directing a request to a location or person, or answering a question. After training, the service returns information for texts that it hasn't seen before. The response includes the name of the top classes and confidence values.\n\n![demo](public/demo.gif)\n\nYou can view a [demo](https://natural-language-classifier-demo.ng.bluemix.net/) of this app.\n\n\n## Prerequisites\n\n1. Sign up for an [IBM Cloud account](https://cloud.ibm.com/registration/).\n1. Download the [IBM Cloud CLI](https://cloud.ibm.com/docs/cli/index.html#overview).\n1. Create an instance of the Natural Language Classifier service and get your credentials:\n    - Go to the [Natural Language Classifier](https://cloud.ibm.com/catalog/services/natural-language-classifier) page in the IBM Cloud Catalog.\n    - Log in to your IBM Cloud account.\n    - Click **Create**.\n    - Click **Show** to view the service credentials.\n    - Copy the `apikey` value.\n    - Copy the `url` value.\n\n## Configuring the application\n\n1. The Natural Language Classifier service must be trained before you can successfully use this application. The training data is provided in the file `training/weather_data_train.csv`.  \n If you have `username` and `password` credentials, train a classifier by using the following command:\n\n  ```sh\n  curl -i -u \"apikey\":\"\u003capikey\u003e\" \\\n  -F training_data=@training/weather_data_train.csv \\\n  -F training_metadata=\"{\\\"language\\\":\\\"en\\\",\\\"name\\\":\\\"TutorialClassifier\\\"}\" \\\n  \"\u003curl\u003e/v1/classifiers\"\n  ```\n  Make sure to replace `\u003capikey\u003e` and `\u003curl\u003e`.  \n  After running the command, copy the value for `classifier_id`.\n\n2. In the application folder, copy the *.env.example* file and create a file called *.env*\n\n    ```\n    cp .env.example .env\n    ```\n\n7. Open the *.env* file and add the service credentials that you obtained in the previous step.\n\n    Example *.env* file that configures the `apikey` and `url` for a Natural Language Classifier service instance hosted in the US East region:\n\n    ```\n    NATURAL_LANGUAGE_CLASSIFIER_IAM_APIKEY=X4rbi8vwZmKpXfowaS3GAsA7vdy17Qh7km5D6EzKLHL2\n    NATURAL_LANGUAGE_CLASSIFIER_URL=https://gateway.watsonplatform.net/natural-language-classifier/api\n    ```\n\n8. Add the `CLASSIFIER_ID` to the previous properties\n\n    ```\n    CLASSIFIER_ID=522be-7b41-ab44-dec3-g1eab2ha73c6\n    ```\n\n## Running locally\n\n1. Install the dependencies\n\n    ```\n    npm install\n    ```\n\n1. Run the application\n\n    ```\n    npm start\n    ```\n\n1. View the application in a browser at `localhost:3000`\n\n## Deploying to IBM Cloud as a Cloud Foundry Application\n\n1. Login to IBM Cloud with the [IBM Cloud CLI](https://cloud.ibm.com/docs/cli/index.html#overview)\n\n    ```\n    ibmcloud login\n    ```\n\n1. Target a Cloud Foundry organization and space.\n\n    ```\n    ibmcloud target --cf\n    ```\n\n1. Edit the *manifest.yml* file. Change the **name** field to something unique.  \n  For example, `- name: my-app-name`.\n1. Deploy the application\n\n    ```\n    ibmcloud app push\n    ```\n\n1. View the application online at the app URL.  \nFor example: https://my-app-name.mybluemix.net\n\n\n## Directory structure\n\n```none\n.\n├── app.js                      // express routes\n├── config                      // express configuration\n│   ├── error-handler.js\n│   ├── express.js\n│   └── security.js\n├── manifest.yml\n├── package.json\n├── public                      // static resources\n├── server.js                   // entry point\n├── test                        // unit tests\n├── training\n│   └── weather_data_train.csv  // training file\n└── views                       // react components\n```\n\n## License\n\nThis sample code is licensed under Apache 2.0.  \nFull license text is available in [LICENSE](LICENSE).\n\n## Contributing\n\nSee [CONTRIBUTING](CONTRIBUTING.md).\n\n## Open Source @ IBM\n\nFind more open source projects on the\n[IBM Github Page](http://ibm.github.io/).\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fwatson-developer-cloud%2Fnatural-language-classifier-nodejs","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fwatson-developer-cloud%2Fnatural-language-classifier-nodejs","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fwatson-developer-cloud%2Fnatural-language-classifier-nodejs/lists"}