xiaolv commited on
Commit
ddd8c7a
·
1 Parent(s): 5d1c080

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +8 -6
app.py CHANGED
@@ -1,7 +1,8 @@
1
  # -*- coding: utf-8 -*-
2
  """
3
- @author:XuMing(xuming624@qq.com)
4
- @description: text similarity example, fine-tuned by CoSENT model
 
5
  """
6
  import gradio as gr
7
  from text2vec import Similarity
@@ -9,6 +10,7 @@ from text2vec import Similarity
9
  # 中文句向量模型(CoSENT)
10
  sim_model = Similarity(model_name_or_path='shibing624/text2vec-base-chinese',
11
  similarity_type='cosine', embedding_type='sbert')
 
12
 
13
 
14
  def ai_text(sentence1, sentence2):
@@ -33,8 +35,8 @@ if __name__ == '__main__':
33
  inputs=[input1, input2],
34
  outputs=[output_text],
35
  theme="grass",
36
- title="Chinese Text to Vector Model shibing624/text2vec-base-chinese",
37
- description="Copy or input Chinese text here. Submit and the machine will calculate the cosine score.",
38
  article="Link to <a href='https://github.com/shibing624/text2vec' style='color:blue;' target='_blank\'>Github REPO</a>",
39
- examples=examples
40
- ).launch()
 
1
  # -*- coding: utf-8 -*-
2
  """
3
+ # File : employ_monitor.py
4
+ # Time :2023/4/18 16:23
5
+ # Author :小吕同学
6
  """
7
  import gradio as gr
8
  from text2vec import Similarity
 
10
  # 中文句向量模型(CoSENT)
11
  sim_model = Similarity(model_name_or_path='shibing624/text2vec-base-chinese',
12
  similarity_type='cosine', embedding_type='sbert')
13
+ sim_model.get_scores()
14
 
15
 
16
  def ai_text(sentence1, sentence2):
 
35
  inputs=[input1, input2],
36
  outputs=[output_text],
37
  theme="grass",
38
+ title="基于 [ shibing624/text2vec-base-chinese ] 模型的相似句子判断",
39
+ description="计算两个句子之间的 [cosine] 余弦相似度。",
40
  article="Link to <a href='https://github.com/shibing624/text2vec' style='color:blue;' target='_blank\'>Github REPO</a>",
41
+ examples=examples,
42
+ ).launch(show_error=True)