Natnael B. Haile
Cursor
feat: complete IR Studio with Git LFS tracking for all binary assets and NFCorpus index
fbad523 Download src/data/irData.ts from NathyB/ir-studio: direct link, hf CLI and curl.
- Browser
- Download file 6.38 kB
-
https://huggingface.co/spaces/NathyB/ir-studio/resolve/main/src/data/irData.ts
- Command line
-
hf download hf://spaces/NathyB/ir-studio/src/data/irData.ts
-
curl -L -o irData.ts https://huggingface.co/spaces/NathyB/ir-studio/resolve/main/src/data/irData.ts
6.38 kB
| import type { Document, Query } from '../types'; | |
| export const IDFS: Record<string, number> = { | |
| 'what': 0.12, | |
| 'is': 0.08, | |
| 'the': 0.05, | |
| 'daily': 2.85, | |
| 'life': 1.94, | |
| 'of': 0.06, | |
| 'a': 0.04, | |
| 'thai': 4.12, | |
| 'monk': 4.78, | |
| 'buddhist': 3.91, | |
| 'monastery': 4.35, | |
| 'morning': 2.15, | |
| 'alms': 5.21, | |
| 'meditation': 3.82, | |
| 'blood': 2.45, | |
| 'pressure': 2.89, | |
| 'hypertension': 4.62, | |
| 'diet': 2.31, | |
| 'exercise': 2.74, | |
| 'garlic': 4.88, | |
| 'transformer': 4.41, | |
| 'attention': 3.65, | |
| 'neural': 3.12, | |
| 'retrieval': 3.78, | |
| 'bm25': 5.60, | |
| 'dense': 3.89, | |
| }; | |
| export const SAMPLE_DOCUMENTS: Document[] = [ | |
| { | |
| id: 'doc-70231', | |
| title: 'Daily Routine of Buddhist Monks in Thailand', | |
| text: 'In Thailand, a Buddhist monk starts his daily life at 4:00 AM with meditation and chanting. At dawn, monks walk barefoot through village streets to collect morning alms (food) from local laypeople. After eating the morning meal, monks study Buddhist scriptures (Dharma) and engage in afternoon meditation.', | |
| length: 54, | |
| termFreqs: { | |
| 'thai': 1, | |
| 'monk': 2, | |
| 'daily': 1, | |
| 'life': 1, | |
| 'meditation': 2, | |
| 'alms': 1, | |
| 'buddhist': 2, | |
| 'morning': 2, | |
| }, | |
| denseVector: [0.82, 0.65, -0.21, 0.44, 0.73, -0.12, 0.58, 0.31], | |
| spladeTokens: { | |
| 'thai': 2.8, | |
| 'monk': 3.4, | |
| 'buddhist': 3.1, | |
| 'alms': 2.9, | |
| 'daily': 1.8, | |
| 'life': 1.6, | |
| 'meditation': 2.4, | |
| 'temple': 1.9, | |
| 'sangha': 2.2, | |
| 'theravada': 2.0, | |
| }, | |
| goldRelevance: 2, | |
| }, | |
| { | |
| id: 'doc-84912', | |
| title: 'Life in Rural Northern Thailand', | |
| text: 'Daily life in northern Thailand is centered on agriculture and sticky rice cultivation. Families awaken before sunrise to prepare breakfast and feed water buffalo before heading into the fields.', | |
| length: 32, | |
| termFreqs: { | |
| 'thai': 1, | |
| 'daily': 1, | |
| 'life': 1, | |
| 'morning': 1, | |
| }, | |
| denseVector: [0.35, 0.22, 0.15, -0.42, 0.31, 0.05, 0.18, -0.22], | |
| spladeTokens: { | |
| 'thai': 2.1, | |
| 'daily': 1.4, | |
| 'life': 1.5, | |
| 'agriculture': 2.6, | |
| 'farming': 2.4, | |
| 'chiang': 1.8, | |
| }, | |
| goldRelevance: 0, | |
| }, | |
| { | |
| id: 'doc-10492', | |
| title: 'Theravada Monastic Disciplines & Vinaya', | |
| text: 'Monastic life for Theravada bhikkhus adheres strictly to the Vinaya code consisting of 227 rules. Monks shave their heads, wear saffron robes, and depend entirely on the generosity of the community for sustenance.', | |
| length: 38, | |
| termFreqs: { | |
| 'monk': 2, | |
| 'life': 1, | |
| 'buddhist': 1, | |
| }, | |
| denseVector: [0.71, 0.58, -0.18, 0.39, 0.62, -0.09, 0.49, 0.28], | |
| spladeTokens: { | |
| 'monk': 3.1, | |
| 'theravada': 2.8, | |
| 'vinaya': 2.9, | |
| 'buddhist': 2.6, | |
| 'thai': 1.7, | |
| 'robes': 2.1, | |
| 'monastery': 2.3, | |
| }, | |
| goldRelevance: 1, | |
| }, | |
| { | |
| id: 'doc-44210', | |
| title: 'Hypertension Management: Diet & Lifestyle', | |
| text: 'Managing high blood pressure requires consistent lifestyle modifications including sodium restriction, regular aerobic exercise, and diets high in potassium. Clinical studies show garlic extract and hibiscus tea also exhibit mild anti-hypertensive effects.', | |
| length: 36, | |
| termFreqs: { | |
| 'blood': 1, | |
| 'pressure': 1, | |
| 'hypertension': 1, | |
| 'diet': 1, | |
| 'exercise': 1, | |
| 'garlic': 1, | |
| }, | |
| denseVector: [-0.62, -0.31, 0.77, 0.12, -0.45, 0.81, -0.29, 0.54], | |
| spladeTokens: { | |
| 'hypertension': 3.2, | |
| 'blood': 2.4, | |
| 'pressure': 2.5, | |
| 'cardiovascular': 2.8, | |
| 'diet': 1.9, | |
| 'garlic': 2.1, | |
| }, | |
| goldRelevance: 0, | |
| }, | |
| { | |
| id: 'doc-55102', | |
| title: 'Garlic Supplementation for Blood Pressure Reduction', | |
| text: 'A meta-analysis of randomized controlled trials suggests garlic supplements can lower systolic blood pressure by an average of 8-10 mmHg in hypertensive individuals through endothelial nitric oxide synthesis.', | |
| length: 32, | |
| termFreqs: { | |
| 'garlic': 2, | |
| 'blood': 1, | |
| 'pressure': 1, | |
| 'hypertension': 1, | |
| }, | |
| denseVector: [-0.58, -0.28, 0.81, 0.15, -0.41, 0.79, -0.25, 0.60], | |
| spladeTokens: { | |
| 'garlic': 3.4, | |
| 'blood': 2.3, | |
| 'pressure': 2.4, | |
| 'hypertension': 2.9, | |
| 'systolic': 2.7, | |
| 'cardiovascular': 2.5, | |
| }, | |
| goldRelevance: 0, | |
| }, | |
| { | |
| id: 'doc-99411', | |
| title: 'Self-Attention in Transformer Language Models', | |
| text: 'The transformer architecture relies on multi-head scaled dot-product attention to compute contextual representations across input tokens without recurrence, enabling efficient parallel training and state-of-the-art neural IR retrieval models.', | |
| length: 33, | |
| termFreqs: { | |
| 'transformer': 1, | |
| 'attention': 1, | |
| 'neural': 1, | |
| 'retrieval': 1, | |
| }, | |
| denseVector: [0.12, -0.75, -0.42, 0.88, 0.15, -0.33, 0.67, -0.51], | |
| spladeTokens: { | |
| 'transformer': 3.5, | |
| 'attention': 3.2, | |
| 'neural': 2.8, | |
| 'retrieval': 2.9, | |
| 'bert': 3.0, | |
| 'bi-encoder': 2.4, | |
| }, | |
| goldRelevance: 0, | |
| }, | |
| ]; | |
| export const PRESET_QUERIES: Query[] = [ | |
| { | |
| id: 'qid-1048585', | |
| text: 'what is the daily life of a thai monk', | |
| dataset: 'MS MARCO Passage', | |
| denseVector: [0.79, 0.61, -0.19, 0.40, 0.70, -0.10, 0.55, 0.29], | |
| spladeTokens: { | |
| 'what': 0.2, | |
| 'daily': 2.2, | |
| 'life': 1.9, | |
| 'thai': 3.5, | |
| 'monk': 4.1, | |
| 'buddhist': 2.8, | |
| 'monastery': 2.4, | |
| 'temple': 2.1, | |
| }, | |
| relevantDocIds: ['doc-70231', 'doc-10492'], | |
| }, | |
| { | |
| id: 'qid-156493', | |
| text: 'causes of high blood pressure and natural remedies', | |
| dataset: 'NFCorpus', | |
| denseVector: [-0.60, -0.30, 0.78, 0.14, -0.44, 0.80, -0.28, 0.56], | |
| spladeTokens: { | |
| 'blood': 2.8, | |
| 'pressure': 3.1, | |
| 'hypertension': 3.8, | |
| 'natural': 2.0, | |
| 'remedies': 2.4, | |
| 'diet': 2.3, | |
| 'garlic': 2.6, | |
| }, | |
| relevantDocIds: ['doc-44210', 'doc-55102'], | |
| }, | |
| { | |
| id: 'qid-2001', | |
| text: 'deep learning transformer attention mechanism in information retrieval', | |
| dataset: 'Custom', | |
| denseVector: [0.14, -0.73, -0.40, 0.86, 0.16, -0.31, 0.65, -0.49], | |
| spladeTokens: { | |
| 'transformer': 3.6, | |
| 'attention': 3.4, | |
| 'retrieval': 3.1, | |
| 'neural': 2.9, | |
| 'deep': 2.1, | |
| 'learning': 2.0, | |
| 'bert': 2.7, | |
| }, | |
| relevantDocIds: ['doc-99411'], | |
| }, | |
| ]; | |