wxy01giser commited on
Commit
9cec7bc
·
verified ·
1 Parent(s): ba441c8

Update cluster_insight.py

Browse files
Files changed (1) hide show
  1. cluster_insight.py +4 -2
cluster_insight.py CHANGED
@@ -84,9 +84,11 @@ def extract_cluster_keywords_auto(sentences, labels, cluster_id, top_n=3):
84
  return "关键词提取失败"
85
 
86
 
87
- model_path = r'.\sbert\models--shibing624--text2vec-base-chinese\snapshots\183bb99aa7af74355fb58d16edf8c13ae7c5433e'
88
  # 从本地加载模型
89
- MODEL = SentenceTransformer(model_path)
 
 
90
 
91
  def encode_sentences_with_cache(sentences, model): #, cache_path='sentence_vectors.pkl'
92
  """
 
84
  return "关键词提取失败"
85
 
86
 
87
+ # model_path = r'.\sbert\models--shibing624--text2vec-base-chinese\snapshots\183bb99aa7af74355fb58d16edf8c13ae7c5433e'
88
  # 从本地加载模型
89
+ model_dir = os.path.join("sbert", "models--shibing624--text2vec-base-chinese", "snapshots", "183bb99aa7af74355fb58d16edf8c13ae7c5433e")
90
+ # model = SentenceTransformer(model_dir)
91
+ MODEL = SentenceTransformer(model_dir)
92
 
93
  def encode_sentences_with_cache(sentences, model): #, cache_path='sentence_vectors.pkl'
94
  """