avinsit123 / Keyphrase-Generation-GANs

Contains code for generating key phrases using GANs

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Keyphrase-Generation-GANs

Contains code for generating key phrases using GANs

Instructions

Download the following data folder and Model checkpoints folder and unzip it and insert it in this repo in your local system.The Data Folder contains around 2000 samples from the kp20k data folder . In order to train the Discriminator run hierarchal_attention_Discriminator_training.py . All the Discriminator checkpoints will be created in the folder Discriminator_checkpts . You can test the strength of the Dicriminator by running hierarchal_attention_Discriminator_training_f1score.py . Currently the program supports running on cpu . In order to run it on device of your choice change the devices variable in each python file

  1. Discriminator_individual.py : A Discriminator which only identifies keyphrases as human readable or not human readable.
  2. Discriminator_training_individual.py: Training a Discriminator which only identifies keyphrases as human readable or not human readable.
  3. Discriminator_training.py: Training a Discriminator which assigns a score to keyphrase indicating whether it can be assigned to an abstract.
  4. Discriminator.py : a Discriminator which assigns a score to keyphrase indicating whether it can be assigned to an abstract
  5. RLtraining(with 2 Discriminators).py : The reward is calculated as adding the scores and then from 2 discriminators we use the reward for reinforcement learning.
  6. RLtraining1_individual.py : The reward is calculated as taking reward from the Discriminator_individual only
  7. RLtraining(with 2 Discriminators and f1 scores).py : The reward is calculated by adding rewards from both the discriminators and also adding the f1 score of the generated keyphrase string.

About

Contains code for generating key phrases using GANs


Languages

Language:Python 100.0%