Skip to content

armgit / laya

Public Imported from GitHub
0

Non-autoregressive System 1 decision engine. Typed choice, score and yes/no decisions over any text in a single forward pass, in 100+ languages, with a router that picks the right checkpoint per request.

13.7 KB
Raw Blame
{
  "name": "min_confidence_map_default",
  "state": "Thanks, that is all sorted now.",
  "serialized_state": "Thanks, that is all sorted now.",
  "questions": {
    "department": {
      "type": "choice",
      "instructions": "Which department should handle this?",
      "criteria": {
        "billing": "invoices, payments, double charges, refunds",
        "technical": "bugs, outages, integration errors",
        "account": "logins, seats, plan changes"
      }
    },
    "urgency": {
      "type": "score",
      "instructions": "How urgent is this request?",
      "criteria": [
        "not urgent",
        "this week",
        "today",
        "drop everything"
      ]
    },
    "churn_risk": {
      "type": "noul",
      "instructions": "The customer threatens to cancel the account."
    },
    "needs_human": {
      "type": "noul",
      "instructions": "This requires a human agent rather than an automated reply.",
      "criteria": {
        "false": "a template reply resolves it",
        "true": "a person must intervene"
      }
    }
  },
  "per_question": [
    {
      "id": "department",
      "type": "choice",
      "qtype": 0,
      "instructions": "Which department should handle this?",
      "head_text": "choice question: Which department should handle this?",
      "options": [
        "billing: invoices, payments, double charges, refunds",
        "technical: bugs, outages, integration errors",
        "account: logins, seats, plan changes"
      ],
      "input_ids": [
        2,
        6241,
        2872,
        235292,
        12236,
        9888,
        1412,
        6589,
        736,
        235336,
        1,
        4,
        54972,
        235292,
        88220,
        235269,
        15598,
        235269,
        4199,
        12036,
        235269,
        85869,
        4,
        9838,
        235292,
        30608,
        235269,
        142788,
        235269,
        16827,
        10266,
        4,
        3185,
        235292,
        12138,
        235256,
        235269,
        18723,
        235269,
        1780,
        4559,
        1,
        7807,
        235269,
        674,
        603,
        832,
        24087,
        1490,
        235265,
        1
      ],
      "markers": [
        11,
        22,
        31
      ]
    },
    {
      "id": "urgency",
      "type": "score",
      "qtype": 1,
      "instructions": "How urgent is this request?",
      "head_text": "score question: How urgent is this request?",
      "options": [
        "level 0: not urgent",
        "level 1: this week",
        "level 2: today",
        "level 3: drop everything"
      ],
      "input_ids": [
        2,
        7716,
        2872,
        235292,
        2250,
        34722,
        603,
        736,
        3853,
        235336,
        1,
        4,
        2403,
        235248,
        235276,
        235292,
        780,
        34722,
        4,
        2403,
        235248,
        235274,
        235292,
        736,
        2788,
        4,
        2403,
        235248,
        235284,
        235292,
        3646,
        4,
        2403,
        235248,
        235304,
        235292,
        7605,
        4553,
        1,
        7807,
        235269,
        674,
        603,
        832,
        24087,
        1490,
        235265,
        1
      ],
      "markers": [
        11,
        18,
        25,
        31
      ]
    },
    {
      "id": "churn_risk",
      "type": "noul",
      "qtype": 2,
      "instructions": "The customer threatens to cancel the account.",
      "head_text": "noul question: The customer threatens to cancel the account.",
      "options": [
        "false: no, the statement does not hold",
        "true: yes, the statement holds"
      ],
      "input_ids": [
        2,
        552,
        6311,
        2872,
        235292,
        714,
        6650,
        80670,
        577,
        12459,
        573,
        3185,
        235265,
        1,
        4,
        1566,
        235292,
        793,
        235269,
        573,
        6218,
        1721,
        780,
        3385,
        4,
        1382,
        235292,
        7778,
        235269,
        573,
        6218,
        12723,
        1,
        7807,
        235269,
        674,
        603,
        832,
        24087,
        1490,
        235265,
        1
      ],
      "markers": [
        14,
        24
      ]
    },
    {
      "id": "needs_human",
      "type": "noul",
      "qtype": 2,
      "instructions": "This requires a human agent rather than an automated reply.",
      "head_text": "noul question: This requires a human agent rather than an automated reply.",
      "options": [
        "false: a template reply resolves it",
        "true: a person must intervene"
      ],
      "input_ids": [
        2,
        552,
        6311,
        2872,
        235292,
        1417,
        9286,
        476,
        3515,
        10588,
        4644,
        1178,
        671,
        34177,
        7260,
        235265,
        1,
        4,
        1566,
        235292,
        476,
        11387,
        7260,
        116075,
        665,
        4,
        1382,
        235292,
        476,
        1552,
        2004,
        75103,
        1,
        7807,
        235269,
        674,
        603,
        832,
        24087,
        1490,
        235265,
        1
      ],
      "markers": [
        17,
        25
      ]
    }
  ],
  "batch": {
    "input_ids": [
      [
        2,
        6241,
        2872,
        235292,
        12236,
        9888,
        1412,
        6589,
        736,
        235336,
        1,
        4,
        54972,
        235292,
        88220,
        235269,
        15598,
        235269,
        4199,
        12036,
        235269,
        85869,
        4,
        9838,
        235292,
        30608,
        235269,
        142788,
        235269,
        16827,
        10266,
        4,
        3185,
        235292,
        12138,
        235256,
        235269,
        18723,
        235269,
        1780,
        4559,
        1,
        7807,
        235269,
        674,
        603,
        832,
        24087,
        1490,
        235265,
        1
      ],
      [
        2,
        7716,
        2872,
        235292,
        2250,
        34722,
        603,
        736,
        3853,
        235336,
        1,
        4,
        2403,
        235248,
        235276,
        235292,
        780,
        34722,
        4,
        2403,
        235248,
        235274,
        235292,
        736,
        2788,
        4,
        2403,
        235248,
        235284,
        235292,
        3646,
        4,
        2403,
        235248,
        235304,
        235292,
        7605,
        4553,
        1,
        7807,
        235269,
        674,
        603,
        832,
        24087,
        1490,
        235265,
        1,
        0,
        0,
        0
      ],
      [
        2,
        552,
        6311,
        2872,
        235292,
        714,
        6650,
        80670,
        577,
        12459,
        573,
        3185,
        235265,
        1,
        4,
        1566,
        235292,
        793,
        235269,
        573,
        6218,
        1721,
        780,
        3385,
        4,
        1382,
        235292,
        7778,
        235269,
        573,
        6218,
        12723,
        1,
        7807,
        235269,
        674,
        603,
        832,
        24087,
        1490,
        235265,
        1,
        0,
        0,
        0,
        0,
        0,
        0,
        0,
        0,
        0
      ],
      [
        2,
        552,
        6311,
        2872,
        235292,
        1417,
        9286,
        476,
        3515,
        10588,
        4644,
        1178,
        671,
        34177,
        7260,
        235265,
        1,
        4,
        1566,
        235292,
        476,
        11387,
        7260,
        116075,
        665,
        4,
        1382,
        235292,
        476,
        1552,
        2004,
        75103,
        1,
        7807,
        235269,
        674,
        603,
        832,
        24087,
        1490,
        235265,
        1,
        0,
        0,
        0,
        0,
        0,
        0,
        0,
        0,
        0
      ]
    ],
    "attention_mask": [
      [
        1,
        1,
        1,
        1,
        1,
        1,
        1,
        1,
        1,
        1,
        1,
        1,
        1,
        1,
        1,
        1,
        1,
        1,
        1,
        1,
        1,
        1,
        1,
        1,
        1,
        1,
        1,
        1,
        1,
        1,
        1,
        1,
        1,
        1,
        1,
        1,
        1,
        1,
        1,
        1,
        1,
        1,
        1,
        1,
        1,
        1,
        1,
        1,
        1,
        1,
        1
      ],
      [
        1,
        1,
        1,
        1,
        1,
        1,
        1,
        1,
        1,
        1,
        1,
        1,
        1,
        1,
        1,
        1,
        1,
        1,
        1,
        1,
        1,
        1,
        1,
        1,
        1,
        1,
        1,
        1,
        1,
        1,
        1,
        1,
        1,
        1,
        1,
        1,
        1,
        1,
        1,
        1,
        1,
        1,
        1,
        1,
        1,
        1,
        1,
        1,
        0,
        0,
        0
      ],
      [
        1,
        1,
        1,
        1,
        1,
        1,
        1,
        1,
        1,
        1,
        1,
        1,
        1,
        1,
        1,
        1,
        1,
        1,
        1,
        1,
        1,
        1,
        1,
        1,
        1,
        1,
        1,
        1,
        1,
        1,
        1,
        1,
        1,
        1,
        1,
        1,
        1,
        1,
        1,
        1,
        1,
        1,
        0,
        0,
        0,
        0,
        0,
        0,
        0,
        0,
        0
      ],
      [
        1,
        1,
        1,
        1,
        1,
        1,
        1,
        1,
        1,
        1,
        1,
        1,
        1,
        1,
        1,
        1,
        1,
        1,
        1,
        1,
        1,
        1,
        1,
        1,
        1,
        1,
        1,
        1,
        1,
        1,
        1,
        1,
        1,
        1,
        1,
        1,
        1,
        1,
        1,
        1,
        1,
        1,
        0,
        0,
        0,
        0,
        0,
        0,
        0,
        0,
        0
      ]
    ],
    "marker_pos": [
      [
        11,
        22,
        31,
        0
      ],
      [
        11,
        18,
        25,
        31
      ],
      [
        14,
        24,
        0,
        0
      ],
      [
        17,
        25,
        0,
        0
      ]
    ],
    "marker_mask": [
      [
        true,
        true,
        true,
        false
      ],
      [
        true,
        true,
        true,
        true
      ],
      [
        true,
        true,
        false,
        false
      ],
      [
        true,
        true,
        false,
        false
      ]
    ],
    "qtype": [
      0,
      1,
      2,
      2
    ]
  },
  "marker_axis_padded": false,
  "logits": [
    [
      -1.6179548501968384,
      -1.8165647983551025,
      -1.123018503189087,
      -10000.0
    ],
    [
      -0.4120713472366333,
      0.4631410241127014,
      -0.00779646635055542,
      0.054005563259124756
    ],
    [
      4.764176845550537,
      -0.41596102714538574,
      -10000.0,
      -10000.0
    ],
    [
      0.335951566696167,
      -0.49896663427352905,
      -10000.0,
      -10000.0
    ]
  ],
  "act_logits": [
    [
      1420.1611328125,
      -1689.47265625
    ],
    [
      1465.701416015625,
      -1730.4908447265625
    ],
    [
      1524.2642822265625,
      -1806.6566162109375
    ],
    [
      1414.691650390625,
      -1679.205322265625
    ]
  ],
  "result": {
    "model": "laya-rl-agent",
    "answers": {
      "department": {
        "type": "choice",
        "choice": "account",
        "probabilities": {
          "billing": 0.289,
          "technical": 0.2369,
          "account": 0.4741
        },
        "confidence": 0.0408,
        "answer_confidence": 0.4741,
        "action": {
          "act_probability": 1.0
        },
        "low_confidence": true,
        "abstention": "abstained",
        "abstention_threshold": 0.55
      },
      "urgency": {
        "type": "score",
        "score": 1.5678,
        "legend": {
          "0": "not urgent",
          "1": "this week",
          "2": "today",
          "3": "drop everything"
        },
        "probabilities": {
          "0": 0.1541,
          "1": 0.3696,
          "2": 0.2308,
          "3": 0.2455
        },
        "confidence": 0.034,
        "answer_confidence": 0.3696,
        "action": {
          "act_probability": 1.0
        },
        "low_confidence": true,
        "abstention": "abstained",
        "abstention_threshold": 0.55
      },
      "churn_risk": {
        "type": "noul",
        "noul": 0.0056,
        "confidence": 0.9944,
        "answer_confidence": 0.9944,
        "action": {
          "act_probability": 1.0
        },
        "abstention": "passed",
        "abstention_threshold": 0.55
      },
      "needs_human": {
        "type": "noul",
        "noul": 0.3026,
        "confidence": 0.6974,
        "answer_confidence": 0.6974,
        "action": {
          "act_probability": 1.0
        },
        "abstention": "passed",
        "abstention_threshold": 0.55
      }
    },
    "usage": {
      "input_tokens": 183,
      "output_tokens": 0,
      "state_tokens": 8,
      "state_tokens_dropped": 0,
      "truncated": false,
      "truncated_questions": []
    }
  },
  "options": {
    "min_confidence": {
      "default": 0.55
    }
  }
}