Skip to content

Is it possible to leverage a repeated pattern as a custom entity? #69

Discussion options

You must be logged in to vote

Currently + regex operator like operation is not supported; it is there in our ToDos but so far we have not been able to devote time on this.

As a work around, you may like to try following code:

const winkNLP = require( 'wink-nlp' );
const its = require( 'wink-nlp/src/its.js' );
const model = require( 'wink-eng-lite-web-model' );
const nlp = winkNLP( model );
const p = [
  { name: 'firstNameList', patterns: ['[PROPN] [|PUNCT|CCONJ] [|CCONJ]'] }
];
nlp.learnCustomEntities( p );
const text = 'Tom, Dana, James, Lily, and Ronan went to park. They met John and Mike in the park.';
const doc = nlp.readDoc( text );
doc.sentences().each( ( s ) => console.log( s.customEntities().out().join( ' ' ) ) )

Replies: 1 comment 1 reply

Comment options

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

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