Update README.md
Browse files
README.md
CHANGED
@@ -101,6 +101,9 @@ reranker = pipeline(
|
|
101 |
top_k=None
|
102 |
)
|
103 |
|
|
|
|
|
|
|
104 |
similarities = reranker(
|
105 |
[
|
106 |
dict(
|
@@ -110,6 +113,7 @@ similarities = reranker(
|
|
110 |
for context in contexts
|
111 |
]
|
112 |
)
|
|
|
113 |
contexts_reranked = sorted(
|
114 |
filter(
|
115 |
lambda x: x[0]['label'] == "LABEL_1",
|
@@ -118,6 +122,7 @@ contexts_reranked = sorted(
|
|
118 |
key=lambda x: x[0],
|
119 |
reverse=True
|
120 |
)
|
|
|
121 |
score, contexts_cleaned = zip(
|
122 |
*filter(
|
123 |
lambda x: x[0] >= 0.8,
|
|
|
101 |
top_k=None
|
102 |
)
|
103 |
|
104 |
+
query: str
|
105 |
+
contexts: List[str]
|
106 |
+
|
107 |
similarities = reranker(
|
108 |
[
|
109 |
dict(
|
|
|
113 |
for context in contexts
|
114 |
]
|
115 |
)
|
116 |
+
|
117 |
contexts_reranked = sorted(
|
118 |
filter(
|
119 |
lambda x: x[0]['label'] == "LABEL_1",
|
|
|
122 |
key=lambda x: x[0],
|
123 |
reverse=True
|
124 |
)
|
125 |
+
|
126 |
score, contexts_cleaned = zip(
|
127 |
*filter(
|
128 |
lambda x: x[0] >= 0.8,
|