| --- |
| library_name: onnx |
| tags: |
| - gte |
| - sentence-transformers |
| - sentence-similarity |
| - feature-extraction |
| - onnx |
| - inference4j |
| license: mit |
| pipeline_tag: sentence-similarity |
| --- |
| |
| # GTE Base — ONNX |
|
|
| ONNX export of [thenlper/gte-base](https://huggingface.co/thenlper/gte-base), an English embedding model from Alibaba. Maps sentences to 768-dimensional dense vectors using CLS pooling with L2 normalization. |
|
|
| Mirrored for use with [inference4j](https://github.com/inference4j/inference4j), an inference-only AI library for Java. |
|
|
| ## Original Source |
|
|
| - **Repository:** [thenlper/Alibaba (ONNX by Xenova)](https://huggingface.co/thenlper/gte-base) |
| - **License:** mit |
|
|
| ## Usage with inference4j |
|
|
| ```java |
| try (SentenceTransformerEmbedder model = SentenceTransformerEmbedder.builder() |
| .modelId("inference4j/gte-base") |
| .poolingStrategy(PoolingStrategy.CLS) |
| .normalize() |
| .build()) { |
| float[] embedding = model.encode("Hello, world!"); |
| System.out.println("Dimension: " + embedding.length); // 768 |
| } |
| ``` |
|
|
| ## Model Details |
|
|
| | Property | Value | |
| |----------|-------| |
| | Architecture | BERT Base (12 layers, 768 hidden) | |
| | Task | Sentence embeddings / semantic similarity | |
| | Output dimension | 768 | |
| | Pooling | CLS | |
| | Normalization | L2 | |
| | Max sequence length | 512 | |
| | Original framework | PyTorch (HuggingFace Transformers) | |
|
|
| ## License |
|
|
| This model is licensed under the [MIT License](https://opensource.org/licenses/MIT). Original model by [thenlper/Alibaba](https://huggingface.co/thenlper/gte-base), ONNX export by [Xenova](https://huggingface.co/Xenova). |
|
|