UNPKG

clustex

Version:

Clustex is a lightweight text classification package designed to efficiently categorize text based on similarity metrics and learned token weights.

14 lines (10 loc) 394 B
import fs from "fs"; import path from "path"; import { fileURLToPath } from "url"; const __filename = fileURLToPath(import.meta.url); const __dirname = path.dirname(__filename); const filePath = path.resolve(__dirname, "datasets"); function getDataset(name) { return JSON.parse(fs.readFileSync(path.resolve(filePath, `${name}.json`), "utf-8")); } export default getDataset;