Spaces:
Runtime error
Runtime error
Commit
•
2334258
1
Parent(s):
867ca48
Update app.py
Browse files
app.py
CHANGED
@@ -1,4 +1,4 @@
|
|
1 |
-
import
|
2 |
import streamlit as st
|
3 |
import torch
|
4 |
import numpy as np
|
@@ -39,7 +39,7 @@ text = title + '. ' + abstract
|
|
39 |
tokens_info = tokenizer(text, padding=True, truncation=True, return_tensors="pt")
|
40 |
out_first = model_first(**tokens_info).pooler_output
|
41 |
out_second = model_second(out_first).detach().numpy()
|
42 |
-
out_second =
|
43 |
indices = np.argsort(out_second)[0][::-1]
|
44 |
sum_prob = 0
|
45 |
for i in indices:
|
|
|
1 |
+
from scipy.special import softmax
|
2 |
import streamlit as st
|
3 |
import torch
|
4 |
import numpy as np
|
|
|
39 |
tokens_info = tokenizer(text, padding=True, truncation=True, return_tensors="pt")
|
40 |
out_first = model_first(**tokens_info).pooler_output
|
41 |
out_second = model_second(out_first).detach().numpy()
|
42 |
+
out_second = softmax(out_second)
|
43 |
indices = np.argsort(out_second)[0][::-1]
|
44 |
sum_prob = 0
|
45 |
for i in indices:
|