Giter Club home page Giter Club logo

pubiasedn's Introduction

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.

pubiasedn's People

Contributors

cyber-meow avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

pubiasedn's Issues

documentation on packages used

Thank you for putting this repository together.

I am having trouble running train_elmo_prepare.py to prepare the embeddings for the newsgroup experiment, which is seemed to be caused by conflicts in package versions, particularly in the allennlp and torch packages.

Would it be possible to add a requirements.txt, or for you to outline what package-versions you used?

Replicating 20 Newsgroups

I am trying to replicate the 20 newsgroups results in this paper. If I am understanding the code correctly, the program is expecting the feature vectors in h5py files. I do not see the code automatically generating these files or instructions how to create them ourselves. Do you have any details you could share on this?

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.