gamza commited on
Commit
8de1fde
β€’
1 Parent(s): e3724eb

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +4 -0
app.py CHANGED
@@ -10,6 +10,10 @@ examples = [["μš”μ¦˜ 잠이 μ•ˆ μ˜¨λ‹€"]]
10
 
11
  model = SentenceTransformer('jhgan/ko-sroberta-multitask')
12
 
 
 
 
 
13
  def recommend(message):
14
  embedding = model.encode(message)
15
  df_emb['거리'] = df_emb['μ„œν‰μž„λ² λ”©'].map(lambda x: cosine_similarity([embedding], [x]).squeeze())
 
10
 
11
  model = SentenceTransformer('jhgan/ko-sroberta-multitask')
12
 
13
+ df = pd.read_pickle('BookData_emb.pkl')
14
+ df_emb = df[['μ„œν‰μž„λ² λ”©']].copy()
15
+
16
+
17
  def recommend(message):
18
  embedding = model.encode(message)
19
  df_emb['거리'] = df_emb['μ„œν‰μž„λ² λ”©'].map(lambda x: cosine_similarity([embedding], [x]).squeeze())