All Projects → zhuchen03 → Freelb

zhuchen03 / Freelb

Adversarial Training for Natural Language Understanding

Programming Languages

python
139335 projects - #7 most used programming language

Projects that are alternatives of or similar to Freelb

When
A natural language date/time parser with pluggable rules
Stars: ✭ 1,113 (+657.14%)
Mutual labels:  natural-language
Assistantjs
TypeScript framework to build cross-platform voice applications (alexa, google home, ...).
Stars: ✭ 100 (-31.97%)
Mutual labels:  natural-language
Nlcst
Natural Language Concrete Syntax Tree format
Stars: ✭ 116 (-21.09%)
Mutual labels:  natural-language
Rasa nlu chi
Turn Chinese natural language into structured data 中文自然语言理解
Stars: ✭ 1,166 (+693.2%)
Mutual labels:  natural-language
Forte
Forte is a flexible and powerful NLP builder FOR TExt. This is part of the CASL project: http://casl-project.ai/
Stars: ✭ 89 (-39.46%)
Mutual labels:  natural-language
Getlang
Natural language detection package in pure Go
Stars: ✭ 110 (-25.17%)
Mutual labels:  natural-language
Shift Ctrl F
🔎 Search the information available on a webpage using natural language instead of an exact string match.
Stars: ✭ 1,023 (+595.92%)
Mutual labels:  natural-language
Parse English
English (natural language) parser
Stars: ✭ 137 (-6.8%)
Mutual labels:  natural-language
Tagan
An official PyTorch implementation of the paper "Text-Adaptive Generative Adversarial Networks: Manipulating Images with Natural Language", NeurIPS 2018
Stars: ✭ 97 (-34.01%)
Mutual labels:  natural-language
Nodejs Language
Node.js client for Google Cloud Natural Language: Derive insights from unstructured text using Google machine learning.
Stars: ✭ 113 (-23.13%)
Mutual labels:  natural-language
Cognitive Social Crm
An application that monitors a Twitter feed and determines customer sentiment using IBM Watson Assistant, Tone Analyzer, Natural Language Understanding, as well as CloudantDB
Stars: ✭ 71 (-51.7%)
Mutual labels:  natural-language
Stemmer
Fast Porter stemmer implementation
Stars: ✭ 86 (-41.5%)
Mutual labels:  natural-language
Natural logic interpreter
Automatically interpret and validate nested natural logic arguments based on rules of inference and propositional logic
Stars: ✭ 110 (-25.17%)
Mutual labels:  natural-language
Text Analytics With Python
Learn how to process, classify, cluster, summarize, understand syntax, semantics and sentiment of text data with the power of Python! This repository contains code and datasets used in my book, "Text Analytics with Python" published by Apress/Springer.
Stars: ✭ 1,132 (+670.07%)
Mutual labels:  natural-language
Pytextrank
Python implementation of TextRank for phrase extraction and summarization of text documents
Stars: ✭ 1,675 (+1039.46%)
Mutual labels:  natural-language
Bert In Production
A collection of resources on using BERT (https://arxiv.org/abs/1810.04805 ) and related Language Models in production environments.
Stars: ✭ 58 (-60.54%)
Mutual labels:  natural-language
Node Sdk
☄️ Node.js library to access IBM Watson services.
Stars: ✭ 1,471 (+900.68%)
Mutual labels:  natural-language
Natural Regex
Create regex from natural language
Stars: ✭ 147 (+0%)
Mutual labels:  natural-language
Retext Equality
plugin to check for possible insensitive, inconsiderate language
Stars: ✭ 118 (-19.73%)
Mutual labels:  natural-language
Ai Chatbot Framework
A python chatbot framework with Natural Language Understanding and Artificial Intelligence.
Stars: ✭ 1,564 (+963.95%)
Mutual labels:  natural-language

Introduction

This repository contains the implementation for FreeLB on GLUE tasks based on both fairseq and HuggingFace's transformers libraries, under ./fairseq-RoBERTa/ and ./huggingface-transformers/ respectively. We also integrated our implementations of vanilla PGD, FreeAT and YOPO in our fairseq version. FreeLB is an adversarial training approach for improving transformer-based language models on Natural Language Understanding tasks. It accumulates the gradient in the ascent steps and updates the parameters with the accumulated gradients, which is approximately equivalent to enlarging the batch size with diversified adversarial examples within different radiuses around the clean input. FreeLB improves the performance of BERT and RoBERTa on various Natural Language Understanding tasks including Question Answering, Natural Language Inference, and Sentiment Analysis.

For technical details and additional experimental results, please refer to our paper:

Chen Zhu, Yu Cheng, Zhe Gan, Siqi Sun, Tom Goldstein, and Jingjing Liu. FreeLB: Enhanced Adversarial Training for Language Understanding. In ICLR, 2020.

What's New

  • Feb 15, 2020: Initial release of FreeLB based on fairseq and HuggingFace's transformers. The first one contains our implementations of FreeLB, FreeAT, YOPO for RoBERTa, while the latter one is FreeLB for ALBERT.

  • May 16, 2020: Hyperparameters for ALBERT are now available at huggingface-transformers/launch/run_glue.sh.

Prerequisites

The code is compatible with PyTorch 1.4.0. In addition, you need to execute the followings in order, to install the prerequisites for fairseq and HuggingFace's transformers:

# Install apex
git clone https://github.com/NVIDIA/apex
cd apex
pip install -v --no-cache-dir --global-option="--cpp_ext" --global-option="--cuda_ext" ./

# Configure fairseq
cd ../fairseq-RoBERTa
pip install --editable .

# Download and pre-process GLUE data
wget https://gist.githubusercontent.com/W4ngatang/60c2bdb54d156a41194446737ce03e2e/raw/17b8dd0d724281ed7c3b2aeeda662b92809aadd5/download_glue_data.py
python download_glue_data.py --data_dir glue_data --tasks all
source ./examples/roberta/preprocess_GLUE_tasks.sh glue_data ALL

cd ../huggingface-transformers
pip install --editable .
mkdir logs

Launch

The launch scripts are under ./fairseq-RoBERTa/launch/ and ./huggingface-transformers/launch/, where we have included most of the running scripts for RoBERTa and ALBERT on GLUE dev sets. We will release more details in the future.

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].