Skip to content

Trying to Create BM25 Embeddings/Sementic Search - Error: prepareInput(text, "search").filter is not a function #116

Discussion options

You must be logged in to vote

Hello @Chaddeus

It seems the code has not followed the required workflow – the define prep tasks has to be defined. Here is the revised code in JS for your reference:

// Load wink-bm25-text-search
var bm25 = require( 'wink-bm25-text-search' );
// Create search engine's instance
var engine = bm25();
// Load wink nlp and its model
const winkNLP = require( 'wink-nlp' );
// Use web model
const model = require( 'wink-eng-lite-web-model' );
const nlp = winkNLP( model );
const its = nlp.its;



function createChunks(text) {
    let contextDoc = nlp.readDoc(text)
    let sentences = []

    contextDoc.sentences().each((s) => {
        const sentence = []
        s.tokens().each((t) => sentence.push(

Replies: 1 comment 1 reply

Comment options

You must be logged in to vote
1 reply
@Chaddeus
Comment options

Answer selected by Chaddeus
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
2 participants