Giter VIP home page Giter VIP logo

attucker's Introduction

AtTuckER

Knowledge Graph Emedding with relation-definition and relation-entity attention.

Preprocess:

  • Check in ./data/, whether specific dataset exist.

Preprocessing FB**

data--FB15k
    --FB15k237---train.txt
              ---valid.txt
              ---text.txt
              ---entity2multisentdesc.txt
              ---entity2type.txt
              ---entity_symbol2type.txt

NOTE: when preprocessing, you first need

```
train.txt : head_symbol \t relation \t tail+symbol in each one col.
valid.txt : head_symbol \t relation \t tail+symbol in each one col.
test.txt : head_symbol \t relation \t tail+symbol  in each one col.
entity_symbol2cano.txt : entity_symbol \t entity canonical name              in each one col.
entity_symbol2type.txt : entity_symbol \t type1 \t type2 \t type3 ...        in each one col.
entity_symbol2multisentdesc.txt : entity_symbol \t multisentence description in each one col.
```

Preprocess run command example: python3 preprocess_ent2type_desc_cano_reladj.py -entity_symbol2cano_type_desc_alreadydumped False -reverse_rel_data_alreadydumped False -KBdataset FB15k-237 -spacy_model_str en_core_web_lg -multiprocess True

Preprocessing WN**

  • First, download WordNet-3.0.tar.gz to ./misc_data/ and do tar -xzvf *

  • run python3 preprocess_wordnet.py -KBdataset WN18 (and python3 preprocess_wordnet.py -KBdataset WN18RR )

    • If train/dev/test/ exists in ./data/WN**/, you can use this preprocessor to another WN** datasets.
  • run python3 preprocess_ent2type_desc_cano_reladj.py -entity_symbol2cano_type_desc_alreadydumped False -reverse_rel_data_alreadydumped False -KBdataset WN18 -spacy_model_str en_core_web_lg -multiprocess True

Preprocessing DBpedia**

  • First Download
wget http://downloads.dbpedia.org/2016-10/core-i18n/en/nif_context_en.ttl.bz2
wget http://downloads.dbpedia.org/2016-10/core-i18n/en/infobox_properties_en.ttl.bz2
wget http://downloads.dbpedia.org/2016-10/core-i18n/en/labels_en.ttl.bz2

to ./misc_data/dbpedia2016/

then cd misc_data/dbpedia2016/ python dbpedia_ents_prep.py infobox_properties_en.ttl.bz2 labels_en.ttl.bz2 nif_context_en.ttl.bz2 > dbpedia_ents.text.jsonl

Next, run context preprocessor.

python3 preprocess_dbpedia.py -jsonl2json_alreadydumped False -entitycheckalreadydone False -parsed_json_squeezing_by_entities_on_db50_and_db500_already False
nohup sh preprocess_dbpedia.sh > 191123_preprocess_dbpedia.log &

This will take 6-10 hours on 72 core cpus.

attucker's People

Contributors

izuna385 avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.