{"id":17340846,"url":"https://github.com/kenfdev/faas-azure-text-analytics","last_synced_at":"2025-09-15T03:04:06.499Z","repository":{"id":88345711,"uuid":"130303639","full_name":"kenfdev/faas-azure-text-analytics","owner":"kenfdev","description":null,"archived":false,"fork":false,"pushed_at":"2023-12-15T11:53:10.000Z","size":2147,"stargazers_count":0,"open_issues_count":1,"forks_count":0,"subscribers_count":3,"default_branch":"master","last_synced_at":"2025-02-01T13:30:39.013Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Go","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/kenfdev.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null}},"created_at":"2018-04-20T03:26:31.000Z","updated_at":"2018-04-20T03:58:47.000Z","dependencies_parsed_at":"2023-12-15T12:52:57.765Z","dependency_job_id":null,"html_url":"https://github.com/kenfdev/faas-azure-text-analytics","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/kenfdev%2Ffaas-azure-text-analytics","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kenfdev%2Ffaas-azure-text-analytics/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kenfdev%2Ffaas-azure-text-analytics/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kenfdev%2Ffaas-azure-text-analytics/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/kenfdev","download_url":"https://codeload.github.com/kenfdev/faas-azure-text-analytics/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":245813153,"owners_count":20676760,"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-10-15T15:46:43.781Z","updated_at":"2025-03-27T08:42:20.340Z","avatar_url":"https://github.com/kenfdev.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"# OpenFaaS Azure Text Analytics Function\n\nThis function is a simple wrapper function for the [Text Analytics API](https://azure.microsoft.com/en-us/services/cognitive-services/text-analytics/).\n\n## Prerequisites\n\n* [faas-cli](https://github.com/openfaas/faas-cli)\n* [OpenFaaS](https://github.com/openfaas/faas) inside your cluster\n* [API Key](https://azure.microsoft.com/en-us/try/cognitive-services/?api=text-analytics) for the Text Analytics API\n* API Key deployed as a secret inside the cluster\n\n## Try it out\n\n### stack.yml\n\n``` yaml\nfunctions:\n  azure-text-analytics:\n    lang: golang-http\n    handler: ./azure-text-analytics\n    image: \u003cYour DockerHub Account\u003e/azure-text-analytics\n    secrets:\n    - azure-api-keys # Make sure you deployed the API Key as a secret with this name\n    environment:\n      write_debug: true\n      API_KEY_NAME: azure-free-text-analytics-api-key # This is the Key of the secret\n      TEXT_ANALYZE_BASE_URL: https://eastasia.api.cognitive.microsoft.com/text/analytics/v2.0\n```\n\n### Build, Push, Deploy\n\nBe sure to set your OpenFaas Gateway URL with\n\n* env variable `OPENFAAS_URL`\n* `-g` option with the `faas-cli`\n\n```\nfaas build \u0026\u0026 faas push \u0026\u0026 faas deploy [-g \u003cGATEWAY URL\u003e]\n```\n\n### Invoke\n\n```\necho '{\"text\":\"This function is an awesome function that simply integrates with the Azure Text Analytics API.\"}' | faas invoke azure-text-analytics [-g \u003cGATEWAY URL\u003e]\n```\n\nYou'll get something like the following.\n\n```json\n{\n  \"language\": \"en\",\n  \"sentiment_score\": 0.884989857673645,\n  \"key_phrases\": [\"awesome function\", \"Azure Text Analytics API\"]\n}\n```\n\n## Give it a quick test with docker-compose\n\n### API Key\n\nMake sure you place your API key inside a file called `azure-free-text-analytics-api-key` .\n\nPut your API key inside that file.\n\n```\ndocker-compose up\n```\n\nBy default, this docker-compose version will expose the API to http://127.0.0.1:9080.\nSimply `curl` it with the `text` you want to analyze.\n\n```\ncurl -v -X POST -d '{\"text\":\"This function is an awesome function that simply integrates with the Azure Text Analytics API.\"}' http://localhost:9080\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fkenfdev%2Ffaas-azure-text-analytics","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fkenfdev%2Ffaas-azure-text-analytics","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fkenfdev%2Ffaas-azure-text-analytics/lists"}