-
Notifications
You must be signed in to change notification settings - Fork 26
Open
Description
ClassifierReborn::Summarizer.perform_lsi uses a neat trick to avoid LSI's default behavior of "auto-rebuilding" the index after every time a person adds new content .
def perform_lsi(chunks, count, separator)
lsi = ClassifierReborn::LSI.new auto_rebuild: false
chunks.each { \|chunk\| lsi << chunk unless chunk.strip.empty? \|\| chunk.strip.split.size == 1 }
lsi.build_index
summaries = lsi.highest_relative_content count
summaries.reject { \|chunk\| !summaries.include? chunk }.map(&:strip).join(separator)
endThis could be useful behavior to have.
Metadata
Metadata
Assignees
Labels
No labels