We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
跑个unit test的时候例句得到负值的cosine similarity,这个是怎么回事?是util.cos_sim函数的问题么?
try: logger.info("START - 加载 Sen-SIMILARITY 模型") # model = SentenceTransformer('distiluse-base-multilingual-cased-v2') model = SentenceTransformer('uer/sbert-base-chinese-nli') # uer model中文性能好很多。 logger.info("FINISH - 加载 Sen-SIMILARITY 模型") except Exception as e: logger.warning("Exception thrown during Intialising pretrained model.", e)
try: # Compute embedding for both lists embedding1 = model.encode(sentence1) embedding2 = model.encode(sentence2) #Compute cosine-similarities simcos = util.cos_sim(embedding1, embedding2) return simcos except Exception as e: logger.warning("Exception thrown during get similarity", e) return None`
The text was updated successfully, but these errors were encountered:
No branches or pull requests
跑个unit test的时候例句得到负值的cosine similarity,这个是怎么回事?是util.cos_sim函数的问题么?
The text was updated successfully, but these errors were encountered: