{"id":15662583,"url":"https://github.com/climbsrocks/empythy","last_synced_at":"2025-05-06T01:02:58.530Z","repository":{"id":80566109,"uuid":"65230962","full_name":"ClimbsRocks/empythy","owner":"ClimbsRocks","description":"Automated NLP sentiment predictions- batteries included, or use your own data","archived":false,"fork":false,"pushed_at":"2017-12-15T10:15:39.000Z","size":2543,"stargazers_count":18,"open_issues_count":1,"forks_count":8,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-05-06T01:02:48.759Z","etag":null,"topics":["automated-machine-learning","batteries-included","machine-learning","machinelearning","nlp","nlp-library","nlp-machine-learning","nlp-sentiment-classifier","sentiment","sentiment-classification","sentiment-classifier","sentiment-predictions"],"latest_commit_sha":null,"homepage":"http://empythy.com","language":"Python","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/ClimbsRocks.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}},"created_at":"2016-08-08T18:59:49.000Z","updated_at":"2023-09-12T17:04:22.000Z","dependencies_parsed_at":null,"dependency_job_id":"7bb051f6-3dd6-43b9-86bc-8c0e46a1c409","html_url":"https://github.com/ClimbsRocks/empythy","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/ClimbsRocks%2Fempythy","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ClimbsRocks%2Fempythy/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ClimbsRocks%2Fempythy/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ClimbsRocks%2Fempythy/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/ClimbsRocks","download_url":"https://codeload.github.com/ClimbsRocks/empythy/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":252601876,"owners_count":21774663,"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":["automated-machine-learning","batteries-included","machine-learning","machinelearning","nlp","nlp-library","nlp-machine-learning","nlp-sentiment-classifier","sentiment","sentiment-classification","sentiment-classifier","sentiment-predictions"],"created_at":"2024-10-03T13:33:23.762Z","updated_at":"2025-05-06T01:02:58.509Z","avatar_url":"https://github.com/ClimbsRocks.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# empathyMachines\n\u003e A standalone NLP sentiment classifier you can import as a module\n\n## Purposes\n\n1. Offer a batteries-included NLP classifier you can use either on it's own, or to make sentiment predictions as part of a broder NLP project (for example, when classifying customer messages, whether the customer is angry or not might help you determine if this is a compensation request, or a request to adjust their address.)\n1. Have the entire sentiment prediction process scaffolded so you can feed in your own training corpus, and easily train an NLP sentiment classifier.\n\n## How to use\n\n1. `pip install empythy`\n1.\n```\nfrom empythy import EmpathyMachines\nnlp_classifier = EmpathyMachines()\nnlp_classifier.train()\nnlp_classifier.predict(text_string)\n```\n\n### Corpora included\n\n#### NLTK Movie Reviews\nThe classic sentiment corpus, 2000 movie reviews already gathered by NLTK.\n\n#### Assembling a custom Twitter sentiment corpus\n[CrowdFlower](http://www.crowdflower.com/data-for-everyone) hosts a number of Twitter corpora that have already been graded for sentiment by panels of humans.\n\nI aggregated together 6 of their corpora into a single, aggregated and cleaned corpus, with consistent scoring labels across the entire corpus. The cleaned corpus contains over 45,000 documents, with positive, negative, and neutral sentiments.\n\n\n### Train on your own corpus\n\nFeel free to train a classifier on your own corpus!\n\nTwo ways to do this\n\n1. Read in a .csv file with header row containing \"sentiment\", \"text\", and optionally, \"confidence\"\n    - Pass the name of the .csv file to train, like so:\n    - `nlp_classifier.train(corpus='custom', corpus_path='path/to/custom/corpus.csv')`\n1. Pass in an array of Python dictionaries, where each dictionary has attributes for \"sentiment\", \"text\", and optionally, \"confidence\"\n    - `nlp_classifier.train(corpus='custom', corpus_array=my_array_of_texts)`\n    - Two important parts to this, both `corpus='custom'`, and `corpus_array=my_variable_holding_the_documents`.\n\n### Advanced Usage\n1. `nlp_classifier.train(verbose=False)` to turn off print status statements while training.\n1. `nlp_classifier.train(print_analytics_results=True)` to print out results of training the classifier.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fclimbsrocks%2Fempythy","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fclimbsrocks%2Fempythy","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fclimbsrocks%2Fempythy/lists"}