File size: 1,146 Bytes
24ec802
31ae6cb
24ec802
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
31ae6cb
b2ab0e6
 
 
1af9ff5
 
 
9b1109f
b2ab0e6
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
import requests
import streamlit as st
import streamlit.components.v1 as components

def semanticComparativeClassification():
        
    #API_URL = "https://api-inference.huggingface.co/models/Maite89/Roberta_finetuning_semantic_similarity_stsb_multi_mt"
    API_URL = "https://api-inference.huggingface.co/models/symanto/sn-xlm-roberta-base-snli-mnli-anli-xnli"
    headers = {"Authorization": "Bearer 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"}
    
    def query(payload):
    	response = requests.post(API_URL, headers=headers, json=payload)
    	return response.json()
    	
    output = query({
    	"inputs": {
            "wait_for_model" : True,
    		"source_sentence": "Sincronización de Lya2 con el teléfono",
    		"sentences": [
    			"Conoces Lya2",
    			"He perdido la contraseña. Como la recupero.",
    			"Que dia más bonito",
    			"Como sincronizo el móbil con Lya2"
    		]
    	},
    })
    
    return output


#x = st.slider('Select a value')
#st.write(x, 'squared is', x * x)

x = semanticComparativeClassification()

for i in x:
    print(i)   
st.title('Uber pickups in NYC')
st.components.v1.html('sadasffas')