Spaces:
Runtime error
Runtime error
Yasin Yousif
commited on
Commit
·
c9c2e8c
1
Parent(s):
c64789a
update 3
Browse files
story.py
CHANGED
@@ -31,6 +31,7 @@ def story_model(preds,res_len=5):
|
|
31 |
for word,prob in preds:
|
32 |
dists += np.array([prob * (word in sent) for sent in All_sentenses])
|
33 |
|
34 |
-
f_res = list(zip(dists,All_sentenses))
|
|
|
35 |
|
36 |
return [f for _,f in f_res[-res_len:]] # list of sentenses
|
|
|
31 |
for word,prob in preds:
|
32 |
dists += np.array([prob * (word in sent) for sent in All_sentenses])
|
33 |
|
34 |
+
f_res = list(zip(dists,All_sentenses))
|
35 |
+
f_res.sort(key=lambda x:x[0])
|
36 |
|
37 |
return [f for _,f in f_res[-res_len:]] # list of sentenses
|