Share via

Changing ProfanityFilter Settings in Disconnected Azure Speech Containers

tomoe 25 Reputation points
2026-05-14T15:42:42.7033333+00:00

I am using a disconnected container for Azure Speech.

docker image ls

REPOSITORY TAG IMAGE ID CREATED SIZE

mcr.microsoft.com/azure-cognitive-services/speechservices/speech-to-text 5.2.0-amd64-ja-jp 8e43784ae380 2 months ago 12.4GB

I discovered that there is a way to specify the ProfanityFilter on the request side of the SDK, but

due to our current system configuration and constraints, it is difficult to change the settings on the SDK side, so

I am exploring whether this can be configured on the container side.

I tried specifying “-e ProfanityFilterMode=Raw” or “-e ProfanityFilterMode=None” when running docker run,

but when I checked the behavior using docker logs [container_name], I found that the output looked like this, indicating that it had no effect.

{"eventName":"dppexecution","eventLevel":4,"properties":[{"key":"connectionId","value":"a08edde7-9a90-4771-80ea-52a36b845bca"},{"key":"clientConnectionId","value":"c9d5d489-24c9-43f5-b67d-a46f121c363d"},{"key":"clientId","value":"bd48097f-e910-488a-984c-a5a84b4a0633"},{"key":"trafficType","value":"Untagged"},{"key":"endpoint","value":"/displaypostprocess.protocols.definitions.rpc.v1.DisplayPostProcessor/ProcessText"},{"key":"w3cTraceId","value":"4502e3260a14f74a691d42b4a074bc0c"},{"key":"accountId","value":""},{"key":"Event_Time_Utc","value":"2026-05-14T15:13:59.2774365Z"},{"key":"activityId","value":"/#217/1/1516/3/"},{"key":"relatedActivityId","value":"00000000-0000-0000-0000-000000000000"},{"key":"Success","value":"True"},{"key":"ExecutionStatus","value":"ExecutionSuccessful"},{"key":"BuilderPrefix","value":""},{"key":"ExecutionId","value":"3649a73a-e029-41d1-bbd7-7357757cdf81"},{"key":"Metadata","value":"{\n  \"locale\": \"ja-JP\",\n  \"preferredLocale\": null,\n  \"leftContextPresent\": false,\n  \"rightContextPresent\": false,\n  \"templateName\": \"ConversationIntermediate\",\n  \"lexicalTextLength\": 43,\n  \"features\": {\n    \"itn\": {\n      \"isDisabled\": false,\n      \"doRescoring\": false\n    },\n    \"capitalization\": null,\n    \"reformulation\": null,\n    \"keywordStripping\": null,\n    \"implicitPunctuation\": null,\n    \"explicitPunctuation\": null,\n    \"profanity\": {\n      \"isDisabled\": false,\n      \"profanityType\": 1\n    },\n    \"rescoring\": null,\n    \"correctionAlternates\": null,\n    \"displayTiming\": null,\n    \"disfluency\": null,\n    \"formatTopResult\": null,\n    \"streamingPunctuation\": null,\n    \"continuousPunctuation\": null,\n    \"endPunctuation\": null,\n    \"beginCapitalization\": null\n  },\n  \"flights\": [\n    \"dppongrpc\",\n    \"xonlineinterp\"\n  ],\n  \"builders\": [\n    {\n      \"builderId\": \"RemoveGhostWords\",\n      \"success\": true,\n      \"metadata\": \"\",\n      \"elapsedTimeMs\": 0.0008\n    },\n    {\n      \"builderId\": \"RuleBasedRescoring\",\n      \"success\": true,\n      \"metadata\": \"PreviousIndex: 0, RuleMatched: False, ThresholdExceeded: False, NbestCount: 1, RuletreePresent: False, RuletreeValid: False, Status: Empty rule tree, Locale: ja-JP\",\n      \"elapsedTimeMs\": 0.0031\n    },\n    {\n      \"builderId\": \"WfstITN\",\n      \"success\": true,\n      \"metadata\": \"Locale: ja-JP\",\n      \"elapsedTimeMs\": 2.0208\n    },\n    {\n      \"builderId\": \"ProfanityMasking\",\n      \"success\": true,\n      \"metadata\": \"Locale: ja-JP\",\n      \"elapsedTimeMs\": 0.2678\n    }\n  ],\n  \"firstPassDecoderType\": \"e2e\",\n  \"totalScores\": [\n    0.0\n  ],\n  \"phraseListCount\": 0,\n  \"tenantTokenEnabled\": false,\n  \"ariatokenUriOverride\": false\n}"},{"key":"SampledMetric_Name","value":"Perf_dppexecution"},{"key":"SampledMetric_Value","value":"2.4429"},{"key":"SampledMetric_Units","value":"milliseconds"}]}

<point>

"profanity": { "isDisabled": false, "profanityType": 1 }

"builderId": "ProfanityMasking", "success": true

Could you please let me know if this is because the container has been terminated, if it depends on the version, or if the configuration is incorrect?

Thank you.

Azure Speech in Foundry Tools

Answer accepted by question author

Karnam Venkata Rajeswari 3,655 Reputation points Microsoft External Staff Moderator
2026-05-20T20:35:56.3233333+00:00

Hello @tomoe ,

Welcome to Microsoft Q&A .Thank you for reaching out to us.

The observed behavior is expected and by design within the Azure Speech-to-Text container architecture. The ProfanityFilterMode setting is not supported as part of the container configuration, and therefore cannot influence runtime behavior when passed through Docker environment variables. Instead, profanity filtering is controlled exclusively at the request level through the Speech SDK or REST API. As a result, no container-level override or workaround exists for this behavior, and any required change must be implemented at the request or integration layer.

Reason the profanity setting not taking effect

The container is functioning as expected. Profanity filtering is not configurable at the container level, therefore:

  • Environment variables such as -e ProfanityFilterMode=Raw or None are not supported
  • These parameters are ignored during container startup
  • The container does not provide any global switch to control profanity behavior

The logs:

  • "profanityType": 1
  • Successful profanity processing

confirm that default masking behavior remains active, which is expected.

Scope of control for profanity filtering

Profanity handling is applied during the speech recognition output processing stage and is controlled strictly at the request level.

Supported options include:

Speech SDK

speechConfig.SetProfanity(ProfanityOption.Raw);   // Raw / Masked / Removed
``

REST API

profanity=raw | masked | removed

Client / invocation layer

  • Profanity settings must be explicitly passed with each request

This behavior is part of the display formatting pipeline and the not container configuration.

Please note the important limitation - For disconnected deployments, the following limitation applies:

There is no supported or documented mechanism to configure profanity filtering at the container level. No container‑level workaround exists.

Therefore:

  • Docker environment variables cannot modify profanity behavior
  • Default masking will always apply unless overridden per request
  • This is a design limitation, not a failure or misconfiguration

To achieve the required outcome:

  1. Identify request flow - SDK, REST API or intermediate service
  2. Apply request-level configuration - Explicitly pass - raw, masked, or removed
  3. Handle the integration constraints
    1. If direct modification is restricted:
      • Introduce middleware/proxy to inject parameters
    2. If modification is not feasible:
      • Consider post-processing of transcription output

The following references might be helpful , please check them out

Thank you

 

Please 'Upvote'(Thumbs-up) and 'Accept' as answer if the response was helpful. This will be benefitting other community members who face the same issue.

Was this answer helpful?

1 person found this answer helpful.
0 comments No comments

1 additional answer

Sort by: Most helpful
  1. AI answer

    2026-05-14T15:43:04.94+00:00

    Profanity filtering behavior for Azure Speech containers is controlled by the Speech service/SDK request parameters, not by container-level environment variables. The provided context only documents supported docker run parameters for speech-to-text containers, and ProfanityFilterMode is not listed among them.

    For disconnected speech-to-text containers, the documented docker run configuration focuses on:

    • Image selection ({IMAGE})
    • Licensing and billing (billing, apikey, DownloadLicense=True, Mounts:License, Mounts:Output)
    • Resource limits (--memory, --cpus)
    • Volume mounts for license and output directories

    No container-level setting for profanity filtering is described. Instead, profanity filtering is described as a feature applied at the recognition/display-text layer, with options such as Masked (default), Raw, and Removed, and is configured via client-side options (for example, CLI --profanity parameter) rather than container configuration.

    Given the available documentation, changing profanity behavior must be done on the client/request side (for example, SDK or CLI options). There is no supported or documented way in this context to override profanity filtering globally via docker run environment variables on the speech-to-text container, so the attempted -e ProfanityFilterMode=... settings have no effect.


    References:

    AI-generated content may be incorrect. Read our transparency notes for more information.

    Was this answer helpful?

Your answer

Answers can be marked as 'Accepted' by the question author and 'Recommended' by moderators, which helps users know the answer solved the author's problem.