Constructor KeywordExtraction
- Namespace
- LMKit.TextAnalysis
- Assembly
- LM-Kit.NET.dll
KeywordExtraction(LM)
Initializes a new instance of the KeywordExtraction class with the specified language model.
public KeywordExtraction(LM model)
Parameters
modelLMThe language model to be used for keyword extraction.
Examples
using LMKit.Model;
using LMKit.TextAnalysis;
using System;
// Load a language model
LM model = LM.LoadFromModelID("lmkit-tasks:4b-preview");
// Create the keyword extractor
KeywordExtraction extractor = new KeywordExtraction(model);
Console.WriteLine($"KeywordExtraction initialized with model: {extractor.Model.Name}");
Console.WriteLine($"Default keyword count: {extractor.KeywordCount}");
Console.WriteLine($"Default max n-gram size: {extractor.MaxNgramSize}");
Exceptions
- ArgumentNullException
Thrown if the model is null.
- InvalidModelException
Thrown if the provided model is an embedding model or if the model does not have the necessary weights.