Gokul Soumya
feat: Implement binary shield as a library
8972ad7
raw
history blame contribute delete
204 Bytes
import numpy as np
from sentence_transformers import SentenceTransformer
def extract_embedding(text: str, model: SentenceTransformer) -> np.ndarray:
return model.encode(text, convert_to_numpy=True)