{"id":21198364,"url":"https://github.com/mina-faridi/document-ranking-with-galago","last_synced_at":"2026-04-25T08:32:55.956Z","repository":{"id":202402403,"uuid":"520229143","full_name":"mina-faridi/Document-Ranking-with-Galago","owner":"mina-faridi","description":"Galago related homeworks of Information Retrieval Course","archived":false,"fork":false,"pushed_at":"2022-09-29T06:07:00.000Z","size":1939,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2026-01-02T23:14:09.692Z","etag":null,"topics":["bm25","document-ranking","galago","information-retrieval","map","ndcg","pivoted-length-normalisation","recall","stemming","tokenizing","university-of-tehran"],"latest_commit_sha":null,"homepage":"","language":"Java","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/mina-faridi.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null}},"created_at":"2022-08-01T18:56:56.000Z","updated_at":"2024-12-30T19:01:28.000Z","dependencies_parsed_at":null,"dependency_job_id":"127ad473-4469-407e-be6c-daa23c983740","html_url":"https://github.com/mina-faridi/Document-Ranking-with-Galago","commit_stats":null,"previous_names":["mina-faridi/document-ranking-with-galago"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/mina-faridi/Document-Ranking-with-Galago","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mina-faridi%2FDocument-Ranking-with-Galago","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mina-faridi%2FDocument-Ranking-with-Galago/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mina-faridi%2FDocument-Ranking-with-Galago/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mina-faridi%2FDocument-Ranking-with-Galago/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/mina-faridi","download_url":"https://codeload.github.com/mina-faridi/Document-Ranking-with-Galago/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mina-faridi%2FDocument-Ranking-with-Galago/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":32255253,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-04-25T04:23:17.126Z","status":"ssl_error","status_checked_at":"2026-04-25T04:21:53.360Z","response_time":59,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.6:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"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":["bm25","document-ranking","galago","information-retrieval","map","ndcg","pivoted-length-normalisation","recall","stemming","tokenizing","university-of-tehran"],"created_at":"2024-11-20T19:50:54.078Z","updated_at":"2026-04-25T08:32:55.928Z","avatar_url":"https://github.com/mina-faridi.png","language":"Java","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Document-Ranking-with-Galago\nGalago related homeworks of Information Retrieval Course\n\nIn this code News documents in TREC type are ranked. Here are the steps that the code works:\n\n* stemming\n\n* tokenizing\n\n\nthese methods are used as the retrieval function:\n\n* BM25\n\n* Pivoted Length Normalization\n\n\n* nDCG, MAP, Recall and P@5 scales are used for evaluation.\n\npreparing the environment:\n\nFirst, install the ubuntu operating system, and then install Java, Maven, and Galago respectively.\nThe text file, which is in the form of a zip, must be extracted from the zip so that it can be converted into the trectext format.\n\nCreating the index:\nThis code creates an index and performs the steps of tokenization, normalization of words, removal of prepositions, and stemming.\n\nWe use these settings to tokenize the text:\n\n```sh\n\n\"tokenizer\" :{\n\n\"fields\" : [\"text\",\"head\"],\n\n\"formats\" : {\n\n    \"text\"   : \"string\",\n    \n    \"head\"   : \"string\"\n\n  }\n\n}\n```\nThere are different algorithms for rooting, one of the most common of which is porter, which actually removes repetitive parts such as ing from the end of words and has a good performance overall. Set it up\nThis is how it was done\n```sh\n\"stemmer\" : [\"porter\"]\n```\n\nTo create the mentioned index, save it and run it with the following command:\n```sh\nGalago/galago-3.16/core/target/appassembler/bin/galago build  /home/mina/Desktop/CA1-Resources/indexResult.json\n```\n\n```\n  {\n  \t\"server\" : true,\n   \n    \"indexPath\" : \"indexDir\",\n    \"inputPath\" : \"./CA1-Resources/Corpus/corpus/Documents.trectext\",\n      \n      \"stemmer\" : [\"porter\"],\n      \n      \"tokenizer\" : {\n      \n      \"fields\" : [\"text\",\"head\"],\n      \n      \"formats\" : {\n          \"text\"    : \"string\",\n          \"head\"    : \"string\"\n        }\n      },\n      \"fileType\":\"trectext\"\n    }\n```\n## First question: BM25 recovery method\nFirst, we perform the query on queries 101 to 150 or the main method BM25. And we set the value of output results for each query to 100 (100 = requested).\nThe following table shows the results of MAP, nDCG, Recall, P5 criteria in queries 101 to 150 with different b, k parameters. Based on this table, we can see that the optimal state occurred at b=0.4, k=2.5.\n\n\n\n\u003cdiv align=\"center\"\u003e\n  \u003ca\u003e\n    \u003cimg src=\"https://github.com/mina-faridi/Document-Ranking-with-Galago/blob/main/HW1/pictures/1.png\" alt=\"Logo\" width=\"500\" height=\"350\"\u003e\n  \u003c/a\u003e\n\u003c/div\u003e\n\nIn the next part, we perform the query for queries 51 to 100. Once we give the default value to parameters b, k and once the optimal value of the previous part and observe that the result is better by using the optimal parameters. Because the optimal values of b and k are related to the document itself, and since the documents are fixed, with different queries, the optimal values should not differ much, and optimization can be effective in this case.\n\n\u003cdiv align=\"center\"\u003e\n  \u003ca\u003e\n    \u003cimg src=\"https://github.com/mina-faridi/Document-Ranking-with-Galago/blob/main/HW1/pictures/2.png\" alt=\"Logo\" width=\"250\" height=\"100\"\u003e\n  \u003c/a\u003e\n\u003c/div\u003e\n\nIn the next part, we examine the results of queries with different evaluation functions. The values obtained from each of the mentioned methods are listed in the table below. According to the table, the first proposed method does not have optimal efficiency criteria because it only uses IDF, and we also conclude from this table that models 4 and 5 had better overall results based on the evaluation criteria and by using The optimal b, k parameters obtained in the previous parts have shown more improvement. As you can see in the table below, due to the fact that parameters b and k were not used in methods one and three, these two methods are not sensitive to the changes of these parameters, so optimization is not possible.\n\n\u003cdiv align=\"center\"\u003e\n  \u003ca\u003e\n    \u003cimg src=\"https://github.com/mina-faridi/Document-Ranking-with-Galago/blob/main/HW1/pictures/3.png\" alt=\"Logo\" width=\"500\" height=\"200\"\u003e\n  \u003c/a\u003e\n\u003c/div\u003e\n\n\nIn this part, the fifth proposed method and the original model along with the BM25 basic model and the model without nested logarithmic components are compared. As can be seen, the BM25+ model has achieved the best results on the default values of k and b parameters.\n\n\n\n\u003cdiv align=\"center\"\u003e\n  \u003ca\u003e\n    \u003cimg src=\"https://github.com/mina-faridi/Document-Ranking-with-Galago/blob/main/HW1/pictures/4.png\" alt=\"Logo\" width=\"250\" height=\"120\"\u003e\n  \u003c/a\u003e\n\u003c/div\u003e\n\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmina-faridi%2Fdocument-ranking-with-galago","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmina-faridi%2Fdocument-ranking-with-galago","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmina-faridi%2Fdocument-ranking-with-galago/lists"}