Skip to content

Commit

Permalink
Update masked-lm tests
Browse files Browse the repository at this point in the history
  • Loading branch information
xenova committed Sep 2, 2023
1 parent 9077c21 commit 96b9143
Showing 1 changed file with 30 additions and 29 deletions.
59 changes: 30 additions & 29 deletions tests/pipelines.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -248,34 +248,34 @@ describe('Pipelines', () => {
let outputs = await unmasker(texts[0]);
let expected = [
{
score: 0.9496445655822754,
score: 0.9405396580696106,
token: 2051,
token_str: 'time',
sequence: 'once upon a time.'
},
{
score: 0.01029531005769968,
score: 0.01182964164763689,
token: 13342,
token_str: 'mattress',
sequence: 'once upon a mattress.'
},
{
score: 0.0013969476567581296,
score: 0.0017291896510869265,
token: 6480,
token_str: 'lifetime',
sequence: 'once upon a lifetime.'
},
{
score: 0.0008216543938033283,
score: 0.0010079898638650775,
token: 2504,
token_str: 'level',
sequence: 'once upon a level.'
},
{
score: 0.0007674929802305996,
token: 2940,
token_str: 'hill',
sequence: 'once upon a hill.'
score: 0.0009655007743276656,
token: 2154,
token_str: 'day',
sequence: 'once upon a day.'
}
];
compare(outputs, expected);
Expand All @@ -289,65 +289,66 @@ describe('Pipelines', () => {

let expected = [[
{
score: 0.9918821454048157,
score: 0.9900539517402649,
token: 2051,
token_str: 'time',
sequence: 'once upon a time.'
},
{
score: 0.0010219492251053452,
score: 0.0012258145725354552,
token: 13342,
token_str: 'mattress',
sequence: 'once upon a mattress.'
},
{
score: 0.00024931252119131386,
score: 0.0002977887343149632,
token: 2096,
token_str: 'while',
sequence: 'once upon a while.'
},
{
score: 0.00015193592116702348,
token: 2558,
token_str: 'period',
sequence: 'once upon a period.'
},
{
score: 0.00015131247346289456,
score: 0.0001899998023873195,
token: 6480,
token_str: 'lifetime',
sequence: 'once upon a lifetime.'
},
{
score: 0.00017618606216274202,
token: 2558,
token_str: 'period',
sequence: 'once upon a period.'
}
], [
],
[
{
score: 0.29160282015800476,
score: 0.2863538861274719,
token: 2414,
token_str: 'london',
sequence: 'london is the capital of england.'
},
{
score: 0.06457117199897766,
score: 0.0607745461165905,
token: 2009,
token_str: 'it',
sequence: 'it is the capital of england.'
},
{
score: 0.031988438218832016,
score: 0.037455108016729355,
token: 6484,
token_str: 'birmingham',
sequence: 'birmingham is the capital of england.'
},
{
score: 0.0317111536860466,
token: 7067,
token_str: 'bristol',
sequence: 'bristol is the capital of england.'
},
{
score: 0.030000191181898117,
score: 0.029375044628977776,
token: 5087,
token_str: 'manchester',
sequence: 'manchester is the capital of england.'
},
{
score: 0.0292277242988348,
token: 7067,
token_str: 'bristol',
sequence: 'bristol is the capital of england.'
}
]];

Expand Down

0 comments on commit 96b9143

Please sign in to comment.