Ban Competitors

Apply guardrails to block competitor mentions. Control outputs to align with business or compliance goals.

Scanner to detect competitors in a prompt. It uses a named-entity recognition model to extract organizations from the prompt and compares them to a list of competitors.

An effective competitor list should include:

  • The official titles of all recognized competitors.

  • Commonly used abbreviations or variations of these titles.

  • Any subsidiaries or affiliated brands of the competitors.

Ensuring the thoroughness and precision of this list is crucial for the efficacy of the scanning system.

Considerations and Constraints

  • Precision: The precision of competitor identification heavily relies on the capabilities of the Named Entity Recognition (NER) model and the inclusiveness of the competitor roster.

  • Contextual Awareness: The scanner might not grasp the full context surrounding a competitor's name, potentially resulting in excessive redaction.

  • Efficiency: The scanning procedure could introduce additional computational burden, particularly when dealing with extensive texts containing numerous entities.

Parameters:

data:

  • prompt (str): Prompt to check for competitors.

arguments:

  • competitors (Sequence[str]): List of competitors to detect.

  • threshold (float, optional): Threshold to determine if a competitor is present in the prompt. Default is 0.5.

  • redact (bool, optional): Whether to redact the competitor name. Default is True.

Interpretation:

The values matching the names of competitors from the competitors list should be replaced with [REDACTED] in the output.

Example:

Last updated

Was this helpful?