Disable profanity filter for recognition via Web Speech API
Asked Answered
G

1

25

I am using webkitSpeechRecognition instance to access the native speech recognition in Chrome. The problem is that the Web Speech API specification does not cover the topic of profanity filtering, yet Google's Speech API, by default, has the profanity filter enabled. It is not a major problem - luckily the default filter for Web Speech API shows the first letter and hides the rest under the asterisks. However there are cases when a word starting with a certain letter and having a certain length be derived from different cuss words and guessing what the person has said may not give an accurate result.

The question here is: how can the profanity filtering level of Web Speech API in Chrome be controlled? The JavaScript instance does not expose any additional (platform specific) variables to play around with. The actual Speech API had the pfilter URL parameter which can be set to 0 (no filtering), 1 (filtering and replacing words with ####) or 2 (filtering and replacing all but the first letter with asterisks). This parameter is also exposed for Chrome Extension developers, it is located in SpeechInputStartOptions (however it is a boolean variable).

P.S. The SpeechInputStartOptions documentation talks about default Chrome filtering settings. I could not find the setting for this or any information about where it is located. Even though ideally, the solution should not involve user having to do something, finding the in-Chrome setting for it would still be a breakthrough.

Guanine answered 8/2, 2015 at 21:33 Comment(3)
Unofficial draft of Web Speech API does not says anything about filtering or profanity language. Looks like web services implemented it without relying on browser side filtering, and seems like there is no mechanism to pass any parameters to speech api, except the serviceURI which could have some arguments in it.Hamann
Do you want to control/disable it? Disabling is rather possible by &pfilter=0, so I think you wish to control it. Then, define how would u like to control it!Armagnac
@RahulVerma I think they want to simply disable it yes. If you know how to pass that pfilter param through the Web API, then that would make a good answer. (the serviceURI parameter that moka talked about has been disabled in Chrome, so not sure how you'd pass it...)Impact
E
12

Currently, Chrome does not allow disabling the profanity filter on webkitSpeechRecognition.

I was able to find these 2 bugs:

  1. bug filed on WICG

  2. bug on Chromium to support disabling profanity filter

The Chromium source code does seem to have the option called filter_profanities but seems to be defaulting it to true for the web version.

( In case you are interested, link to Chromium source for speech_recognition_session_config.h that defines filter_profanities)

Closest working solution I could find was Google's Speech to text cloud solution which does allow removing the profanity filter.

Effectual answered 11/8, 2020 at 11:6 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.