效果不如有监督的bert文本相似度好
from aip import AipNlp APP_ID = "22216281" APT_KEY = "foEeYauuvnqWGv4hp5T2ZZyD" SECRET_KEY = "67vK4QymaLTou7LMSDYyqS0ralhAi3u2" client = AipNlp(APP_ID,APT_KEY,SECRET_KEY) result = client.simnet("这件衣服颜色怎么样?","这件衣服价格怎么样") print(result)
from aip import AipContentCensor APP_ID = "22216281" APT_KEY = "BUz7W6CluHfa3fW3KGGLpEzU" SECRET_KEY = "kUnu5ZBaBOUww6UePENO1Rg8FqbYpHSu" client = AipContentCensor(APP_ID,APT_KEY,SECRET_KEY) # result = client.simnet("这件衣服颜色怎么样?","这件衣服价格怎么样") result = client.textCensorUserDefined("周恩来") print(result)