davda54 commited on
Commit
bc4505b
·
1 Parent(s): e3dd569
Files changed (1) hide show
  1. app.py +6 -6
app.py CHANGED
@@ -80,17 +80,17 @@ edge_labels = [
80
  ]
81
 
82
  def render_table(forms, lemmas, upos, xpos, feats, metadata, edges, edge_labels):
83
- feats = [list(feat.split("|")) for feat in feats]
84
  max_len = max([len(feat) for feat in feats])
85
  feats = [feat + [""] * (max_len - len(feat)) for feat in feats]
86
  feats = list(zip(*feats))
87
 
88
  array = [
89
- ["<sup>FORMS</sup>"] + forms,
90
- ["<sup>LEMMAS:</sup>"] + lemmas,
91
- ["<sup>UPOS:</sup>"] + upos,
92
- ["<sup>XPOS:</sup>"] + xpos,
93
- ["<sup>UFEATS:</sup>"] + list(feats[0]),
94
  *([""] + list(row) for row in feats[1:])
95
  ]
96
 
 
80
  ]
81
 
82
  def render_table(forms, lemmas, upos, xpos, feats, metadata, edges, edge_labels):
83
+ feats = [[f"*{f.split('=')[0]}:* {f.split('=')[1]}" for f in (feat.split("|"))] for feat in feats]
84
  max_len = max([len(feat) for feat in feats])
85
  feats = [feat + [""] * (max_len - len(feat)) for feat in feats]
86
  feats = list(zip(*feats))
87
 
88
  array = [
89
+ [""] + forms,
90
+ ["<sup>LEMMAS</sup>"] + lemmas,
91
+ ["<sup>UPOS</sup>"] + upos,
92
+ ["<sup>XPOS</sup>"] + xpos,
93
+ ["<sup>UFEATS</sup>"] + list(feats[0]),
94
  *([""] + list(row) for row in feats[1:])
95
  ]
96