Skip to content

Commit 2eefc80

Browse files
bump v0.4.3
1 parent 8ad3134 commit 2eefc80

8 files changed

Lines changed: 225 additions & 54 deletions

File tree

CHANGELOG.md

Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
# CHANGES
2+
3+
## 0.4.3 (2025-08-02)
4+
5+
- Resolve mecabrc not found issue
6+
- Support Python 3.12, 3.13
7+
- Migrate packaging solution from setup.py to pyproject.toml
8+
9+
## 0.4.2 (2023-02-19)
10+
11+
- Enable user's dictionary
12+
- Solve install issue
13+
- Support Python 3.11
14+
- PEP8
15+
16+
## 0.3.1 (2022-08-17)
17+
18+
- Improve dictionaries
19+
- Use Bunkai module instead of sengiri
20+
21+
## 0.2 (2019-10-07)
22+
23+
- Add new methods count_polarity (thanks @yskn67) and analyze_detail
24+
- Drop support Python 3.3
25+
- Use sengiri package
26+
- Support parallel negation (e.g. お金も希望もない is negative)
27+
- Support "arujanai" expression (e.g. お金があるじゃない is positive)
28+
29+
## 0.1.2 (2019-02-18)
30+
31+
- Fix missing CHANGES.rst
32+
33+
## 0.1.1 (2019-02-13)
34+
35+
- Set install_requires
36+
37+
## 0.1 (2019-02-12)
38+
39+
- First release

CHANGES.rst

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,9 @@
11
CHANGES
22
=======
33

4+
!WARNING! This documentation is deprecated. See https://github.com/ikegami-yukino/oseti/blob/master/CHANGELOG.md
5+
6+
47
0.4.2 (2023-02-19)
58
------------------
69

README.md

Lines changed: 92 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,92 @@
1+
# oseti
2+
3+
[![PyPI Downloads](https://static.pepy.tech/badge/oseti)](https://pepy.tech/projects/oseti)[![PyPI - Version](https://img.shields.io/pypi/v/oseti)![PyPI - Python Version](https://img.shields.io/pypi/pyversions/oseti)![PyPI - License](https://img.shields.io/pypi/l/oseti)](http://pypi.python.org/pypi/oseti/)
4+
5+
Dictionary based Sentiment Analysis for Japanese
6+
7+
## INSTALLATION
8+
9+
```sh
10+
pip install oseti
11+
```
12+
13+
If encountered "AttributeError: module 'emoji' has no attribute 'UNICODE_EMOJI'", then execute the following command:
14+
15+
```sh
16+
pip install --ignore-requires-python -U bunkai
17+
```
18+
19+
## USAGE
20+
21+
```python
22+
import oseti
23+
24+
analyzer = oseti.Analyzer()
25+
analyzer.analyze('天国で待ってる。')
26+
# => [1.0]
27+
analyzer.analyze('遅刻したけど楽しかったし嬉しかった。すごく充実した!')
28+
# => [0.3333333333333333, 1.0]
29+
30+
analyzer.count_polarity('遅刻したけど楽しかったし嬉しかった。すごく充実した!')
31+
# => [{'positive': 2, 'negative': 1}, {'positive': 1, 'negative': 0}])
32+
analyzer.count_polarity('そこにはいつもと変わらない日常があった。')
33+
# => [{'positive': 0, 'negative': 0}]
34+
35+
analyzer.analyze_detail('お金も希望もない!')
36+
# => [{'positive': [], 'negative': ['お金-NEGATION', '希望-NEGATION'], 'score': -1.0}])
37+
analyzer.analyze_detail('お金がないわけではない')
38+
# => [{'positive': ['お金'], 'negative': [], 'score': 1.0}]
39+
40+
# Applying user's dictionary
41+
analyzer = oseti.Analyzer(word_dict={'カワイイ': 'p', 'ブサイク': 'n'},
42+
wago_dict={'イカ する': 'ポジ', 'まがまがしい': 'ネガ'})
43+
analyzer.analyze_detail("カワイイ")
44+
# => [{'positive': ['カワイイ'], 'negative': [], 'score': 1.0}]
45+
analyzer.analyze_detail("ブサイクだ")
46+
# => [{'positive': [], 'negative': ['ブサイク'], 'score': -1.0}]
47+
analyzer.analyze_detail("まがまがしい")
48+
# => [{'positive': [], 'negative': ['まがまがしい'], 'score': -1.0}]
49+
analyzer.analyze_detail("イカすよ")
50+
# => [{'positive': ['イカ する'], 'negative': [], 'score': 1.0}]
51+
```
52+
53+
## ACKNOWLEDGEMENT
54+
55+
This module uses 日本語評価極性辞書(用言編)ver.1.0 and 日本語評価極性辞書(名詞編)ver.1.0.
56+
57+
I appreciate people involved in these data.
58+
59+
- 小林のぞみ,乾健太郎,松本裕治,立石健二,福島俊一. 意見抽出のための評価表現の収集. 自然言語処理,Vol.12, No.3, pp.203-222, 2005. / Nozomi Kobayashi, Kentaro Inui, Yuji Matsumoto, Kenji Tateishi. Collecting Evaluative Expressions for Opinion Extraction, Journal of Natural Language Processing 12(3), 203-222, 2005.
60+
61+
- 東山昌彦, 乾健太郎, 松本裕治. 述語の選択選好性に着目した名詞評価極性の獲得. 言語処理学会第14回年次大会論文集, pp.584-587, 2008. / Masahiko Higashiyama, Kentaro Inui, Yuji Matsumoto. Learning Sentiment of Nouns from Selectional Preferences of Verbs and Adjectives. Proceedings of the 14th Annual Meeting of the Association for Natural Language Processing, pp.584-587, 2008.
62+
63+
## Cited by
64+
65+
### Scientific paper
66+
67+
- 丸山 正人, 竹川 高志. 個人の特性を反映した文章の類似度判定による小説推薦. DEIM Forum 2020, P2-26, 2020.
68+
- Yoshihiro Adachi and Negishi Takanori. Development and evaluation of a real-time analysis method for free-description questionnaire responses. 2020 15th International Conference on Computer Science & Education (ICCSE), p. 78-82, 2020.
69+
- Uģis Nastevičs. THE IMAGE OF LATVIA AND LATVIANS ON JAPANESE TWITTER: REFLECTIONS ON PEOPLE. Culture Crossroads, Vol. 17, p.93-113, 2021.
70+
- 安達 由洋, 近藤 友啓, 小林 孝充, 惠谷 菜央, 石井 解人. 感情語辞書を用いた日本語文の感情分析. 可視化情報学会誌, 2021, 41 巻, 161 号, p. 21-27, 2022.
71+
- 田村匠, 丸山真佐夫. Character-Level CNNを用いた日本語評判分析. 情報処理学会第84回全国大会, Vol.2, pp.675-676, 2022.
72+
- Kazuko UNO. How to spread accurate scientific-based information in real time after large-scale disasters: a multifaceted research of radiation related information spreading on Twitter after 3.11. 2022.
73+
- 星野 雄介. ⾃然⾔語処理技術を⽤いた新型コロナウイルスに関する新聞社説の予備的分析―新聞社ごとの違いと研究の展望―. 武蔵野大学経営研究所紀要, p.113-148, 2022.
74+
- イー フエイチー, 望月 源. テレビ字幕データを用いた感情分析による「ある日の日本の気分」推定に関する研究. 言語処理学会 第28回年次大会 発表論文集, pp.857-862, 2022.
75+
- Tomoya Ohba, Candy Olivia Mawalim, Shun Katada, Haruki Kuroki, Shogo Okada. Multimodal Analysis for Communication Skill and Self-Efficacy Level Estimation in Job Interview Scenario. MUM 2022, P.110-120, 2022.
76+
- Kunihiro Miyazaki, Takayuki Uchiba, Fujio Toriumi, Kenji Tanaka, Takeshi Sakaki. Retrospective Analysis of Controversial Subtopics on COVID-19 in Japan. ASONUM'21, p.510-517, 2022.
77+
- 渡邉みさと, 沼部恵, 阿部沙亜弥, 尾上洋介. BuzzLead:TikTokの流行曲予測システム. 情報処理学会インタラクション2023, p.956-961, 2023.
78+
- 樋口 亮太. セリフの感情極性と物語中の出来事の関係性に基づくキャラクタの変化に関する調査, 2022年度関西大学大学院総合情報学研究科修士論文, 2023.
79+
- Sonia Yaco. AI as a Meta-Analyst: Interrogating AI Test Results on the Meiji Era WE Griffis Manuscript Collection. In: Proceedings of the 13th Conference of Japanese Association for Digital Humanities (JADH2024), 2024.
80+
- Tomoyuki Kobayashi, Koki Yamada, Michio Murakami, Akihiko Ozaki, Hiroyuki A. Torii, and Kazuko Uno. Assessment of attitudes toward critical actors during public health crises. International Journal of Disaster Risk Reduction, Vol. 108, 2024.
81+
- Feby Juana Candra, Aika Shiro, Yingting Chen, Taro Kanno, Satori Hachisuka, Yuta Yoshino, and Shuhei Watanabe. Fostering Creativity Through Behavioral and Emotional Insights in Meetings. In: International Conference on Human-Computer Interaction, p. 273-286, 2025.
82+
83+
### Slide
84+
85+
- Python ライブラリ開発における失敗談 〜開発者に選ばれるライブラリを作るために必要なこと〜 / pycon-jp-2022: https://speakerdeck.com/taishii/pycon-jp-2022
86+
87+
### Blog
88+
89+
- 肯否分析 [自然言語処理の餅屋]: https://www.jnlp.org/nlp/%E3%83%86%E3%82%AD%E3%82%B9%E3%83%88%E3%83%9E%E3%82%A4%E3%83%8B%E3%83%B3%E3%82%B0/%E8%82%AF%E5%90%A6%E5%88%86%E6%9E%90
90+
- メンヘラがツイートを形態素解析して気分の波を調べた結果www #Python - Qiita: https://qiita.com/yusuke_astro/items/dc38802b81f348189a98
91+
- AKIBA.AWS ONLINE #09で「Amazon Comprehendから始める感情分析」について話しました #AKIBAAWS | DevelopersIO: https://dev.classmethod.jp/articles/talking-about-amazon-comprehend-and-sentiment-analysis-in-akiba-aws-online-09/
92+
- Slackのtimesにネガポジ分析を掛けて1年を振り返る - susunshunのお粗末な記録: https://susunshun.hatenablog.com/entry/2019/12/25/173221

README.rst

Lines changed: 24 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
11
oseti
22
==========
3-
|circleci| |coveralls| |pyversion| |version| |license|
3+
|pyversion| |version| |license|
4+
5+
!WARNING! This documentation is deprecated. See https://github.com/ikegami-yukino/oseti/blob/master/README.md
46

57
Dictionary based Sentiment Analysis for Japanese
68

@@ -11,6 +13,12 @@ INSTALLATION
1113

1214
$ pip install oseti
1315

16+
If encountered "AttributeError: module 'emoji' has no attribute 'UNICODE_EMOJI'", then execute the following command:
17+
18+
::
19+
20+
$ pip install --ignore-requires-python -U bunkai
21+
1422

1523
USAGE
1624
============
@@ -50,7 +58,9 @@ USAGE
5058
ACKNOWLEDGEMENT
5159
=================
5260

53-
This module uses 日本語評価極性辞書(用言編)ver.1.0 and 日本語評価極性辞書(名詞編)ver.1.0
61+
This module uses 日本語評価極性辞書(用言編)ver.1.0 and 日本語評価極性辞書(名詞編)ver.1.0.
62+
63+
I appreciate people involved in these data.
5464

5565
- 小林のぞみ,乾健太郎,松本裕治,立石健二,福島俊一. 意見抽出のための評価表現の収集. 自然言語処理,Vol.12, No.3, pp.203-222, 2005. / Nozomi Kobayashi, Kentaro Inui, Yuji Matsumoto, Kenji Tateishi. Collecting Evaluative Expressions for Opinion Extraction, Journal of Natural Language Processing 12(3), 203-222, 2005.
5666

@@ -61,16 +71,21 @@ Cited by
6171

6272
Scientific paper
6373
-----------------
64-
- 田村匠, 丸山真佐夫. Character-Level CNNを用いた日本語評判分析. 情報処理学会第84回全国大会, Vol.2, pp.675-676, 2022.
65-
- 安達 由洋, 近藤 友啓, 小林 孝充, 惠谷 菜央, 石井 解人. 感情語辞書を用いた日本語文の感情分析. 可視化情報学会誌, 2021, 41 巻, 161 号, p. 21-27, 2022.
66-
- イー フエイチー, 望月 源. テレビ字幕データを用いた感情分析による「ある日の日本の気分」推定に関する研究. 言語処理学会 第28回年次大会 発表論文集, pp.857-862, 2022.
67-
- 渡邉みさと, 沼部恵, 阿部沙亜弥, 尾上洋介. BuzzLead:TikTokの流行曲予測システム. 情報処理学会インタラクション2023, p.956-961, 2023.
68-
- 丸山 正人, 竹川 高志. 個人の特性を反映した文章の類似度判定による小説推薦. DEIM Forum 2020 P2-26, 2020.
69-
- 星野 雄介. ⾃然⾔語処理技術を⽤いた新型コロナウイルスに関する新聞社説の予備的分析―新聞社ごとの違いと研究の展望―. 武蔵野大学経営研究所紀要, p.113-148, 2022.
74+
- 丸山 正人, 竹川 高志. 個人の特性を反映した文章の類似度判定による小説推薦. DEIM Forum 2020, P2-26, 2020.
75+
- Yoshihiro Adachi and Negishi Takanori. Development and evaluation of a real-time analysis method for free-description questionnaire responses. 2020 15th International Conference on Computer Science & Education (ICCSE), p. 78-82, 2020.
7076
- Uģis Nastevičs. THE IMAGE OF LATVIA AND LATVIANS ON JAPANESE TWITTER: REFLECTIONS ON PEOPLE. Culture Crossroads, Vol. 17, p.93-113, 2021.
77+
- 安達 由洋, 近藤 友啓, 小林 孝充, 惠谷 菜央, 石井 解人. 感情語辞書を用いた日本語文の感情分析. 可視化情報学会誌, 2021, 41 巻, 161 号, p. 21-27, 2022.
78+
- 田村匠, 丸山真佐夫. Character-Level CNNを用いた日本語評判分析. 情報処理学会第84回全国大会, Vol.2, pp.675-676, 2022.
7179
- Kazuko UNO. How to spread accurate scientific-based information in real time after large-scale disasters: a multifaceted research of radiation related information spreading on Twitter after 3.11. 2022.
72-
- Tomoya Ohba, Candy Olivia Mawalim, Shun Katada, Haruki Kuroki, Shogo Okada. Multimodal Analysis for Communication Skill and Self-Efficacy Level Estimation in Job Interview Scenario. MUM 2022, P.110–120, 2022.
80+
- 星野 雄介. ⾃然⾔語処理技術を⽤いた新型コロナウイルスに関する新聞社説の予備的分析―新聞社ごとの違いと研究の展望―. 武蔵野大学経営研究所紀要, p.113-148, 2022.
81+
- イー フエイチー, 望月 源. テレビ字幕データを用いた感情分析による「ある日の日本の気分」推定に関する研究. 言語処理学会 第28回年次大会 発表論文集, pp.857-862, 2022.
82+
- Tomoya Ohba, Candy Olivia Mawalim, Shun Katada, Haruki Kuroki, Shogo Okada. Multimodal Analysis for Communication Skill and Self-Efficacy Level Estimation in Job Interview Scenario. MUM 2022, P.110-120, 2022.
7383
- Kunihiro Miyazaki, Takayuki Uchiba, Fujio Toriumi, Kenji Tanaka, Takeshi Sakaki. Retrospective Analysis of Controversial Subtopics on COVID-19 in Japan. ASONUM'21, p.510-517, 2022.
84+
- 渡邉みさと, 沼部恵, 阿部沙亜弥, 尾上洋介. BuzzLead:TikTokの流行曲予測システム. 情報処理学会インタラクション2023, p.956-961, 2023.
85+
- 樋口 亮太. セリフの感情極性と物語中の出来事の関係性に基づくキャラクタの変化に関する調査, 2022年度関西大学大学院総合情報学研究科修士論文, 2023.
86+
- Sonia Yaco. AI as a Meta-Analyst: Interrogating AI Test Results on the Meiji Era WE Griffis Manuscript Collection. In: Proceedings of the 13th Conference of Japanese Association for Digital Humanities (JADH2024), 2024.
87+
- Tomoyuki Kobayashi, Koki Yamada, Michio Murakami, Akihiko Ozaki, Hiroyuki A. Torii, and Kazuko Uno. Assessment of attitudes toward critical actors during public health crises. International Journal of Disaster Risk Reduction, Vol. 108, 2024.
88+
- Feby Juana Candra, Aika Shiro, Yingting Chen, Taro Kanno, Satori Hachisuka, Yuta Yoshino, and Shuhei Watanabe. Fostering Creativity Through Behavioral and Emotional Insights in Meetings. In: International Conference on Human-Computer Interaction, p. 273-286, 2025.
7489

7590
Slide
7691
------
@@ -83,12 +98,6 @@ Blog
8398
- AKIBA.AWS ONLINE #09で「Amazon Comprehendから始める感情分析」について話しました #AKIBAAWS | DevelopersIO: https://dev.classmethod.jp/articles/talking-about-amazon-comprehend-and-sentiment-analysis-in-akiba-aws-online-09/
8499
- Slackのtimesにネガポジ分析を掛けて1年を振り返る - susunshunのお粗末な記録: https://susunshun.hatenablog.com/entry/2019/12/25/173221
85100

86-
.. |circleci| image:: https://dl.circleci.com/status-badge/img/gh/ikegami-yukino/oseti/tree/master.svg?style=svg
87-
:target: https://dl.circleci.com/status-badge/redirect/gh/ikegami-yukino/oseti/tree/master
88-
89-
.. |coveralls| image:: https://coveralls.io/repos/ikegami-yukino/oseti/badge.svg?branch=master&service=github
90-
:target: https://coveralls.io/github/ikegami-yukino/oseti?branch=master
91-
:alt: coveralls.io
92101

93102
.. |pyversion| image:: https://img.shields.io/pypi/pyversions/oseti.svg
94103

oseti/__init__.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# -*- coding: utf-8 -*-
22
from .oseti import Analyzer
33

4-
VERSION = (0, 4, 2)
5-
__version__ = '0.4.2'
4+
VERSION = (0, 4, 3)
5+
__version__ = '0.4.3'
66
__all__ = ['Analyzer']

pyproject.toml

Lines changed: 55 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,55 @@
1+
[build-system]
2+
requires = [
3+
"setuptools>=60",
4+
"setuptools-scm>=8.0"
5+
]
6+
build-backend = "setuptools.build_meta"
7+
8+
[project]
9+
name = "oseti"
10+
dynamic = ["version", "dependencies"]
11+
authors = [
12+
{name = "Yukino Ikegami", email = "yknikgm@gmail.com"}
13+
]
14+
maintainers = [
15+
{name = "Yukino Ikegami", email = "yknikgm@gmail.com"}
16+
]
17+
description = "Dictionary based Sentiment Analysis for Japanese language"
18+
readme = "README.md"
19+
keywords = ["sentiment analysis", "japanese", "textpreprocessing", "JapaneseText"]
20+
classifiers = [
21+
"Development Status :: 4 - Beta",
22+
"Intended Audience :: Science/Research",
23+
"Intended Audience :: Information Technology",
24+
"Intended Audience :: Developers",
25+
"Natural Language :: Japanese",
26+
"License :: OSI Approved :: MIT License",
27+
"Programming Language :: Python",
28+
"Programming Language :: Python :: 3",
29+
"Programming Language :: Python :: 3.8",
30+
"Programming Language :: Python :: 3.9",
31+
"Programming Language :: Python :: 3.10",
32+
"Programming Language :: Python :: 3.11",
33+
"Programming Language :: Python :: 3.12",
34+
"Programming Language :: Python :: 3.13",
35+
"Topic :: Text Processing",
36+
"Topic :: Text Processing :: Linguistic",
37+
]
38+
39+
[tool.setuptools.dynamic]
40+
version = {attr = "oseti.__version__"}
41+
42+
[project.urls]
43+
Homepage = "https://github.com/ikegami-yukino/oseti"
44+
Repository = "https://github.com/ikegami-yukino/oseti.git"
45+
Issues = "https://github.com/ikegami-yukino/oseti/issues"
46+
Changelog = "https://github.com/ikegami-yukino/oseti/blob/master/CHANGELOG.md"
47+
48+
[tool.setuptools.package-data]
49+
oseti = ["dic/*.json"]
50+
51+
[project.optional-dependencies]
52+
test = ["pytest"]
53+
54+
[tool.pytest.ini_options]
55+
testpaths = ["test_oseti.py"]

requirements.txt

Lines changed: 0 additions & 2 deletions
This file was deleted.

setup.py

Lines changed: 10 additions & 35 deletions
Original file line numberDiff line numberDiff line change
@@ -1,45 +1,20 @@
11
# -*- coding: utf-8 -*-
22
from codecs import open
3+
import importlib.util
34
import os
4-
import pkgutil
55
import re
66
from setuptools import setup
77

8-
install_requires = [] if pkgutil.find_loader('MeCab') else ['mecab']
8+
install_requires = [] if importlib.util.find_spec('MeCab') else ['mecab']
99

1010
with open(os.path.join('oseti', '__init__.py'), 'r', encoding='utf8') as f:
11-
version = re.compile(r".*__version__ = '(.*?)'",
12-
re.S).match(f.read()).group(1)
11+
version = re.compile(r".*__version__ = '(.*?)'", re.S).match(f.read()).group(1) # type: ignore
12+
1313

1414
setup(name='oseti',
15-
packages=['oseti'],
16-
version=version,
17-
license='MIT License',
18-
platforms=['POSIX', 'Windows', 'Unix', 'MacOS'],
19-
description='Dictionary based Sentiment Analysis for Japanese',
20-
author='Yukino Ikegami',
21-
author_email='yknikgm@gmail.com',
22-
url='https://github.com/ikegami-yukino/oseti',
23-
keywords=['sentiment analysis'],
24-
classifiers=[
25-
'Development Status :: 3 - Alpha', 'Intended Audience :: Developers',
26-
'Intended Audience :: Information Technology',
27-
'License :: OSI Approved :: MIT License',
28-
'Natural Language :: Japanese',
29-
'Programming Language :: Python :: 3.4',
30-
'Programming Language :: Python :: 3.5',
31-
'Programming Language :: Python :: 3.6',
32-
'Programming Language :: Python :: 3.7',
33-
'Programming Language :: Python :: 3.8',
34-
'Programming Language :: Python :: 3.9',
35-
'Programming Language :: Python :: 3.10',
36-
'Programming Language :: Python :: 3.11',
37-
'Topic :: Text Processing :: Linguistic'
38-
],
39-
long_description='%s\n\n%s' %
40-
(open('README.rst', encoding='utf8').read(),
41-
open('CHANGES.rst', encoding='utf8').read()),
42-
package_data={'oseti': ['dic/*.json']},
43-
install_requires=['bunkai'] + install_requires,
44-
tests_require=['pytest'],
45-
test_suite='pytest')
15+
packages=['oseti'],
16+
version=version,
17+
install_requires=['bunkai'] + install_requires,
18+
tests_require=['pytest'],
19+
test_suite='pytest'
20+
)

0 commit comments

Comments
 (0)