Skip to main content
POST
/
evaluate_test_cases
Python
import os
from unstructured import UnstructuredClient

client = UnstructuredClient(
    username=os.environ.get("UNSTRUCTURED_USERNAME"),  # This is the default and can be omitted
    password=os.environ.get("UNSTRUCTURED_PASSWORD"),  # This is the default and can be omitted
)
response = client.tags.pattern.evaluate_test_cases(
    patterns=[{
        "pattern": "pattern"
    }],
    test_cases=[{
        "category": "category",
        "should_match": True,
        "text": "text",
    }],
)
print(response.evaluated_test_cases)
{
  "evaluated_test_cases": [
    {
      "text": "<string>",
      "should_match": true,
      "actual_match": true,
      "category": "<string>",
      "matched_patterns": [
        "<string>"
      ]
    }
  ]
}

Documentation Index

Fetch the complete documentation index at: https://docs.deasylabs.com/llms.txt

Use this file to discover all available pages before exploring further.

Authorizations

Authorization
string
header
required

Basic authentication header of the form Basic <encoded-value>, where <encoded-value> is the base64-encoded string username:password.

Body

application/json

Request to evaluate test cases against multiple regex patterns.

patterns
RegexPatternEvaluate · object[]
required
test_cases
TestCase · object[]
required

Response

Successful Response

Response from evaluating test cases.

evaluated_test_cases
EvaluatedTestCase · object[]
required