Update app.py
Browse files
app.py
CHANGED
@@ -3,7 +3,7 @@ import streamlit as st
|
|
3 |
import streamlit.components.v1 as components
|
4 |
from transformers import *
|
5 |
from carga_articulos import cargar_articulos
|
6 |
-
from preprocesamiento_articulos import limpieza_articulos
|
7 |
from entrenamiento_modelo import term_document_matrix, tf_idf_score
|
8 |
from resultados_consulta import resultados_consulta, detalles_resultados
|
9 |
import tensorflow as tf
|
@@ -126,9 +126,10 @@ def main():
|
|
126 |
|
127 |
for i in range(len(df_answer)):
|
128 |
|
129 |
-
text=df_answer.loc[i, "resumen"]
|
130 |
-
|
131 |
-
st.write(f'Aqui {
|
|
|
132 |
outputs = qa_model(input_ids=inputs['input_ids'], attention_mask=inputs['attention_mask'])
|
133 |
answer_start_index = int(tf.math.argmax(outputs.start_logits, axis=-1)[0])
|
134 |
answer_end_index = int(tf.math.argmax(outputs.end_logits, axis=-1)[0])
|
|
|
3 |
import streamlit.components.v1 as components
|
4 |
from transformers import *
|
5 |
from carga_articulos import cargar_articulos
|
6 |
+
from preprocesamiento_articulos import limpieza_articulos, remove_URL, remove_html_markup
|
7 |
from entrenamiento_modelo import term_document_matrix, tf_idf_score
|
8 |
from resultados_consulta import resultados_consulta, detalles_resultados
|
9 |
import tensorflow as tf
|
|
|
126 |
|
127 |
for i in range(len(df_answer)):
|
128 |
|
129 |
+
text=remove_html_markup(df_answer.loc[i, "resumen"])
|
130 |
+
text=remove_URL(text)
|
131 |
+
st.write(f'Aqui {text}' )
|
132 |
+
inputs = tokenizer(query, text[0:512], return_tensors='tf')
|
133 |
outputs = qa_model(input_ids=inputs['input_ids'], attention_mask=inputs['attention_mask'])
|
134 |
answer_start_index = int(tf.math.argmax(outputs.start_logits, axis=-1)[0])
|
135 |
answer_end_index = int(tf.math.argmax(outputs.end_logits, axis=-1)[0])
|