{"metadata":{"kernelspec":{"language":"python","display_name":"Python 3","name":"python3"},"language_info":{"name":"python","version":"3.11.13","mimetype":"text/x-python","codemirror_mode":{"name":"ipython","version":3},"pygments_lexer":"ipython3","nbconvert_exporter":"python","file_extension":".py"},"kaggle":{"accelerator":"none","dataSources":[{"sourceId":121150,"databundleVersionId":15061024,"sourceType":"competition"}],"dockerImageVersionId":31234,"isInternetEnabled":true,"language":"python","sourceType":"notebook","isGpuEnabled":false}},"nbformat_minor":4,"nbformat":4,"cells":[{"cell_type":"markdown","source":"# Some weird translation or transliteration\n\nIf you count the number of characters of the transliteration and the translation, you will see that in some case they do not make sense. There are some long transliterations with very short translation and also the opposite as you see below.\n","metadata":{}},{"cell_type":"code","source":"# This Python 3 environment comes with many helpful analytics libraries installed\n# It is defined by the kaggle/python Docker image: https://github.com/kaggle/docker-python\n# For example, here's several helpful packages to load\n\nimport numpy as np # linear algebra\nimport pandas as pd # data processing, CSV file I/O (e.g. pd.read_csv)\n\n# Input data files are available in the read-only \"../input/\" directory\n# For example, running this (by clicking run or pressing Shift+Enter) will list all files under the input directory\n\nimport os\nfor dirname, _, filenames in os.walk('/kaggle/input'):\n    for filename in filenames:\n        print(os.path.join(dirname, filename))\n\n# You can write up to 20GB to the current directory (/kaggle/working/) that gets preserved as output when you create a version using \"Save & Run All\" \n# You can also write temporary files to /kaggle/temp/, but they won't be saved outside of the current session","metadata":{"_uuid":"8f2839f25d086af736a60e9eeb907d3b93b6e0e5","_cell_guid":"b1076dfc-b9ad-4769-8c92-a6c4dae69d19","trusted":true,"execution":{"iopub.status.busy":"2025-12-23T11:18:38.340338Z","iopub.execute_input":"2025-12-23T11:18:38.340663Z","iopub.status.idle":"2025-12-23T11:18:41.139318Z","shell.execute_reply.started":"2025-12-23T11:18:38.340632Z","shell.execute_reply":"2025-12-23T11:18:41.137920Z"}},"outputs":[],"execution_count":null},{"cell_type":"code","source":"INPUT_DIR = \"/kaggle/input/deep-past-initiative-machine-translation\"\ntrain_df = pd.read_csv(f\"{INPUT_DIR}/train.csv\")\ntest_df = pd.read_csv(f\"{INPUT_DIR}/test.csv\")\n# lexicon = pd.read_csv(f\"{INPUT_DIR}/OA_Lexicon_eBL.csv\")","metadata":{"trusted":true,"execution":{"iopub.status.busy":"2025-12-23T11:18:41.141696Z","iopub.execute_input":"2025-12-23T11:18:41.142232Z","iopub.status.idle":"2025-12-23T11:18:41.216968Z","shell.execute_reply.started":"2025-12-23T11:18:41.142199Z","shell.execute_reply":"2025-12-23T11:18:41.215929Z"}},"outputs":[],"execution_count":null},{"cell_type":"code","source":"train_df['count_char'] = train_df['transliteration'].str.len()/train_df['translation'].str.len()","metadata":{"trusted":true,"execution":{"iopub.status.busy":"2025-12-23T11:18:52.988433Z","iopub.execute_input":"2025-12-23T11:18:52.988762Z","iopub.status.idle":"2025-12-23T11:18:53.003553Z","shell.execute_reply.started":"2025-12-23T11:18:52.988720Z","shell.execute_reply":"2025-12-23T11:18:53.002579Z"}},"outputs":[],"execution_count":null},{"cell_type":"markdown","source":"# Some stats","metadata":{}},{"cell_type":"code","source":"train_df['count_char'].describe()","metadata":{"trusted":true},"outputs":[],"execution_count":null},{"cell_type":"markdown","source":"# Long translation to small transliteration","metadata":{}},{"cell_type":"code","source":"train_df.sort_values(by = 'count_char').head(5)","metadata":{"trusted":true,"execution":{"iopub.status.busy":"2025-12-23T11:20:42.260706Z","iopub.execute_input":"2025-12-23T11:20:42.261299Z","iopub.status.idle":"2025-12-23T11:20:42.278357Z","shell.execute_reply.started":"2025-12-23T11:20:42.261264Z","shell.execute_reply":"2025-12-23T11:20:42.277206Z"}},"outputs":[],"execution_count":null},{"cell_type":"code","source":"N = 832\nprint('TRANSLIT: ', train_df['transliteration'][N], \"\\n\\nTRANSLAT: \", train_df['translation'][N])","metadata":{"trusted":true,"execution":{"iopub.status.busy":"2025-12-23T11:29:35.983432Z","iopub.execute_input":"2025-12-23T11:29:35.983946Z","iopub.status.idle":"2025-12-23T11:29:35.989669Z","shell.execute_reply.started":"2025-12-23T11:29:35.983921Z","shell.execute_reply":"2025-12-23T11:29:35.988628Z"}},"outputs":[],"execution_count":null},{"cell_type":"markdown","source":"# Deep Seek translation\n\nDeep Seek translated it as follows:\n\n4 talents of tin under the seal of Aššur-immitti (and) Adad-bāni were brought to us. We weighed it, and (the total was) 4 talents, 6 minas, 5 shekels of tin.\n\nFrom it, 0.83333 mina is the wastage/deduction of its tin; we gave (this) to the office of the kārum (merchant colony).\n\nBefore Enna-Aššur, son of Aninum; before Ennum-Aššur, son of Uzu'a.\n\nFrom that tin, Šalim-Aššur took 2 talents, 2.5 minas.","metadata":{}},{"cell_type":"markdown","source":"# Long transliteration to small translation","metadata":{}},{"cell_type":"code","source":"train_df.sort_values(by = 'count_char', ascending = False).head(5)","metadata":{"trusted":true,"execution":{"iopub.status.busy":"2025-12-23T11:26:59.536046Z","iopub.execute_input":"2025-12-23T11:26:59.536377Z","iopub.status.idle":"2025-12-23T11:26:59.549227Z","shell.execute_reply.started":"2025-12-23T11:26:59.536349Z","shell.execute_reply":"2025-12-23T11:26:59.548259Z"}},"outputs":[],"execution_count":null},{"cell_type":"code","source":"N = 57\nprint('TRANSLIT: ', train_df['transliteration'][N], \"\\n\\nTRANSLAT: \", train_df['translation'][N])","metadata":{"trusted":true,"execution":{"iopub.status.busy":"2025-12-23T11:29:10.565424Z","iopub.execute_input":"2025-12-23T11:29:10.565783Z","iopub.status.idle":"2025-12-23T11:29:10.572156Z","shell.execute_reply.started":"2025-12-23T11:29:10.565729Z","shell.execute_reply":"2025-12-23T11:29:10.570866Z"}},"outputs":[],"execution_count":null},{"cell_type":"markdown","source":"# Deep Seek translation\n\nDeep Seek translated it as follows:\n\nLulu, Ennam-Aššur, and Abu-šalim—on behalf of Aššur-ṭāb son of Elama—seized me (to question me) about Aššur-ṭāb son of Alāḫim, and they said as follows:\n\nThey said: “The purchase price of 21 talents 9 minas of massî-copper belonging to Aššur-ṭāb son of Elama, which is stored in your house—have you sold it?”\n\nAššur-ṭāb (son of Alāḫim) said: “I have sold it, and I am holding 17 minas 50 shekels (i.e. 17.833 mina) and 2 shekels of silver as its price. The field … in the name of Aššur-ṭāb son of Elama—the silver transaction is completed.”\n\nConcerning these matters, the kārum of Burušḫattum gave judgment for us, and we took an oath before the dagger of Aššur.\n\nWitnesses: Ikuppiya, Uṣur-ša-Aššur.","metadata":{}}]}