ikegami-yukino / pymlask

Emotion analyzer for Japanese text
Other
114 stars 26 forks source link
emotion-analysis emotion-detection japanese-language natural-language-processing nlp sentiment-analysis

pymlask

|coveralls| |pyversion| |version| |license|

pymlask is a Python version of ML-Ask (eMotive eLement and Expression Analysis system)

For details about ML-Ask, See http://arakilab.media.eng.hokudai.ac.jp/~ptaszynski/repository/mlask.htm

See also http://qiita.com/yukinoi/items/ef6fb48b5e3694e9659c (in Japanese)

Contributions are welcome!

Dependencies

MeCab binary

Installation

Modified dictionary version (recommended)

::

pip install pymlask

ML-Ask Original dictionary version (same as Ptaszynski's Perl version)

::

pip install git+https://github.com/ikegami-yukino/pymlask@original

Example

.. code:: python

from mlask import MLAsk emotion_analyzer = MLAsk() emotion_analyzer.analyze('彼のことは嫌いではない!(;´Д`)')

=> {'text': '彼のことは嫌いではない!(;´Д`)',

'emotion': defaultdict(<class 'list'>,{'yorokobi': ['嫌いCVS'], 'suki': ['嫌いCVS']}),

'orientation': 'POSITIVE',

'activation': 'NEUTRAL',

'emoticon': ['(;´Д`)'],

'intension': 2,

'intensifier': {'exclamation': ['!'], 'emotikony': ['´Д', 'Д', '´Д', '(;´Д`)']},

'representative': ('yorokobi', ['嫌い*CVS'])

}

emotion_analyzer = mlask.MLAsk('-d /usr/local/lib/mecab/dic/mecab-ipadic-neologd') # Use other dictionary

Dictionary sources

LICENSE

The BSD 3-Clause License

Copyright

ML-Ask Python: The BSD 3-Clause License (c) 2017 Yukino Ikegami. All Rights Reserved.

ML-Ask (original): The BSD 3-Clause License (c) 2007-2013, Michal Ptaszynski, Pawel Dybala, Rafal Rzepka, Kenji Arakii. All Rights Reserved.

Cited by

Scientific paper

Blog

.. |coveralls| image:: https://coveralls.io/repos/ikegami-yukino/pymlask/badge.png :target: https://coveralls.io/r/ikegami-yukino/pymlask :alt: coveralls.io

.. |pyversion| image:: https://img.shields.io/pypi/pyversions/pymlask.svg

.. |version| image:: https://img.shields.io/pypi/v/pymlask.svg :target: http://pypi.python.org/pypi/pymlask/ :alt: latest version

.. |license| image:: https://img.shields.io/pypi/l/mlask.svg :target: http://pypi.python.org/pypi/mlask/ :alt: license