Views
No views yet
namaste-asu-matcherall-MiniLM-L6-v2 to specialize in clinical terminology mapping. It embeds patient symptoms and raw text complaints into a vector space optimized for matching against standard Ayurveda, Siddha, and Unani (ASU) classification codes from the NAMASTE dictionary.sentence-transformers/all-MiniLM-L6-v2[!NOTE] This is a sentence embedding (Bi-Encoder) model. It is designed solely for converting text strings into dense vector representations (384-dimensional floats) to calculate cosine similarity. It is not a generative conversational model (like Llama or GPT) and cannot generate text responses.
"pitta imbalance" or "vata agravation" to "Aggravation of vata pattern").1from sentence_transformers import SentenceTransformer
2
3# Load directly from Hugging Face
4model = SentenceTransformer("0xsoh/namaste-asu-matcher")
5
6sentences = [
7 "vata aggravation",
8 "severe headache",
9 "shivering fever"
10]
11embeddings = model.encode(sentences)
12print(embeddings.shape) # Output: (3, 384)1from sentence_transformers import SentenceTransformer, util
2
3model = SentenceTransformer("0xsoh/namaste-asu-matcher")
4
5query = model.encode("high body temperature")
6standard_terms = model.encode(["Fever with body pain disorder", "Headache disorders", "Constipation pattern"])
7
8# Compute similarity scores
9scores = util.cos_sim(query, standard_terms)
10print(scores)SentenceTransformer(
(0): Transformer({'transformer_task': 'feature-extraction', 'modality_config': {'text': {'method': 'forward', 'method_output_name': 'last_hidden_state'}}, 'module_output_name': 'token_embeddings', 'architecture': 'BertModel'})
(1): Pooling({'embedding_dimension': 384, 'pooling_mode': 'mean', 'include_prompt': True})
(2): Normalize({})
)anchor and positive| anchor | positive |
|---|---|
Cephalalgia disorder | Cephalalgia disorder Head, brain, nerve and movement disorders -> Headache disorders (ICD-11: SK00) |
cephalalgia | Cephalalgia disorder Head, brain, nerve and movement disorders -> Headache disorders (ICD-11: SK00) |
Migraine disorder | Migraine disorder Head, brain, nerve and movement disorders -> Headache disorders (ICD-11: SK01) |
MultipleNegativesRankingLoss with these parameters:
1{
2 "scale": 20.0,
3 "similarity_fct": "cos_sim",
4 "gather_across_devices": false,
5 "directions": ["query_to_doc"],
6 "partition_mode": "joint",
7 "hardness_mode": null,
8 "hardness_strength": 0.0
9}AdamW (adamw_torch)| Epoch | Step | Training Loss |
|---|---|---|
| 0.2381 | 10 | 0.1055 |
| 0.4762 | 20 | 0.0672 |
| 0.7143 | 30 | 0.0387 |
| 0.9524 | 40 | 0.0346 |
| 1.1905 | 50 | 0.0301 |
| 1.4286 | 60 | 0.0241 |
| 1.6667 | 70 | 0.0341 |
| 1.9048 | 80 | 0.0388 |
| 2.1429 | 90 | 0.0212 |
| 2.3810 | 100 | 0.0658 |
| 2.6190 | 110 | 0.0197 |
| 2.8571 | 120 | 0.0411 |
| 3.0952 | 130 | 0.0482 |
| 3.3333 | 140 | 0.0417 |
| 3.5714 | 150 | 0.0253 |
| 3.8095 | 160 | 0.0569 |
| 4.0476 | 170 | 0.0211 |
| 4.2857 | 180 | 0.0496 |
| 4.5238 | 190 | 0.0342 |
| 4.7619 | 200 | 0.0286 |
| 5.0 | 210 | 0.0464 |
1@inproceedings{reimers-2019-sentence-bert,
2 title = "Sentence-BERT: Sentence Embeddings using Siamese BERT-Networks",
3 author = "Reimers, Nils and Gurevych, Iryna",
4 booktitle = "Proceedings of the 2019 Conference on Empirical Methods in Natural Language Processing",
5 month = "11",
6 year = "2019",
7 publisher = "Association for Computational Linguistics",
8 url = "https://arxiv.org/abs/1908.10084",
9}1@misc{oord2019representationlearningcontrastivepredictive,
2 title={Representation Learning with Contrastive Predictive Coding},
3 author={Aaron van den Oord and Yazhe Li and Oriol Vinyals},
4 year={2019},
5 eprint={1807.03748},
6 archivePrefix={arXiv},
7 primaryClass={cs.LG},
8 url={https://arxiv.org/abs/1807.03748},
9}