Normalize CRLF; add English (en_version) support and language flags#15
Draft
Normalize CRLF; add English (en_version) support and language flags#15
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Motivation
--langflag to run experiments/evaluations inzhorenmode.Description
chinatravel/environment/world_env.py,chinatravel/environment/tools/attractions/apis.py,chinatravel/environment/tools/restaurants/apis.py, andchinatravel/environment/tools/poi/apis.pywithout changing logic._get_languageand_normalize_query_languageinchinatravel/data/load_datasets.pyto swap language-specific fields (e.g.*_en) into base keys whenlang == 'en'.en_versionflags to the environment and tool classes (WorldEnv,Poi,Attractions,Accommodations,Restaurants,IntercityTransport,Transportation) and used afile_suffix = "_en"convention to load language-specific files whenen_version=True.--langargument torun_exp.py,run_tpc.py,eval_exp.py, andeval_tpc.py, and passen_version=args.lang == 'en'intoWorldEnvconstruction.IntercityTransportby keeping city name mappings (city_cn_to_en,city_en_to_cn) and accepting either Chinese or English city names inselect.Poi.searchreturn English or Chinese error messages based onen_version, and adjusted metro-station labeling inTransportation.gototo use English labels whenen_versionis enabled.Restaurants.id_is_opento treat both Chinese"不营业"and English"closed"as closed, and ensuredhard_logic_pyfrom the HF dataset isast.literal_eval-parsed only when it's a string.pop-based transfers with assignments to avoid mutating intermediate maps unnecessarily.Normalize line endings for env files back to CRLFfor the EOL normalization commit.Testing
git diff --ignore-cr-at-eolwhich showed no content changes for the normalized files (success).python -m compileallon the touched environment files which completed without errors (success).pythonone-liners used to count and rewrite EOLs) and validated the conversions (success).Codex Task