!pip install hanlp_restful -U

"""
Explanation: <h2 align="center">点击下列图标在线运行HanLP</h2>
<div align="center">
    <a href="https://colab.research.google.com/github/hankcs/HanLP/blob/doc-zh/plugins/hanlp_demo/hanlp_demo/zh/sts_restful.ipynb" target="_blank"><img src="https://colab.research.google.com/assets/colab-badge.svg" alt="Open In Colab"/></a>
    <a href="https://mybinder.org/v2/gh/hankcs/HanLP/doc-zh?filepath=plugins%2Fhanlp_demo%2Fhanlp_demo%2Fzh%2Fsts_restful.ipynb" target="_blank"><img src="https://mybinder.org/badge_logo.svg" alt="Open In Binder"/></a>
</div>

安装
无论是Windows、Linux还是macOS，HanLP的安装只需一句话搞定：
End of explanation
"""


from hanlp_restful import HanLPClient
HanLP = HanLPClient('https://www.hanlp.com/api', auth=None, language='zh') # auth不填则匿名，zh中文，mul多语种

"""
Explanation: 创建客户端
End of explanation
"""


HanLP.semantic_textual_similarity([
    ('看图猜一电影名', '看图猜电影'),
    ('无线路由器怎么无线上网', '无线上网卡和无线路由器怎么用'),
    ('北京到上海的动车票', '上海到北京的动车票'),
])

"""
Explanation: 申请秘钥
由于服务器算力有限，匿名用户每分钟限2次调用。如果你需要更多调用次数，建议申请免费公益API秘钥auth。
语义文本相似度
输入两段短文本组成的二元组列表，执行语义文本相似度：
End of explanation
"""


