Coder Social home page Coder Social logo

subatt's Introduction

SubAtt

Implementation of SubAtt. For more information, see our paper : https://aclanthology.org/2023.findings-acl.221/

Quick Usage:

  1. Build a corpus using preprocess from https://github.com/timoschick/form-context-model.

  2. Call split_vocabulary_into_train_and_val.py on the preprocessed corpus folder to create a dict that splits training and validation words.

  3. Train subword embeddings using train_torch_subwords.py

  4. Train SubAtt model using train_SubAtt_All_Versions.py

  5. Use trained model to predict new embeddings using its estimate_vector() and estimate_multiple_vectors() functions. Note: ANY input with zero subwords or contexts will currently lead to shape issues, so be sure to check for this before using these methods.

Some Examples:

python3 split_vocabulary_into_train_and_val.py $TrainCorpus #Step 2, creates TRAIN_VAL_DICT file

python3 train_torch_subwords.py $SubwordOutputDir $TrainCorpus $WordEmbs 30 0.7 1 64 1e-2 0 25 0 100 $TRAIN_VAL_DICT #Step 3

python3 train_SubAtt_All_Versions.py Pretrain_SubAtt $ModelOutputDir $TrainCorpus $SubwordOutputDir $WordEmbs 30 0.7 1 64 1e-4 0 25 0 100 8 fast 768 12 #Step 4

subatt's People

Contributors

rajicon avatar

Watchers

 avatar

subatt's Issues

issue with Subword_Torch

Hello,

While following the instructions in the README.md to Step 3, I noticed that the "train_torch_subwords.py" script references a "Subword_Torch" model class, which does not seem to be defined in the codebase.

I suspect there might be a missing class definition or a typo in the class name.

Could you please give me some advice about how to resolve this issue?

Thank you for your time and patience.

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.