Property MaxInputTokens
- Namespace
- LMKit.TextAnalysis
- Assembly
- LM-Kit.NET.dll
MaxInputTokens
Gets or sets the maximum number of input tokens that the categorization engine will analyze.
public int MaxInputTokens { get; set; }
Property Value
Examples
using LMKit.Model;
using LMKit.TextAnalysis;
using System;
using System.Collections.Generic;
LM model = LM.LoadFromModelID("lmkit-tasks:4b-preview");
Categorization categorizer = new Categorization(model);
// Increase token limit for longer documents
categorizer.MaxInputTokens = 4096;
var categories = new List<string> { "legal", "technical", "marketing" };
string longDocument = "... lengthy document content ...";
int index = categorizer.GetBestCategory(categories, longDocument);
Console.WriteLine($"Category: {categories[index]}");
Remarks
Any content beyond this token count will be truncated before classification. The default is 2048 tokens.