Skip to content

PyTorch implementation for the paper Classification from Positive, Unlabeled and Biased Negative Data.

Notifications You must be signed in to change notification settings

kangISU/PUbiasedN

 
 

Repository files navigation

PUbiasedN

PyTorch implementation for experiments in the paper Classification from Positive, Unlabeled and Biased Negative Data.

Requirements

  1. Python >= 3.6
  2. PyTorch >= 0.4.0, scikit-learn, NumPy
  3. yaml to load parameters
  4. nltk, allennlp, h5py to prepare the 20newsgroups ELMO embedding

Usage

The file pu_biased_n.py allows to reproduce most of the experimental results described in the paper:

python(3) pu_biased_n.py --dataset [dataset] --params-path [parameter-path] --random-seed [random-seed]

where dataset is either mnist, cifar10 or newsgroups and parameter-path is a yml file containing the hyperparameters of the experiment. The hyperparameter files used for the results shown in Table 1 can be found under the params/ directory.

20newgroups preprocessing

To prepare the ELMO embedding of the 20newsgroups dataset. Please download the ELMO 5.5B pre-trained model from https://allennlp.org/elmo (elmo_2x4096_512_2048cnn_2xhighway_5.5B_weights) and put it under data/20newsgroups/; then run the two files train_elmo_prepare.py and test_elmo_prepare.py located in this same directory.

About

PyTorch implementation for the paper Classification from Positive, Unlabeled and Biased Negative Data.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages

  • Python 100.0%