Git Product home page Git Product logo

gentaxo's Introduction

GenTaxo

GenTaxo (pronounced “gen-tech-so”) is a generation-based approach for taxonomy completion. It enhances taxonomy completion by identifying the positions in existing taxonomies that need new concepts and generating the concept names.

This repo contain source code used for self-supervised taxonomy expansion method GenTaxo, published in KDD 2021.

Enhancing Taxonomy Completion with Concept Generation via Fusing Relational Representations

Requirements and Installation

GenTaxo currently runs on Linux,Mac and Windows with following requirements

  • PyTorch >= 1.2.0
  • Python >= 3.6.0
  • DGL >= 0.4.0

A detailed dependencies list can be found in requirements.txt and can be installed by:

  pip install -r requirements.txt

Quick Start

Step 1.a: Organize your input taxonomy along with node features into the following 3 files

1. <TAXONOMY_NAME>.terms, each line represents one concept in the taxonomy, including its ID and surface name

taxon1_id \t taxon1_surface_name
taxon2_id \t taxon2_surface_name
taxon3_id \t taxon3_surface_name
...

2. <TAXONOMY_NAME>.taxo, each line represents one relation in the taxonomy, including the parent taxon ID and child taxon ID

parent_taxon1_id \t child_taxon1_id
parent_taxon2_id \t child_taxon2_id
parent_taxon3_id \t child_taxon3_id
...

3. <TAXONOMY_NAME>.terms.<EMBED_SUFFIX>.embed, the first line indicates the vocabulary size and embedding dimension, each of the following line represents one taxon with its pretrained embedding

<VOCAB_SIZE> <EMBED_DIM>
taxon1_id taxon1_embedding
taxon2_id taxon2_embedding
taxon3_id taxon3_embedding
...

The embedding file follows the gensim word2vec format.

Step 1.b: Generate train/validation/test partition files

You can generate your desired train/validation/test parition files by creating another 3 separated files (named <TAXONOMY_NAME>.terms.train, <TAXONOMY_NAME>.terms.validation, as well as <TAXONOMY_NAME>.terms.test) and puting them in the same directory as the above three required files.

These three partition files are of the same format -- each line includes one taxon_id that appears in the above <TAXONOMY_NAME>.terms file.

Step 2: Generate the binary dataset file

  1. create a folder "./data/{DATASET_NAME}"
  2. put the above three required files (as well as three optional partition files) in "./data/{DATASET_NAME}"
  3. under this root directory, run
python generate_dataset_binary.py \
    --taxon_name <TAXONOMY_NAME> \
    --data_dir <DATASET_NAME> \
    --embed_suffix <EMBED_SUFFIX> \
    --existing_partition 1 \
    --partition_pattern internal \

Running Taxonomy Completion Module

python ./Taxonomy_Completion_Module/train.py --config config_files/$DATASET/config.json

Running Concept Name Generation Module

./Concept_Name_Generation/sh run.sh

Getting Generation Result

./Concept_Name_Generation/sh test.sh

Getting Taxonomy Completion Result

python ./Taxonomy_Completion_Module/infer.py --resume <MODEL_CHECKPOINT.pth> --taxon <INPUT_TAXON_LIST.txt> --save <OUTPUT_RESULT.tsv> --device 0

Reference

@article{zeng2021enhancing,
  title={Enhancing Taxonomy Completion with Concept Generation via Fusing Relational Representations},
  author={Zeng, Qingkai and Lin, Jinfeng and Yu, Wenhao and Cleland-Huang, Jane and Jiang, Meng},
  booktitle={Proceedings of the 27th ACM SIGKDD International Conference on Knowledge Discovery \& Data Mining},
  year={2021}
}

License

GenTaxo use the MIT License. The license applies to the pre-trained models as well.

Acknowledgements

The code is implemented based on TMN and GraphWriter-DGL.

Contact Us

Contact Qingkai Zeng ([email protected]), if you have any questions.

gentaxo's People

Contributors

qingkaizeng avatar jinfenglin avatar

Stargazers

Jeff Carpenter avatar Yifan Ding avatar  avatar czq_nlpr avatar  avatar  avatar Edward Z avatar Shenglei avatar  avatar  avatar Dongha Lee avatar Ramsey avatar DajunZhou avatar Suyuchen Wang avatar  avatar X-LEFT avatar Leon Zhu avatar Lovely Dragon avatar Serge Martel avatar 曾俊峰 avatar Alex Xu avatar 长岛哥哥 avatar 数据娃掘 avatar 趣味横生 avatar 王力没有红 avatar  avatar Kenja Taimu avatar Joon Lee avatar Ambrè Ong avatar Junghoon Jung avatar 哈泽和它的朋友圈 avatar Marius Jørgensen avatar timothy Rasinski avatar Wenhao Yu avatar

Watchers

 avatar  avatar  avatar Wenhao Yu avatar Joshua Ostwalt avatar Mingming Chen avatar 戦闘斥候 avatar

gentaxo's Issues

How to generate concept name generation datasets?

Hi there

Many thanks for publishing your code. After looking at the README and the paper, it's still unclear to me how to get the data format used as input in the concept name generation. I assume the present data in Concept_Name_Generation/data should serve as an example.

I don't understand the interaction (how to run) completely. From the paper I would gather, that to train the concept generation, it needs a taxonomy with masked concepts. However, I cannot see how to get such a dataset from my taxonomy in the format described in the README. Is this something I would need to implement from scratch? This seems strange, since I would have expected it to be part of the published code. Also, in the README there is just a call to a bash script, which does not seem to be dependent on the actual taxonomy.

Maybe I am misunderstanding. A clarification would be much appreciated. Thanks!

config files

Hello,

Thanks for sharing your code and data!
In the readme file, you mention the usage of config files. However, I was not able to locate any config_files folder?
Can you provide me with the config files?

Ines

Some questions about the code.

Hi, QingkaiZeng!
Thanks for offering a brand-new perspective towards Taxonomy Expansion task! I'm trying to learn more about how the Concept Name Generation works. It says the code is implemented based on TMN and GraphWriter-DGL, but I've noticed that the code is the exactly same to TMN without any new content or changes. I guess you didn't submit the latest version of the code correctly. LOL.

If you could share the latest version of your code that implements CNG module, it would be very much appreciated. Thanks a lot!

README?

Do you have a README file for using the code?

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.