"anti-cursing" is a python package that detects and switches negative or any kind of cursing word from sentences or comments whatever๐คฌ
You just install the package the way you install any other package and then you can use it in your code.
So this is the very first idea
But you can find my package in pypi(https://pypi.org/project/anti-cursing/0.0.2/)
๐๐ปPlz bare with the program to install model's weight and bias from huggingface at the first time you use the package.
There are often situations where you have to code something, detect a forbidden word, and change it to another word. Hardcoding all parts is very inconvenient, and in the Python ecosystem, there are many packages to address. One of them is "anti-cursing".
The package, which operates exclusively for Korean, does not simply change the banned word by setting it up, but detects and replaces the banned word by learning a deep learning model.
Therefore, it is easy to cope with new malicious words as long as they are learned. For this purpose, semi-supervied learning through pseudo labeling is used.
Additionally, instead of changing malicious words to special characters such as --- or ***, you can convert them into emojis to make them more natural.
You can install the package using pip:
pip install anti-cursing
pip.mp4
from anti_cursing.utils import antiCursing
antiCursing.anti_cur("๋๋ ๋๊ฐ ์ข์ง๋ง, ๋๋ ๋๋ฌด ๊ฐ์๋ผ์ผ")
๋๋ ๋๊ฐ ์ข์ง๋ง, ๋๋ ๋๋ฌด ๐ผ๐ป์ผ
working.mp4
Classification | KcElectra | KoBERT | RoBERTa-base | RoBERTa-large |
---|---|---|---|---|
Validation Accuracy | 0.88680 | 0.85721 | 0.83421 | 0.86994 |
Validation Loss | 1.00431 | 1.23237 | 1.30012 | 1.16179 |
Training Loss | 0.09908 | 0.03761 | 0.0039 | 0.06255 |
Epoch | 10 | 40 | 20 | 20 |
Batch-size | 8 | 32 | 16 | 32 |
transformers | beomi/KcELECTRA-base | skt/kobert-base-v1 | xlm-roberta-base | klue/roberta-large |
-
- https://github.com/smilegate-ai/korean_unsmile_dataset
- Korean Sentiment Analysis
- paper
-
- https://news.naver.com
- Non-labeled Data for Test Dataset
- https://cloud.google.com/translate/docs (API DOCS)
This repository is licensed under the MIT license. See LICENSE for details.
Click here to see the License information --> License
- Nhan Cach Dang, Maria N. Moreno-Garcia, Fernando De la Prieta. 2006. Sentiment Analysis Based on Deep Learning : A Comparative Study. In Proceedings of the 2006 Conference on Empirical Methods in Natural Language Processing (EMNLP 2006), pages 1โ8, Prague, Czech Republic. Association for Computational Linguistics.
- Ashish Vaswani, Noam Shazeer, Niki Parmar, Jakob Uszkoreit, Llion Jones, Aidan N Gomez, Lukasz Kaiser, and Illia Polosukhin. 2017. Attention is all you need. In Advances in Neural Information Processing Systems, pages 6000โ6010.
- Jacob Devlin, Ming-Wei Chang, Kenton Lee, and Kristina Toutanova. 2018. BERT: Pre-training of deep bidirectional transformers for language understanding. In Proceedings of the 2018 Conference of the North American Chapter of the Association for Computational Linguistics: Human Language Technologies, Volume 1 (Long Papers), pages 4171โ4186.
- Kevin Clark, Minh-Thang Luong, Quoc V. Le, Christopher D. Manning. 2019. Electra: Pre-training text encoders as discriminators rather than generators. In Proceedings of the 2019 Conference of the North American Chapter of the Association for Computational Linguistics: Human Language Technologies, Volume 1 (Long Papers), pages 4171โ4186.
- Minjoon Seo, Aniruddha Kembhavi, Ali Farhadi, Hannaneh Hajishirzi. 2016. Bidirectional Attention Flow for Machine Comprehension. In Proceedings of the 2016 Conference on Empirical Methods in Natural Language Processing, pages 2129โ2139.
- Partha Mukherjeea, Saptarshi Ghoshb, and Saptarshi Ghoshc. 2018. Effect of Negation in Sentences on Sentiment Analysis and Polarity Detection. In Proceedings of the 2018 Conference on Empirical Methods in Natural Language Processing, pages 2129โ2139.
- Seonghwan Kim, Seongwon Lee, and Seungwon Do. 2019. KOAS: Korean Text Offensiveness Analysis System. In Proceedings of the 2019 Conference on Empirical Methods in Natural Language Processing and the 9th International Joint Conference on Natural Language Processing (EMNLP-IJCNLP), pages 1โ11.
- Seonghwan Kim, Seongwon Lee, and Seungwon Do. 2019. Korean Unsmile Dataset. In Proceedings of the 2019 Conference on Empirical Methods in Natural Language Processing and the 9th International Joint Conference on Natural Language Processing (EMNLP-IJCNLP), pages 1โ11.
update soon plz bare with me ๐๐ป
**"anti-cursing"**์ ๋ฌธ์ฅ์ด๋ ๋๊ธ์์ ๋ถ์ ์ ์ด๊ฑฐ๋ ๋ชจ๋ ์ข ๋ฅ์ ์์ค์ ๊ฐ์งํ๊ณ ์ ํํ๋ ํ์ด์ฌ ํจํค์ง์ ๋๋ค๐คฌ
๋ค๋ฅธ ํจํค์ง๋ฅผ ์ค์นํ๋ ๋ฐฉ์๊ณผ ๋์ผํ๊ฒ ํจํค์ง๋ฅผ ์ค์นํ ๋ค์ ์ฝ๋์์ ์ฌ์ฉํ ์ ์์ต๋๋ค.
Pypi(https://pypi.org/project/anti-cursing/0.0.2/)์ ํจํค์ง๋ฅด ์ ๋ก๋ํ์ต๋๋ค. ์ด๊ณณ์์ ํ์ธํ์ค ์ ์์ต๋๋ค.
๐๐ปํจํค์ง๋ฅผ ์ฒ์ ์ค์นํ์๊ณ ์ฌ์ฉํ์ค ๋ ๋ฅ๋ฌ๋ ๋ชจ๋ธ์ ๋ถ๋ฌ์ค๊ธฐ ์ํด huggingface์์ parsing์ ์๋ํฉ๋๋ค. ์ฒ์์๋ง ํด๋น ์์ ์ด ํ์ํ๋ ์๊ฐ์ด ์กฐ๊ธ ๊ฑธ๋ฆผ๊ณผ ์ฉ๋์ ์ฐจ์งํจ์ ๊ณ ๋ คํด์ฃผ์ธ์
๋ฌด์ธ๊ฐ ์ฝ๋ฉ์ ํ๋ฉฐ, ๊ธ์ง ๋จ์ด๋ฅผ ๊ฐ์งํ๊ณ ๊ทธ๊ฒ์ ๋ค๋ฅธ ๋จ์ด๋ก ๋ฐ๊ฟ์ผํ ์ํฉ์ด ์ข ์ข ์๊น๋๋ค. ๋ชจ๋ ๋ถ๋ถ์ ํ๋์ฝ๋ฉํ๋ ๊ฒ์ด ๋งค์ฐ ๋ถํธํ๋ฉฐ, ํ์ด์ฌ ์ํ๊ณ์์๋ ์ด๋ฅผ ํด๊ฒฐํ๊ธฐ ์ํ ๋ง์ ํจํค์ง๊ฐ ์์ต๋๋ค. ๊ทธ ์ค ํ๋๊ฐ **"anti-cursing"**์ ๋๋ค.
ํ๊ตญ์ด ์ ์ฉ์ผ๋ก ๋์ํ๋ ํด๋น ํจํค์ง๋ ๋จ์ํ ๊ธ์ง ๋จ์ด๋ฅผ ๊ธฐ์กด์ ์ค์ ํ์ฌ ๋ฐ๊พธ๋ ๊ฒ์ด ์๋, ๋ฅ๋ฌ๋ ๋ชจ๋ธ์ ํ์ตํ์ฌ ๊ธ์ง ๋จ์ด๋ฅผ ๊ฐ์งํ๊ณ ๋ฐ๊ฟ๋๋ค. ๋ฐ๋ผ์ ์๋กญ๊ฒ ์๊ธฐ๋ ์ ์ฑ ๋จ์ด์ ๋ํด์๋ ํ์ต๋ง ์ด๋ฃจ์ด์ง๋ค๋ฉด ์ฝ๊ฒ ๋์ฒํ ์ ์์ต๋๋ค. ์ด๋ฅผ ์ํด pseudo labeling์ ํตํ semi-supervied learning์ ์ฌ์ฉํฉ๋๋ค.
์ถ๊ฐ๋ก ์ ์ฑ๋จ์ด๋ฅผ ---๋ ***๊ฐ์ ํน์๋ฌธ์๋ก ๋ณ๊ฒฝํ๋ ๊ฒ์ด ์๋, ์ด๋ชจ์ง๋ก ๋ณํํ์ฌ ๋์ฑ ์์ฐ์ค๋ฝ๊ฒ ๋ฐ๊ฟ ์ ์์ต๋๋ค.
- ์ค์น
- ์ฌ์ฉ๋ฒ
- ๋ชจ๋ธ ์ฑ๋ฅ ๋น๊ต
- ๋ฐ์ดํฐ์
- ์ฌ์ฉ API
- License
- ์ฐธ๊ณ ๋ฌธํ
- ์งํ์ํฉ
- ๋ฐ์
pip๋ฅผ ์ฌ์ฉํ์ฌ ํจํค์ง๋ฅผ ์ค์นํ ์ ์์ต๋๋ค.
pip install anti-cursing
pip.mp4
from anti_cursing.utils import antiCursing
antiCursing.anti_cur("๋๋ ๋๊ฐ ์ข์ง๋ง, ๋๋ ๋๋ฌด ๊ฐ์๋ผ์ผ")
๋๋ ๋๊ฐ ์ข์ง๋ง, ๋๋ ๋๋ฌด ๐ผ๐ป์ผ
working.mp4
Classification | KcElectra | KoBERT | RoBERTa-base | RoBERTa-large |
---|---|---|---|---|
Validation Accuracy | 0.88680 | 0.85721 | 0.83421 | 0.86994 |
Validation Loss | 1.00431 | 1.23237 | 1.30012 | 1.16179 |
Training Loss | 0.09908 | 0.03761 | 0.0039 | 0.06255 |
Epoch | 10 | 40 | 20 | 20 |
Batch-size | 8 | 32 | 16 | 32 |
transformers | beomi/KcELECTRA-base | skt/kobert-base-v1 | xlm-roberta-base | klue/roberta-large |
-
- https://github.com/smilegate-ai/korean_unsmile_dataset
- ํ๊ตญ์ด ๊ฐ์ ๋ถ๋ฅ ๋ฐ์ดํฐ์
- paper
-
- https://news.naver.com
- ํ ์คํธ๋ฅผ ์ํ ๋ฐ์ดํฐ์
- https://cloud.google.com/translate/docs (API ๋ฌธ์)
์ด ํ๋ก์ ํธ๋ MIT ๋ผ์ด์ผ์ค๋ฅผ ๋ฐ๋ฆ ๋๋ค. ์์ธํ ๋ด์ฉ์ LICENSE ํ์ผ์ ์ฐธ๊ณ ํด์ฃผ์ธ์.
๋ผ์ด์ผ์ค ์ ๋ณด --> License
- Nhan Cach Dang, Maria N. Moreno-Garcia, Fernando De la Prieta. 2006. Sentiment Analysis Based on Deep Learning : A Comparative Study. In Proceedings of the 2006 Conference on Empirical Methods in Natural Language Processing (EMNLP 2006), pages 1โ8, Prague, Czech Republic. Association for Computational Linguistics.
- Ashish Vaswani, Noam Shazeer, Niki Parmar, Jakob Uszkoreit, Llion Jones, Aidan N Gomez, Lukasz Kaiser, and Illia Polosukhin. 2017. Attention is all you need. In Advances in Neural Information Processing Systems, pages 6000โ6010.
- Jacob Devlin, Ming-Wei Chang, Kenton Lee, and Kristina Toutanova. 2018. BERT: Pre-training of deep bidirectional transformers for language understanding. In Proceedings of the 2018 Conference of the North American Chapter of the Association for Computational Linguistics: Human Language Technologies, Volume 1 (Long Papers), pages 4171โ4186.
- Kevin Clark, Minh-Thang Luong, Quoc V. Le, Christopher D. Manning. 2019. Electra: Pre-training text encoders as discriminators rather than generators. In Proceedings of the 2019 Conference of the North American Chapter of the Association for Computational Linguistics: Human Language Technologies, Volume 1 (Long Papers), pages 4171โ4186.
- Minjoon Seo, Aniruddha Kembhavi, Ali Farhadi, Hannaneh Hajishirzi. 2016. Bidirectional Attention Flow for Machine Comprehension. In Proceedings of the 2016 Conference on Empirical Methods in Natural Language Processing, pages 2129โ2139.
- Partha Mukherjeea, Saptarshi Ghoshb, and Saptarshi Ghoshc. 2018. Effect of Negation in Sentences on Sentiment Analysis and Polarity Detection. In Proceedings of the 2018 Conference on Empirical Methods in Natural Language Processing, pages 2129โ2139.
- Seonghwan Kim, Seongwon Lee, and Seungwon Do. 2019. KOAS: Korean Text Offensiveness Analysis System. In Proceedings of the 2019 Conference on Empirical Methods in Natural Language Processing and the 9th International Joint Conference on Natural Language Processing (EMNLP-IJCNLP), pages 1โ11.
- Seonghwan Kim, Seongwon Lee, and Seungwon Do. 2019. Korean Unsmile Dataset. In Proceedings of the 2019 Conference on Empirical Methods in Natural Language Processing and the 9th International Joint Conference on Natural Language Processing (EMNLP-IJCNLP), pages 1โ11.
์์ผ๋ก ์ถ๊ฐ๋ ์์ ์ ๋๋ค ์ ์๋ง ๊ธฐ๋ค๋ ค์ฃผ์ธ์๐๐ป