Skip to content

Commit e5cbb7b

Browse files
feat(benchmark/run): add option to include/exclude custom entities
1 parent bc0a2c5 commit e5cbb7b

File tree

1 file changed

+9
-5
lines changed

1 file changed

+9
-5
lines changed

benchmark/run.js

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -8,14 +8,18 @@ var nlp = winkNLP( model );
88

99
var s1 = fs.readFileSync( './benchmark/jj-ch13.txt', 'utf8' ); // eslint-disable-line no-sync
1010

11-
var examples = [
12-
{ name: 'ADJ-NOUN', patterns: [ 'ADJ NOUN' ] }
13-
];
11+
if ( process.argv[ 2 ] ) {
12+
var examples = [
13+
{ name: 'ADJ-NOUN', patterns: [ 'ADJ NOUN' ] }
14+
];
1415

15-
nlp.learnCustomEntities( examples );
16+
nlp.learnCustomEntities( examples );
17+
18+
console.log( '\nAdding custom entities detection to the pipe.\n' );
19+
}
1620

1721
var suite = new Benchmark.Suite();
18-
console.log( '\nNLP Pipe in use: Tokenizer, SBD, Negation, NER, Sentiment, POS, Custom Entities' ); // eslint-disable-line no-console
22+
console.log( '\nNLP Pipe in use: Tokenizer, SBD, Negation, NER, Sentiment, POS' ); // eslint-disable-line no-console
1923
console.log( 'Processing Ch 13 of Ulysses by James Joyce:\n' ); // eslint-disable-line no-console
2024
// add tests
2125
suite.add('\n\t(i) James Joyce (20467 tokens)\t', function ( ) {

0 commit comments

Comments
 (0)