Update app.py
Browse files
app.py
CHANGED
@@ -146,8 +146,9 @@ def main():
|
|
146 |
end_probabilities = tf.nn.softmax(outputs.end_logits, axis=-1)[0]
|
147 |
scores = start_probabilities[:, None] * end_probabilities[None, :]
|
148 |
scores = tf.linalg.band_part(scores, 0, -1)
|
|
|
149 |
st.write(scores)
|
150 |
-
max_index =
|
151 |
st.write(max_index)
|
152 |
start_index = max_index // scores.shape[1]
|
153 |
end_index = max_index % scores.shape[1]
|
|
|
146 |
end_probabilities = tf.nn.softmax(outputs.end_logits, axis=-1)[0]
|
147 |
scores = start_probabilities[:, None] * end_probabilities[None, :]
|
148 |
scores = tf.linalg.band_part(scores, 0, -1)
|
149 |
+
scores = scores.flatten()
|
150 |
st.write(scores)
|
151 |
+
max_index = np.argmax(scores)
|
152 |
st.write(max_index)
|
153 |
start_index = max_index // scores.shape[1]
|
154 |
end_index = max_index % scores.shape[1]
|