Spaces:
Runtime error
Runtime error
Merge pull request #8 from WillSH97/add-title-desc-text
Browse files- reranker.py +4 -1
reranker.py
CHANGED
@@ -89,10 +89,13 @@ def textParser(item: dict) -> str:
|
|
89 |
output_text=''
|
90 |
itemkeys=[x for x in item.keys() if x in textkeys]
|
91 |
for key in itemkeys:
|
92 |
-
output_text=output_text+
|
93 |
assert output_text!='', 'text string is empty'
|
94 |
return output_text
|
95 |
|
|
|
|
|
|
|
96 |
def rankingfunc(inputJSON: dict, k: int = 10, mode: str = RankingModes.DIVERSIFY, debug: bool = False) -> dict:
|
97 |
'''
|
98 |
Rank a set of social media posts using our ranking algorithm
|
|
|
89 |
output_text=''
|
90 |
itemkeys=[x for x in item.keys() if x in textkeys]
|
91 |
for key in itemkeys:
|
92 |
+
output_text=output_text+item[key]+' '
|
93 |
assert output_text!='', 'text string is empty'
|
94 |
return output_text
|
95 |
|
96 |
+
|
97 |
+
################ TEST THIS!!!!!!!!!!!!!!!!!!!!!!!
|
98 |
+
|
99 |
def rankingfunc(inputJSON: dict, k: int = 10, mode: str = RankingModes.DIVERSIFY, debug: bool = False) -> dict:
|
100 |
'''
|
101 |
Rank a set of social media posts using our ranking algorithm
|