{"metadata":{"kernelspec":{"language":"python","display_name":"Python 3","name":"python3"},"language_info":{"pygments_lexer":"ipython3","nbconvert_exporter":"python","version":"3.6.4","file_extension":".py","codemirror_mode":{"name":"ipython","version":3},"name":"python","mimetype":"text/x-python"}},"nbformat_minor":4,"nbformat":4,"cells":[{"cell_type":"markdown","source":"# Google American Sign Language\n\nSo Google is again here with another great competition **`Google - American Sign Language Fingerspelling Recognition`**\n\nLets first understand the competition in detail \n\n* **American Sign Language FingerSpelling** - $American$ $Sign$ $Language$ $FingerSpelling$ is a method used in sign language to spell out individual letters or words. It involves using specific handshapes and movements to represent each letter of the alphabet. $FingerSpelling$ is an important tool for communication and is often used to convey names, places, or unfamiliar words in $ASL$. It requires practice and skill to execute accurately and fluently, and NO!!, (middle finger is not included in this language)\n\n<img src = \"https://d.newsweek.com/en/full/1394686/asl-getty-images.jpg\">","metadata":{}},{"cell_type":"code","source":"import 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","_kg_hide-output":true,"execution":{"iopub.status.busy":"2023-05-11T15:15:48.573937Z","iopub.execute_input":"2023-05-11T15:15:48.574335Z","iopub.status.idle":"2023-05-11T15:15:48.589242Z","shell.execute_reply.started":"2023-05-11T15:15:48.57429Z","shell.execute_reply":"2023-05-11T15:15:48.588396Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"pip install --pre torcharrow -f https://download.pytorch.org/whl/nightly/cpu/torch_nightly.html","metadata":{"_kg_hide-output":true,"execution":{"iopub.status.busy":"2023-05-11T15:15:52.270678Z","iopub.execute_input":"2023-05-11T15:15:52.271088Z","iopub.status.idle":"2023-05-11T15:16:05.357603Z","shell.execute_reply.started":"2023-05-11T15:15:52.271055Z","shell.execute_reply":"2023-05-11T15:16:05.356074Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"import pandas as pd \nimport torchdata\nimport torcharrow","metadata":{"execution":{"iopub.status.busy":"2023-05-11T15:16:08.84611Z","iopub.execute_input":"2023-05-11T15:16:08.846557Z","iopub.status.idle":"2023-05-11T15:16:08.85185Z","shell.execute_reply.started":"2023-05-11T15:16:08.846517Z","shell.execute_reply":"2023-05-11T15:16:08.850776Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"markdown","source":"# 1 | Train \n\nSo this our `train data`, this data contains all the information related to the the `training` and `target` values. As of I think `file_id` , `sequence_id` , `participant_id`, are not that important for the model, and thus it would be better if we just remove them","metadata":{}},{"cell_type":"code","source":"train = pd.read_csv(\"/kaggle/input/asl-fingerspelling/train.csv\")\ntrain","metadata":{"execution":{"iopub.status.busy":"2023-05-11T15:16:11.11447Z","iopub.execute_input":"2023-05-11T15:16:11.114862Z","iopub.status.idle":"2023-05-11T15:16:11.223227Z","shell.execute_reply.started":"2023-05-11T15:16:11.114834Z","shell.execute_reply":"2023-05-11T15:16:11.222155Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"markdown","source":"The `path` shows where the `parquet file` is located. You could also have just used the `file_id` for lacating the corresponding `parquet_file`, as if we split the `path` into `train_landmarks/` and the other part, we basically get the same value. \n\nWe used `path` instead of the `file_id`. As file paths are easier to process when we try to find the data\n\nThe other column `phrase` is the target column, we will train for \n\n# 2 | Supplemental MetData\n\nSuplement data looks like the same, its just we will test our model on this data ","metadata":{}},{"cell_type":"code","source":"supplemental_metdata = pd.read_csv(\"/kaggle/input/asl-fingerspelling/supplemental_metadata.csv\")\nsupplemental_metdata","metadata":{"execution":{"iopub.status.busy":"2023-05-11T15:16:12.95938Z","iopub.execute_input":"2023-05-11T15:16:12.959801Z","iopub.status.idle":"2023-05-11T15:16:13.043107Z","shell.execute_reply.started":"2023-05-11T15:16:12.959768Z","shell.execute_reply":"2023-05-11T15:16:13.042085Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"supplemental_metdata.drop([\"file_id\" , \"sequence_id\" , \"participant_id\"] , axis = 1 , inplace = True)\nsupplemental_metdata","metadata":{"execution":{"iopub.status.busy":"2023-05-11T15:16:13.842564Z","iopub.execute_input":"2023-05-11T15:16:13.842949Z","iopub.status.idle":"2023-05-11T15:16:13.860572Z","shell.execute_reply.started":"2023-05-11T15:16:13.842921Z","shell.execute_reply":"2023-05-11T15:16:13.859284Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"markdown","source":"# 3 | Parquet Files\nParquet files are a little bit complicated to work with. But you can find particular methods in `pandas` and `tensorflow`. \n\n`Pytorch` has a specialised library for **loading parquet data from pipelines/paths**. You can find it **[torch.datapipes.iter.ParquetDataFrameLoader](https://pytorch.org/data/main/generated/torchdata.datapipes.iter.ParquetDataFrameLoader.html)**, You need to install `torcharrow` to use this library, `torcharrow` is not in stable release, but you can still install it using \n```\n! pip install --pre torcharrow -f https://download.pytorch.org/whl/nightly/cpu/torch_nightly.html\nimport torcharraow\n```\nThough even after installing it is showing error to me, I dont know if it is the problem with my system only or not. If you find any leads, please tell me :)\n\nHere is the **[Github](https://github.com/pytorch/torcharrow)** for `torcharrow`\n\nHere is the code for loading the data\n```\ntorchdata.datapipes.iter.ParquetDataFrameLoader(train[\"path\"])\n```\n\nNow lets see how we are given the data \n\nI dont know but the `sample_data` is not shown in the actual release of the notebook. but can be seen in the `edit` mode. \n\nIt has $1,73,385$ rows and $1,630$ columns","metadata":{}},{"cell_type":"code","source":"sample_data = pd.read_parquet(\"/kaggle/input/asl-fingerspelling/supplemental_landmarks/1032110484.parquet\")\nsample_data","metadata":{"execution":{"iopub.status.busy":"2023-05-11T15:16:14.864373Z","iopub.execute_input":"2023-05-11T15:16:14.864748Z","iopub.status.idle":"2023-05-11T15:16:17.837118Z","shell.execute_reply.started":"2023-05-11T15:16:14.864719Z","shell.execute_reply":"2023-05-11T15:16:17.836013Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"markdown","source":"# 4 | Advisory\n\nThis data has both `video` as an `input` and `language` as `output`. One lead (as of I think) is we can use R-CNN(Reccurent-Convolution Neural Network). Video data works great on these types of models. \n\nAlso we need to reduce the training time as much as possible. As of the competition says. \n\n**THAT IT FOR TODAY GUYS**\n\n**WE WILL GO DEEPER INTO THE DATA IN THE UPCOMING VERSIONS**\n\n**PLEASE COMMENT YOUR THOUGHTS, HIHGLY APPRICIATED**\n\n**DONT FORGET TO MAKE AN UPVOTE, IF YOU LIKED MY WORK**\n\n<img src = \"https://i.imgflip.com/19aadg.jpg\">\n\n**PEACE OUT!!!**\n","metadata":{}}]}