Class: Kreuzberg::ExtractedKeyword

Inherits:
T::Struct
  • Object
show all
Extended by:
T::Sig
Defined in:
lib/kreuzberg/types.rb

Overview

Extracted keyword with relevance metadata.

Represents a single keyword extracted from text along with its relevance score, the algorithm that extracted it, and optional position information.

Examples:

keyword = Kreuzberg::ExtractedKeyword.new(
  text: "machine learning",
  score: 0.95,
  algorithm: "yake",
  positions: [42, 128]
)
puts "#{keyword.text}: #{keyword.score}"