SYNTOLOGY HomeExplorerAtlasCodeMethodologyAboutDevelopersFeedPricing
Paper · 2408.04872 · EMNLP · 2024

SCOI: Syntax-augmented Coverage-based In-context Example Selection for Machine Translation

Zhixiang Wang, Yunfang Wu, Chenming Tang

arXiv · PDF · Open in the Atlas

Code that ran

We lifted 9 functions out of this paper's own repositories and ran 7 of them in a sandbox. "Ran" means the function executed on a synthesized input and returned a value. It is not a reproduction of the paper's results.

RepositoryRoleRan
hplt-project/sacremoses canonical 7 of 9
FunctionStatusWhere it lives
check Ran hplt-project/sacremoses/audit/attacks.py
code served (permissive licence) · get_code("9570b2dda6ffa32f")
convert_chinese Ran hplt-project/sacremoses/sacremoses/chinese.py
code served (permissive licence) · get_code("f5a406f30bca0411")
expected_detok_change Ran hplt-project/sacremoses/audit/differential.py
code served (permissive licence) · get_code("2df024e31bf66764")
is_cjk Ran hplt-project/sacremoses/sacremoses/util.py
code served (permissive licence) · get_code("282cf8e4c7b77fb0")
run Ran hplt-project/sacremoses/audit/attacks.py
code served (permissive licence) · get_code("053cc6cfb4e44a51")
xml_escape Ran hplt-project/sacremoses/sacremoses/util.py
code served (permissive licence) · get_code("4ca27c4d1e1cb3da")
xml_unescape Ran hplt-project/sacremoses/sacremoses/util.py
code served (permissive licence) · get_code("5d5f7123a9021668")
main Not yet run hplt-project/sacremoses/audit/differential.py
code served (permissive licence) · get_code("c6fe46bed16bd015")
run_tree Not yet run hplt-project/sacremoses/audit/differential.py
code served (permissive licence) · get_code("df92c0a0afc56ab2")

Repositories linked to this paper

Some links come from the archived Papers with Code dataset (CC BY-SA 4.0): attribution and licence.

Abstract

In-context learning (ICL) greatly improves the performance of large language models (LLMs) on various down-stream tasks, where the improvement highly depends on the quality of demonstrations. In this work, we introduce syntactic knowledge to select better in-context examples for machine translation (MT). We propose a new strategy, namely Syntax-augmented COverage-based In-context example selection (SCOI), leveraging the deep syntactic structure beyond conventional word matching. Specifically, we measure the set-level syntactic coverage by computing the coverage of polynomial terms with the help of a simplified treeto-polynomial algorithm, and lexical coverage using word overlap. Furthermore, we devise an alternate selection approach to combine both coverage measures, taking advantage of syntactic and lexical information. We conduct experiments with two multi-lingual LLMs on six translation directions. Empirical results show that our proposed SCOI obtains the highest average COMET score among all learning-free methods, indicating that combining syntactic and lexical coverage successfully helps to select better in-context examples for MT. Our code is available at https://github.com/ JamyDon/SCOI.

For agents

The same record, over MCP at https://syntology.ai/mcp:

get_harvested_code_for_paper("2408.04872")
get_code_for_paper("2408.04872")
have("2408.04872")

Connect an agent — have() is free.