RomanTraveler commited on
Commit
f611e6b
1 Parent(s): 98740a5

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +23 -2
app.py CHANGED
@@ -1,4 +1,4 @@
1
- import gradio as gr
2
  from sentence_transformers import SentenceTransformer, util
3
 
4
  i18n_model = SentenceTransformer('distiluse-base-multilingual-cased-v2')
@@ -17,4 +17,25 @@ gr.Interface(
17
  ['You do not need to specify the input language.', 'You can use any language.']],
18
  live=True,
19
  allow_flagging="never"
20
- ).launch(debug=True, enable_queue=True)
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ """import gradio as gr
2
  from sentence_transformers import SentenceTransformer, util
3
 
4
  i18n_model = SentenceTransformer('distiluse-base-multilingual-cased-v2')
 
17
  ['You do not need to specify the input language.', 'You can use any language.']],
18
  live=True,
19
  allow_flagging="never"
20
+ ).launch(debug=True, enable_queue=True)"""
21
+ import streamlit as st
22
+ from sentence_transformers import SentenceTransformer, util
23
+
24
+ i18n_model = SentenceTransformer('distiluse-base-multilingual-cased-v2')
25
+
26
+ #def inference(s1:str, s2:str):
27
+ # score = util.cos_sim(i18n_model.encode(s1), i18n_model.encode(s2)).item()
28
+ # return f'{score:.3f}'
29
+
30
+ txt1 = st.text_area('Text1','Account issues Create, download, and send white-label reports to your customers to keep them posted on how their campaigns are going. Watch a short video review of the Dedicated SEO Dashboard ')
31
+ list1 = txt1.split(" ")
32
+ txt2 = st.text_area('Text2','Проблеми з обліковим записом Створюйте, завантажуйте та надсилайте своїм клієнтам звіти з білою етикеткою, щоб вони були в курсі того, як проходять їхні кампанії. ')
33
+ list2 = txt2.split(" ")
34
+
35
+
36
+
37
+
38
+ i = 1
39
+ while i < 1000:
40
+ st.write(util.cos_sim(i18n_model.encode(list1[i]), i18n_model.encode(list2[i])).item())
41
+ i += 1