Update README.md
Browse files
README.md
CHANGED
@@ -102,20 +102,20 @@ reranker = pipeline(
|
|
102 |
similarity = reranker(
|
103 |
[
|
104 |
dict(
|
105 |
-
text=
|
106 |
text_pair=query # and query in `text_pair` argument.
|
107 |
)
|
108 |
-
for
|
109 |
]
|
110 |
)
|
111 |
-
|
112 |
filter(
|
113 |
lambda x: x[0]['label'] == "LABEL_1",
|
114 |
zip(similarity, context_list)
|
115 |
),
|
116 |
key=lambda x: x[0]
|
117 |
)
|
118 |
-
score,
|
119 |
*filter(
|
120 |
lambda x: x[0] >= 0.8
|
121 |
)
|
|
|
102 |
similarity = reranker(
|
103 |
[
|
104 |
dict(
|
105 |
+
text=context, # the model was trained with context in `text` argument
|
106 |
text_pair=query # and query in `text_pair` argument.
|
107 |
)
|
108 |
+
for context in contexts
|
109 |
]
|
110 |
)
|
111 |
+
contexts_reranked = sorted(
|
112 |
filter(
|
113 |
lambda x: x[0]['label'] == "LABEL_1",
|
114 |
zip(similarity, context_list)
|
115 |
),
|
116 |
key=lambda x: x[0]
|
117 |
)
|
118 |
+
score, contexts_cleaned = zip(
|
119 |
*filter(
|
120 |
lambda x: x[0] >= 0.8
|
121 |
)
|