afinn

AFINN sentiment analysis in Python

https://github.com/fnielsen/afinn

Science Score: 28.0%

This score indicates how likely this project is to be science-related based on various indicators:

  • CITATION.cff file
    Found CITATION.cff file
  • codemeta.json file
  • .zenodo.json file
  • DOI references
  • Academic publication links
  • Committers with academic emails
    2 of 9 committers (22.2%) from academic institutions
  • Institutional organization owner
  • JOSS paper metadata
  • Scientific vocabulary similarity
    Low similarity (8.8%) to scientific vocabulary

Keywords

afinn danish english sentiment-analysis sentiment-lexcions
Last synced: 9 months ago · JSON representation ·

Repository

AFINN sentiment analysis in Python

Basic Info
  • Host: GitHub
  • Owner: fnielsen
  • License: apache-2.0
  • Language: Jupyter Notebook
  • Default Branch: master
  • Size: 234 KB
Statistics
  • Stars: 467
  • Watchers: 20
  • Forks: 220
  • Open Issues: 21
  • Releases: 0
Topics
afinn danish english sentiment-analysis sentiment-lexcions
Created almost 11 years ago · Last pushed about 4 years ago
Metadata Files
Readme License Citation

README.rst

afinn
=====

AFINN sentiment analysis in Python: Wordlist-based approach for sentiment analysis.

How to install
--------
    >>> git clone https://github.com/fnielsen/afinn
    >>> cd afinn
    >>> python setup.py install



Examples
--------

    >>> from afinn import Afinn
    >>> afinn = Afinn()
    >>> afinn.score('This is utterly excellent!')
    3.0

In Danish:

    >>> afinn = Afinn(language='da')
    >>> afinn.score('Hvis ikke det er det mest afskyelige flueknepperi...')
    -6.0

In Finnish:

	>>> afinn = Afinn(language='fi')
	>>> afinn.score('Siellä on uusi hyvä juttu, katsokaa ja kuunnelkaa ihmeessä.')
	3.0

In Swedish:

	>>> afinn = Afinn(language='sv')
	>>> afinn.score('det är inte bra')
	-2.0

In Turkish:

	>>> afinn = Afinn(language='tr')
	>>> from six import u
	>>> afinn.score(u('iyi de\u011Fil'))
	-2.0

	>>> afinn = Afinn(language='tr')
	>>> afinn.score('iyi değil')
	-2.0

With emoticons:

    >>> afinn = Afinn(emoticons=True)
    >>> afinn.score('I saw that yesterday :)')
    2.0

With multiple sentences (here with data from an Austen novel available in Gutenberg):

    >>> from afinn import Afinn
    >>> from nltk.corpus import gutenberg
    >>> import textwrap
    >>> afinn = Afinn()
    >>> sentences = (" ".join(wordlist) for wordlist in gutenberg.sents('austen-sense.txt'))
    >>> scored_sentences = ((afinn.score(sent), sent) for sent in sentences)
    >>> sorted_sentences = sorted(scored_sentences)
    >>> print("\n".join(textwrap.wrap(sorted_sentences[0][1], 70)))
    To attach myself to your sister , therefore , was not a thing to be
    thought of ;-- and with a meanness , selfishness , cruelty -- which no
    indignant , no contemptuous look , even of yours , Miss Dashwood , can
    ever reprobate too much -- I was acting in this manner , trying to
    engage her regard , without a thought of returning it .-- But one
    thing may be said for me : even in that horrid state of selfish vanity
    , I did not know the extent of the injury I meditated , because I did
    not THEN know what it was to love .

Citation
--------
If you as a scientist use the wordlist or the code please cite this one:

* Finn Årup Nielsen, "A new ANEW: evaluation of a word list for sentiment analysis in microblogs", Proceedings of the ESWC2011 Workshop on 'Making Sense of Microposts': Big things come in small packages. Volume 718 in CEUR Workshop Proceedings: 93-98. 2011 May. Matthew Rowe, Milan Stankovic, Aba-Sah Dadzie, Mariann Hardey (editors)

Paper with supplement: http://www2.imm.dtu.dk/pubdb/views/edoc_download.php/6006/pdf/imm6006.pdf

See also
--------
* http://neuro.compute.dtu.dk/wiki/AFINN - Brede Wiki entry on AFINN with pointers to many scientific papers
* 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


Travis et al.
-------------

.. image:: https://travis-ci.com/fnielsen/afinn.svg?branch=master
    :target: https://travis-ci.com/fnielsen/afinn

.. image:: https://coveralls.io/repos/fnielsen/afinn/badge.svg?branch=master :target: https://coveralls.io/github/fnielsen/afinn?branch=master

.. image:: https://img.shields.io/pypi/dm/afinn.svg?style=flat
   :target: https://pypi.python.org/pypi/afinn
   :alt: Downloads

.. image:: https://www.openhub.net/p/afinn/widgets/project_thin_badge.gif
   :target: https://www.openhub.net/p/afinn
   :alt: Open Hub

Owner

  • Name: Finn Årup Nielsen
  • Login: fnielsen
  • Kind: user
  • Location: Kongens Lyngby, Denmark
  • Company: Technical University of Denmark

Data science. Data and text mining, neuroinformatics, social media, wiki.

Citation (CITATION)

If you are a scientist and use the wordlists or code you can cite this publication:

@InProceedings{NielsenF2011New,
  author =       {Finn {\AA}rup Nielsen}, 
  title =        {A new {ANEW}: evaluation of a word list for
                  sentiment analysis in microblogs}, 
  booktitle =    {Proceedings of the ESWC2011 Workshop on 'Making
                  Sense of Microposts': Big things come in small
                  packages}, 
  pages =        {93--98},
  year =         {2011},
  editor =       {Matthew Rowe and Milan Stankovic and Aba-Sah Dadzie
                  and Mariann Hardey},  
  volume =       {718},
  number =       {},
  series =       {CEUR Workshop Proceedings},
  address =      {},
  organization = {},
  publisher =    {},
  month =        {May},
  DOI =          {},
  URL = {http://ceur-ws.org/Vol-718/paper_16.pdf},
  OPTnote =      {},
  OPTannote =    {}
}

GitHub Events

Total
  • Watch event: 22
  • Fork event: 2
Last Year
  • Watch event: 22
  • Fork event: 2

Committers

Last synced: over 3 years ago

All Time
  • Total Commits: 112
  • Total Committers: 9
  • Avg Commits per committer: 12.444
  • Development Distribution Score (DDS): 0.384
Top Committers
Name Email Commits
fnielsen f****n@d****k 69
Finn Årup Nielsen fn@i****k 26
Floris Snuif f****s@m****m 6
goker g****r@c****e 5
moamen m****6@g****m 2
Floris Snuif f****e@m****l 1
Jakub Polak k****k@u****m 1
Matti f****k@l****n 1
Rahman Usta r****a@u****m 1
Committer Domains (Top 20 + Academic)

Issues and Pull Requests

Last synced: 11 months ago

All Time
  • Total issues: 21
  • Total pull requests: 18
  • Average time to close issues: 8 months
  • Average time to close pull requests: 7 months
  • Total issue authors: 10
  • Total pull request authors: 11
  • Average comments per issue: 1.24
  • Average comments per pull request: 2.0
  • Merged pull requests: 8
  • Bot issues: 0
  • Bot pull requests: 0
Past Year
  • Issues: 0
  • Pull requests: 0
  • Average time to close issues: N/A
  • Average time to close pull requests: N/A
  • Issue authors: 0
  • Pull request authors: 0
  • Average comments per issue: 0
  • Average comments per pull request: 0
  • Merged pull requests: 0
  • Bot issues: 0
  • Bot pull requests: 0
Top Authors
Issue Authors
  • fnielsen (12)
  • ali-unlu (1)
  • MattOates (1)
  • ojongerius (1)
  • richierocks (1)
  • NorthGuard (1)
  • analyticalpicasso (1)
  • dwicak (1)
  • Arthavruksha (1)
  • katerinastar (1)
Pull Request Authors
  • mopinion (6)
  • fnielsen (3)
  • olavski (1)
  • chaicebryan (1)
  • mmaguero (1)
  • peterjot (1)
  • rahmanusta (1)
  • kupolak (1)
  • gokercebeci (1)
  • moamenibrahim (1)
  • angstwad (1)
Top Labels
Issue Labels
bug (2) enhancement (2)
Pull Request Labels

Packages

  • Total packages: 1
  • Total downloads:
    • pypi 3,390 last-month
  • Total dependent packages: 2
  • Total dependent repositories: 56
  • Total versions: 2
  • Total maintainers: 1
pypi.org: afinn

AFINN sentiment analysis

  • Versions: 2
  • Dependent Packages: 2
  • Dependent Repositories: 56
  • Downloads: 3,390 Last month
  • Docker Downloads: 0
Rankings
Dependent repos count: 2.0%
Docker downloads count: 2.0%
Average: 2.9%
Stargazers count: 3.1%
Dependent packages count: 3.2%
Forks count: 3.5%
Downloads: 3.8%
Maintainers (1)
Last synced: 10 months ago