SimCSE: Simple Contrastive Learning of Sentence Embeddings
Paper • 2104.08821 • Published
How to use swtx/simcse-chinese-roberta-www-ext with Transformers:
# Use a pipeline as a high-level helper
from transformers import pipeline
pipe = pipeline("feature-extraction", model="swtx/simcse-chinese-roberta-www-ext") # Load model directly
from transformers import AutoTokenizer, AutoModel
tokenizer = AutoTokenizer.from_pretrained("swtx/simcse-chinese-roberta-www-ext")
model = AutoModel.from_pretrained("swtx/simcse-chinese-roberta-www-ext")YAML Metadata Warning:empty or missing yaml metadata in repo card
Check out the documentation for more information.
This model provides simplified Chinese sentence embeddings encoding based on Simple Contrastive Learning. The pretrained model(Chinese RoBERTa WWM Ext) is used for token encoding.
from transformers import AutoTokenizer, AutoModel
tokenizer = AutoTokenizer.from_pretrained("swtx/simcse-chinese-roberta-wwm-ext")
model = AutoModel.from_pretrained("swtx/simcse-chinese-roberta-wwm-ext")