{"id":16824381,"url":"https://github.com/sambhav/ltr-demo","last_synced_at":"2025-07-06T15:06:42.589Z","repository":{"id":117451771,"uuid":"166652672","full_name":"sambhav/ltr-demo","owner":"sambhav","description":"A simple LTR Demo","archived":false,"fork":false,"pushed_at":"2019-02-24T11:16:32.000Z","size":498,"stargazers_count":11,"open_issues_count":0,"forks_count":6,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-06-05T00:35:21.738Z","etag":null,"topics":["demo","docker","learning","ltr","rank","solr","to"],"latest_commit_sha":null,"homepage":null,"language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/sambhav.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2019-01-20T11:17:28.000Z","updated_at":"2022-02-10T15:57:45.000Z","dependencies_parsed_at":null,"dependency_job_id":"bcf384c4-01f3-4407-a640-dd4c8bba3583","html_url":"https://github.com/sambhav/ltr-demo","commit_stats":null,"previous_names":["sambhav/ltr-demo","samj1912/ltr-demo"],"tags_count":1,"template":false,"template_full_name":null,"purl":"pkg:github/sambhav/ltr-demo","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sambhav%2Fltr-demo","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sambhav%2Fltr-demo/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sambhav%2Fltr-demo/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sambhav%2Fltr-demo/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/sambhav","download_url":"https://codeload.github.com/sambhav/ltr-demo/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sambhav%2Fltr-demo/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":263922513,"owners_count":23530338,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["demo","docker","learning","ltr","rank","solr","to"],"created_at":"2024-10-13T11:10:53.627Z","updated_at":"2025-07-06T15:06:42.545Z","avatar_url":"https://github.com/sambhav.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# LTR-demo\n\nThis repository is supposed to serve as a demo of Learning-to-Rank for Solr.\n\n## Building the demo\n\nThis demo requires you to have docker and docker compose installed. Follow the instructions on the\n[official docker docs page](https://docs.docker.com/compose/install/) carefully to install docker-compose\nfor your OS. Once that is installed -\n\n1. Checkout this git repository locally and `cd` to the root of this repo.\n2. Download the wikipedia dump -\n```\nwget https://github.com/samj1912/ltr-demo/releases/download/data-dump/simple-wikipedia.json.gz\n```\n3. Run the following commands to bring up an instance of Solr up with the required config -\n```\ndocker-compose build\ndocker-compose up -d solr\n```\n4. Solr will then be reachable on `http://localhost:8983/solr`\n4. To index the above dump run\n```\ndocker-compose up indexer\n```\n5. To bring up the web app for annotations and model comparisons run -\n```\ndocker-compose up -d webapp\n```\n6. The web app will be available on `http://localhost:5000`\n\n## Annotations and Training\n\n1. You can use the page at `http://localhost:5000` to annotate queries, just type a query and mark the documents as relevant/not relevant (just click on the button next to each result to flip it).\n\n2. Once that you have your annotations, you can check the performance of the solr baseline model (bm25) by visiting `http://localhost:5000/stats`, if you click on the model name you will see more detail about the performance of the model - and how the model is ranking each single query. \n\n3. Let's train a model now: \n```\ndocker exec ltr-demo_webapp_1 ./manage.py train \n```\nTo get a help page describing different ways to train a model. \n\n4. To train and upload a linear model to Apache Solr execute: \n```\ndocker exec ltr-demo_webapp_1 ./manage.py train linear\n```\nIt will train and upload a linear model - once you run it, you can visit `http://localhost:5000/stats` and see the new model. \n\n5. To train and upload a tree model to Apache Solr execute: \n```\ndocker exec ltr-demo_webapp_1 ./manage.py train lambdamart \n```\nIt will train and upload a tree model - once you run it, you can visit `http://localhost:5000/stats` and see the new model. \nYou can customize the training parameters for the lambdamart model, you can find more details in:\n\n```\ndocker exec ltr-demo_webapp_1 ./manage.py train lambdamart --help\n```\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsambhav%2Fltr-demo","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fsambhav%2Fltr-demo","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsambhav%2Fltr-demo/lists"}