Module: SkillExtractor

Defined in:
lib/skill_extractor/matcher.rb,
lib/skill_extractor.rb,
lib/skill_extractor/mlp.rb,
lib/skill_extractor/version.rb

Overview

Keyword matcher — a faithful port of FlashText's extract_keywords. Word boundaries: any char outside [A-Za-z0-9_]. Case-insensitive, longest-match-wins, non-overlapping. Identical spans across all skill-extractor language implementations.

Defined Under Namespace

Classes: Extractor, KeywordMatcher, MLP

Constant Summary collapse

MODEL =
"Xenova/all-MiniLM-L6-v2"
CONTEXT_BEFORE =
20
CONTEXT_AFTER =
21
DEFAULT_THRESHOLD =
0.5
DATA_DIR =
File.expand_path("../data", __dir__)
VERSION =
"0.1.0"

Class Method Summary collapse

Class Method Details

.extract_skills(text, threshold: DEFAULT_THRESHOLD) ⇒ Object

Module-level convenience wrapper around a shared Extractor.



66
67
68
69
# File 'lib/skill_extractor.rb', line 66

def self.extract_skills(text, threshold: DEFAULT_THRESHOLD)
  @default ||= Extractor.new
  @default.extract(text, threshold: threshold)
end