{"id":13430327,"url":"https://github.com/unixpickle/sentigraph","last_synced_at":"2025-05-02T00:32:22.056Z","repository":{"id":138791251,"uuid":"66220220","full_name":"unixpickle/sentigraph","owner":"unixpickle","description":"Graph sentiment throughout a piece of text","archived":false,"fork":false,"pushed_at":"2016-08-28T13:55:38.000Z","size":780,"stargazers_count":16,"open_issues_count":0,"forks_count":4,"subscribers_count":3,"default_branch":"master","last_synced_at":"2024-04-14T05:30:39.967Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","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/unixpickle.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}},"created_at":"2016-08-21T20:53:47.000Z","updated_at":"2024-02-13T00:23:44.000Z","dependencies_parsed_at":null,"dependency_job_id":"5aa759ac-9aed-4ae9-8ad8-c17beb2a06ca","html_url":"https://github.com/unixpickle/sentigraph","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/unixpickle%2Fsentigraph","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/unixpickle%2Fsentigraph/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/unixpickle%2Fsentigraph/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/unixpickle%2Fsentigraph/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/unixpickle","download_url":"https://codeload.github.com/unixpickle/sentigraph/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":251966432,"owners_count":21672666,"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-07-31T02:00:52.255Z","updated_at":"2025-05-02T00:32:17.042Z","avatar_url":"https://github.com/unixpickle.png","language":"Go","readme":"# sentigraph\n\nThe goal of this project is to use Machine Learning to graph the mood (positive/negative) over a long piece of text (e.g. a book). In other words, it will graph sentiment over time.\n\n# Example\n\nUsing this tool, you can turn a book (in this case Under The Dome by Steven King) into a map of emotion like this:\n\n![Under the Dome heatmap](examples/UnderTheDome.png)\n\nThe red bars indicate negative mood, the green indicate positive mood, and white indicates neutral.\n\n# Usage\n\nThis project has three different components, so there are three main steps to using it.\n\n## Train a classifier\n\nThe first step is to train a Machine Learning algorithm to determine the sentiment of a piece of text. You must download a training corpus for this (I recommend the one at [http://help.sentiment140.com/for-students/](http://help.sentiment140.com/for-students/)). You will need to pick a location to save the trained classifier (I'll use `/path/to/classifier`):\n\n```\n$ go run train/*.go bayes /path/to/classifier /path/to/training.csv\n```\n\nThis will take several minutes to run, and once it's done you will have a classifier.\n\n## Create a CSV for some text\n\nThe next step is to generate a CSV file with the sentiment of each sentence in the body of text you would like to graph. To do this, do the following:\n\n```\n$ go run plotcsv/*.go /path/to/classifier /path/to/text.txt /path/to/sentiments.csv\n```\n\nThis will generate a file at `/path/to/sentiments.csv` containing sentiments for each sentence in the text file `/path/to/text.txt`.\n\n## Graph the sentiments\n\nFinally, to create a graphical image of the previously generated CSV file, you can do the following:\n\n```\n$ go run graph/*.go /path/to/sentiments.csv /path/to/graph.png heat\n```\n\nThat will create a sentiment heat map out of the CSV file.\n","funding_links":[],"categories":["Go"],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Funixpickle%2Fsentigraph","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Funixpickle%2Fsentigraph","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Funixpickle%2Fsentigraph/lists"}