AIAS/2_nlp_sdks/semantic_simnet_bow_sdk
2024-11-25 10:43:10 +08:00
..
models no message 2024-11-25 10:43:10 +08:00
src/main no message 2024-11-25 10:43:10 +08:00
pom.xml no message 2024-11-25 10:43:10 +08:00
README_CN.md no message 2024-11-25 10:43:10 +08:00
README_EN.md no message 2024-11-25 10:43:10 +08:00
semantic_simnet_bow_sdk.iml no message 2024-11-25 10:43:10 +08:00
semantic-simnet-bow-sdk.iml no message 2024-11-25 10:43:10 +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?