{"id":22790727,"url":"https://github.com/zachalam/empathy","last_synced_at":"2025-07-15T14:14:17.768Z","repository":{"id":78266459,"uuid":"66052266","full_name":"zachalam/empathy","owner":"zachalam","description":"Emotion based text analyzer for prioritizing support tickets (Apache Spark).","archived":false,"fork":false,"pushed_at":"2016-08-20T22:53:28.000Z","size":4332,"stargazers_count":4,"open_issues_count":0,"forks_count":0,"subscribers_count":4,"default_branch":"master","last_synced_at":"2025-05-13T13:04:12.614Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","language":"Python","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/zachalam.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,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null}},"created_at":"2016-08-19T04:20:57.000Z","updated_at":"2020-07-10T18:48:56.000Z","dependencies_parsed_at":"2023-03-08T07:45:13.615Z","dependency_job_id":null,"html_url":"https://github.com/zachalam/empathy","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/zachalam/empathy","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zachalam%2Fempathy","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zachalam%2Fempathy/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zachalam%2Fempathy/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zachalam%2Fempathy/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/zachalam","download_url":"https://codeload.github.com/zachalam/empathy/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zachalam%2Fempathy/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":261212459,"owners_count":23125581,"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-12-12T02:28:49.215Z","updated_at":"2025-06-22T00:04:52.276Z","avatar_url":"https://github.com/zachalam.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# empathy\nThe goal of empathy is simple: Improve customer happiness by categorizing support tickets based on their emotion.\n\nWhen a customer submits a support ticket through your site: run the text through empathy and save the emotion. Use this emotion to find and respond to unhappy customers (prioritize \"angry\" over \"happy\" tickets) faster.\n\nInstallation\n-----------------------------\nIn empathy.py - Ensure that the EMO_FILE constant is pointing to the \"emotions.csv\" directory on disk.\n```\nEMO_FILE = \"../empathy/emotions.csv\"\n```\n\nUsage: Analyze Text\n-----------------------------\nSimply call spark-submit with empathy. Pass the text to be analyzed as a second parameter.\n```\ntime ./bin/spark-submit /path/to/empathy/empathy.py \"I love this company. You guys provide excellent support.\" \u003e OUTPUT\n```\n\n*NEW* - Usage: Teach Emotion\n-----------------------------\nEmpathy can become smarter! Simply pass it a string AND an emotion, and empathy will store them in it's RDD (influencing emotions in the future).\nSimply call spark-submit with empathy. Pass the text to be analyzed as a second parameter. The third parameter is a emotion string (ie: happiness).\n```\ntime ./bin/spark-submit /path/to/empathy/empathy.py \"I love this company. You guys provide excellent support.\" \"happiness\" \u003e OUTPUT\n```\n\nExample output\n-----------------------------\nOutput is returned as a JSON-parsable string.\n\nExample Call: \"I love this company. You guys provide excellent support.\"\n```\n{\"emotion\": \"love\",\n\"message\": \"I love this company. You guys provide excellent support.\",\n\"sentence\": 1}\n```\nEmotion: love\n\n\nExample Call: The support at this company isn't good. I'm very unhappy. I won't be ordering from you again.\n```\n{\"emotion\": \"sadness\",\n\"message\": \"The support at this company isn't good. I'm very unhappy. I won't be ordering from you again.\",\n\"sentence\": 3}\n```\nEmotion: sadness\n\n* \"emotion\" is detected emotion.\n* \"message\" is string empathy was called with.\n* \"sentence\" is the sentence number giving off the strongest emotion.\n\n\nData Source\n-----------------------------\n[Sentiment Analysis: Emotion in Text\n](https://www.crowdflower.com/wp-content/uploads/2016/07/text_emotion.csv) -\nIn a variation on the popular task of sentiment analysis, this dataset contains labels for the emotional content (such as happiness, sadness, and anger) of texts. Hundreds to thousands of examples across 13 labels. (crowdflower.com)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fzachalam%2Fempathy","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fzachalam%2Fempathy","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fzachalam%2Fempathy/lists"}