Spaces:
Runtime error
Runtime error
Yasin Yousif
commited on
Commit
·
c64789a
1
Parent(s):
8a8221e
update 2
Browse files
story.py
CHANGED
@@ -31,6 +31,6 @@ 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)).sort(key=lambda x:x[0])
|
35 |
|
36 |
-
return [f for _,f in f_res] # 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)).sort(key=lambda x:x[0])
|
35 |
|
36 |
+
return [f for _,f in f_res[-res_len:]] # list of sentenses
|