Text Embeddings API
1.0.0
This project provides a REST API for generating text embeddings using the Sentence Transformers model. It is built using Flask and aims to simplify the process of converting text into embeddings for various NLP tasks.
BAAI/bge-base-zh model./: Accepts a JSON payload with a text field and returns the corresponding embeddings.curl -X POST http://<server_address>/ -H "Content-Type: application/json" -d '{"text": "Your text here"}'{
"Embeddings": [...]
}SentenceTransformer from the sentence_transformers package to load the pre-trained model.Clone the repository:
git clone https://github.com/faisal-fida/text-embeddings-API.git
cd text-embeddings-APIInstall dependencies:
pip install -r requirements.txtRun the application:
python main.pyThis API provides an efficient and straightforward approach to generating text embeddings, with robust error handling and logging to ensure reliability. It is ideal for applications needing quick and accurate text representation for NLP tasks.