hacpdsae2023 commited on
Commit
00e69cc
·
1 Parent(s): 7a0ff5a

Adding input text to be embedded

Browse files
Files changed (1) hide show
  1. app.py +5 -1
app.py CHANGED
@@ -4,6 +4,9 @@ import pandas as pd
4
  from sentence_transformers import SentenceTransformer
5
  model = SentenceTransformer('paraphrase-MiniLM-L6-v2')
6
 
 
 
 
7
  #Sentences we want to encode. Example:
8
  sentence = ['This framework generates embeddings for each input sentence']
9
 
@@ -12,7 +15,8 @@ sentence = ['This framework generates embeddings for each input sentence']
12
  embedding = model.encode(sentence)
13
 
14
  x = st.slider('Select a value')
15
- st.write(x, 'squared is', x * x, 'embedding', embedding[0][0])
 
16
 
17
 
18
  uploaded_file = st.file_uploader("Choose a file")
 
4
  from sentence_transformers import SentenceTransformer
5
  model = SentenceTransformer('paraphrase-MiniLM-L6-v2')
6
 
7
+ input_sentence = st.text_input('Movie title', 'Life of Brian')
8
+ #st.write('The current movie title is', title)
9
+
10
  #Sentences we want to encode. Example:
11
  sentence = ['This framework generates embeddings for each input sentence']
12
 
 
15
  embedding = model.encode(sentence)
16
 
17
  x = st.slider('Select a value')
18
+ #st.write(x, 'squared is', x * x, 'embedding', embedding[0][0])
19
+ st.write('The embedding of', input_sentence, 'at position',x,'is',embedding[0][int(x)])
20
 
21
 
22
  uploaded_file = st.file_uploader("Choose a file")