{"about":{"site":"https://codewithpapers.app","non_affiliation":"Code with Papers and Syntology are not affiliated with, endorsed by, or sponsored by Papers with Code, Meta, or the pwc-archive mirror.","licence":"CC BY-SA 4.0","licence_url":"https://creativecommons.org/licenses/by-sa/4.0/legalcode","attribution":"https://codewithpapers.app/attribution","modified":"archive material modified by Syntology; see the attribution page"},"url":"/paper/speeding-up-word-movers-distance-and-its","title":"Speeding up Word Mover's Distance and its variants via properties of distances between embeddings","arxiv_id":"1912.00509","date":"2019-12-01","proceeding":null,"authors":["Matheus Werner","Eduardo Laber"],"abstract":"The Word Mover's Distance (WMD) proposed by Kusner et al. is a distance between documents that takes advantage of semantic relations among words that are captured by their embeddings. This distance proved to be quite effective, obtaining state-of-art error rates for classification tasks, but is also impracticable for large collections/documents due to its computational complexity. For circumventing this problem, variants of WMD have been proposed. Among them, Relaxed Word Mover's Distance (RWMD) is one of the most successful due to its simplicity, effectiveness, and also because of its fast implementations. Relying on assumptions that are supported by empirical properties of the distances between embeddings, we propose an approach to speed up both WMD and RWMD. Experiments over 10 datasets suggest that our approach leads to a significant speed-up in document classification tasks while maintaining the same error rates.","url_abs":"https://arxiv.org/abs/1912.00509v2","url_pdf":"https://arxiv.org/pdf/1912.00509v2.pdf","source":{"archive":"pwc-archive (Hugging Face), CC BY-SA 4.0","snapshot":"2025-07-28","licence_url":"https://creativecommons.org/licenses/by-sa/4.0/legalcode","row_kind":"abstracts"},"code_links":[{"paper_slug":"speeding-up-word-movers-distance-and-its","repo_url":"https://github.com/matwerner/fast-wmd","is_official":1,"mentioned_in_paper":1,"mentioned_in_github":1,"framework":"none","reach":{"status":"ok","spdx":"MIT"}}],"tasks":[{"task_slug":"document-classification","task_name":"Document Classification"},{"task_slug":"classification","task_name":"General Classification"}],"methods":[{"method_slug":"speed","method_name":"SPEED"}],"datasets_introduced":[],"methods_introduced":[],"results":[{"leaderboard":"/sota/document-classification-on-amazon","task":"Document Classification","dataset":"Amazon","model":"REL-RWMD k-NN","rank_in_archive_order":3,"of":3,"metrics":{"Accuracy":"93.03"},"uses_additional_data":false},{"leaderboard":"/sota/document-classification-on-bbcsport","task":"Document Classification","dataset":"BBCSport","model":"REL-RWMD k-NN","rank_in_archive_order":4,"of":4,"metrics":{"Accuracy":"95.18"},"uses_additional_data":false},{"leaderboard":"/sota/document-classification-on-classic","task":"Document Classification","dataset":"Classic","model":"REL-RWMD k-NN","rank_in_archive_order":1,"of":2,"metrics":{"Accuracy":"96.85"},"uses_additional_data":false},{"leaderboard":"/sota/document-classification-on-recipe","task":"Document Classification","dataset":"Recipe","model":"REL-RWMD k-NN","rank_in_archive_order":2,"of":2,"metrics":{"Accuracy":"56.80"},"uses_additional_data":false},{"leaderboard":"/sota/document-classification-on-reuters-21578","task":"Document Classification","dataset":"Reuters-21578","model":"REL-RWMD k-NN","rank_in_archive_order":2,"of":8,"metrics":{"Accuracy":"95.61"},"uses_additional_data":false},{"leaderboard":"/sota/document-classification-on-twitter","task":"Document Classification","dataset":"Twitter","model":"REL-RWMD k-NN","rank_in_archive_order":2,"of":3,"metrics":{"Accuracy":"71.05"},"uses_additional_data":false},{"leaderboard":"/sota/text-classification-on-20news","task":"Text Classification","dataset":"20NEWS","model":"REL-RWMD k-NN","rank_in_archive_order":15,"of":16,"metrics":{"Accuracy":"74.78"},"uses_additional_data":false},{"leaderboard":"/sota/text-classification-on-ohsumed","task":"Text Classification","dataset":"Ohsumed","model":"REL-RWMD k-NN","rank_in_archive_order":9,"of":10,"metrics":{"Accuracy":"58.74"},"uses_additional_data":false}],"syntology":{"atlas_url":"https://app.syntology.ai/?focus=1912.00509","mcp":{"get_harvested_code_for_paper":{"arxiv_id":"1912.00509"}},"developers":"https://syntology.ai/developers","read_at":"2026-09-24T18:15:14+00:00","read_at_is":"when the build read Syntology's graph, not when any sample ran","claim":"Per-sample execution status on synthesized fixtures; not a correctness claim about the paper. Samples come from repositories linked to the paper, official or community; repo_kind says which.","repos":[{"provenance":"external:paperswithcode_snapshot_2025-07-28","url":"https://github.com/matwerner/fast-wmd","reach":{"status":"ok","spdx":"MIT"}}],"summary":{"unverified":1},"by_repo_kind":{"official":{"samples":1,"ran":0,"repositories":1}},"repo_kind_vocabulary":{"official":"The archive marks this repository official for the paper","named_in_paper":"The archive records that the paper mentions this repository; it is not marked official","listed":"In the archive's code links for this paper, not marked official and not recorded as mentioned in the paper","found_in_text":"Syntology found this repository in the paper's own text; whether it is the authors' implementation is not asserted","community":"Not in the archive's code links for this paper; a community repository Syntology harvested"},"n_pointer_only_for_licence":0,"samples":[{"code_sha256_prefix":"58a039f8251f021e","entry":"getDatasetSplit","repo":"matwerner/fast-wmd","repo_kind":"official","path":"dataset/kusner/kusner_dataset_parser-2.py","file_url":"https://github.com/matwerner/fast-wmd/blob/HEAD/dataset/kusner/kusner_dataset_parser-2.py","link_basis":"first_harvest_node","language":"python","status":"unverified","verification_level":0,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"MIT","inline_ok":true,"mcp_get_code":{"code_sha256":"58a039f8251f021e"}}]},"arxiv_metadata":null,"syntology_extracted_results":null}