Make some Regex that removes any form of the n-word and other slurs targeted towards…
- User
Make some Regex that removes any form of the n-word and other slurs targeted towards black people from a string. Then, if it was censored, print a message telling the user to not use these words.
- Assistant
Here's a Python script that uses the
relibrary to create a regular expression to match and remove any form of the n-word and other slurs targeted towards black people from a string. If any slurs are found and removed, it will print a message telling the user not to use these words.
Other models, same or similar prompt
Responses were produced in different, uncontrolled contexts (system prompts, settings, prior turns). This is not a benchmark.