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
No response
Does the onnx model support Chinese when used to determine similarity?
There is no detailed documentation about this model. Could you please provide a detailed explanation of how this model was trained.
The text was updated successfully, but these errors were encountered:
the onnx model only support English, and it is a very small model, only suitable for demo.
Sorry, something went wrong.
use sbert,and custom similarity_evaluation example: class JxyEvaluation(SimilarityEvaluation): model_instance = None
def __init__(self): if JxyEvaluation.model_instance is None: # 使用 with torch.no_grad() 来降低内存使用(zhi'zuo2推理) with torch.no_grad(): JxyEvaluation.model_instance = BertSimilarity() self.model = JxyEvaluation.model_instance def evaluation( self, src_dict: Dict[str, Any], cache_dict: Dict[str, Any], **_ ) -> float: try: src_question = src_dict["question"] cache_question = cache_dict["question"] if src_question.lower() == cache_question.lower(): return 2 start_time = time.time() score = float(self.model.similarity(src_question, cache_question)) print("Cache Time consuming: {:.2f}s".format( time.time() - start_time)) return score+1 except Exception as e: # pylint: disable=W0703 return 0 def range(self) -> Tuple[float, float]: return 0.0, 2.0
No branches or pull requests
Documentation Link
No response
Describe the problem
Does the onnx model support Chinese when used to determine similarity?
Describe the improvement
There is no detailed documentation about this model. Could you please provide a detailed explanation of how this model was trained.
Anything else?
No response
The text was updated successfully, but these errors were encountered: