{"id":15014152,"url":"https://github.com/kennethenevoldsen/asent","last_synced_at":"2025-04-06T12:13:03.027Z","repository":{"id":37940034,"uuid":"416652558","full_name":"KennethEnevoldsen/asent","owner":"KennethEnevoldsen","description":"Asent is a python library for performing efficient and transparent sentiment analysis using spaCy. ","archived":false,"fork":false,"pushed_at":"2024-04-15T20:40:35.000Z","size":56825,"stargazers_count":118,"open_issues_count":0,"forks_count":16,"subscribers_count":3,"default_branch":"main","last_synced_at":"2025-04-06T12:12:35.652Z","etag":null,"topics":["interpretability","natural-language-processing","nlp","python3","sentiment-analysis","spacy","spacy-extensions"],"latest_commit_sha":null,"homepage":"https://kennethenevoldsen.github.io/asent/","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/KennethEnevoldsen.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":"CONTRIBUTING.md","funding":null,"license":"LICENSE","code_of_conduct":"CODE_OF_CONDUCT.md","threat_model":null,"audit":null,"citation":"citation.cff","codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2021-10-13T08:31:08.000Z","updated_at":"2025-03-05T11:36:18.000Z","dependencies_parsed_at":"2023-09-26T00:15:01.429Z","dependency_job_id":"8315b291-3446-447d-9869-c6d1d50f15b0","html_url":"https://github.com/KennethEnevoldsen/asent","commit_stats":{"total_commits":270,"total_committers":10,"mean_commits":27.0,"dds":0.3925925925925926,"last_synced_commit":"c98a89dadedc2d76debda9f86c00f23fdb9f0ca6"},"previous_names":[],"tags_count":14,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/KennethEnevoldsen%2Fasent","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/KennethEnevoldsen%2Fasent/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/KennethEnevoldsen%2Fasent/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/KennethEnevoldsen%2Fasent/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/KennethEnevoldsen","download_url":"https://codeload.github.com/KennethEnevoldsen/asent/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247478331,"owners_count":20945266,"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":["interpretability","natural-language-processing","nlp","python3","sentiment-analysis","spacy","spacy-extensions"],"created_at":"2024-09-24T19:45:15.853Z","updated_at":"2025-04-06T12:13:03.009Z","avatar_url":"https://github.com/KennethEnevoldsen.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"\u003ca href=\"https://github.com/kennethenevoldsen/asent\"\u003e\u003cimg src=\"https://github.com/KennethEnevoldsen/asent/blob/main/docs/img/logo_black_font.png?raw=true\" width=\"300\" align=\"right\" /\u003e\u003c/a\u003e\n# Asent: Fast, flexible and transparent sentiment analysis\n\n\n[![PyPI version](https://badge.fury.io/py/asent.svg)](https://pypi.org/project/asent/)\n[![python version](https://img.shields.io/badge/Python-%3E=3.9-blue)](https://github.com/kennethenevoldsen/asent)\n[![Code style: black](https://img.shields.io/badge/Code%20Style-Black-black)](https://black.readthedocs.io/en/stable/the_black_code_style/current_style.html)\n[![github actions pytest](https://github.com/kennethenevoldsen/asent/actions/workflows/tests.yml/badge.svg)](https://github.com/kennethenevoldsen/asent/actions)\n[![github actions docs](https://github.com/kennethenevoldsen/asent/actions/workflows/documentation.yml/badge.svg)](https://kennethenevoldsen.github.io/asent/)\n[![pip downloads](https://img.shields.io/pypi/dm/asent.svg)](https://pypi.org/project/asent/)\n\n\nAsent is a rule-based sentiment analysis library for Python made using [SpaCy](https://spacy.io). \nIt is inspired by [Vader](https://github.com/cjhutto/vaderSentiment), but uses a more modular ruleset, that allows the user to change e.g. the method for finding negations. Furthermore, it includes visualizers to visualize model predictions, making the model easily interpretable.\n\n\n## Installation\n\nInstalling Asent is simple using pip:\n\n```\npip install asent\n```\n\nThere is no reason to update from GitHub as the version on pypi should always be the same of on GitHub.\n\n## Simple Example\nThe following shows a simple example of how you can quickly apply sentiment analysis using asent. For more on using asent see the [usage guides].\n\n```python\nimport spacy\nimport asent\n\n# create spacy pipeline\nnlp = spacy.blank('en')\nnlp.add_pipe('sentencizer')\n\n# add the rule-based sentiment model\nnlp.add_pipe(\"asent_en_v1\")\n\n# try an example\ntext = \"I am not very happy, but I am also not especially sad\"\ndoc = nlp(text)\n\n# print polarity of document, scaled to be between -1, and 1\nprint(doc._.polarity)\n# neg=0.0 neu=0.631 pos=0.369 compound=0.7526\n```\n\nNaturally, a simple score can be quite unsatisfying, thus Asent implements a series of visualizer to interpret the results: \n```python\n# visualize model prediction\nasent.visualize(doc, style=\"prediction\")\n```\n\n\u003cimg src=\"https://raw.githubusercontent.com/KennethEnevoldsen/asent/main/docs/img/model_pred.png\" width=\"500\" /\u003e\n\nIf we want to know why the model comes the result it does we can use the `analysis` style:\n```python\n# visualize the analysis performed by the model:\nasent.visualize(doc[:5], style=\"analysis\")\n```\n\u003cimg src=\"https://raw.githubusercontent.com/KennethEnevoldsen/asent/main/docs/img/model_analysis.png\" width=\"700\" /\u003e\n\nWhere the value in the parenthesis (2.7) indicates the human-rating of the word, while\nthe value outside the parenthesis indicates the value accounting for the negation.\nAsent also accounts for contrastive conjugations (e.g. but), casing, emoji's and\npunctuations. For more on how the model works check out the [usage guide].\n\n# 📖 Documentation\n\n| Documentation              |                                                                                                                         |\n| -------------------------- | ----------------------------------------------------------------------------------------------------------------------- |\n| 🔧 **[Installation]**       | Installation instructions for Asent                                                                                     |\n| 📚 **[Usage Guides]**       | Guides and instructions on how to use asent and its features. It also gives short introduction to how the models works. |\n| 📰 **[News and changelog]** | New additions, changes and version history.                                                                             |\n| 🎛 **[Documentation]**      | The detailed reference for Asents's API. Including function documentation                                               |\n\n[Documentation]: https://kennethenevoldsen.github.io/asent/index.html\n[Installation]: https://kennethenevoldsen.github.io/asent/installation.html\n[usage guides]: https://kennethenevoldsen.github.io/asent/introduction.html\n[News and changelog]: https://kennethenevoldsen.github.io/asent/news.html\n\n# 💬 Where to ask questions\n\n| Type                           |                        |\n| ------------------------------ | ---------------------- |\n| 🚨 **FAQ**                      | [FAQ]                  |\n| 🚨 **Bug Reports**              | [GitHub Issue Tracker] |\n| 🎁 **Feature Requests \u0026 Ideas** | [GitHub Issue Tracker] |\n| 👩‍💻 **Usage Questions**          | [GitHub Discussions]   |\n| 🗯 **General Discussion**       | [GitHub Discussions]   |\n\n\n[FAQ]: https://kennethenevoldsen.github.io/asent/faq.html\n[github issue tracker]: https://github.com/kennethenevoldsen/asent/issues\n[github discussions]: https://github.com/kennethenevoldsen/asent/discussions\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fkennethenevoldsen%2Fasent","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fkennethenevoldsen%2Fasent","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fkennethenevoldsen%2Fasent/lists"}