{"id":21291558,"url":"https://github.com/smartdataanalytics/literale","last_synced_at":"2025-10-29T19:40:40.906Z","repository":{"id":37612148,"uuid":"117646539","full_name":"SmartDataAnalytics/LiteralE","owner":"SmartDataAnalytics","description":"Knowledge Graph Embeddings learned from the structure and literals of knowledge graphs","archived":false,"fork":false,"pushed_at":"2022-06-21T22:48:55.000Z","size":54765,"stargazers_count":42,"open_issues_count":6,"forks_count":16,"subscribers_count":19,"default_branch":"master","last_synced_at":"2024-04-16T07:41:35.151Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/SmartDataAnalytics.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2018-01-16T07:13:23.000Z","updated_at":"2024-04-16T07:41:35.152Z","dependencies_parsed_at":"2022-08-18T14:50:12.273Z","dependency_job_id":null,"html_url":"https://github.com/SmartDataAnalytics/LiteralE","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/SmartDataAnalytics%2FLiteralE","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/SmartDataAnalytics%2FLiteralE/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/SmartDataAnalytics%2FLiteralE/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/SmartDataAnalytics%2FLiteralE/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/SmartDataAnalytics","download_url":"https://codeload.github.com/SmartDataAnalytics/LiteralE/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":225738017,"owners_count":17516477,"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","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":[],"created_at":"2024-11-21T13:35:41.342Z","updated_at":"2025-10-29T19:40:35.841Z","avatar_url":"https://github.com/SmartDataAnalytics.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# LiteralE\nKnowledge Graph Embeddings learned from the structure and literals of knowledge graphs.\n\nArXiv link for the paper: [Incorporating Literals into Knowledge Graph Embeddings](https://arxiv.org/abs/1802.00934)\n\n### Credits\n\nThis work is built on top of Tim Dettmers' ConvE codes: \u003chttps://github.com/TimDettmers/ConvE\u003e.\n\n### Getting Started\n\n**Note:** Python 3.6+ is required.\n\nNote that we only support computation on GPU (CUDA). We have tested our code with Nvidia Titan Xp (12GB) and RTX 2080Ti (11GB). 6 or 8GB of memory should also be enough though we couldn't test them.\n\n1. Install PyTorch. We have verified that version 1.2.0 works.\n2. Install other requirements: `pip install -r requirements.txt`\n3. Run `chmod +x preprocess.sh \u0026\u0026 ./preprocess.sh`\n4. Install spacy model: `python -m spacy download en \u0026\u0026 python -m spacy download en_core_web_md`\n5. Preprocess datasets (do these steps for each dataset in `{FB15k, FB15k-237, YAGO3-10}`):\n    1. `python main_literal.py dataset {FB15k, FB15k-237, YAGO3-10} epochs 0 process True`\n    2. Numerical literals: `python preprocess_num_lit.py --dataset {FB15k, FB15k-237, YAGO3-10}`\n    3. Text literals: `python preprocess_txt_lit.py --dataset {FB15k, FB15k-237, YAGO3-10}`\n\n\n### Reproducing Paper's Experiments\n\nFor DistMult+LiteralE and ComplEx+LiteralE:\n```\npython main_literal.py dataset {FB15k, FB15k-237, YAGO3-10} model {DistMult, ComplEx} input_drop 0.2 embedding_dim 100 batch_size 128 epochs 100 lr 0.001 process True\n```\n\nFor ConvE+LiteralE:\n```\npython main_literal.py dataset {FB15k, FB15k-237, YAGO3-10} model ConvE input_drop 0.2 hidden_drop 0.3 feat_drop 0.2 embedding_dim 200 batch_size 128 epochs 100 lr 0.001 process True\n```\n\nFor DistMult+LiteralE with numerical and textual literals:\n```\npython main_literal.py dataset {FB15k, FB15k-237, YAGO3-10} model DistMult_text input_drop 0.2 embedding_dim 100 batch_size 128 epochs 100 lr 0.001 process True\n```\n\nNB: For base models, replace `main_literal.py` with `main.py`.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsmartdataanalytics%2Fliterale","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fsmartdataanalytics%2Fliterale","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsmartdataanalytics%2Fliterale/lists"}