Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/uesteibar/veritaserum
Sentiment analysis based on afinn-165, emojis and some enhancements.
https://github.com/uesteibar/veritaserum
afinn elixir elixir-library hex sentiment-analysis
Last synced: 1 day ago
JSON representation
Sentiment analysis based on afinn-165, emojis and some enhancements.
- Host: GitHub
- URL: https://github.com/uesteibar/veritaserum
- Owner: uesteibar
- License: other
- Created: 2017-05-17T17:32:20.000Z (over 7 years ago)
- Default Branch: master
- Last Pushed: 2023-01-19T08:59:59.000Z (about 2 years ago)
- Last Synced: 2025-01-17T12:15:36.797Z (8 days ago)
- Topics: afinn, elixir, elixir-library, hex, sentiment-analysis
- Language: Elixir
- Homepage: https://hex.pm/packages/veritaserum
- Size: 50.8 KB
- Stars: 83
- Watchers: 3
- Forks: 10
- Open Issues: 2
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
- License: LICENSE.md
Awesome Lists containing this project
- freaking_awesome_elixir - Elixir - Sentiment analysis based on afinn-165, emojis and some enhancements. (Text and Numbers)
- fucking-awesome-elixir - veritaserum - Sentiment analysis based on afinn-165, emojis and some enhancements. (Text and Numbers)
- awesome-elixir - veritaserum - Sentiment analysis based on afinn-165, emojis and some enhancements. (Text and Numbers)
README
# Veritaserum
[![Build Status](https://travis-ci.org/uesteibar/veritaserum.svg?branch=master)](https://travis-ci.org/uesteibar/veritaserum)
[![Module Version](https://img.shields.io/hexpm/v/veritaserum.svg)](https://hex.pm/packages/veritaserum)
[![Hex Docs](https://img.shields.io/badge/hex-docs-lightgreen.svg)](https://hexdocs.pm/veritaserum/)
[![License](https://img.shields.io/hexpm/l/veritaserum.svg)](https://github.com/uesteibar/veritaserum/blob/master/LICENSE.md)Simple sentiment analysis for [Elixir](http://elixir-lang.org/) based on the AFINN-165 list and some extra enhancements.
It also supports:
- **emojis** (❤️, 😱...)
- **boosters** (*very*, *really*...)
- **negators** (*don't*, *not*...).## Index
- [Installation](#installation)
- [Usage](#usage)
- [Running Locally](#running-locally)
- [Contributing](#contributing)## Installation
Add `veritaserum` to your list of dependencies in `mix.exs`:
```elixir
def deps do
[{:veritaserum, "~> 0.2.2"}]
end
```## Usage
To analyze a text
```elixir
Veritaserum.analyze("I love Veritaserum!") #=> 3# It also supports emojis
Veritaserum.analyze("I ❤️ Veritaserum!") #=> 2# It also supports negators
Veritaserum.analyze("I like Veritaserum!") #=> 2
Veritaserum.analyze("I don't like Veritaserum!") #=> -2#and boosters
Veritaserum.analyze("Veritaserum is cool!") #=> 1
Veritaserum.analyze("Veritaserum is very cool!") #=> 2
```You can also pass a list
```elixir
Veritaserum.analyze(["I love Veritaserum!", "I hate some things!"]) #=> [3, -3]
```Documentation can be found on [HexDocs](https://hexdocs.pm/veritaserum).
## Running locally
Clone the repository
```bash
git clone [email protected]:uesteibar/veritaserum.git
```Install dependencies
```bash
cd veritaserum
mix deps.get
```To run the tests
```bash
mix test
```To run the lint
```elixir
mix credo
```## Contributing
Pull requests are always welcome =)
The project uses [standard-changelog](https://github.com/conventional-changelog/conventional-changelog) to update the [Changelog](https://github.com/uesteibar/veritaserum/blob/master/CHANGELOG.md) with each commit message and upgrade the package version.
For that reason every contribution should have a title and body that follows the [conventional commits standard](https://conventionalcommits.org/) conventions (e.g. `feat(analyzer): Make it smarter than Jarvis`).To make this process easier, you can do the following:
Install `commitizen` and `cz-conventional-changelog` globally
```bash
npm i -g commitizen cz-conventional-changelog
```Save `cz-conventional-changelog` as default
```bash
echo '{ "path": "cz-conventional-changelog" }' > ~/.czrc
```Instead of `git commit`, you can now run
```
git cz
```
and follow the instructions to generate the commit message.