nickil commited on
Commit
3f7fee7
1 Parent(s): 3266825

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +8 -4
app.py CHANGED
@@ -52,12 +52,16 @@ 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
- 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}"
 
 
 
 
61
 
62
 
63
  iface = gradio.Interface(
 
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
+ gold_standard_img.save('gold_standard.png')
61
+ best_parse_img.save('best_parse.png')
62
+ gold_standard_img_png = Image.open("gold_standard.png")
63
+ best_parse_img_png = Image.open("best_parse.png")
64
+ return gold_standard_img_png, best_parse_img_png, f"{sentence_f1:.2f}"
65
 
66
 
67
  iface = gradio.Interface(