Spaces:
Running
Running
| from modules.config.categories import ScriptureCategoryConstants | |
| from modules.google_drive.google_drive_utils import convert_drive_url_to_direct | |
| stotra_rathnam_config = { | |
| # ------------------------------------------------- | |
| # Identity | |
| # ------------------------------------------------- | |
| "name": "stotra_rathnam", | |
| "title": "Stotra Rathnam", | |
| "banner_url": convert_drive_url_to_direct( | |
| "https://drive.google.com/file/d/1RKx3xeNYnC8WW_Ca4vYlhaGU_uvgN1Bz/view?usp=drive_link" | |
| ), | |
| "category": ScriptureCategoryConstants.STOTRAM, | |
| # ------------------------------------------------- | |
| # Storage / retrieval | |
| # ------------------------------------------------- | |
| "output_dir": "./outputs/stotra_rathnam", | |
| "collection_name": "stotra_rathnam", | |
| "collection_embedding_fn": "openai", | |
| # ------------------------------------------------- | |
| # Unit semantics (Stage 4) | |
| # ------------------------------------------------- | |
| "unit": "slokam", | |
| "unit_field": "_global_index", | |
| # ------------------------------------------------- | |
| # Field mapping (Stage 4 JSON) | |
| # ------------------------------------------------- | |
| "field_mapping": { | |
| # Primary Sanskrit verse | |
| "text": "text", | |
| # Prefer enriched commentary/translation where available | |
| "translation": lambda doc: "\n\n".join( | |
| section | |
| for section in [ | |
| ( | |
| ( | |
| "Introduction\n" | |
| "------------\n" | |
| f"{doc.get('introduction', '').strip()}" | |
| ) | |
| if doc.get("introduction", "").strip() | |
| else None | |
| ), | |
| ( | |
| ( | |
| "Simple Translation\n" | |
| "------------------\n" | |
| f"{doc.get('simple_translation', '').strip()}" | |
| ) | |
| if doc.get("simple_translation", "").strip() | |
| else None | |
| ), | |
| ( | |
| ( | |
| "Commentary (Vyākhyānam)\n" | |
| "-----------------------\n" | |
| f"{doc.get('commentary', '').strip()}" | |
| ) | |
| if doc.get("commentary", "").strip() | |
| else None | |
| ), | |
| ] | |
| if section | |
| ), | |
| "word_by_word_native": "word_by_word", | |
| # Structural | |
| "chapter_name": "chapter_name", | |
| "unit_index": "_global_index", | |
| # UI / navigation label | |
| "relative_path": lambda doc: ( | |
| f"{doc.get('chapter_name')} — Slokam {doc.get('verse_index')}" | |
| ), | |
| # Static author | |
| "author": lambda doc: "Sri Alavandār (Yāmunācārya)", | |
| }, | |
| # ------------------------------------------------- | |
| # Metadata fields (Stage 4 aware) | |
| # ------------------------------------------------- | |
| "metadata_fields": [ | |
| { | |
| "name": "chapter_name", | |
| "datatype": "str", | |
| "label": "Section", | |
| "description": "Section of Stotra Rathnam", | |
| "show_as_filter": True, | |
| "component": "dropdown", | |
| "lov": lambda: [ | |
| "DYANASLOKAM", | |
| "STOTRAM", | |
| ], | |
| }, | |
| { | |
| "name": "_global_index", | |
| "datatype": "int", | |
| "label": "Global Index", | |
| "description": "Absolute slokam index", | |
| "show_as_filter": True, | |
| "is_unique": True, | |
| }, | |
| { | |
| "name": "verse_index", | |
| "datatype": "int", | |
| "label": "Slokam Number", | |
| "description": "Sequential slokam number within the work", | |
| "show_as_filter": True, | |
| }, | |
| { | |
| "name": "text", | |
| "datatype": "str", | |
| "label": "Slokam (Devanagari)", | |
| "description": "Original Sanskrit slokam", | |
| "show_as_filter": False, | |
| }, | |
| { | |
| "name": "introduction", | |
| "datatype": "str", | |
| "label": "Introduction", | |
| "description": "Introductory explanation of the slokam", | |
| "show_as_filter": False, | |
| }, | |
| { | |
| "name": "word_by_word", | |
| "datatype": "str", | |
| "label": "Word-by-word Meaning", | |
| "description": "Padārtha (word-by-word) explanation", | |
| "show_as_filter": False, | |
| }, | |
| { | |
| "name": "simple_translation", | |
| "datatype": "str", | |
| "label": "Simple Translation", | |
| "description": "Concise English meaning", | |
| "show_as_filter": False, | |
| }, | |
| { | |
| "name": "commentary", | |
| "datatype": "str", | |
| "label": "Vyākhyānam", | |
| "description": "Detailed traditional commentary", | |
| "show_as_filter": False, | |
| }, | |
| ], | |
| # ------------------------------------------------- | |
| # Source & language | |
| # ------------------------------------------------- | |
| "pdf_path": "./data/stotra_rathnam.pdf", | |
| "source": "divyaprabandham.koyil.org", | |
| "language": "san", # Sanskrit (Devanagari) | |
| # ------------------------------------------------- | |
| # LLM hints | |
| # ------------------------------------------------- | |
| "example_labels": [], | |
| "examples": [], | |
| "llm_hints": [ | |
| "Stotra Rathnam is a Sanskrit stotra by Sri Alavandār (Yāmunācārya)", | |
| "It expounds Vishishtadvaita philosophy and surrender (śaraṇāgati)", | |
| "The work includes dhyāna ślokas and a sequence of devotional slokams", | |
| ], | |
| # ------------------------------------------------- | |
| # Credits | |
| # ------------------------------------------------- | |
| "credits": { | |
| "art": [], | |
| "data": [ | |
| { | |
| "name": "koyil.org", | |
| "url": "https://divyaprabandham.koyil.org/index.php/2016/12/sthothra-rathnam/", | |
| "role": "Text & Commentary Source", | |
| }, | |
| { | |
| "name:": "sanskritdocuments.org", | |
| "url": "https://sanskritdocuments.org/doc_vishhnu/stotraratnaAlavandAra.html", | |
| "role": "Sanskrit Sloka Source", | |
| }, | |
| ], | |
| "audio": [ | |
| { | |
| "name": "Srirangam Sri Vasudevan Srinivasachariar", | |
| "url": "https://www.youtube.com/@akivasudev", | |
| "role": "Recitation audio provider", | |
| "photo_url": "https://drive.google.com/uc?export=download&id=1HB1Nr39j2-55rIeOK_wYNbZZndcGZIaf", | |
| }, | |
| ], | |
| "video": [], | |
| }, | |
| # ------------------------------------------------- | |
| # Audio | |
| # ------------------------------------------------- | |
| "audio_modes": { | |
| "recitation": "Recitation", | |
| }, | |
| } | |