Skip to content

Is it possible to set up a winkModel (using the wink-eng-lite-web-model) in a Worker? #68

Discussion options

You must be logged in to vote

In that case simply browserify your worker and it should work:

nlp-main.js

const winkNLP = require( 'wink-nlp' );
const model = require( 'wink-eng-lite-web-model' );
const nlp = winkNLP( model )

onmessage = function ( e ) {
  const message = nlp.readDoc(e.data).tokens().out();
  console.log(`[From Main (Text)]: ${e.data}`);

  postMessage(JSON.stringify(message));
};

The above file should be browserify using following command:

browserify nlp-main.js -o nlp.js

Replies: 6 comments 20 replies

Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
8 replies
@SkepticMystic
Comment options

@sanjayaksaxena
Comment options

@SkepticMystic
Comment options

@SkepticMystic
Comment options

@SkepticMystic
Comment options

Comment options

You must be logged in to vote
3 replies
@SkepticMystic
Comment options

@sanjayaksaxena
Comment options

@sanjayaksaxena
Comment options

Answer selected by SkepticMystic
Comment options

You must be logged in to vote
8 replies
@SkepticMystic
Comment options

@SkepticMystic
Comment options

@sanjayaksaxena
Comment options

@SkepticMystic
Comment options

@sanjayaksaxena
Comment options

Comment options

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
2 participants
Converted from issue

This discussion was converted from issue #67 on December 21, 2021 08:30.