Sentiment analysis in Elixir.
The library is highly influenced by other afinn
implementations.
Dictionaries included:
- English Language 🇬🇧
- Danish Language 🇩🇰
- Installation
- Usage
- Dictionaries
- Similar libraries in other programming languages
- Documentation
- Contributing
The package can be installed
by adding afinn
to your list of dependencies in mix.exs
:
def deps do
[
{:afinn, "~> 0.2.1"}
]
end
The following languages are currently supported:
Language | Symbol |
---|---|
English | :en |
Danish | :dk |
text = 'I love this!'
Afinn.score(text, :en)
#=> 3
Afinn.score_to_words(text, :en)
#=> :positive
Afinn.score("Dårligt produkt!", :dk)
#=> -3
The dictionaries used in this repository are from a project by Finn Årup Nielsen: https://github.com/fnielsen/afinn/tree/master/afinn/data
For more information visit: http://corpustext.com/reference/sentiment_afinn.html
Paper with supplement: http://www2.imm.dtu.dk/pubdb/views/edoc_download.php/6006/pdf/imm6006.pdf
- https://github.com/fnielsen/afinn - Sentiment analysis in Python with AFINN word list
- https://github.com/darenr/afinn - Sentiment analysis in Javascript with AFINN word list
- https://github.com/prograils/afinn - Sentiment analysis in Ruby with AFINN word list
Documentation can be generated with ExDoc and published on HexDocs. Once published, the docs can be found at https://hexdocs.pm/afinn.
Bug reports and pull requests are welcome on GitHub at https://github.com/kupolak/afinn.