{"id":15509600,"url":"https://github.com/huan/ng-plus-wechaty","last_synced_at":"2025-04-23T02:27:17.080Z","repository":{"id":91647297,"uuid":"311227799","full_name":"huan/ng-plus-wechaty","owner":"huan","description":"Conversational AI TensorFlow.js NLP examples with Wechaty SDK and Angular","archived":false,"fork":false,"pushed_at":"2022-01-06T07:27:56.000Z","size":764,"stargazers_count":6,"open_issues_count":2,"forks_count":4,"subscribers_count":2,"default_branch":"main","last_synced_at":"2025-03-12T05:03:03.511Z","etag":null,"topics":["angular","tensorflow","tfjs","wechaty"],"latest_commit_sha":null,"homepage":"https://ng-plus.dev","language":"TypeScript","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/huan.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":"2020-11-09T04:55:14.000Z","updated_at":"2025-02-08T06:21:33.000Z","dependencies_parsed_at":null,"dependency_job_id":"8d594a80-b92e-4676-8c76-39f7ea45899e","html_url":"https://github.com/huan/ng-plus-wechaty","commit_stats":{"total_commits":39,"total_committers":1,"mean_commits":39.0,"dds":0.0,"last_synced_commit":"95ec95948a9e796e945a087952137db660d8805c"},"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/huan%2Fng-plus-wechaty","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/huan%2Fng-plus-wechaty/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/huan%2Fng-plus-wechaty/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/huan%2Fng-plus-wechaty/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/huan","download_url":"https://codeload.github.com/huan/ng-plus-wechaty/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":250356630,"owners_count":21417121,"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":["angular","tensorflow","tfjs","wechaty"],"created_at":"2024-10-02T09:43:19.124Z","updated_at":"2025-04-23T02:27:17.068Z","avatar_url":"https://github.com/huan.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# ng-plus-wechaty\n\n## Requirements\n\n1. Wechaty Token\n\n### Wechaty Token: apply a token from Wechaty Puppet Service Providers\n\nYou can apply a Windows / Pad protocol token from our puppet service providers:\n\n1. [Apply Wechaty Puppet Service Token](https://github.com/wechaty/puppet-supports/issues/new/choose)\n1. [Wechaty Puppet Service FAQ](https://wechaty.js.org/docs/puppet-services/faq)\n\n#### Create a Wechaty Puppet Service Token by yourself (DIY)\n\nCopy the following shell script and then paste it into the term of your server, to setup your Wechaty token:\n\n```sh\n# learn how to DIY a Wechaty Puppet Service token at http://wechaty.js.org/docs/puppet-services/diy\nexport WECHATY_TOKEN=insecure_wechaty_puppet_service_token_diy\n\n# Set port for your hostie service: must be published accessible on the internet\n# Wechaty IO Client use this port to publish the Puppet Service\nexport WECHATY_PUPPET_SERVER_PORT=48788\n\n# learn more about Wechaty Puppet PadLocal at https://wechaty.js.org/docs/puppet-services/padlocal\nexport WECHATY_PUPPET=wechaty-puppet-padlocal\n# get a 7 days free token at PadLocal official website: http://pad-local.com/\nexport WECHATY_PUPPET_PADLOCAL_TOKEN=YOUR_PADLOCAL_TOKEN_AT_HERE\n\nexport WECHATY_LOG=verbose\n\ndocker run \\\n  --rm \\\n  -ti \\\n  -e WECHATY_LOG \\\n  -e WECHATY_PUPPET \\\n  -e WECHATY_PUPPET_PADLOCAL_TOKEN \\\n  -e WECHATY_PUPPET_SERVER_PORT \\\n  -e WECHATY_TOKEN \\\n  -p \"$WECHATY_PUPPET_SERVER_PORT\" \\\n  wechaty/wechaty:0.78\n```\n\n\u003e Learn more: [Puppet Service: DIY](https://wechaty.js.org/docs/puppet-services/diy/) This guide will help you generate a Wechaty Token for connecting to the Wechaty Puppet Service.\n\n## Live Coding Explanation\n\nWe have four steps in our live coding, they are saved in four separate branches for easy loading and testing.\n\n### Step 1. `ng new my-app`\n\nBranch: [ng_china_2020_step_1_ng_new_my-app](https://github.com/huan/ng2020-wechaty/tree/ng_china_2020_step_1_ng_new_my-app)\n\n```sh\nnpx --package @angular/cli ng new my-app\ncd my-app\nng serve --open\n```\n\nLearn more from \u003chttps://angular.io/guide/setup-local\u003e\n\n### Step 2. Wechaty\n\nBranch: [ng_china_2020_step_2_wechaty](https://github.com/huan/ng2020-wechaty/tree/ng_china_2020_step_2_wechaty)\n\n```sh\nnpm i @chatie/angular brolog\n```\n\n#### `app.module.ts`\n\n```ts\nimport { WechatyModule } from '@chatie/angular'\n@NgModule({\n  imports: [\n    WechatyModule,\n    ...\n  ],\n  ...\n```\n\n#### `app.component.html`\n\n```html\n\u003cwechaty\n  #wechaty\n  token=\"insecure_wechaty_puppet_service_token_diy\"\n\n  (heartbeat) = \"onHeartbeat($event)\"\n  (scan)      = \"onScan($event)\"\n  (login)     = \"wechaty.startSyncMessage(); onLogin($event)\"\n  (message)   = \"onMessage($event)\"\n\u003e\n\u003c/wechaty\u003e\n```\n\n### Step 3. TensorFlow.js Toxicity\n\nBranch: [ng_china_2020_step_3_toxicity](https://github.com/huan/ng2020-wechaty/tree/ng_china_2020_step_3_toxicity)\n\n```sh\nnpm install @tensorflow/tfjs\nnpm install @tensorflow-models/toxicity\n\nng generate service toxicity\n```\n\n[![TensorFlow.js Toxicity Model](docs/images/toxicity.webp)](https://storage.googleapis.com/tfjs-models/demos/toxicity/index.html)\n\nLearn more:\n\n1. [TensorFlow.js models: toxicity classifier source](https://github.com/tensorflow/tfjs-models/tree/master/toxicity)\n1. [TensorFlow.js toxicity classifier demo](https://storage.googleapis.com/tfjs-models/demos/toxicity/index.html): This is a demo of the TensorFlow.js toxicity model, which classifies text according to whether it exhibits offensive attributes (i.e. profanity, sexual explicitness).\n1. [Text classification using TensorFlow.js: An example of detecting offensive language in browser](https://medium.com/tensorflow/text-classification-using-tensorflow-js-an-example-of-detecting-offensive-language-in-browser-e2b94e3565ce)\n\nThe traffic light code is copy/pasted from this great tutorial: [Stop in the Name of the Traffic Light](https://medium.com/@robhitt/stop-in-the-name-of-the-traffic-light-c5f4d8a9d2e6)\n\n### 4. TensorFlow.js QnA\n\nTo be written.\n\nBranch: [step_4_tensorflow-models_qna](https://github.com/huan/ng2020-wechaty/tree/step_4_tensorflow-models_qna)\n\n```sh\nnpm install @tensorflow-models/qna\n```\n\n```ts\n// to be written\n```\n\nLearn more:\n\n1. [TensorFlow.js models: Question and Answer source](https://github.com/tensorflow/tfjs-models/tree/master/qna) Use a pre-trained model to answer questions based on the content of a given passage.\n1. [TensorFlow.js models: Question and Answer demo](https://storage.googleapis.com/tfjs-models/demos/mobilebert-qna/index.html)\n1. [TensorFlow Blog: Exploring helpful uses for BERT in your browser with Tensorflow.js](https://blog.tensorflow.org/2020/03/exploring-helpful-uses-for-bert-in-your-browser-tensorflow-js.html)\n\n## Talks\n\n### 1. Ng+ Developers Conference 2020 Keynote: Conversational AI, Chatbot, and Angular, Huan, Nov 21, 2020\n\n[![Huan Ng+ Developers Conference 2020 Keynote: Conversational AI, Chatbot, and Angular](docs/images/ng2020-huan-keynote.webp)](https://ng-plus.dev/#/topics)\n\n\u003e November 21 - 22 @online\n\nKnowledge, ideas, and insights for the Next Generation\n\n- ngChina 2020: \u003chttps://ng-plus.dev\u003e\n- ngChina 2019: \u003chttps://ng-china.org\u003e\n\n#### Slides \u0026 Video\n\n[![Huan Ng+ Developers Conference 2020 Keynote: Conversational AI, Chatbot, and Angular](docs/images/conversational-ai-chatbot-and-angular.png)](https://docs.google.com/presentation/d/1Gd3D8bS6OifXDsdSe0x5i6XsP_uISX3W9tR8yBA0mYs/edit?usp=sharing)\n\n\u003e Google Slides \u003chttps://docs.google.com/presentation/d/1Gd3D8bS6OifXDsdSe0x5i6XsP_uISX3W9tR8yBA0mYs/edit?usp=sharing\u003e\n\nTalk Video: \u003chttps://youtu.be/SACugbTNQnc\u003e\n\n## Resources\n\n1. [TensorFlow.js Tutorials](https://www.tensorflow.org/js/tutorials)\n1. [TensorFlow.js Models](https://www.tensorflow.org/js/models)\n1. [TensorFlow.js Demos](https://www.tensorflow.org/js/demos)\n1. [TensorFlow.js Examples](https://github.com/tensorflow/tfjs-examples/)\n1. [TensorFlow.js Gallery](https://github.com/tensorflow/tfjs/blob/master/GALLERY.md)\n\n## Author\n\n[Huan LI](https://github.com/huan) ([李卓桓](http://linkedin.com/in/zixia)), Google Machine Learning Developer Expert, zixia@zixia.net\n\n[![Profile of Huan LI (李卓桓) on StackOverflow](https://stackexchange.com/users/flair/265499.png)](https://stackexchange.com/users/265499)\n\n## Copyright \u0026 License\n\n- Docs released under Creative Commons\n- Code released under the Apache-2.0 License\n- Code \u0026 Docs © 2020-2021 Huan LI \\\u003czixia@zixia.net\\\u003e\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fhuan%2Fng-plus-wechaty","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fhuan%2Fng-plus-wechaty","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fhuan%2Fng-plus-wechaty/lists"}