Spaces:
Runtime error
Runtime error
kpriyanshu256
commited on
Commit
·
36ac3bd
1
Parent(s):
18eff01
Typo fixed
Browse files
app.py
CHANGED
@@ -135,7 +135,7 @@ def disambiguate(text, acronym):
|
|
135 |
mask = torch.tensor(inputs['mask'])
|
136 |
token_type = torch.tensor(inputs['token_type'])
|
137 |
offsets = inputs['offset']
|
138 |
-
expansion = inputs['
|
139 |
acronym = inputs['acronym']
|
140 |
|
141 |
ids = torch.unsqueeze(ids, 0)
|
@@ -151,7 +151,7 @@ def disambiguate(text, acronym):
|
|
151 |
start_idx = np.argmax(start_prob[0,:])
|
152 |
end_idx = np.argmax(end_prob[0,:])
|
153 |
|
154 |
-
|
155 |
return exp
|
156 |
|
157 |
text = gr.inputs.Textbox(lines=5, label="Context",\
|
|
|
135 |
mask = torch.tensor(inputs['mask'])
|
136 |
token_type = torch.tensor(inputs['token_type'])
|
137 |
offsets = inputs['offset']
|
138 |
+
expansion = inputs['expansion']
|
139 |
acronym = inputs['acronym']
|
140 |
|
141 |
ids = torch.unsqueeze(ids, 0)
|
|
|
151 |
start_idx = np.argmax(start_prob[0,:])
|
152 |
end_idx = np.argmax(end_prob[0,:])
|
153 |
|
154 |
+
_, exp = evaluate_jaccard(text, expansion[0], acronym[0], offsets[0], start_idx, end_idx)
|
155 |
return exp
|
156 |
|
157 |
text = gr.inputs.Textbox(lines=5, label="Context",\
|