Skip to content

Commit

Permalink
Dependencies: Remove TextBlob; Utils: Remove TextBlob's English senti…
Browse files Browse the repository at this point in the history
…ment analyzer
  • Loading branch information
BLKSerene committed Aug 7, 2023
1 parent 32aeef9 commit 047d5a4
Show file tree
Hide file tree
Showing 8 changed files with 10 additions and 16 deletions.
5 changes: 2 additions & 3 deletions ACKNOWLEDGMENTS.md
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,5 @@ As Wordless stands on the shoulders of giants, I hereby extend my sincere gratit
26|[spacy-pkuseg](https://github.com/explosion/spacy-pkuseg) |0.0.32|Ruixuan Luo (罗睿轩), Jingjing Xu (许晶晶),<br>Xuancheng Ren (任宣丞), Yi Zhang (张艺),<br>Zhiyuan Zhang (张之远), Bingzhen Wei (位冰镇),<br>Xu Sun (孙栩)<br>Adriane Boyd, Ines Montani|[MIT](https://github.com/explosion/spacy-pkuseg/blob/master/LICENSE)
27|[stopword](https://github.com/fergiemcdowall/stopword) |2.0.5 |Fergus McDowall|[MIT](https://github.com/fergiemcdowall/stopword/blob/master/LICENSE)
28|[SudachiPy](https://github.com/WorksApplications/sudachi.rs) |0.6.7 |Works Applications Co., Ltd.|[Apache-2.0](https://github.com/WorksApplications/sudachi.rs/blob/develop/LICENSE)
29|[TextBlob](https://github.com/sloria/TextBlob) |0.17.1|Steven Loria|[MIT](https://github.com/sloria/TextBlob/blob/dev/LICENSE)
30|[Underthesea](https://undertheseanlp.com/) |6.7.0 |Vu Anh|[GPL-3.0-or-later](https://github.com/undertheseanlp/underthesea/blob/main/LICENSE)
31|[wordcloud](https://github.com/amueller/word_cloud) |1.9.2 |Andreas Christian Müller|[MIT](https://github.com/amueller/word_cloud/blob/main/LICENSE)
29|[Underthesea](https://undertheseanlp.com/) |6.7.0 |Vu Anh|[GPL-3.0-or-later](https://github.com/undertheseanlp/underthesea/blob/main/LICENSE)
30|[wordcloud](https://github.com/amueller/word_cloud) |1.9.2 |Andreas Christian Müller|[MIT](https://github.com/amueller/word_cloud/blob/main/LICENSE)
5 changes: 2 additions & 3 deletions ACKNOWLEDGMENTS_zho_cn.md
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,5 @@
26|[spacy-pkuseg](https://github.com/explosion/spacy-pkuseg) |0.0.32|罗睿轩, 许晶晶, 任宣丞, 张艺, 张之远, 位冰镇, 孙栩<br>Adriane Boyd, Ines Montani|[MIT](https://github.com/explosion/spacy-pkuseg/blob/master/LICENSE)
27|[stopword](https://github.com/fergiemcdowall/stopword) |2.0.5 |Fergus McDowall|[MIT](https://github.com/fergiemcdowall/stopword/blob/master/LICENSE)
28|[SudachiPy](https://github.com/WorksApplications/sudachi.rs) |0.6.7 |Works Applications Co., Ltd.|[Apache-2.0](https://github.com/WorksApplications/sudachi.rs/blob/develop/LICENSE)
29|[TextBlob](https://github.com/sloria/TextBlob) |0.17.1|Steven Loria|[MIT](https://github.com/sloria/TextBlob/blob/dev/LICENSE)
30|[Underthesea](https://undertheseanlp.com/) |6.7.0 |Vu Anh|[GPL-3.0-or-later](https://github.com/undertheseanlp/underthesea/blob/main/LICENSE)
31|[wordcloud](https://github.com/amueller/word_cloud) |1.9.2 |Andreas Christian Müller|[MIT](https://github.com/amueller/word_cloud/blob/main/LICENSE)
29|[Underthesea](https://undertheseanlp.com/) |6.7.0 |Vu Anh|[GPL-3.0-or-later](https://github.com/undertheseanlp/underthesea/blob/main/LICENSE)
30|[wordcloud](https://github.com/amueller/word_cloud) |1.9.2 |Andreas Christian Müller|[MIT](https://github.com/amueller/word_cloud/blob/main/LICENSE)
5 changes: 2 additions & 3 deletions ACKNOWLEDGMENTS_zho_tw.md
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,5 @@
26|[spacy-pkuseg](https://github.com/explosion/spacy-pkuseg) |0.0.32|羅睿軒, 許晶晶, 任宣丞, 張藝, 張之遠, 位冰鎮, 孫栩<br>Adriane Boyd, Ines Montani|[MIT](https://github.com/explosion/spacy-pkuseg/blob/master/LICENSE)
27|[stopword](https://github.com/fergiemcdowall/stopword) |2.0.5 |Fergus McDowall|[MIT](https://github.com/fergiemcdowall/stopword/blob/master/LICENSE)
28|[SudachiPy](https://github.com/WorksApplications/sudachi.rs) |0.6.7 |Works Applications Co., Ltd.|[Apache-2.0](https://github.com/WorksApplications/sudachi.rs/blob/develop/LICENSE)
29|[TextBlob](https://github.com/sloria/TextBlob) |0.17.1|Steven Loria|[MIT](https://github.com/sloria/TextBlob/blob/dev/LICENSE)
30|[Underthesea](https://undertheseanlp.com/) |6.7.0 |Vu Anh|[GPL-3.0-or-later](https://github.com/undertheseanlp/underthesea/blob/main/LICENSE)
31|[wordcloud](https://github.com/amueller/word_cloud) |1.9.2 |Andreas Christian Müller|[MIT](https://github.com/amueller/word_cloud/blob/main/LICENSE)
29|[Underthesea](https://undertheseanlp.com/) |6.7.0 |Vu Anh|[GPL-3.0-or-later](https://github.com/undertheseanlp/underthesea/blob/main/LICENSE)
30|[wordcloud](https://github.com/amueller/word_cloud) |1.9.2 |Andreas Christian Müller|[MIT](https://github.com/amueller/word_cloud/blob/main/LICENSE)
2 changes: 2 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -37,10 +37,12 @@

### ❌ Removals
- Utils: Remove PyThaiNLP's perceptron part-of-speech tagger (LST20)
- Utils: Remove TextBlob's English sentiment analyzer
- Work Area: Remove Profiler - Fernández Huerta's Readability Score / Szigriszt's Perspicuity Index

### ⏫ Dependency Changes
- Dependencies: Add khmer-nltk
- Dependencies: Remove TextBlob
- Dependencies: Upgrade Beautiful Soup to 4.12.2
- Dependencies: Upgrade Botok to 0.8.12
- Dependencies: Upgrade Charset Normalizer to 3.2.0
Expand Down
1 change: 0 additions & 1 deletion requirements_dev.txt
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,6 @@ pythainlp
python-mecab-ko
sacremoses
simplemma
textblob
underthesea

## pymorphy3
Expand Down
1 change: 0 additions & 1 deletion requirements_tests.txt
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,6 @@ pyphen == 0.14.0
pythainlp == 4.0.2
sacremoses == 0.0.53
simplemma == 0.9.1
textblob == 0.17.1
underthesea == 6.7.0

## python-mecab-ko
Expand Down
2 changes: 1 addition & 1 deletion tests/wl_tests_work_area/test_concordancer.py
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,7 @@ def update_gui_table(err_msg, concordance_lines):
assert right_text_search

# Sentiment
assert sentiment == 'No Support' or -1 <= sentiment <= 1
assert sentiment == 'No language support' or -1 <= sentiment <= 1
# Token No.
assert no_token >= 1
assert len_tokens >= 1
Expand Down
5 changes: 1 addition & 4 deletions wordless/wl_concordancer.py
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,6 @@
import numpy
from PyQt5.QtCore import pyqtSignal, QCoreApplication, Qt
from PyQt5.QtWidgets import QCheckBox, QLabel, QLineEdit, QGroupBox, QStackedWidget
import textblob
import underthesea

from wordless.wl_checks import wl_checks_work_area
Expand Down Expand Up @@ -884,9 +883,7 @@ def run(self):
# Sentiment
context_text = ' '.join([context_left_text, node_text, context_right_text])

if text.lang.startswith('eng'):
concordance_line.append(textblob.TextBlob(context_text).sentiment.polarity)
elif text.lang == 'vie':
if text.lang == 'vie':
sentiment = underthesea.sentiment(context_text)

if sentiment == 'positive':
Expand Down

0 comments on commit 047d5a4

Please sign in to comment.