Views
No views yet
1pip install torch sentencepiece scikit-learn matplotlib
2git lfs install
3git clone https://huggingface.co/DeepMostInnovations/hindi-embedding-foundational-model
4cd hindi-embedding-foundational-modelpip install unsloth transformers bitsandbytes accelerate langchain langchain-community faiss-cpupython hindi-rag-system.py --model_dir /path/to/your/model --tokenizer_dir /path/to/tokenizer --data_dir ./data --output_dir ./output --indexpython hindi-rag-system.py --model_dir /path/to/your/model --tokenizer_dir /path/to/tokenizer --output_dir ./output --interactive --qa1from hindi_embeddings import HindiEmbedder
2
3# Initialize the embedder
4model = HindiEmbedder("path/to/hindi-embedding-foundational-model")
5
6# Encode sentences to embeddings
7sentences = [
8 "मुझे हिंदी भाषा बहुत पसंद है।",
9 "मैं हिंदी भाषा सीख रहा हूँ।"
10]
11embeddings = model.encode(sentences)
12print(f"Embedding shape: {embeddings.shape}")
13
14# Compute similarity between sentences
15similarity = model.compute_similarity(sentences[0], sentences[1])
16print(f"Similarity: {similarity:.4f}")
17
18# Perform semantic search
19query = "भारत की राजधानी"
20documents = [
21 "दिल्ली भारत की राजधानी है।",
22 "मुंबई भारत का सबसे बड़ा शहर है।",
23 "हिमालय पर्वत भारत के उत्तर में स्थित है।"
24]
25results = model.search(query, documents)
26for i, result in enumerate(results):
27 print(f"{i+1}. Score: {result['score']:.4f}")
28 print(f" Document: {result['document']}")
29
30# Visualize embeddings
31example_sentences = [
32 "मुझे हिंदी में पढ़ना बहुत पसंद है।",
33 "आज मौसम बहुत अच्छा है।",
34 "भारत एक विशाल देश है।"
35]
36model.visualize_embeddings(example_sentences)@misc{DeepMostInnovations2025hindi,
author = {DeepMost Innovations},
title = {Hindi Sentence Embeddings Model},
year = {2025},
publisher = {Hugging Face},
howpublished = {\url{https://huggingface.co/DeepMostInnovations/hindi-embedding-foundational-model}}
}