Skip to content

Commit

Permalink
Update test_onnx.py
Browse files Browse the repository at this point in the history
  • Loading branch information
ZhengTang1120 committed Dec 16, 2021
1 parent 9007983 commit 82ba700
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions main/src/main/python/test_onnx.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
import json
import numpy as np
from pytorch.seqScorer import *
import time

if __name__ == '__main__':

Expand Down Expand Up @@ -34,7 +35,7 @@
ort_char = onnxruntime.InferenceSession("char.onnx")

scoreCountsByLabel = ScoreCountsByLabel()

start_time = time.time()

This comment has been minimized.

Copy link
@bethard

bethard Dec 16, 2021

for taskId in range(0, taskManager.taskCount):
taskName = taskManager.tasks[taskId].taskName
sentences = taskManager.tasks[taskId].testSentences
Expand Down Expand Up @@ -78,5 +79,6 @@
print (f"Micro F1 : {scoreCountsByLabel.f1()}")
for label in scoreCountsByLabel.labels():
print (f"\tP/R/F1 for label {label} ({scoreCountsByLabel.map[label].gold}): {scoreCountsByLabel.precision(label)} / {scoreCountsByLabel.recall(label)} / {scoreCountsByLabel.f1(label)}")

duration = time.time() - start_time
print (duration)

0 comments on commit 82ba700

Please sign in to comment.