hacpdsae2023 commited on
Commit
4d072c1
·
1 Parent(s): ad3e5f6

added documentation as markdown and rounded score

Browse files
Files changed (1) hide show
  1. app.py +3 -2
app.py CHANGED
@@ -34,7 +34,7 @@ embedding_input_topic = model.encode(input_topic)
34
 
35
  cos_scores = util.cos_sim(embedding_input_topic, embedding_sentence)[0][0]
36
 
37
- st.write('Score for topic', input_topic, ':', cos_scores.tolist())
38
 
39
  l_scores = []
40
  for topic in ['Space','Transportation','Health']:
@@ -44,7 +44,8 @@ for topic in ['Space','Transportation','Health']:
44
 
45
  st.write('Most likely topic:', ['Space','Transportation','Health'][np.argmax(l_scores)])
46
 
47
- st.markdown('## ')
 
48
  uploaded_file1 = st.file_uploader("Choose a file: sentence list")
49
  if uploaded_file1 is not None:
50
  #read csv
 
34
 
35
  cos_scores = util.cos_sim(embedding_input_topic, embedding_sentence)[0][0]
36
 
37
+ st.write('Score for topic', input_topic, ':', np.round(cos_scores.tolist(),2))
38
 
39
  l_scores = []
40
  for topic in ['Space','Transportation','Health']:
 
44
 
45
  st.write('Most likely topic:', ['Space','Transportation','Health'][np.argmax(l_scores)])
46
 
47
+ st.markdown('## Adding bulk sentences and topics')
48
+ st.markdown('In this section we can upload a file with sentences (one column, header "sentence") and a file with topics (one column, header "topics") we can compute the most likely topic')
49
  uploaded_file1 = st.file_uploader("Choose a file: sentence list")
50
  if uploaded_file1 is not None:
51
  #read csv