{"id":23302178,"url":"https://github.com/seanknox/pr_sentiment_analysis","last_synced_at":"2026-04-30T15:32:08.432Z","repository":{"id":48708862,"uuid":"284158247","full_name":"seanknox/pr_sentiment_analysis","owner":"seanknox","description":"Look ma, I'm analyzing sentiments!","archived":false,"fork":false,"pushed_at":"2022-10-06T16:34:58.000Z","size":24,"stargazers_count":1,"open_issues_count":1,"forks_count":0,"subscribers_count":2,"default_branch":"main","last_synced_at":"2025-04-06T22:22:34.549Z","etag":null,"topics":["ai","cognitive-services","github","machine-learning","microsoft","ruby"],"latest_commit_sha":null,"homepage":"","language":"Ruby","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/seanknox.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":"2020-08-01T00:51:04.000Z","updated_at":"2022-09-11T20:21:42.000Z","dependencies_parsed_at":"2023-01-19T13:18:35.052Z","dependency_job_id":null,"html_url":"https://github.com/seanknox/pr_sentiment_analysis","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/seanknox/pr_sentiment_analysis","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/seanknox%2Fpr_sentiment_analysis","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/seanknox%2Fpr_sentiment_analysis/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/seanknox%2Fpr_sentiment_analysis/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/seanknox%2Fpr_sentiment_analysis/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/seanknox","download_url":"https://codeload.github.com/seanknox/pr_sentiment_analysis/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/seanknox%2Fpr_sentiment_analysis/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":32469344,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-04-30T13:12:12.517Z","status":"ssl_error","status_checked_at":"2026-04-30T13:12:06.837Z","response_time":57,"last_error":"SSL_read: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"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":["ai","cognitive-services","github","machine-learning","microsoft","ruby"],"created_at":"2024-12-20T10:19:12.213Z","updated_at":"2026-04-30T15:32:08.414Z","avatar_url":"https://github.com/seanknox.png","language":"Ruby","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Sentiment of Pull Request comments\n\nThis uses Microsoft's Text Analytics v2.1 API to analyze the sentiment of comments in a GitHub pull request.\n\nThe scores are the APIs best guess at a sentiment reading. Scores closer to 1 == \"friendly\".\n\n`senti.rb` does its best to remove GitHub's code suggestion blocks from comments (\\`\\`\\`suggestion\\`\\`\\`), as it tends to confuse the sentiment analysis.\n\n## Getting Started\n\n- First, sign up for the [trial of Microsoft's Cognitive Services](https://azure.microsoft.com/en-us/free/cognitive-services/)\n- Get your `TEXT_ANALYTICS_SUBSCRIPTION_KEY` and your `TEXT_ANALYTICS_ENDPOINT`.\n- Generate a GitHub access token with repo permissions: \u003chttps://github.com/settings/tokens\u003e\n\n### Install dependencies\n\n`senti.rb` is written in Ruby; you'll need to have a Ruby and `bundler` installed on your system. Macs have Ruby installed by default.\n\n`bundle install`\n\n### Run\n\nYou'll need to set these environment variables in your shell, with an `export` or at runtime.\n\nTo analyze PR #1 in this repo:\n\n```shell\nexport TEXT_ANALYTICS_SUBSCRIPTION_KEY=your_key TEXT_ANALYTICS_ENDPOINT=https://westcentralus.api.cognitive.microsoft.com GITHUB_ACCESS_TOKEN=your_github_access_token GITHUB_REPO=\"seanknox/pr_sentiment_analysis\" PR_NUMBER=1\n\nbundle exec ruby -W0 senti.rb\n===== SENTIMENT ANALYSIS =====\nComment: Looks great! I love it. You are the best. : Sentiment Score: 0.9979691505432129\nComment: I don't like this! And I don't like YOU!!!: Sentiment Score: 0.002584695816040039\nComment: This is an ambiguous comment? Maybe?: Sentiment Score: 0.7764753699302673\nComment: I don't like you but I put a smiley so thanks to machine learning not knowing passive aggressiveness it'll think this is nice 😄 : Sentiment Score: 0.9964126944541931\n\nOverall sentiment average: 0.6933604776859283 / median 0.8864440321922302\n\nGITHUB_REPO=\"seanknox/another_repo\" \\\nPR_NUMBER=93 \\\nbundle exec ruby -W0 senti.rb\n\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fseanknox%2Fpr_sentiment_analysis","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fseanknox%2Fpr_sentiment_analysis","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fseanknox%2Fpr_sentiment_analysis/lists"}