#分词tokens=tokenizer.tokenize(text)input_ids=tokenizer.convert_tokens_to_ids(tokens)input_ids=tokenizer.build_inputs_with_special_tokens(input_ids)#转换为PyTorch张量importtorchinput_ids=torch.tensor([input_ids])#推理outputs=model(input_ids)#获取句子的嵌入表示sentence_embedding=outputs.last_hidden_...
and returns a sub-string from the context as a answer to the question. The Text Embedding model which is pre-trained on Multilingual Wikipedia returns an embedding of the input pair of question-context strings. PyTorch, the PyTorch logo and any related marks are trademarks of Facebook, Inc....
Here is how to use this model to get the features of a given text in PyTorch: fromtransformersimportBertTokenizer, BertModel tokenizer = BertTokenizer.from_pretrained('bert-base-multilingual-cased') model = BertModel.from_pretrained("bert-base-multilingual-cased") text ="Replace me by any text...
框架: JAX Safetensors TensorFlow + 1 更多 其他: pytorch License: License: apache-2.0 加入合集 模型评测 部署 微调实例 下载模型 main bert-base-multilingual-cased 1 贡献者 提交历史 JoshuaUpload fp16 ONNX weightsde3cdbe 10 个月前