New intent classification engine - MiniLM L6v2 and MiniLM L12v2 ONNX
This commit is contained in:
parent
4815c7f9bb
commit
8e830334e8
25 changed files with 61932 additions and 150 deletions
35
resources/models/all-MiniLM-L6-v2/README.md
Normal file
35
resources/models/all-MiniLM-L6-v2/README.md
Normal file
|
|
@ -0,0 +1,35 @@
|
|||
---
|
||||
license: apache-2.0
|
||||
pipeline_tag: sentence-similarity
|
||||
---
|
||||
|
||||
ONNX port of [sentence-transformers/all-MiniLM-L6-v2](https://huggingface.co/sentence-transformers/all-MiniLM-L6-v2) for text classification and similarity searches.
|
||||
|
||||
### Usage
|
||||
|
||||
Here's an example of performing inference using the model with [FastEmbed](https://github.com/qdrant/fastembed).
|
||||
|
||||
```py
|
||||
from fastembed import TextEmbedding
|
||||
|
||||
documents = [
|
||||
"You should stay, study and sprint.",
|
||||
"History can only prepare us to be surprised yet again.",
|
||||
]
|
||||
|
||||
model = TextEmbedding(model_name="sentence-transformers/all-MiniLM-L6-v2")
|
||||
embeddings = list(model.embed(documents))
|
||||
|
||||
# [
|
||||
# array([
|
||||
# 0.00611658, 0.00068912, -0.0203846, ..., -0.01751488, -0.01174267,
|
||||
# 0.01463472
|
||||
# ],
|
||||
# dtype=float32),
|
||||
# array([
|
||||
# 0.00173448, -0.00329958, 0.01557874, ..., -0.01473586, 0.0281806,
|
||||
# -0.00448205
|
||||
# ],
|
||||
# dtype=float32)
|
||||
# ]
|
||||
```
|
||||
Loading…
Add table
Add a link
Reference in a new issue