-
-
Notifications
You must be signed in to change notification settings - Fork 183
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Added extra whitespace pattern to Regex Filter
- Loading branch information
1 parent
0646362
commit 2faf539
Showing
8 changed files
with
44 additions
and
30 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -234,6 +234,8 @@ public function transform(array &$samples) : void | |
} | ||
|
||
$value = argmax($scores); | ||
|
||
break; | ||
} | ||
} | ||
} | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -31,18 +31,19 @@ protected function setUp() : void | |
$this->dataset = Unlabeled::quick([ | ||
['I was not proud of what I had learned, but I never doubted that it was worth $$$ knowing..'], | ||
['Too weird to live, [email protected] too rare to die https://rubixml.com'], | ||
['A man who procrastinates in @his choosing will inevitably have his choice made for him by #circumstance'], | ||
['A man who procrastinates in @his choosing will inevitably have his choice made for him by #circumstance'], | ||
['The quick quick brown fox jumped over the lazy man sitting at a bus stop drinking a can of Cola cola'], | ||
['Diese äpfel Äpfel schmecken sehr gut'], | ||
]); | ||
|
||
$this->transformer = new RegexFilter([ | ||
RegexFilter::URL, | ||
RegexFilter::EMAIL, | ||
RegexFilter::MENTION, | ||
RegexFilter::HASHTAG, | ||
RegexFilter::EXTRA_CHARACTERS, | ||
RegexFilter::EXTRA_WORDS, | ||
RegexFilter::MENTION, | ||
RegexFilter::HASHTAG, | ||
RegexFilter::EXTRA_WHITESPACE, | ||
]); | ||
} | ||
|
||
|
@@ -64,10 +65,10 @@ public function transform() : void | |
|
||
$expected = [ | ||
['I was not proud of what I had learned, but I never doubted that it was worth $ knowing.'], | ||
['Too weird to live, too rare to die '], | ||
['A man who procrastinates in choosing will inevitably have his choice made for him by '], | ||
['The quick brown fox jumped over the lazy man sitting at a bus stop drinking a can of cola'], | ||
['Diese Äpfel schmecken sehr gut'], | ||
['Too weird to live, too rare to die '], | ||
['A man who procrastinates in choosing will inevitably have his choice made for him by '], | ||
['The quick brown fox jumped over the lazy man sitting at a bus stop drinking a can of cola'], | ||
['Diese Äpfel schmecken sehr gut'], | ||
]; | ||
|
||
$this->assertEquals($expected, $this->dataset->samples()); | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters