Files
2026-07-13 12:37:18 +08:00

931 B

jupytext, kernelspec
jupytext kernelspec
formats text_representation
ipynb,md:myst
extension format_name format_version jupytext_version
.md myst 0.8 1.4.2
display_name language name
Python 3 python python3

sts

sts package holds pre-trained Semantic Textual Similarity (STS) models. We surveyed both supervised and unsupervised models and we believe that unsupervised models are still immature at this moment. Unsupervised STS is good for IR but not NLP especially on sentences with little lexical overlap.


.. automodule:: hanlp.pretrained.sts
    :members:

import hanlp

sim = hanlp.load(hanlp.pretrained.sts.STS_ELECTRA_BASE_ZH)
sim([
    ['看图猜一电影名', '看图猜电影'],
    ['无线路由器怎么无线上网', '无线上网卡和无线路由器怎么用'],
    ['北京到上海的动车票', '上海到北京的动车票'],
])