-
-
Notifications
You must be signed in to change notification settings - Fork 189
/
Copy pathSentenceBench.php
35 lines (29 loc) · 1 KB
/
SentenceBench.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
<?php
namespace Rubix\ML\Benchmarks\Tokenizers;
use Rubix\ML\Tokenizers\Sentence;
/**
* @Groups({"Tokenizers"})
* @BeforeMethods({"setUp"})
*/
class SentenceBench
{
protected const SAMPLE_TEXT = "Do you see any Teletubbies in here? Do you see a slender plastic tag clipped to my shirt with my name printed on it? Do you see a little Asian child with a blank expression on his face sitting outside on a mechanical helicopter that shakes when you put quarters in it? No? Well, that's what you see at a toy store. And you must think you're in a toy store, because you're here shopping for an infant named Jeb.";
/**
* @var \Rubix\ML\Tokenizers\Sentence;
*/
protected $tokenizer;
public function setUp() : void
{
$this->tokenizer = new Sentence();
}
/**
* @Subject
* @revs(1000)
* @Iterations(5)
* @OutputTimeUnit("milliseconds", precision=3)
*/
public function tokenize() : void
{
$this->tokenizer->tokenize(self::SAMPLE_TEXT);
}
}