{"metadata":{"kernelspec":{"language":"python","display_name":"Python 3","name":"python3"},"language_info":{"name":"python","version":"3.12.12","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":"# Hi Aššur,\n# If you were from the Archadian era, your first name would be Aššur.","metadata":{}},{"cell_type":"code","source":"import numpy as np\nimport pandas as pd\n\nimport os\nfor dirname, _, filenames in os.walk('/kaggle/input'):\n    for filename in filenames:\n        print(os.path.join(dirname, filename))","metadata":{"_uuid":"8f2839f25d086af736a60e9eeb907d3b93b6e0e5","_cell_guid":"b1076dfc-b9ad-4769-8c92-a6c4dae69d19","trusted":true,"execution":{"iopub.status.busy":"2026-01-27T09:17:30.804499Z","iopub.execute_input":"2026-01-27T09:17:30.804903Z","iopub.status.idle":"2026-01-27T09:17:31.183307Z","shell.execute_reply.started":"2026-01-27T09:17:30.804872Z","shell.execute_reply":"2026-01-27T09:17:31.182390Z"},"_kg_hide-output":true,"_kg_hide-input":true},"outputs":[],"execution_count":null},{"cell_type":"code","source":"train = pd.read_csv(\"/kaggle/input/deep-past-initiative-machine-translation/train.csv\")","metadata":{"trusted":true,"execution":{"iopub.status.busy":"2026-01-27T09:32:52.761679Z","iopub.execute_input":"2026-01-27T09:32:52.762547Z","iopub.status.idle":"2026-01-27T09:32:52.804774Z","shell.execute_reply.started":"2026-01-27T09:32:52.762513Z","shell.execute_reply":"2026-01-27T09:32:52.803580Z"}},"outputs":[],"execution_count":null},{"cell_type":"code","source":"train","metadata":{"trusted":true,"execution":{"iopub.status.busy":"2026-01-27T09:32:54.195736Z","iopub.execute_input":"2026-01-27T09:32:54.196529Z","iopub.status.idle":"2026-01-27T09:32:54.207890Z","shell.execute_reply.started":"2026-01-27T09:32:54.196487Z","shell.execute_reply":"2026-01-27T09:32:54.206839Z"}},"outputs":[],"execution_count":null},{"cell_type":"code","source":"!pip install wordfreq","metadata":{"trusted":true,"execution":{"iopub.status.busy":"2026-01-27T09:29:38.593776Z","iopub.execute_input":"2026-01-27T09:29:38.594147Z","iopub.status.idle":"2026-01-27T09:29:47.239055Z","shell.execute_reply.started":"2026-01-27T09:29:38.594117Z","shell.execute_reply":"2026-01-27T09:29:47.237656Z"}},"outputs":[],"execution_count":null},{"cell_type":"code","source":"!pip install langdetect","metadata":{"trusted":true,"execution":{"iopub.status.busy":"2026-01-27T09:29:55.424947Z","iopub.execute_input":"2026-01-27T09:29:55.425319Z","iopub.status.idle":"2026-01-27T09:30:03.940524Z","shell.execute_reply.started":"2026-01-27T09:29:55.425281Z","shell.execute_reply":"2026-01-27T09:30:03.939214Z"}},"outputs":[],"execution_count":null},{"cell_type":"code","source":"import re\nfrom wordfreq import zipf_frequency\n\ndef ext(text):\n    ascii_words = re.findall(r\"\\b[a-zA-Z]+\\b\", text)\n\n    english_words = [\n        w for w in ascii_words\n        if zipf_frequency(w.lower(), \"en\") > 2\n    ]\n    return english_words\n\ndef wrd(text):\n    words = re.findall(r\"\\b\\w+\\b\", text)\n    return words","metadata":{"trusted":true,"execution":{"iopub.status.busy":"2026-01-27T09:32:59.153182Z","iopub.execute_input":"2026-01-27T09:32:59.153553Z","iopub.status.idle":"2026-01-27T09:32:59.160148Z","shell.execute_reply.started":"2026-01-27T09:32:59.153522Z","shell.execute_reply":"2026-01-27T09:32:59.159207Z"}},"outputs":[],"execution_count":null},{"cell_type":"code","source":"train[\"ext\"] = train[\"translation\"].apply(ext)\ntrain[\"wrd\"] = train[\"translation\"].apply(wrd)","metadata":{"trusted":true,"execution":{"iopub.status.busy":"2026-01-27T09:33:01.040612Z","iopub.execute_input":"2026-01-27T09:33:01.041475Z","iopub.status.idle":"2026-01-27T09:33:01.371873Z","shell.execute_reply.started":"2026-01-27T09:33:01.041436Z","shell.execute_reply":"2026-01-27T09:33:01.370833Z"}},"outputs":[],"execution_count":null},{"cell_type":"code","source":"l = []\nfor i in range(len(train)):\n    l.append(list(set(train[\"wrd\"][i]) - set(train[\"ext\"][i])))","metadata":{"trusted":true,"execution":{"iopub.status.busy":"2026-01-27T09:33:03.584478Z","iopub.execute_input":"2026-01-27T09:33:03.584878Z","iopub.status.idle":"2026-01-27T09:33:03.652781Z","shell.execute_reply.started":"2026-01-27T09:33:03.584847Z","shell.execute_reply":"2026-01-27T09:33:03.651672Z"}},"outputs":[],"execution_count":null},{"cell_type":"code","source":"train[\"names\"] = l","metadata":{"trusted":true,"execution":{"iopub.status.busy":"2026-01-27T09:33:11.753267Z","iopub.execute_input":"2026-01-27T09:33:11.753611Z","iopub.status.idle":"2026-01-27T09:33:11.759641Z","shell.execute_reply.started":"2026-01-27T09:33:11.753581Z","shell.execute_reply":"2026-01-27T09:33:11.758286Z"}},"outputs":[],"execution_count":null},{"cell_type":"code","source":"train['names']","metadata":{"trusted":true,"execution":{"iopub.status.busy":"2026-01-27T09:33:13.073192Z","iopub.execute_input":"2026-01-27T09:33:13.074282Z","iopub.status.idle":"2026-01-27T09:33:13.085252Z","shell.execute_reply.started":"2026-01-27T09:33:13.074238Z","shell.execute_reply":"2026-01-27T09:33:13.083593Z"}},"outputs":[],"execution_count":null},{"cell_type":"code","source":"train['names_2']=[ \", \".join( repr(e) for e in y) for y in train['names']]","metadata":{"trusted":true,"execution":{"iopub.status.busy":"2026-01-27T09:33:46.352874Z","iopub.execute_input":"2026-01-27T09:33:46.353216Z","iopub.status.idle":"2026-01-27T09:33:46.366031Z","shell.execute_reply.started":"2026-01-27T09:33:46.353187Z","shell.execute_reply":"2026-01-27T09:33:46.364951Z"}},"outputs":[],"execution_count":null},{"cell_type":"code","source":"train['names_2']","metadata":{"trusted":true,"execution":{"iopub.status.busy":"2026-01-27T09:33:52.016399Z","iopub.execute_input":"2026-01-27T09:33:52.017566Z","iopub.status.idle":"2026-01-27T09:33:52.026149Z","shell.execute_reply.started":"2026-01-27T09:33:52.017511Z","shell.execute_reply":"2026-01-27T09:33:52.025192Z"}},"outputs":[],"execution_count":null},{"cell_type":"code","source":"from collections import Counter\ntrain['names_count']=train['names'].apply(Counter)","metadata":{"trusted":true,"execution":{"iopub.status.busy":"2026-01-27T09:43:39.015513Z","iopub.execute_input":"2026-01-27T09:43:39.015886Z","iopub.status.idle":"2026-01-27T09:43:39.027660Z","shell.execute_reply.started":"2026-01-27T09:43:39.015860Z","shell.execute_reply":"2026-01-27T09:43:39.026511Z"}},"outputs":[],"execution_count":null},{"cell_type":"code","source":"train['names_count']","metadata":{"trusted":true,"execution":{"iopub.status.busy":"2026-01-27T09:43:43.887514Z","iopub.execute_input":"2026-01-27T09:43:43.888554Z","iopub.status.idle":"2026-01-27T09:43:43.897672Z","shell.execute_reply.started":"2026-01-27T09:43:43.888518Z","shell.execute_reply":"2026-01-27T09:43:43.896520Z"}},"outputs":[],"execution_count":null},{"cell_type":"code","source":"temp = [x.most_common() for x in train['names_count']]","metadata":{"trusted":true,"execution":{"iopub.status.busy":"2026-01-27T09:46:32.087150Z","iopub.execute_input":"2026-01-27T09:46:32.087520Z","iopub.status.idle":"2026-01-27T09:46:32.099418Z","shell.execute_reply.started":"2026-01-27T09:46:32.087490Z","shell.execute_reply":"2026-01-27T09:46:32.098213Z"}},"outputs":[],"execution_count":null},{"cell_type":"code","source":"train['names_count'] = temp\ntrain['names_count']","metadata":{"trusted":true,"execution":{"iopub.status.busy":"2026-01-27T09:47:14.282223Z","iopub.execute_input":"2026-01-27T09:47:14.282585Z","iopub.status.idle":"2026-01-27T09:47:14.302435Z","shell.execute_reply.started":"2026-01-27T09:47:14.282549Z","shell.execute_reply":"2026-01-27T09:47:14.301499Z"}},"outputs":[],"execution_count":null},{"cell_type":"code","source":"Counter(temp[0])","metadata":{"trusted":true,"execution":{"iopub.status.busy":"2026-01-27T09:49:34.022933Z","iopub.execute_input":"2026-01-27T09:49:34.023302Z","iopub.status.idle":"2026-01-27T09:49:34.031617Z","shell.execute_reply.started":"2026-01-27T09:49:34.023275Z","shell.execute_reply":"2026-01-27T09:49:34.030137Z"}},"outputs":[],"execution_count":null},{"cell_type":"code","source":"result = [\n    item.replace(\"'\", \"\").strip()\n    for s in train['names_2']\n    for item in s.split(\",\")\n]\n\nresult = [x for x in result if len(x) > 3]\nresult = list(set(result))","metadata":{"trusted":true,"execution":{"iopub.status.busy":"2026-01-27T09:30:29.488637Z","iopub.execute_input":"2026-01-27T09:30:29.489395Z","iopub.status.idle":"2026-01-27T09:30:29.507947Z","shell.execute_reply.started":"2026-01-27T09:30:29.489348Z","shell.execute_reply":"2026-01-27T09:30:29.506672Z"}},"outputs":[],"execution_count":null},{"cell_type":"code","source":"Assyrian_Names = [e for e in result if not e.isdigit()]\nAssyrian_Names","metadata":{"trusted":true,"execution":{"iopub.status.busy":"2026-01-27T09:30:31.400474Z","iopub.execute_input":"2026-01-27T09:30:31.400857Z","iopub.status.idle":"2026-01-27T09:30:31.416468Z","shell.execute_reply.started":"2026-01-27T09:30:31.400828Z","shell.execute_reply":"2026-01-27T09:30:31.415166Z"}},"outputs":[],"execution_count":null},{"cell_type":"code","source":"Assyrian_Names.sort()","metadata":{"trusted":true,"execution":{"iopub.status.busy":"2026-01-27T09:31:37.161461Z","iopub.execute_input":"2026-01-27T09:31:37.161842Z","iopub.status.idle":"2026-01-27T09:31:37.168037Z","shell.execute_reply.started":"2026-01-27T09:31:37.161805Z","shell.execute_reply":"2026-01-27T09:31:37.166278Z"}},"outputs":[],"execution_count":null},{"cell_type":"code","source":"Assyrian_Names","metadata":{"trusted":true,"execution":{"iopub.status.busy":"2026-01-27T09:31:42.737922Z","iopub.execute_input":"2026-01-27T09:31:42.738262Z","iopub.status.idle":"2026-01-27T09:31:42.754932Z","shell.execute_reply.started":"2026-01-27T09:31:42.738235Z","shell.execute_reply":"2026-01-27T09:31:42.753637Z"}},"outputs":[],"execution_count":null}]}