File size: 830 Bytes
d727a16
4b1c6eb
d727a16
2430162
 
 
00e69cc
 
 
2430162
 
 
 
 
336ea26
2430162
d727a16
581cd9f
00e69cc
336ea26
4b1c6eb
 
748cfae
4b1c6eb
5b6d5fb
 
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
import streamlit as st
import pandas as pd

from sentence_transformers import SentenceTransformer
model = SentenceTransformer('paraphrase-MiniLM-L6-v2')

input_sentence = st.text_input('Movie title', 'Life of Brian')
#st.write('The current movie title is', title)

#Sentences we want to encode. Example:
sentence = ['This framework generates embeddings for each input sentence']


#Sentences are encoded by calling model.encode()
embedding = model.encode([input_sentence])

x = st.slider('Select a value')
#embedding = model.encode(input_sentence)
#st.write(x, 'squared is', x * x, 'embedding', embedding[0][0])
st.write('The embedding of "', input_sentence, '" at position',x,'is',embedding[0][0])


uploaded_file = st.file_uploader("Choose a file")
if uploaded_file is not None:
    #read csv
    df1=pd.read_csv(uploaded_file)