Dmitry Kirsanov commited on
Commit
50c7d58
·
1 Parent(s): 45fc24e

fix logic

Browse files
Files changed (2) hide show
  1. app.py +2 -2
  2. understand.py +3 -1
app.py CHANGED
@@ -24,9 +24,9 @@ gradio_app = gr.Interface(
24
  gr.Textbox(label="Document type", lines=1),
25
  gr.Textbox(label="Summary", lines=8),
26
  gr.Textbox(label="Concepts", lines=10),
27
- gr.Number(),
28
  gr.Textbox(label="Actors", lines=10),
29
- gr.Number(),
30
  gr.Textbox(label="Actors, generalized", lines=10),
31
  gr.Textbox(label="Document, annotated with actors", lines=18),
32
  ]
 
24
  gr.Textbox(label="Document type", lines=1),
25
  gr.Textbox(label="Summary", lines=8),
26
  gr.Textbox(label="Concepts", lines=10),
27
+ gr.Number(label="Jackard distance over two attempts"),
28
  gr.Textbox(label="Actors", lines=10),
29
+ gr.Number(label="Jackard distance over two attempts"),
30
  gr.Textbox(label="Actors, generalized", lines=10),
31
  gr.Textbox(label="Document, annotated with actors", lines=18),
32
  ]
understand.py CHANGED
@@ -167,7 +167,9 @@ Here's the document:
167
  <document>{self.values.get("FAD")}</document>""")
168
  reconciled[what['plural']] = self.parse_lists(ret, what['plural'])
169
  print(f"===Reconciled {what['plural']}: {reconciled[what['plural']]}")
170
-
 
 
171
  # finally store in the values
172
  self.values.put("concepts", reconciled["concepts"])
173
  self.values.put("actors", reconciled["actors"])
 
167
  <document>{self.values.get("FAD")}</document>""")
168
  reconciled[what['plural']] = self.parse_lists(ret, what['plural'])
169
  print(f"===Reconciled {what['plural']}: {reconciled[what['plural']]}")
170
+ else:
171
+ reconciled[what['plural']] = two_attempts[0][what['plural']] # they are the same, so we take the first one
172
+
173
  # finally store in the values
174
  self.values.put("concepts", reconciled["concepts"])
175
  self.values.put("actors", reconciled["actors"])