jevrecipes

Recipe catalog / causal-language-strength

Grade the strength of causal language

causal-language-strength is a Jev recipe from the jev-recipes TypeScript package. How strong is the causal claim in the wording of statement, from no relationship claimed to causation stated as fact? Use it when you are checking abstracts, press releases, or summaries of studies for causal overreach, so that wording can be compared with what the study design supports.

Last updated .

Explore this recipe interactively · Source and implementation guide · Markdown version

How do I use causal-language-strength in TypeScript?

Install with npm install jev-recipes. Requires Node.js 22.9 or newer and ES modules. Set TYPESAFE_API_KEY in your server environment for live calls, which send input to TypeSafe and use API quota. See the installation guide.

import { causalLanguageStrength } from 'jev-recipes/causal-language-strength';

const result = await causalLanguageStrength({
  "statement": "Adolescents who reported more screen time in the hour before bed also reported poorer sleep quality (r = 0.31, p < .001). Because the data are cross-sectional, our design does not permit causal conclusions.",
  "minConfidence": 0.8
});
console.log(result);

What input does causal-language-strength take?

FieldTypeNeeded
statementstringRequired
minConfidencenumberOptional
Full input and result schemas
{
  "input": {
    "$schema": "https://json-schema.org/draft/2020-12/schema",
    "type": "object",
    "properties": {
      "statement": {
        "type": "string"
      },
      "minConfidence": {
        "type": "number",
        "minimum": 0,
        "maximum": 1
      }
    },
    "required": [
      "statement"
    ]
  },
  "result": {
    "$schema": "https://json-schema.org/draft/2020-12/schema",
    "type": "object",
    "properties": {
      "model": {
        "type": "string"
      },
      "usage": {
        "type": "object",
        "properties": {
          "input_tokens": {
            "type": "integer",
            "minimum": 0,
            "maximum": 9007199254740991
          },
          "output_tokens": {
            "type": "integer",
            "minimum": 0,
            "maximum": 9007199254740991
          }
        },
        "required": [
          "input_tokens",
          "output_tokens"
        ],
        "additionalProperties": false
      },
      "status": {
        "type": "string",
        "enum": [
          "ready",
          "review"
        ]
      },
      "score": {
        "type": "number",
        "minimum": 0
      },
      "level": {
        "type": "integer",
        "minimum": 0,
        "maximum": 9007199254740991
      },
      "confidence": {
        "type": "number",
        "minimum": 0,
        "maximum": 1
      },
      "probabilities": {
        "type": "object",
        "propertyNames": {
          "type": "string"
        },
        "additionalProperties": {
          "type": "number",
          "minimum": 0,
          "maximum": 1
        }
      },
      "causality": {
        "type": "string",
        "enum": [
          "none",
          "association",
          "suggestive",
          "hedged",
          "asserted"
        ]
      }
    },
    "required": [
      "model",
      "usage",
      "status",
      "score",
      "level",
      "confidence",
      "probabilities",
      "causality"
    ],
    "additionalProperties": false
  }
}

What does a causal-language-strength result look like?

This hand-authored response demonstrates the contract. It is not a model accuracy measurement. Run it without an API key: npx jev-recipes demo causal-language-strength.

{
  "model": "demo-fixture",
  "usage": {
    "input_tokens": 0,
    "output_tokens": 0
  },
  "status": "ready",
  "score": 1.09,
  "level": 1,
  "confidence": 0.9,
  "probabilities": {
    "0": 0.01,
    "1": 0.9,
    "2": 0.08,
    "3": 0.01,
    "4": 0
  },
  "causality": "association"
}

Input

See shared options and behavior for client configuration, validation, and errors. Types are inferred from this folder's Zod 4 schemas.

Result

causality is one of none, association, suggestive, hedged, asserted, taken from the most likely rubric level. level is that level's index from 0 to 4. score is Jev's expected value across the rubric and can fall between levels; use it for ranking or thresholds where a single label loses information.

A result is ready when confidence meets minConfidence. Otherwise it is review and still carries the graded values for inspection. probabilities is keyed by level index.

Reuse and calls

Uses the shared score helper. This folder owns the question, the rubric wording, and the review policy. A live invocation makes one logical Jev request.

Limits

The grade measures how strongly the words claim causation, not whether the claim is justified; a randomized trial may be described in associational language and an observational study in causal language. Comparing the grade against the study design is the reader's task, and the recipe does not read the design unless it is part of the statement. Each statement is graded alone, so checking a whole abstract or press release for the strongest claim means splitting it and taking the maximum in application code.

Example input

demo.json contains editable input and a hand-authored response. After installing jev-recipes, npx jev-recipes demo causal-language-strength shows an offline illustration, not an accuracy measurement. Use npx jev-recipes describe causal-language-strength to inspect the input and result schemas.

How accurate is causal-language-strength?

Fixture only

No verified live accuracy measurement is available. Evaluate representative cases before using this decision in your workflow.

Use the evaluation guide to measure this decision on your own labeled cases.

What are the limits of causal-language-strength?