Instructions to use kornwtp/ConGen-BERT-Mini with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- sentence-transformers
How to use kornwtp/ConGen-BERT-Mini with sentence-transformers:
from sentence_transformers import SentenceTransformer model = SentenceTransformer("kornwtp/ConGen-BERT-Mini") sentences = [ "That is a happy person", "That is a happy dog", "That is a very happy person", "Today is a sunny day" ] embeddings = model.encode(sentences) similarities = model.similarity(embeddings, embeddings) print(similarities.shape) # [4, 4] - Transformers
How to use kornwtp/ConGen-BERT-Mini with Transformers:
# pip install -U transformers accelerate # Load model directly from transformers import AutoTokenizer, AutoModel tokenizer = AutoTokenizer.from_pretrained("kornwtp/ConGen-BERT-Mini") model = AutoModel.from_pretrained("kornwtp/ConGen-BERT-Mini", device_map="auto") - Notebooks
- Google Colab
- Kaggle
|
Download README.md from kornwtp/ConGen-BERT-Mini: direct link, hf CLI and curl.
- Browser
- Download file 1.58 kB
-
https://huggingface.co/kornwtp/ConGen-BERT-Mini/resolve/main/README.md
- Command line
-
hf download hf://kornwtp/ConGen-BERT-Mini/README.md
-
curl -L -o README.md https://huggingface.co/kornwtp/ConGen-BERT-Mini/resolve/main/README.md
1.58 kB
| pipeline_tag: sentence-similarity | |
| license: apache-2.0 | |
| tags: | |
| - sentence-transformers | |
| - feature-extraction | |
| - sentence-similarity | |
| - transformers | |
| # kornwtp/ConGen-BERT-Mini | |
| This is a [ConGen](https://github.com/KornWtp/ConGen) model: It maps sentences to a 256 dimensional dense vector space and can be used for tasks like semantic search. | |
| ## Usage | |
| Using this model becomes easy when you have [ConGen](https://github.com/KornWtp/ConGen) installed: | |
| ``` | |
| pip install -U git+https://github.com/KornWtp/ConGen.git | |
| ``` | |
| Then you can use the model like this: | |
| ```python | |
| from sentence_transformers import SentenceTransformer | |
| sentences = ["This is an example sentence", "Each sentence is converted"] | |
| model = SentenceTransformer('kornwtp/ConGen-BERT-Mini') | |
| embeddings = model.encode(sentences) | |
| print(embeddings) | |
| ``` | |
| ## Evaluation Results | |
| For an automated evaluation of this model, see the *Sentence Embeddings Benchmark*: [Semantic Textual Similarity](https://github.com/KornWtp/ConGen#main-results---sts) | |
| ## Citing & Authors | |
| ```bibtex | |
| @inproceedings{limkonchotiwat-etal-2022-congen, | |
| title = "{ConGen}: Unsupervised Control and Generalization Distillation For Sentence Representation", | |
| author = "Limkonchotiwat, Peerat and | |
| Ponwitayarat, Wuttikorn and | |
| Lowphansirikul, Lalita and | |
| Udomcharoenchaikit, Can and | |
| Chuangsuwanich, Ekapol and | |
| Nutanong, Sarana", | |
| booktitle = "Findings of the Association for Computational Linguistics: EMNLP 2022", | |
| year = "2022", | |
| publisher = "Association for Computational Linguistics", | |
| } | |
| ``` |