{"id":25299913,"url":"https://github.com/alifa98/modernbert-trajectory-classification","last_synced_at":"2025-08-26T23:37:54.810Z","repository":{"id":274883224,"uuid":"924380212","full_name":"alifa98/ModernBERT-Trajectory-Classification","owner":"alifa98","description":"Trajectory Classification with the new architecture of BERT, the 'ModernBERT'","archived":false,"fork":false,"pushed_at":"2025-01-29T23:55:51.000Z","size":8,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-04-06T23:39:07.545Z","etag":null,"topics":["bert","modern-bert","modernbert","trajectory","trajectory-classifier"],"latest_commit_sha":null,"homepage":"","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/alifa98.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2025-01-29T22:26:18.000Z","updated_at":"2025-01-29T23:55:55.000Z","dependencies_parsed_at":"2025-01-29T23:34:54.719Z","dependency_job_id":null,"html_url":"https://github.com/alifa98/ModernBERT-Trajectory-Classification","commit_stats":null,"previous_names":["alifa98/modernbert-trajectory-classification"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/alifa98/ModernBERT-Trajectory-Classification","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/alifa98%2FModernBERT-Trajectory-Classification","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/alifa98%2FModernBERT-Trajectory-Classification/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/alifa98%2FModernBERT-Trajectory-Classification/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/alifa98%2FModernBERT-Trajectory-Classification/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/alifa98","download_url":"https://codeload.github.com/alifa98/ModernBERT-Trajectory-Classification/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/alifa98%2FModernBERT-Trajectory-Classification/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":272267724,"owners_count":24903764,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","status":"online","status_checked_at":"2025-08-26T02:00:07.904Z","response_time":60,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["bert","modern-bert","modernbert","trajectory","trajectory-classifier"],"created_at":"2025-02-13T05:35:35.636Z","updated_at":"2025-08-26T23:37:54.779Z","avatar_url":"https://github.com/alifa98.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Training ModernBERT for Trajectory Classification\n\nThis repository contains the code for training ModernBERT for trajectory classification.\nThe code is based on the [Hugging Face ModernBERT](https://huggingface.co/docs/transformers/en/model_doc/modernbert#overview) implementation.\n\n\n\n## Datasets\nDatasets are [higher-order mobility data](https://zenodo.org/records/8076553).\n\n## Dependencies\nInstall dependencies using the following command:\n\n```bash\nconda env create -f environment.yml\n```\n\n\nActivate the environment:\n\n```bash\nconda activate modern\n```\n\n## Preprocessing\nWe put all the hexagon/tessellation ids in a single file and then use the `transformers` library to train a tokenizer on the corpus. The tokenizer is then used to in training the model as a pre-trained tokenizer.\n\n```bash\npython preprocess.py\n```\n\n## Training a Tokenizer\nWe train a tokenizer on the hexagon/tessellation ids using the `transformers` library.\n\n```bash\npython tokenizer_trainer.py\n```\n\n## Training\n\nAdjust the hyperparameters in the `train.py` file and then run the following command to train the model:\n\n```bash\npython train.py\n```\n\n\n## Evaluation\nFor evaluation of the model, run the following command:\n\n```bash\npython evaluate_script.py\n```\n\n## Running for your own data\nAdjust the path of dataset and column names in each file then run the following commands.\n\n\n## How can I train on my own trajectory data which is not in the hexagon/tessellation format?\n\nFor this you should map it to a hexagon/tessellation format.\nYou can convert to raw trajectory data to hexagon/tessellation format using the following repository:\n[Point2Hex](https://github.com/alifa98/point2hex).\n\n\n## Citation\nTo cite this repo:\n```\n@misc{Faraji2025ModenBERT,\n  author = {Faraji, Ali},\n  title = {Training ModernBERT for Trajectory Classification},\n  year = {2025},\n  publisher = {GitHub},\n  journal = {GitHub repository},\n  howpublished = {\\url{https://github.com/alifa98/ModernBERT-Trajectory-Classification}},\n}\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Falifa98%2Fmodernbert-trajectory-classification","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Falifa98%2Fmodernbert-trajectory-classification","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Falifa98%2Fmodernbert-trajectory-classification/lists"}