license:apache-2.0 region:us
---
license: apache-2.0
---
基于搜狐新闻语料训练的中文词向量模型

#### 加载模型
```python
def loadmodel( modelPath):
    new_model = gensim.models.Word2Vec.load(modelPath)  # 加载
    return new_model
```
#### 计算文本相似度

```python
def similar(model):
    # 计算两个词的相似度
    word1 = "你说"
    word2 = "说"
    similarity = model.wv.similarity(word1, word2)

    print(f"相似度为：{similarity}")
```



