Files
fil/docs/snippets/wasm/utils/keyword_extraction_example.md
Henrik Jess Nielsen b4c07d3693
All checks were successful
Deploy fil (kreuzberg) / deploy (push) Successful in 49s
Nomad changes
2026-06-01 23:40:55 +02:00

411 B

import init, { extractFile } from "kreuzberg-wasm";

await init();

const config = {
  keywords: {
    algorithm: "yake",
    maxKeywords: 10,
    minScore: 0.3,
  },
};

const result = await extractFile("research_paper.pdf", undefined, config);
console.log(`Content length: ${result.content.length}`);
console.log(`Keywords: ${JSON.stringify(result.metadata?.keywords ?? [])}`);