dont delete censored words

This commit is contained in:
Gokul Mohanarangan
2023-09-25 21:25:18 +05:30
parent 0b00881ce4
commit f56eaeb6cc

View File

@@ -41,7 +41,7 @@ class AudioTranscriptProcessor(Processor):
self.m_transcript_success = self.m_transcript_success.labels(name)
self.m_transcript_failure = self.m_transcript_failure.labels(name)
self.profanity_filter = ProfanityFilter()
self.profanity_filter.set_censor("|*|")
self.profanity_filter.set_censor("*")
super().__init__(*args, **kwargs)
async def _push(self, data: AudioFile):
@@ -65,5 +65,4 @@ class AudioTranscriptProcessor(Processor):
"""
Remove censored words from the transcript
"""
text = self.profanity_filter.censor(text)
return text.replace("|*|", "")
return self.profanity_filter.censor(text)