Evaluation Using Interface

Input:

  • Required Inputs:
    • response: The text content column to evaluate for workplace appropriateness.
  • Configuration Parameters:
    • None specified for this evaluation.

Output:

  • Result: Passed / Failed

Interpretation:

  • Passed: Indicates the response content is considered appropriate for a general workplace environment (Not Safe For Work content was not detected).
  • Failed: Signifies that the response content contains material potentially inappropriate for a general workplace environment (e.g., explicit, offensive, or harmful content).

Evaluation Using Python SDK

Click here to learn how to setup evaluation using the Python SDK.


Input TypeParameterTypeDescription
Required InputsresponsestringThe text content to evaluate for workplace appropriateness.

OutputTypeDescription
ResultfloatReturns 1.0 if the content is deemed safe for work (Passed), 0.0 if it is not safe for work (Failed).

from fi.evals import Evaluator
from fi.testcases import TestCase
from fi.evals.templates import SafeForWorkText

evaluator = Evaluator(
    fi_api_key="your_api_key",
    fi_secret_key="your_secret_key",
    fi_base_url="<https://api.futureagi.com>"
)

sfw_eval = SafeForWorkText()

test_case = TestCase(
    response="This is a sample text to check for safe for work text"
)

result = evaluator.evaluate(eval_templates=[sfw_eval], inputs=[test_case])
sfw_result = result.eval_results[0].metrics[0].id


What to do when NSFW Text is Detected

Remove or flag the inappropriate content to prevent its dissemination. If necessary, request content revision to ensure compliance with workplace standards.

Implementing robust content filtering policies can help prevent such content from being generated or shared. If detection accuracy needs improvement, adjust detection thresholds, update NSFW content patterns to reflect evolving standards, and strengthen validation rules to enhance filtering effectiveness.


Differentiating Safe for Work Text Eval with Toxicity

Safe for Work evaluation assesses whether content is appropriate for professional environments, ensuring it aligns with workplace standards. In contrast, Toxicity evaluation focuses on detecting harmful or offensive language, identifying content that may be aggressive, inflammatory, or inappropriate, regardless of context.