AIAS/2_nlp_sdks/language_model/semantic_simnet_bow_sdk
2023-03-21 20:46:31 +08:00
..
doc/img no message 2021-10-03 22:25:35 +08:00
models load model from local disk instead of http url 2023-03-20 13:56:52 +08:00
src/main update english comments 2023-03-21 20:46:31 +08:00
pom.xml upgrade to 0.17.0 2022-05-28 14:48:33 +08:00
README_cn.md initial version - writing english doc. 2023-03-20 17:07:14 +08:00
README.md update readme to support bilingual. 2023-03-21 12:08:09 +08:00
semantic_simnet_bow_sdk.iml no message 2021-10-03 22:25:35 +08:00
semantic-simnet-bow-sdk.iml no message 2021-11-28 22:51:25 +08:00

Download the model and place it in the models directory

Text-Short Text Similarity SDK [Chinese]

Calculate the cosine similarity between two sentences: Based on the user input of two texts, the similarity score can be calculated.

image

SDK algorithm:

The model is based on SimNet, which is a model for calculating sentence similarity.

Running example - SemanticExample

After running successfully, the command line should display the following information:

...
[INFO ] - 句子 1: 这个棋局太难了
# Chinese word segmentation
[INFO ] - Words : [这个, 棋局, 太难, 了]
# Part of speech tagging
[INFO ] - Tags : [r, n, a, xc]

[INFO ] - 句子 2: 这个棋局不简单
# Chinese word segmentation
[INFO ] - Words : [这个, 棋局, 不, 简单]
# Part of speech tagging
[INFO ] - Tags : [r, n, d, a]

[INFO ] - 句子 3: 这个棋局很有意思
# Chinese word segmentation
[INFO ] - Words : [这个, 棋局, 很, 有意思]
# Part of speech tagging
[INFO ] - Tags : [r, n, d, a]

# Calculate short text similarity
[INFO ] - 句子 1: 这个棋局太难了
[INFO ] - 句子 2: 这个棋局不简单
[INFO ] - 相似度 : 0.8542996

[INFO ] - 句子 1: 这个棋局太难了
[INFO ] - 句子 3: 这个棋局很有意思
[INFO ] - 相似度 : 0.8260221

Open source algorithm

1. Open source algorithm used by SDK

2. How to export the model?