Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
@@ -1,7 +1,7 @@
|
|
1 |
import requests
|
2 |
import streamlit as st
|
3 |
import streamlit.components.v1 as components
|
4 |
-
|
5 |
def semanticComparativeClassification():
|
6 |
API_URL = "https://api-inference.huggingface.co/models/symanto/sn-xlm-roberta-base-snli-mnli-anli-xnli"
|
7 |
headers = {"Authorization": "Bearer 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"}
|
@@ -43,7 +43,7 @@ def semanticComparativeClassification():
|
|
43 |
|
44 |
index=0
|
45 |
for i in output:
|
46 |
-
st.write(
|
47 |
index = index + 1
|
48 |
|
49 |
sentenceindex = output.index(max(output))
|
@@ -64,6 +64,6 @@ def semanticComparativeClassification():
|
|
64 |
|
65 |
st.session_state.response = ""
|
66 |
st.title('Reconocimiento semántico')
|
67 |
-
title = st.text_input('Pregunta', '
|
68 |
|
69 |
st.text_area( "Respuesta: ", key= "respuesta", height=200 )
|
|
|
1 |
import requests
|
2 |
import streamlit as st
|
3 |
import streamlit.components.v1 as components
|
4 |
+
|
5 |
def semanticComparativeClassification():
|
6 |
API_URL = "https://api-inference.huggingface.co/models/symanto/sn-xlm-roberta-base-snli-mnli-anli-xnli"
|
7 |
headers = {"Authorization": "Bearer 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"}
|
|
|
43 |
|
44 |
index=0
|
45 |
for i in output:
|
46 |
+
st.write(i," - ", sentences[index])
|
47 |
index = index + 1
|
48 |
|
49 |
sentenceindex = output.index(max(output))
|
|
|
64 |
|
65 |
st.session_state.response = ""
|
66 |
st.title('Reconocimiento semántico')
|
67 |
+
title = st.text_input('Pregunta', '', on_change=semanticComparativeClassification,key='mytext')
|
68 |
|
69 |
st.text_area( "Respuesta: ", key= "respuesta", height=200 )
|