| import streamlit as st | |
| from modules.language_processing.language_components import * | |
| import nltk | |
| import gspread | |
| from nltk import tokenize | |
| nltk.download('punkt') | |
| st.sidebar.subheader('Seleccione la tarea que desea probar') | |
| task = st.sidebar.selectbox("Tarea",['Correci贸n de texto jur铆dico', 'Explicaci贸n de los errores en el texto',]) | |
| st.title('Lenguaje Claro: una herramienta para abogados') | |
| st.write('Este es el prototipo de la aplicaci贸n Lenguaje Claro. Esta es alimentada por el API Txt-Jur con inteligencia artificial y conocimiento experto:') | |
| st.subheader('Ingrese su texto jur铆dico (m谩x. 1000 caracteres):') | |
| text = st.text_area(' ', height=200) | |
| summarizer = Summarization_task() | |
| explanator = Utilities() | |
| if text != '': | |
| if task == 'Correci贸n de texto jur铆dico': | |
| corrected_text = summarizer.summarize_gpt(text) | |
| explanator.write_on_sheet(text,corrected_text) | |
| st.write(corrected_text) | |