nekoboost commited on
Commit
d60e3c1
·
1 Parent(s): ce3104d

Create README.md

Browse files
Files changed (1) hide show
  1. README.md +38 -0
README.md ADDED
@@ -0,0 +1,38 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ ---
2
+ license: cc-by-4.0
3
+ language:
4
+ - cs
5
+ pipeline_tag: sentence-similarity
6
+ ---
7
+
8
+ ## SimCSE
9
+
10
+ SimCSE-Small-E-Czech is the [Seznam/small-e-czech](https://huggingface.co/Seznam/retromae-small-cs/) model fine-tuned with the [SimCSE](https://arxiv.org/abs/2104.08821) objective.
11
+
12
+ This model was created at Seznam.cz as part of a project to create high-quality small Czech semantic embedding models. These models perform well across various natural language processing tasks, including similarity search, retrieval, clustering, and classification. For further details or evaluation results, please visit the associated [paper]() or [GitHub repository]((https://github.com/seznam/czech-semantic-embedding-models)).
13
+
14
+ ## How to Use
15
+
16
+ You can load and use the model like this:
17
+
18
+ ```python
19
+ import torch
20
+ from transformers import AutoModel, AutoTokenizer
21
+
22
+ model_name = "Seznam/retromae-small-cs" # Hugging Face link
23
+ tokenizer = AutoTokenizer.from_pretrained(model_name)
24
+ model = AutoModel.from_pretrained(model_name)
25
+
26
+ input_texts = [
27
+ "Dnes je výborné počasí na procházku po parku.",
28
+ "Večer si oblíbím dobrý film a uvařím si čaj."
29
+ ]
30
+
31
+ # Tokenize the input texts
32
+ batch_dict = tokenizer(input_texts, max_length=512, padding=True, truncation=True, return_tensors='pt')
33
+
34
+ outputs = model(**batch_dict)
35
+ embeddings = outputs.last_hidden_state[:, 0] # Extract CLS token embeddings
36
+
37
+ similarity = torch.nn.functional.cosine_similarity(embeddings[0], embeddings[1], dim=0)
38
+ ```