Spaces:
Build error
Build error
Upload 16 files
#24
by
awinml
- opened
app.py
CHANGED
|
@@ -94,14 +94,6 @@ with st.sidebar:
|
|
| 94 |
data = get_data()
|
| 95 |
corpus, bm25 = get_bm25_model(data)
|
| 96 |
|
| 97 |
-
tokenized_query = preprocess_text(query_text).split()
|
| 98 |
-
sparse_scores = np.argsort(bm25.get_scores(tokenized_query), axis=0)[::-1]
|
| 99 |
-
indices_hits = get_bm25_search_hits(corpus, sparse_scores, 50)
|
| 100 |
-
|
| 101 |
-
if use_bm25 == True:
|
| 102 |
-
indices = indices_hits
|
| 103 |
-
else:
|
| 104 |
-
indices = None
|
| 105 |
|
| 106 |
if ner_choice == "Spacy":
|
| 107 |
ner_model = get_spacy_model()
|
|
@@ -128,6 +120,16 @@ with col1:
|
|
| 128 |
)
|
| 129 |
|
| 130 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 131 |
# Extract keywords from query
|
| 132 |
keywords = extract_keywords(query_text, alpaca_model)
|
| 133 |
|
|
@@ -383,7 +385,6 @@ with st.sidebar:
|
|
| 383 |
)
|
| 384 |
|
| 385 |
|
| 386 |
-
|
| 387 |
if document_type == "Single-Document":
|
| 388 |
if encoder_model in ["Hybrid SGPT - SPLADE", "Hybrid Instructor - SPLADE"]:
|
| 389 |
if encoder_model == "Hybrid Instructor - SPLADE":
|
|
|
|
| 94 |
data = get_data()
|
| 95 |
corpus, bm25 = get_bm25_model(data)
|
| 96 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 97 |
|
| 98 |
if ner_choice == "Spacy":
|
| 99 |
ner_model = get_spacy_model()
|
|
|
|
| 120 |
)
|
| 121 |
|
| 122 |
|
| 123 |
+
tokenized_query = preprocess_text(query_text).split()
|
| 124 |
+
sparse_scores = np.argsort(bm25.get_scores(tokenized_query), axis=0)[::-1]
|
| 125 |
+
indices_hits = get_bm25_search_hits(corpus, sparse_scores, 50)
|
| 126 |
+
|
| 127 |
+
if use_bm25 == True:
|
| 128 |
+
indices = indices_hits
|
| 129 |
+
else:
|
| 130 |
+
indices = None
|
| 131 |
+
|
| 132 |
+
|
| 133 |
# Extract keywords from query
|
| 134 |
keywords = extract_keywords(query_text, alpaca_model)
|
| 135 |
|
|
|
|
| 385 |
)
|
| 386 |
|
| 387 |
|
|
|
|
| 388 |
if document_type == "Single-Document":
|
| 389 |
if encoder_model in ["Hybrid SGPT - SPLADE", "Hybrid Instructor - SPLADE"]:
|
| 390 |
if encoder_model == "Hybrid Instructor - SPLADE":
|