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.

20.7 KB
Raw Blame
{
  "name": "sample_app_hindi",
  "state": {
    "body": "मार्च का बिल दो बार लिया गया, कृपया रिफंड करें।"
  },
  "serialized_state": "{\"body\": \"मार्च का बिल दो बार लिया गया, कृपया रिफंड करें।\"}",
  "questions": {
    "department": {
      "type": "choice",
      "instructions": "Which department should handle this request?",
      "criteria": {
        "billing": "invoices, payments, refunds",
        "technical": "bugs, outages, system errors",
        "sales": "pricing, new contracts",
        "other": "everything else"
      }
    },
    "urgency": {
      "type": "score",
      "instructions": "How urgent is this request?",
      "criteria": [
        "not urgent",
        "soon",
        "critical deadline or blocking issue"
      ]
    },
    "churn_risk": {
      "type": "noul",
      "instructions": "Does the user threaten to cancel or leave?"
    },
    "refund_requested": {
      "type": "noul",
      "instructions": "Does the user explicitly request a refund?"
    }
  },
  "per_question": [
    {
      "id": "department",
      "type": "choice",
      "qtype": 0,
      "instructions": "Which department should handle this request?",
      "head_text": "choice question: Which department should handle this request?",
      "options": [
        "billing: invoices, payments, refunds",
        "technical: bugs, outages, system errors",
        "sales: pricing, new contracts",
        "other: everything else"
      ],
      "input_ids": [
        50281,
        22122,
        1953,
        27,
        6758,
        7811,
        943,
        6016,
        436,
        2748,
        32,
        50282,
        50284,
        33484,
        27,
        29838,
        1271,
        13,
        10762,
        13,
        1275,
        41748,
        50284,
        7681,
        27,
        19775,
        13,
        562,
        1131,
        13,
        985,
        6332,
        50284,
        6224,
        27,
        20910,
        13,
        747,
        12712,
        50284,
        643,
        27,
        3253,
        2010,
        50282,
        9819,
        2915,
        1381,
        346,
        32191,
        12001,
        15754,
        17665,
        2483,
        237,
        21433,
        12001,
        6280,
        107,
        20489,
        29903,
        6280,
        101,
        25159,
        6280,
        107,
        12001,
        15754,
        6280,
        112,
        20489,
        29950,
        12001,
        6280,
        234,
        29950,
        12001,
        13,
        21433,
        6123,
        214,
        39695,
        29950,
        12001,
        6280,
        110,
        20489,
        2483,
        106,
        22143,
        2483,
        96,
        21433,
        15754,
        15472,
        22143,
        6123,
        99,
        986,
        50282
      ],
      "markers": [
        12,
        22,
        32,
        39
      ]
    },
    {
      "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: soon",
        "level 2: critical deadline or blocking issue"
      ],
      "input_ids": [
        50281,
        18891,
        1953,
        27,
        1359,
        21007,
        310,
        436,
        2748,
        32,
        50282,
        50284,
        1268,
        470,
        27,
        417,
        21007,
        50284,
        1268,
        337,
        27,
        3517,
        50284,
        1268,
        374,
        27,
        4619,
        20639,
        390,
        14589,
        2523,
        50282,
        9819,
        2915,
        1381,
        346,
        32191,
        12001,
        15754,
        17665,
        2483,
        237,
        21433,
        12001,
        6280,
        107,
        20489,
        29903,
        6280,
        101,
        25159,
        6280,
        107,
        12001,
        15754,
        6280,
        112,
        20489,
        29950,
        12001,
        6280,
        234,
        29950,
        12001,
        13,
        21433,
        6123,
        214,
        39695,
        29950,
        12001,
        6280,
        110,
        20489,
        2483,
        106,
        22143,
        2483,
        96,
        21433,
        15754,
        15472,
        22143,
        6123,
        99,
        986,
        50282
      ],
      "markers": [
        11,
        17,
        22
      ]
    },
    {
      "id": "churn_risk",
      "type": "noul",
      "qtype": 2,
      "instructions": "Does the user threaten to cancel or leave?",
      "head_text": "noul question: Does the user threaten to cancel or leave?",
      "options": [
        "false: no, the statement does not hold",
        "true: yes, the statement holds"
      ],
      "input_ids": [
        50281,
        79,
        3941,
        1953,
        27,
        9876,
        253,
        2608,
        29138,
        281,
        14002,
        390,
        3553,
        32,
        50282,
        50284,
        3221,
        27,
        642,
        13,
        253,
        3908,
        1057,
        417,
        2186,
        50284,
        2032,
        27,
        4754,
        13,
        253,
        3908,
        6556,
        50282,
        9819,
        2915,
        1381,
        346,
        32191,
        12001,
        15754,
        17665,
        2483,
        237,
        21433,
        12001,
        6280,
        107,
        20489,
        29903,
        6280,
        101,
        25159,
        6280,
        107,
        12001,
        15754,
        6280,
        112,
        20489,
        29950,
        12001,
        6280,
        234,
        29950,
        12001,
        13,
        21433,
        6123,
        214,
        39695,
        29950,
        12001,
        6280,
        110,
        20489,
        2483,
        106,
        22143,
        2483,
        96,
        21433,
        15754,
        15472,
        22143,
        6123,
        99,
        986,
        50282
      ],
      "markers": [
        15,
        25
      ]
    },
    {
      "id": "refund_requested",
      "type": "noul",
      "qtype": 2,
      "instructions": "Does the user explicitly request a refund?",
      "head_text": "noul question: Does the user explicitly request a refund?",
      "options": [
        "false: no, the statement does not hold",
        "true: yes, the statement holds"
      ],
      "input_ids": [
        50281,
        79,
        3941,
        1953,
        27,
        9876,
        253,
        2608,
        11120,
        2748,
        247,
        23005,
        32,
        50282,
        50284,
        3221,
        27,
        642,
        13,
        253,
        3908,
        1057,
        417,
        2186,
        50284,
        2032,
        27,
        4754,
        13,
        253,
        3908,
        6556,
        50282,
        9819,
        2915,
        1381,
        346,
        32191,
        12001,
        15754,
        17665,
        2483,
        237,
        21433,
        12001,
        6280,
        107,
        20489,
        29903,
        6280,
        101,
        25159,
        6280,
        107,
        12001,
        15754,
        6280,
        112,
        20489,
        29950,
        12001,
        6280,
        234,
        29950,
        12001,
        13,
        21433,
        6123,
        214,
        39695,
        29950,
        12001,
        6280,
        110,
        20489,
        2483,
        106,
        22143,
        2483,
        96,
        21433,
        15754,
        15472,
        22143,
        6123,
        99,
        986,
        50282
      ],
      "markers": [
        14,
        24
      ]
    }
  ],
  "batch": {
    "input_ids": [
      [
        50281,
        22122,
        1953,
        27,
        6758,
        7811,
        943,
        6016,
        436,
        2748,
        32,
        50282,
        50284,
        33484,
        27,
        29838,
        1271,
        13,
        10762,
        13,
        1275,
        41748,
        50284,
        7681,
        27,
        19775,
        13,
        562,
        1131,
        13,
        985,
        6332,
        50284,
        6224,
        27,
        20910,
        13,
        747,
        12712,
        50284,
        643,
        27,
        3253,
        2010,
        50282,
        9819,
        2915,
        1381,
        346,
        32191,
        12001,
        15754,
        17665,
        2483,
        237,
        21433,
        12001,
        6280,
        107,
        20489,
        29903,
        6280,
        101,
        25159,
        6280,
        107,
        12001,
        15754,
        6280,
        112,
        20489,
        29950,
        12001,
        6280,
        234,
        29950,
        12001,
        13,
        21433,
        6123,
        214,
        39695,
        29950,
        12001,
        6280,
        110,
        20489,
        2483,
        106,
        22143,
        2483,
        96,
        21433,
        15754,
        15472,
        22143,
        6123,
        99,
        986,
        50282
      ],
      [
        50281,
        18891,
        1953,
        27,
        1359,
        21007,
        310,
        436,
        2748,
        32,
        50282,
        50284,
        1268,
        470,
        27,
        417,
        21007,
        50284,
        1268,
        337,
        27,
        3517,
        50284,
        1268,
        374,
        27,
        4619,
        20639,
        390,
        14589,
        2523,
        50282,
        9819,
        2915,
        1381,
        346,
        32191,
        12001,
        15754,
        17665,
        2483,
        237,
        21433,
        12001,
        6280,
        107,
        20489,
        29903,
        6280,
        101,
        25159,
        6280,
        107,
        12001,
        15754,
        6280,
        112,
        20489,
        29950,
        12001,
        6280,
        234,
        29950,
        12001,
        13,
        21433,
        6123,
        214,
        39695,
        29950,
        12001,
        6280,
        110,
        20489,
        2483,
        106,
        22143,
        2483,
        96,
        21433,
        15754,
        15472,
        22143,
        6123,
        99,
        986,
        50282,
        50283,
        50283,
        50283,
        50283,
        50283,
        50283,
        50283,
        50283,
        50283,
        50283,
        50283,
        50283,
        50283
      ],
      [
        50281,
        79,
        3941,
        1953,
        27,
        9876,
        253,
        2608,
        29138,
        281,
        14002,
        390,
        3553,
        32,
        50282,
        50284,
        3221,
        27,
        642,
        13,
        253,
        3908,
        1057,
        417,
        2186,
        50284,
        2032,
        27,
        4754,
        13,
        253,
        3908,
        6556,
        50282,
        9819,
        2915,
        1381,
        346,
        32191,
        12001,
        15754,
        17665,
        2483,
        237,
        21433,
        12001,
        6280,
        107,
        20489,
        29903,
        6280,
        101,
        25159,
        6280,
        107,
        12001,
        15754,
        6280,
        112,
        20489,
        29950,
        12001,
        6280,
        234,
        29950,
        12001,
        13,
        21433,
        6123,
        214,
        39695,
        29950,
        12001,
        6280,
        110,
        20489,
        2483,
        106,
        22143,
        2483,
        96,
        21433,
        15754,
        15472,
        22143,
        6123,
        99,
        986,
        50282,
        50283,
        50283,
        50283,
        50283,
        50283,
        50283,
        50283,
        50283,
        50283,
        50283,
        50283
      ],
      [
        50281,
        79,
        3941,
        1953,
        27,
        9876,
        253,
        2608,
        11120,
        2748,
        247,
        23005,
        32,
        50282,
        50284,
        3221,
        27,
        642,
        13,
        253,
        3908,
        1057,
        417,
        2186,
        50284,
        2032,
        27,
        4754,
        13,
        253,
        3908,
        6556,
        50282,
        9819,
        2915,
        1381,
        346,
        32191,
        12001,
        15754,
        17665,
        2483,
        237,
        21433,
        12001,
        6280,
        107,
        20489,
        29903,
        6280,
        101,
        25159,
        6280,
        107,
        12001,
        15754,
        6280,
        112,
        20489,
        29950,
        12001,
        6280,
        234,
        29950,
        12001,
        13,
        21433,
        6123,
        214,
        39695,
        29950,
        12001,
        6280,
        110,
        20489,
        2483,
        106,
        22143,
        2483,
        96,
        21433,
        15754,
        15472,
        22143,
        6123,
        99,
        986,
        50282,
        50283,
        50283,
        50283,
        50283,
        50283,
        50283,
        50283,
        50283,
        50283,
        50283,
        50283,
        50283
      ]
    ],
    "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,
        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,
        0,
        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,
        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,
        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,
        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,
        0,
        0,
        0,
        0,
        0,
        0,
        0,
        0,
        0
      ]
    ],
    "marker_pos": [
      [
        12,
        22,
        32,
        39
      ],
      [
        11,
        17,
        22,
        0
      ],
      [
        15,
        25,
        0,
        0
      ],
      [
        14,
        24,
        0,
        0
      ]
    ],
    "marker_mask": [
      [
        true,
        true,
        true,
        true
      ],
      [
        true,
        true,
        true,
        false
      ],
      [
        true,
        true,
        false,
        false
      ],
      [
        true,
        true,
        false,
        false
      ]
    ],
    "qtype": [
      0,
      1,
      2,
      2
    ]
  },
  "marker_axis_padded": false,
  "logits": [
    [
      1.0225623846054077,
      0.24040594696998596,
      -0.9230324029922485,
      -0.38694146275520325
    ],
    [
      2.2495646476745605,
      2.5387086868286133,
      1.6902523040771484,
      -10000.0
    ],
    [
      4.114648818969727,
      -0.1043037474155426,
      -10000.0,
      -10000.0
    ],
    [
      4.595254421234131,
      -0.24962997436523438,
      -10000.0,
      -10000.0
    ]
  ],
  "act_logits": [
    [
      4469.7490234375,
      -3653.57080078125
    ],
    [
      3890.696044921875,
      -3193.384765625
    ],
    [
      4046.173828125,
      -3316.29052734375
    ],
    [
      4189.32421875,
      -3421.083984375
    ]
  ],
  "result": {
    "model": "laya-rl-agent",
    "answers": {
      "department": {
        "type": "choice",
        "choice": "billing",
        "probabilities": {
          "billing": 0.413,
          "technical": 0.2648,
          "sales": 0.1367,
          "other": 0.1854
        },
        "confidence": 0.0611,
        "answer_confidence": 0.413,
        "action": {
          "act_probability": 1.0
        }
      },
      "urgency": {
        "type": "score",
        "score": 0.8757,
        "legend": {
          "0": "not urgent",
          "1": "soon",
          "2": "critical deadline or blocking issue"
        },
        "probabilities": {
          "0": 0.3449,
          "1": 0.4345,
          "2": 0.2206
        },
        "confidence": 0.0327,
        "answer_confidence": 0.4345,
        "action": {
          "act_probability": 1.0
        }
      },
      "churn_risk": {
        "type": "noul",
        "noul": 0.1065,
        "confidence": 0.8935,
        "answer_confidence": 0.8935,
        "action": {
          "act_probability": 1.0
        }
      },
      "refund_requested": {
        "type": "noul",
        "noul": 0.08,
        "confidence": 0.92,
        "answer_confidence": 0.92,
        "action": {
          "act_probability": 1.0
        }
      }
    },
    "usage": {
      "input_tokens": 364,
      "output_tokens": 0,
      "state_tokens": 54,
      "state_tokens_dropped": 0,
      "truncated": false,
      "truncated_questions": []
    }
  }
}