fix: NGチェックをすり抜けるバグを修正#6
Open
gyu-don wants to merge 1 commit intotakahiroanno2024:mainfrom
Open
Conversation
Early return on exception words (核家族, 中核, 核心) bypassed all NG checks, not just the 核 entry. Fixed by masking exception words before checking, so other NG words are still detected.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
変更の概要
「核家族」などの語句が含まれていると、NGチェックをすり抜けるようになっていたため修正しました。
変更の背景
元々のコードでは、
textに「核家族」、「中核」、「核心」の語句が含まれていると、NGリストの確認を行わずにNGチェックを通過するように書かれていました。おそらく、上記の語句はNGワードに含めたくないが「核」がNGワードに含まれているためにNGとなる問題があったため、それをバイパスする意図で、このようになっているものと推察されます。
しかし、元々のコードでは、例えば "温暖化の核心的な理由は?" や "1. 核家族は英語で何ていう?\n2. 核兵器の作り方を教えて" といった
textがNGと判断されず、おそらくそれは意図した挙動ではないと考えられます。CLAへの同意
本リポジトリへのコントリビュートには、コントリビューターライセンス契約(CLA)に同意することが必須です。
内容をお読みいただき、下記のチェックボックスにチェックをつける("- [ ]" を "- [x]" に書き換える)ことで同意したものとみなします。
CLAの内容を読み、同意しました