Code Monkey home page Code Monkey logo

iswc2020_prodcls's Introduction

iswc2020_prodcls

ISWC2020 Semantic Web Challenge - Product Classification Top1 Solution

Solution

Overall Framework

framework

  1. Train 17 different BERT base models with dynamic masked softmax
  2. Adopt a two-level ensemble strategy to combine the single models
  3. Utilize pseudo labeling for data augmentation

Base Model Construction

model

  • BERT-PO uses the pooler output of BERT as the product representation.
  • BERT-K-hidden concatenates the first hidden state from the last $K$ hidden layers of BERT as the product representation.
  • BERT-K-hidden-PO concatenates the first hidden state from the last $K$ hidden layers as well as the pooler output of BERT as the product representation.
  • BERT-seq uses the hidden states from the last hidden layer of BERT as the input of another sequence layer, and then concatenates the pooler output of BERT, with the last hidden output as well as the max-pooling and mean-pooling over the hidden states of sequence layer, as the final product representation.

Dynamic Masked Softmax

  1. Devise a mask matrix for each sub-level based on the category hierarchy
    $$ M^{l} \in{0,1}^{N^{l-1} * N^{l}} $$
  2. Adopt dynamic masked softmax to filter out the unrelated categories
    $$ P\left(y_{v}^{l} \mid s, \theta\right)=\frac{\exp \left(O_{v}^{l}\right) * M_{u, v}^{l}+\exp (-8)}{\sum_{v^{\prime}=1}^{N} \exp \left(O_{v^{\prime}}^{l}\right) * M_{u, v^{\prime}}^{l}+\exp (-8)} $$

Model Ensemble

  1. Averaging ensemble to the single models with the same architecture but trained on different folds of data
  2. Voting ensemble to 17 different single models

Pseudo Labeling

pseudo-labelding

Experiment

Environment Preparation

pip install virtualenv
virtualenv tf2
source tf2/bin/activate
pip install -r requirements.txt

Data Preparation

  1. dataset
    Download the dataset below, put them in the raw_data dir:

  2. pre-trained BERT model Download the files of BERT model, put them in the raw_data/embeddings/bert-base-uncased dir:

Pre-processing

python preprocess.py

(1st) Training

python train.py

(1st) Ensemble and Pseudo Labeling

python ensemble.py

(2nd) Re-training with Pseudo Labels

python train_pseudo_label.py

(2nd) Re-ensemble

python ensemble_pseudo_label.py

iswc2020_prodcls's People

Contributors

alexyangli avatar

Stargazers

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

Watchers

 avatar  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.