{
  "conventions": {
    "document_frequency": "number of documents whose raw term frequency is greater than zero",
    "idf": "natural logarithm ln(N/df), with N=3 and no smoothing",
    "term_frequency": "raw token count",
    "tfidf": "raw term frequency multiplied by unrounded binary64 IDF; no normalization or output rounding",
    "tokenization": "left-to-right longest lexicon match; ties follow lexicon order; unmatched input is an error",
    "vocabulary_order": "first appearance across documents, then first appearance within each document"
  },
  "creator": "nlp-editor",
  "expected": {
    "document_frequency_vector": [
      2,
      3,
      2,
      2
    ],
    "documents": [
      {
        "id": "d1",
        "term_frequency_vector": [
          1,
          1,
          1,
          0
        ],
        "text": "猫喜欢鱼",
        "tfidf_vector": [
          0.4054651081081644,
          0.0,
          0.4054651081081644,
          0.0
        ],
        "tokens": [
          "猫",
          "喜欢",
          "鱼"
        ]
      },
      {
        "id": "d2",
        "term_frequency_vector": [
          0,
          1,
          1,
          1
        ],
        "text": "狗喜欢鱼",
        "tfidf_vector": [
          0.0,
          0.0,
          0.4054651081081644,
          0.4054651081081644
        ],
        "tokens": [
          "狗",
          "喜欢",
          "鱼"
        ]
      },
      {
        "id": "d3",
        "term_frequency_vector": [
          1,
          1,
          0,
          1
        ],
        "text": "猫喜欢狗",
        "tfidf_vector": [
          0.4054651081081644,
          0.0,
          0.0,
          0.4054651081081644
        ],
        "tokens": [
          "猫",
          "喜欢",
          "狗"
        ]
      }
    ],
    "idf_vector": [
      0.4054651081081644,
      0.0,
      0.4054651081081644,
      0.4054651081081644
    ],
    "terms": [
      {
        "document_frequency": 2,
        "idf_binary64_hex": "0x1.9f323ecbf984cp-2",
        "idf_expression": "ln(3/2)",
        "idf_value": 0.4054651081081644,
        "term": "猫"
      },
      {
        "document_frequency": 3,
        "idf_binary64_hex": "0x0.0p+0",
        "idf_expression": "ln(3/3)",
        "idf_value": 0.0,
        "term": "喜欢"
      },
      {
        "document_frequency": 2,
        "idf_binary64_hex": "0x1.9f323ecbf984cp-2",
        "idf_expression": "ln(3/2)",
        "idf_value": 0.4054651081081644,
        "term": "鱼"
      },
      {
        "document_frequency": 2,
        "idf_binary64_hex": "0x1.9f323ecbf984cp-2",
        "idf_expression": "ln(3/2)",
        "idf_value": 0.4054651081081644,
        "term": "狗"
      }
    ]
  },
  "license": "CC BY 4.0",
  "license_url": "https://creativecommons.org/licenses/by/4.0/",
  "primitives": {
    "document_count": 3,
    "documents": [
      {
        "id": "d1",
        "text": "猫喜欢鱼"
      },
      {
        "id": "d2",
        "text": "狗喜欢鱼"
      },
      {
        "id": "d3",
        "text": "猫喜欢狗"
      }
    ],
    "idf_logarithm_base": "e",
    "idf_numerator": 3,
    "idf_smoothing": false,
    "lexicon_order": [
      "猫",
      "狗",
      "喜欢",
      "鱼"
    ],
    "vocabulary": [
      "猫",
      "喜欢",
      "鱼",
      "狗"
    ]
  },
  "provenance": "Original fictional three-sentence teaching corpus; no people, external corpus, or deployment data.",
  "schema": 1,
  "source": "AI Encyclopedia CN, Chapter 14"
}
