-
Notifications
You must be signed in to change notification settings - Fork 0
/
test.py
29 lines (28 loc) · 944 Bytes
/
test.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
from scripts import datasets
from scripts import transformer
from scripts import models
import config
from tqdm import tqdm
from termcolor import cprint
if __name__ == '__main__':
test_texts, test_anns = datasets.test()
tf = transformer.LetterLevelTransformer()
features = []
true_labels = []
converted_anns = []
for text, ann in zip(test_texts, test_anns):
label = tf.convertAnnsToLabels(ann, text)
converted_ann = tf.convertLabelsToAnn(text, label)
converted_anns.append(converted_ann)
if True:
#if ann and converted_ann and ann != converted_ann:
cprint('=' * 70, 'red')
#print(text)
#print('========')
#print(label)
#print('=========')
print(ann)
print('=========')
print(converted_ann)
print(sum([len(a) for a in test_anns]))
print(sum([len(a) for a in converted_anns]))