Downloads · 30 days
24
9% of all-time downloads
convaiinnovations/hindi-embedding-foundational-model
hindi-embedding-foundational-model is a sentence similarity model from convaiinnovations. Use it when you need a score for how close two texts are. It is set up for transformers. The card lists the license as mit.
This is a custom state-of-the-art sentence embedding model trained specifically for Hindi text. It leverages an advanced transformer architecture with specialized pooling strategies to create high-quality semantic rep…
Downloads · 30 days
24
9% of all-time downloads
All-time downloads
258
Public
Repo size
6.6 GB
Likes
1
Public
Click a slice to open those files.
.txt2.2 GB · 73%
From the Hugging Face model README
This is a custom state-of-the-art sentence embedding model trained specifically for Hindi text. It leverages an advanced transformer architecture with specialized pooling strategies to create high-quality semantic representations of Hindi sentences.
pip install torch sentencepiece scikit-learn matplotlib
git lfs install
git clone https://huggingface.co/convaiinnovations/hindi-embedding-foundational-model
cd hindi-embedding-foundational-model
This model now includes an enhanced RAG (Retrieval Augmented Generation) system that integrates Unsloth's optimized Llama-3.2-1B-Instruct model for question answering on top of Hindi document retrieval.
pip install unsloth transformers bitsandbytes accelerate langchain langchain-community faiss-cpu
python hindi-rag-system.py --model_dir /path/to/your/model --tokenizer_dir /path/to/tokenizer --data_dir ./data --output_dir ./output --index
python hindi-rag-system.py --model_dir /path/to/your/model --tokenizer_dir /path/to/tokenizer --output_dir ./output --interactive --qa
from hindi_embeddings import HindiEmbedder
# Initialize the embedder
model = HindiEmbedder("path/to/hindi-embedding-foundational-model")
# Encode sentences to embeddings
sentences = [
"मुझे हिंदी भाषा बहुत पसंद है।",
"मैं हिंदी भाषा सीख रहा हूँ।"
]
embeddings = model.encode(sentences)
print(f"Embedding shape: {embeddings.shape}")
# Compute similarity between sentences
similarity = model.compute_similarity(sentences[0], sentences[1])
print(f"Similarity: {similarity:.4f}")
# Perform semantic search
query = "भारत की राजधानी"
documents = [
"दिल्ली भारत की राजधानी है।",
"मुंबई भारत का सबसे बड़ा शहर है।",
"हिमालय पर्वत भारत के उत्तर में स्थित है।"
]
results = model.search(query, documents)
for i, result in enumerate(results):
print(f"{i+1}. Score: {result['score']:.4f}")
print(f" Document: {result['document']}")
# Visualize embeddings
example_sentences = [
"मुझे हिंदी में पढ़ना बहुत पसंद है।",
"आज मौसम बहुत अच्छा है।",
"भारत एक विशाल देश है।"
]
model.visualize_embeddings(example_sentences)
This model uses an advanced transformer-based architecture with the following enhancements:
This model is released under the MIT License.