forked from facebookresearch/ParlAI
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathtest_unigram.py
30 lines (24 loc) · 889 Bytes
/
test_unigram.py
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
#!/usr/bin/env python3
# Copyright (c) Facebook, Inc. and its affiliates.
# This source code is licensed under the MIT license found in the
# LICENSE file in the root directory of this source tree.
import unittest
import parlai.utils.testing as testing_utils
class TestUnigram(unittest.TestCase):
def test_unigram(self):
valid, test = testing_utils.train_model(
{'model': 'unigram', 'task': 'integration_tests', 'num_epochs': 0.01}
)
assert valid['f1'] > 0
class TestUnigramTorchAgent(unittest.TestCase):
def test_unigram(self):
valid, test = testing_utils.train_model(
{
'model': 'test_agents/unigram',
'task': 'integration_tests',
'num_epochs': 1.0,
'batchsize': 32,
'truncate': 4,
}
)
assert valid['f1'] > 0