Update app.py
Browse files
app.py
CHANGED
@@ -153,7 +153,9 @@ def main():
|
|
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 |
|
158 |
#outputs = qa_model(input_ids=inputs['input_ids'], attention_mask=inputs['attention_mask'])
|
159 |
|
@@ -178,11 +180,11 @@ def main():
|
|
178 |
#predict_answer_tokens = inputs.input_ids[0, answer_start_index : answer_end_index + 1]
|
179 |
#answer=tokenizer.decode(predict_answer_tokens)
|
180 |
|
181 |
-
if (len(result['answer'])>0):
|
182 |
-
|
183 |
-
|
184 |
-
|
185 |
-
lista_noticias_respuestas.append(df_answer.loc[i].to_frame().T)
|
186 |
|
187 |
# Barra de progreso
|
188 |
if (usar_barra_progreso==1):
|
|
|
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 |
+
st.write(all_results)
|
158 |
+
#result=all_results.sort_values(by=['score'], ascending=False, inplace=True).head(1)
|
159 |
|
160 |
#outputs = qa_model(input_ids=inputs['input_ids'], attention_mask=inputs['attention_mask'])
|
161 |
|
|
|
180 |
#predict_answer_tokens = inputs.input_ids[0, answer_start_index : answer_end_index + 1]
|
181 |
#answer=tokenizer.decode(predict_answer_tokens)
|
182 |
|
183 |
+
#if (len(result['answer'])>0):
|
184 |
+
# cantidad_respuestas = cantidad_respuestas + 1
|
185 |
+
# df_answer.loc[i, "answer"] = result.loc['answer']
|
186 |
+
# df_answer.loc[i, "score"]= result.loc['score']
|
187 |
+
#lista_noticias_respuestas.append(df_answer.loc[i].to_frame().T)
|
188 |
|
189 |
# Barra de progreso
|
190 |
if (usar_barra_progreso==1):
|