Test-Time Code-Switching for Cross-lingual Aspect Sentiment Triplet Extraction (2025)

Abstract: Aspect Sentiment Triplet Extraction (ASTE) is a thriving research area with impressive outcomes being achieved on high-resource languages. However, the application of cross-lingual transfer to the ASTE task has been relatively unexplored, and current code-switching methods still suffer from term boundary detection issues and out-of-dictionary problems. In this study, we introduce a novel Test-Time Code-SWitching (TT-CSW) framework, which bridges the gap between the bilingual training phase and the monolingual test-time prediction. During training, a generative model is developed based on bilingual code-switched training data and can produce bilingual ASTE triplets for bilingual inputs. In the testing stage, we employ an alignment-based code-switching technique for test-time augmentation. Extensive experiments on cross-lingual ASTE datasets validate the effectiveness of our proposed method. We achieve an average improvement of 3.7% in terms of weighted-averaged F1 in four datasets with different languages. Additionally, we set a benchmark using ChatGPT and GPT-4, and demonstrate that even smaller generative models fine-tuned with our proposed TT-CSW framework surpass ChatGPT and GPT-4 by 14.2% and 5.0% respectively.

## introduction aspect sentiment triplet extraction (aste) task has drawn increasing attention in recent years @xcite @xcite . it aims at the co-extraction of aspect terms, opinion terms and sentiment polarities. despite the success achieved on high-resource languages, it is still challenging to attain comparable performance for languages with limited annotation resources. this highlights the need for crosslingual aste, an extended task commonly trained on languages with rich annotation resources (e.g., english) and tested on those with low resources (e.g., @xcite . recent studies have demonstrated that codeswitching can effectively facilitate cross-lingual transfer for low-resource languages across various nlp tasks @xcite @xcite . however, in terms of cross-lingual aste task, current code-switching methods still suffer from two major issues. firstly, existing code-switching techniques are mainly used during the training phase as a method of data augmentation @xcite , and the prediction is only based on the target language. however, the detection of term boundaries tends to be a challenge when conducting inference in a monolingual context for languages with limited annotation resources. as shown in figure 1 , el sushi con cinta transportadora means conveyor belt sushi(i.e., a type of sushi restaurant) in english. due to limited annotation resources, the model may fail to recognize the aspect term el sushi con cinta transportadora as a whole, and instead predict el sushi only. this leads to the incorrect prediction of term boundaries. furthermore, in the context of the aste task, both opinion and aspect terms typically form phrases. this characteristic poses a challenge for existing code-switching methods that rely on bilingual dictionaries @xcite or follow the translate-then-align procedure @xcite . for instance, sound insulation is not present in the bilingual dictionary, and translating insulation directly could result in semantic inaccuracies. moreover, these terms can frequently be proper nouns, like the english brand name hard rock cafe. however, these terms often fall outside the scope of bilingual dictionaries (i.e., out-of-dictionary issues), leading to issues of inconsistency and inaccuracies due to incorrect translations. based on the above observations, we propose a test-time code-switching framework (tt-csw) for the cross-lingual aste task. in our framework, the code-switching method offers a bilingual context in both training and testing phases. in this way, our framework can act as a bridge between the monolingual test-time prediction and the bilingual training phase. for the training stage, our model learns to predict bilingual aste triplets based on code-switched input.to address the issue of out-of-dictionary and term boundary detection, we propose a boundaryaware code-switching method. this approach preserves the completeness of aspect and opinion terms during the translation process, circumventing problems associated with inconsistency and inaccuracies due to wrong translations from bilingual dictionaries. consequently, it considerably enhances the alignment capability for models to understand the bilingual context and predict term boundaries accurately. during the testing stage, our model can utilize knowledge from code-switching to generate triplets in the target language. to further address the incor-rect prediction for term boundaries during test-time, we introduce a code-switching method based on alignment for test-time augmentation, as illustrated in figure 1 . a heuristic switching strategy is designed to generate a set of code-switched augmentation examples. the output triplets from these examples are then aligned into the target language for the final output. the integration of code-switching during the testing stage provides a bilingual multi-view of the input sentence, which incorporates information from source language with rich annotation resources, and improves performance for predicting term boundaries. extensive experiments on cross-lingual aste datasets validate the effectiveness of our proposed method. by integrating our method with various backbone models, we achieve an average improvement of 3.7% in terms of weighted-averaged f1 in four datasets with different languages. furthermore, we benchmark chatgpt foot_0 and gpt-4 foot_1 , ope-nai's widely-used large language model (llm) and illustrate that small generative models finetuned with our proposed tt-csw framework still outperform chatgpt by 14.2% and 5.0% respectively in terms of weighted-averaged f1. our main contributions are as follows. ## methodology our proposed tt-csw framework, as depicted in figure 2 , is made up of two key components: the training phase and the testing phase. the structure of the training phase, shown on the bottom side, is composed of three elements: boundary-aware code-switching, structural prediction, and alignment prediction. the layout of the testing phase, as illustrated on the upper side, involves two parts: alignment-based code-switching, and alignment of ## conclusion in this study, we present a new code-switching framework for the cross-lingual aspect-based sentiment extraction (aste) task that can be easily incorporated with a variety of generative backbone models. it bridges the gap between the bilingual training phase and the monolingual test-time prediction. our approach includes a boundary-aware code-switching method via the translation system, significantly improving the accurate determination of term boundaries. additionally, we have designed a test-time augmentation alignment method that minimizes the ambiguity of the input sentence and further boosts model performance. our proposed test-time code-switching framework (tt-csw) has been thoroughly evaluated under four crosslingual aste datasets with different languages, demonstrating its effectiveness. by integrating our method with several benchmark models, we obtain an average improvement of 3.7% on weighted f1score. we also evaluate chatgpt and gpt-4, two commonly used large language model (llm) developed by openai. furthermore, we prove that small generative models, when combined with our proposed tt-csw framework, can exceed the performance of chatgpt and gpt-4 by 14.2% and 5.0% respectively.