Spaces:
Build error
Build error
Update app.py
Browse files
app.py
CHANGED
@@ -52,8 +52,9 @@ if __name__ == "__main__":
|
|
52 |
sentence_f1 = calculate_F1_for_spans(tree_to_spans(gold_standard), tree_to_spans(best_parse))
|
53 |
TreeView(Tree.fromstring(gold_standard))._cframe.print_to_file('gold_standard.ps')
|
54 |
TreeView(Tree.fromstring(best_parse))._cframe.print_to_file('best_parse.ps')
|
55 |
-
|
56 |
-
|
|
|
57 |
gold_standard_img = Image.open("gold_standard.ps")
|
58 |
best_parse_img = Image.open("best_parse.ps")
|
59 |
return gold_standard_img, best_parse_img, f"{sentence_f1:.2f}"
|
|
|
52 |
sentence_f1 = calculate_F1_for_spans(tree_to_spans(gold_standard), tree_to_spans(best_parse))
|
53 |
TreeView(Tree.fromstring(gold_standard))._cframe.print_to_file('gold_standard.ps')
|
54 |
TreeView(Tree.fromstring(best_parse))._cframe.print_to_file('best_parse.ps')
|
55 |
+
os.system('convert gold_standard.ps gold_standard.png')
|
56 |
+
os.system('convert best_parse.ps best_parse.png')
|
57 |
+
print(os.listdir())
|
58 |
gold_standard_img = Image.open("gold_standard.ps")
|
59 |
best_parse_img = Image.open("best_parse.ps")
|
60 |
return gold_standard_img, best_parse_img, f"{sentence_f1:.2f}"
|