{"id":22741518,"url":"https://github.com/danitrod/lyra","last_synced_at":"2025-03-30T04:13:51.274Z","repository":{"id":42966140,"uuid":"221275831","full_name":"danitrod/Lyra","owner":"danitrod","description":"Song lyric analyzer with Watson Natural Language Understanding","archived":false,"fork":false,"pushed_at":"2022-12-11T14:27:43.000Z","size":1663,"stargazers_count":1,"open_issues_count":11,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-02-05T06:32:27.387Z","etag":null,"topics":["beautifulsoup","ibm-cloud","ibm-cloud-functions","language-translator","natural-language-understanding","nodejs","python","react","serverless","watson-api"],"latest_commit_sha":null,"homepage":"https://lyra.mybluemix.net","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/danitrod.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}},"created_at":"2019-11-12T17:38:25.000Z","updated_at":"2024-02-07T12:34:57.000Z","dependencies_parsed_at":"2023-01-27T01:01:16.489Z","dependency_job_id":null,"html_url":"https://github.com/danitrod/Lyra","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/danitrod%2FLyra","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/danitrod%2FLyra/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/danitrod%2FLyra/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/danitrod%2FLyra/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/danitrod","download_url":"https://codeload.github.com/danitrod/Lyra/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":246273553,"owners_count":20750906,"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":["beautifulsoup","ibm-cloud","ibm-cloud-functions","language-translator","natural-language-understanding","nodejs","python","react","serverless","watson-api"],"created_at":"2024-12-11T00:12:39.330Z","updated_at":"2025-03-30T04:13:51.251Z","avatar_url":"https://github.com/danitrod.png","language":"JavaScript","readme":"\u003cdiv align=\"center\"\u003e\n\u003ca href=\"https://cloud.ibm.com\"\u003e\n\u003cimg src=\"https://img.shields.io/badge/IBM%20Cloud-powered-blue.svg\" /\u003e\n\u003c/a\u003e\n\u003c/div\u003e\n\n# Lyra, the song analyzer\n\n## Intro\n\nLyra makes use of the Watson Natural Language Understanding (NLU) API to analyze song lyrics. The Node.js backend calls a serverless function sequence via API Connect. The sequence scrapes song lyrics from https://www.letras.com using Python with Beautiful Soup and then calls NLU to analyze the song's emotion and sentiment. If the song is not in English, the sequence also calls the Language Translator API to translate the lyrics to English. The service is supported in any language!\n\nCheck the app out on https://lyra.mybluemix.net.\n\n## Index\n\n* [Flow](#Flow)\n* [Set up](#Creating-the-Serverless-sequence-and-actions-via-IBM-Cloud-Functions-GUI)\n* [Run locally](#Running-the-app-locally)\n* [Deploy](#Deploying-the-app-to-the-cloud)\n\n## Flow\n![flow](doc/source/images/flow.png)\n\n## Creating the Serverless sequence and actions via IBM Cloud Functions GUI\n\nBeing logged in on IBM Cloud, open [IBM Cloud Functions](https://cloud.ibm.com/functions/actions). For every file in the [actions folder](./doc/source/actions), create an action and paste the code inside. In the `analyzeLyrics.py` action, remember to type in your service apikeys:\n- Line 15: Language Translator apikey\n- Line 40: Natural Language Understanding apikey\n\nIf you don't have the apikeys, simply create a free instance of [Language Translator](https://cloud.ibm.com/catalog/services/language-translator) and [Natural Language Understanding](https://cloud.ibm.com/catalog/services/natural-language-understanding) to get them. Then, create a sequence for scraping and analyzing the lyrics. It should include the three actions, in the following order:\n1. songSearcher.py\n2. lyricScraper.py\n3. analyzeLyrics.py\n\n## Making your Python API Public with API Connect\nGo to the [Functions API management section](https://cloud.ibm.com/functions/apimanagement) and create a Managed API. Name it whatever you like. Go to your newly created Managed API and go to the section `Definition`. There, create an operation, give it a path, set the method to `POST` and select your sequence. After creating the operation, remember to scroll down the screen and click on `Save` to save your changes. Now, go back to `Summary` and copy the route on the screen to your API. Insert this route in the [server file](./server/server.js), line 16 and add `/\u003cyour path name\u003e` to the end of the route. Your server should now be able to connect to your API operation.\n\n## Running the app locally\nSimpy clone the repo, put your API route in the server file (step above) and run the following commands from the `/server` directory:\n\n```\n# Installs dependencies\nnpm run install-deps\n\n# Builds app and runs locally\nnpm run local\n```\n\n## Deploying the app to the cloud\nNOTE: You must have the [IBM Cloud Command Line Interface](https://cloud.ibm.com/docs/cli?topic=cloud-cli-getting-started) installed on your machine to follow this step.\n\nAfter [setting up](#Creating-the-Serverless-sequence-and-actions-via-IBM-Cloud-Functions-GUI), installing dependencies and making sure the app is working, go to the `/server` directory, change your app and route names on the [manifest file](./server/manifest.yml) (lines 3 and 8) and run the following commands from `/server`:\n\n```\n# Logs into the IBM Cloud\nibmcloud login\n\n# Selects a Cloud Foundry organization and space to deploy your app\nibmcloud target --cf\n\n# Builds the client and deploys app to cloud\nnpm run deploy\n```\n\n## License\nCopyright 2019 Daniel T. Rodrigues\n\nLicensed under the Apache License, Version 2.0 (the \"License\");\nyou may not use this file except in compliance with the License.\nYou may obtain a copy of the License at\n\n    http://www.apache.org/licenses/LICENSE-2.0\n\nUnless required by applicable law or agreed to in writing, software\ndistributed under the License is distributed on an \"AS IS\" BASIS,\nWITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\nSee the License for the specific language governing permissions and\nlimitations under the License.","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdanitrod%2Flyra","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fdanitrod%2Flyra","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdanitrod%2Flyra/lists"}