Update app.py
Browse files
app.py
CHANGED
@@ -119,7 +119,7 @@ def main():
|
|
119 |
"Escribe tus términos de búsqueda o haz una pregunta terminando con el caracter ?:"
|
120 |
)
|
121 |
|
122 |
-
all_results = pd.DataFrame(columns=["answer","score","start","end"])
|
123 |
|
124 |
if query:
|
125 |
|
@@ -152,7 +152,7 @@ def main():
|
|
152 |
|
153 |
answer = tokenizer.convert_tokens_to_string(tokenizer.convert_ids_to_tokens(input_ids[answer_start:answer_end]))
|
154 |
|
155 |
-
all_results.loc[i] = answer, max(outputs.start_logits.numpy()[0]), 0, 0
|
156 |
|
157 |
# Barra de progreso
|
158 |
if (usar_barra_progreso==1):
|
@@ -167,6 +167,7 @@ def main():
|
|
167 |
for index, row in all_results.iterrows():
|
168 |
if (len(row['answer'])>0):
|
169 |
cantidad_respuestas = cantidad_respuestas + 1
|
|
|
170 |
df_answer.loc[i, "answer"] = row.loc['answer']
|
171 |
df_answer.loc[i, "score"]= row.loc['score']
|
172 |
lista_noticias_respuestas.append(df_answer.loc[i].to_frame().T)
|
|
|
119 |
"Escribe tus términos de búsqueda o haz una pregunta terminando con el caracter ?:"
|
120 |
)
|
121 |
|
122 |
+
all_results = pd.DataFrame(columns=["id","answer","score","start","end"])
|
123 |
|
124 |
if query:
|
125 |
|
|
|
152 |
|
153 |
answer = tokenizer.convert_tokens_to_string(tokenizer.convert_ids_to_tokens(input_ids[answer_start:answer_end]))
|
154 |
|
155 |
+
all_results.loc[i] = i,answer, max(outputs.start_logits.numpy()[0]), 0, 0
|
156 |
|
157 |
# Barra de progreso
|
158 |
if (usar_barra_progreso==1):
|
|
|
167 |
for index, row in all_results.iterrows():
|
168 |
if (len(row['answer'])>0):
|
169 |
cantidad_respuestas = cantidad_respuestas + 1
|
170 |
+
i=row['id']
|
171 |
df_answer.loc[i, "answer"] = row.loc['answer']
|
172 |
df_answer.loc[i, "score"]= row.loc['score']
|
173 |
lista_noticias_respuestas.append(df_answer.loc[i].to_frame().T)
|