Code for using and evaluating SpanBERT.

Overview

SpanBERT

This repository contains code and models for the paper: SpanBERT: Improving Pre-training by Representing and Predicting Spans. If you prefer to use Huggingface, please check out this link -- https://huggingface.co/SpanBERT

Requirements

Apex

Please use an earlier commit of Apex - NVIDIA/apex@4a8c4ac

Pre-trained Models

We release both base and large cased models for SpanBERT. The base & large models have the same model configuration as BERT but they differ in both the masking scheme and the training objectives (see our paper for more details).

These models have the same format as the HuggingFace BERT models, so you can easily replace them with our SpanBET models. If you would like to use our fine-tuning code, the model paths are already hard-coded in the code :)

SQuAD 1.1 SQuAD 2.0 Coref TACRED
F1 F1 avg. F1 F1
BERT (base) 88.5* 76.5* 73.1 67.7
SpanBERT (base) 92.4* 83.6* 77.4 68.2
BERT (large) 91.3 83.3 77.1 66.4
SpanBERT (large) 94.6 88.7 79.6 70.8

Note: The numbers marked as * are evaluated on the development sets because we didn't submit those models to the official SQuAD leaderboard. All the other numbers are test numbers.

Fine-tuning

SQuAD 1.1

python code/run_squad.py \
  --do_train \
  --do_eval \
  --model spanbert-base-cased \
  --train_file train-v1.1.json \
  --dev_file dev-v1.1.json \
  --train_batch_size 32 \
  --eval_batch_size 32  \
  --learning_rate 2e-5 \
  --num_train_epochs 4 \
  --max_seq_length 512 \
  --doc_stride 128 \
  --eval_metric f1 \
  --output_dir squad_output \
  --fp16

SQuAD 2.0

python code/run_squad.py \
  --do_train \
  --do_eval \
  --model spanbert-base-cased \
  --train_file train-v2.0.json \
  --dev_file dev-v2.0.json \
  --train_batch_size 32 \
  --eval_batch_size 32  \
  --learning_rate 2e-5 \
  --num_train_epochs 4 \
  --max_seq_length 512 \
  --doc_stride 128 \
  --eval_metric best_f1 \
  --output_dir squad2_output \
  --version_2_with_negative \
  --fp16

TACRED

python code/run_tacred.py \
  --do_train \
  --do_eval \
  --data_dir <TACRED_DATA_DIR> \
  --model spanbert-base-cased \
  --train_batch_size 32 \
  --eval_batch_size 32 \
  --learning_rate 2e-5 \
  --num_train_epochs 10 \
  --max_seq_length 128 \
  --output_dir tacred_dir \
  --fp16

MRQA (NewsQA, TriviaQA, SearchQA, HotpotQA, NaturalQuestions)

python code/run_mrqa.py \
  --do_train \
  --do_eval \
  --model spanbert-base-cased \
  --train_file TriviaQA-train.jsonl.gz \
  --dev_file TriviaQA-dev.jsonl.gz \
  --train_batch_size 32 \
  --eval_batch_size 32 \
  --learning_rate 2e-5 \
  --num_train_epochs 4 \
  --max_seq_length 512 \
  --doc_stride 128 \
  --eval_per_epoch 5 \
  --output_dir triviaqa_dir \
  --fp16

GLUE

python code/run_glue.py \
   --task_name RTE \
   --model spanbert-base-cased \
   --do_train \
   --do_eval \
   --data_dir <RTE_DATA_DIR> \
   --train_batch_size 32 \
   --eval_batch_size 32 \
   --num_train_epochs 10  \
   --max_seq_length 128 \
   --learning_rate 2e-5 \
   --output_dir RTE_DIR \
   --fp16

Coreference Resolution

Our coreference resolution fine-tuning code is implemented in Tensorflow. Please see https://github.com/mandarjoshi90/coref for more details.

Finetuned Models (SQuAD 1.1/2.0, Relation Extraction, Coreference Resolution)

If you are interested in using our fine-tuned models for downstream tasks, directly, please use the following script.

./code/download_finetuned.sh <model_dir> <task>

where <task> is one of [squad1, squad2, tacred]. You can evaluate the models by setting --do_train to false, --do_eval to true, and --output_dir to <model_dir>/<task> in python code/run_<task>.py.

For coreference resolution, please refer to this repository -- https://github.com/mandarjoshi90/coref

Citation

  @article{joshi2019spanbert,
      title={{SpanBERT}: Improving Pre-training by Representing and Predicting Spans},
      author={Mandar Joshi and Danqi Chen and Yinhan Liu and Daniel S. Weld and Luke Zettlemoyer and Omer Levy},
      journal={arXiv preprint arXiv:1907.10529},
      year={2019}
    }

License

SpanBERT is CC-BY-NC 4.0. The license applies to the pre-trained models as well.

Contact

If you have any questions, please contact Mandar Joshi <[email protected]> or Danqi Chen <[email protected]> or create a Github issue.

Comments
  • Original Pre-trained Model

    Original Pre-trained Model

    Hey I am wondering if it is possible to release the original pretrained model with some parameters of LM head prediction, such as linear layers, instead of the current version (drop those parameters off).

    opened by Impavidity 14
  • Using SpanBERT to predict spans

    Using SpanBERT to predict spans

    Hi, I maintain FitBERT, a library that uses BERT to fill in the blanks (do masked language modeling). An example:

    from fitbert import FitBert
    
    
    # in theory you can pass a model_name and tokenizer
    # currently supported models: bert-large-uncased and distilbert-base-uncased
    # this takes a while and loads a whole big BERT into memory
    fb = FitBert()
    
    masked_string = "Why Bert, you're looking ***mask*** today!"
    options = ['buff', 'handsome', 'strong']
    
    ranked_options = fb.rank(masked_string, options=options)
    # >>> ['handsome', 'strong', 'buff']
    

    I think that SpanBERT should be an improvement to using BERT when the mask covers more than 1 token. However, I am not seeing SBO anywhere in this code. Is it not released? Should I just mask sequential tokens and hope that the model is better at predicting them?

    Also, since you don't do NSP, does the [SEP] tag have any meaning? If not, is there no special EOS token?

    Thanks so much!

    opened by sam-writer 14
  • Apex ModuleNotFoundError: 'fused_adam_cuda'

    Apex ModuleNotFoundError: 'fused_adam_cuda'

    I am using the same python packages as specified in requirements.txt and README (apex@4a8c4ac). Python version 3.6.10 I get the following error after running the SQuAD 2.0 command about 10 minutes in.

    05/06/2020 08:17:34 - INFO - pytorch_pretrained_bert.modeling - Weights of BertForQuestionAnswering not initialized from pretrained model: ['bert.pooler.dense.weight', 'bert.pooler.dense.bias', 'qa_outputs.weight', 'qa_outputs.bias']
    Traceback (most recent call last):
      File "code/run_squad.py", line 1138, in <module>
        main(args)
      File "code/run_squad.py", line 947, in main
        max_grad_norm=1.0)
      File "/home/user/.conda3/envs/spanbert/lib/python3.6/site-packages/apex-0.1-py3.6.egg/apex/optimizers/fused_adam.py", line 40, in __init__
      File "/home/user/.conda3/envs/spanbert/lib/python3.6/importlib/__init__.py", line 126, in import_module
        return _bootstrap._gcd_import(name[level:], package, level)
      File "<frozen importlib._bootstrap>", line 994, in _gcd_import
      File "<frozen importlib._bootstrap>", line 971, in _find_and_load
      File "<frozen importlib._bootstrap>", line 953, in _find_and_load_unlocked
    ModuleNotFoundError: No module named 'fused_adam_cuda'
    
    opened by kaniblu 13
  • TACRED train F1

    TACRED train F1

    I'm confused about how SpanBERT fit the training set.

    I replaced this line: https://github.com/facebookresearch/SpanBERT/blob/master/code/run_tacred.py#L337

    eval_examples = processor.get_dev_examples(args.data_dir)
    

    with

    eval_examples = processor.get_train_examples(args.data_dir)
    

    The training F1 is very low

    accuracy = 0.8149991192531266 eval_loss = 1.294708618564385 f1 = 0.09820465025017167 n_correct = 1001 n_gold = 13012 n_pred = 7374 num = 68124 precision = 0.13574721996202874 recall = 0.07692898862588379

    opened by WindChimeRan 6
  • Merging with transformers library -- Random results

    Merging with transformers library -- Random results

    I just wanted to check if you are planning on merging this with the transformers library since that would make it immensely easier to use. For now, just extracting the archive and calling the Bert APIs has worked for me but the solution feels inelegant as I have to download the model separately. Surprisingly, loading the BertModel using this codebase and the tokenizer using the transformers library results in random results across runs (with the same batch order and content). Can't really point out where the issue is for now!

    opened by shtoshni 6
  • Migrating to HuggingFace's Transformers

    Migrating to HuggingFace's Transformers

    I'm trying to convert the run_tacred.ty to a Huggingface's Transformers compatible version. I load the SpanBERT fine-tuned model for tacred and tokenizer using the following code:

    from transformers import AutoTokenizer, AutoModel
    
    tokenizer = AutoTokenizer.from_pretrained("SpanBERT/spanbert-base-cased")
    model = AutoModel.from_pretrained("SpanBERT/spanbert-base-cased")
    

    But at the evaluation time, when I get to the following section:

    with torch.no_grad():
         logits = model(input_ids, segment_ids, input_mask)
    loss_fct = CrossEntropyLoss()
    tmp_eval_loss = loss_fct(logits.view(-1, num_labels), label_ids.view(-1))
    

    I get the following error:

    AttributeError: 'tuple' object has no attribute 'view'

    which means the output of the model, logits, is not a torch tensor. I'm trying to figure out what the correct size of logits is for the loss_fct function. logits has two elements where each of them is torch.Size([32, 128, 1024]) where 32 is the batch size. label_ids here is also torch.Size([32]).

    Based on the dimensions, I tried the following for the loss_fct based on the acceptable input dimension for loss_fct:

    tmp_eval_loss = loss_fct(logits[0].view(list(input_ids.size())[0], -1), label_ids.view(-1))

    which even though passes the computing loss function step, it throws an error in compute_f1 since we'll have the preds of size (n, 1024) where n is the total number of data points we are evaluating while the labels's size is n.

    I wonder how should I set the dimensions?

    opened by phosseini 5
  • Performance when fine-tuning on TACRED

    Performance when fine-tuning on TACRED

    Hi, thanks for the great work!

    I'm trying to replicate the relation extraction results on TACRED but haven't succeeded yet. Currently I'm unable to achieve an F1 score above 67.2, so I want to clarify a few things.

    NVIDIA Apex

    The first issue (which applies to all tasks) regards NVIDIA Apex. Due to Apex transitioning to the new amp API, commit #512 moved FP16_Optimizer and FusedAdam to the apex.contrib module. Users that compiled Apex from the latest master and want to use SpanBERT's --fp16 get an exception "Please install apex from [...]", because the import of FP16_Optimizer and FusedAdam fails (e.g. in run_tacred.py).

    As a temporary solution, I resorted to an earlier commit (#424) of Apex without these breaking changes. Can you specify the commit you used to compile Apex?

    Fine-tuning

    For fine-tuning on TACRED, I used the following configuration (based on the README and what I gathered from the paper).

    python code/run_tacred.py \
      --do_train \
      --do_eval \
      --data_dir <TACRED_DATA_DIR> \
      --model spanbert-base-cased \
      --train_batch_size 32 \
      --eval_batch_size 32 \
      --learning_rate 2e-5 \
      --num_train_epochs 10 \
      --max_seq_length 128 \
      --output_dir tacred_dir \
      --fp16
    

    Namespace object written to the training logs:

    Namespace(data_dir='../relex-data/tacred/', do_eval=True, do_lower_case=False, do_train=True, eval_batch_size=32, eval_metric='f1', eval_per_epoch=10, eval_test=False, feature_mode='ner', fp16=True, gradient_accumulation_steps=1, learning_rate=2e-05, loss_scale=0, max_seq_length=128, model='spanbert-base-cased', negative_label='no_relation', no_cuda=False, num_train_epochs=10.0, output_dir='model_save', seed=42, train_batch_size=32, train_mode='random_sorted', warmup_proportion=0.1)
    

    eval_results.txt

    accuracy = 0.8535636958154743
    batch_size = 32
    epoch = 8
    eval_loss = 0.7800797500179313
    f1 = 0.6727970716900277
    global_step = 18728
    learning_rate = 2e-05
    precision = 0.6535993061578491
    recall = 0.6931567328918322
    

    Test set results (test_results.txt, after running run_tacred.py with eval_test=True):

    accuracy = 0.8534311342848305
    eval_loss = 0.7800683651940298
    f1 = 0.6725
    precision = 0.6533657182512145
    recall = 0.6927888153053716
    
    • Can you confirm that this is the same configuration used to produce the results stated in the paper?
    • Are there plans to make the fine-tuned TACRED model publicly available?
    opened by ChristophAlt 5
  • fixed typo when loading from_tf

    fixed typo when loading from_tf

    A typo at https://github.com/facebookresearch/SpanBERT/blob/10641ea3795771dd96e9e3e9ef0ead4f4f6a29d2/code/pytorch_pretrained_bert/modeling.py#L551 will make people confused when loading model from_tf checkpoint.

    And fixed it according to this line https://github.com/facebookresearch/SpanBERT/blob/10641ea3795771dd96e9e3e9ef0ead4f4f6a29d2/code/pytorch_pretrained_bert/modeling.py#L50

    CLA Signed 
    opened by oushu1zhangxiangxuan1 4
  • How do I load the pretrained model?

    How do I load the pretrained model?

    I downloaded the spanbert_hf_base.tar file and when I load it torch.load(spanbert_hf_base.tar), it gave me the error KeyError: "filename 'storages' not found". How do I properly load the pretrained model? Thanks

    opened by jiajinghu19 4
  • Prepare training data

    Prepare training data

    I tried to train using run_mrqa.py with the json files (by changing the read files codes). However, I am unable to proceed further. Any help would be appreciated. Please share the preparation for HotpotQA dataset using SpanBERT.

    opened by saravananpsg 4
  • unexpected keyword argument `max_grad_norm` in `run_squad.py`

    unexpected keyword argument `max_grad_norm` in `run_squad.py`

    Training SQuAD 2.0 with the command given in README.md raises following error

    Traceback (most recent call last):
      File "code/run_squad.py", line 1138, in <module>
        main(args)
      File "code/run_squad.py", line 947, in main
        max_grad_norm=1.0)
    TypeError: __init__() got an unexpected keyword argument 'max_grad_norm'
    

    According to https://nvidia.github.io/apex/optimizers.html FusedAdam doesn't take a max_grad_norm argument.

    opened by Dobatymo 4
  • Bump certifi from 2019.9.11 to 2022.12.7

    Bump certifi from 2019.9.11 to 2022.12.7

    Bumps certifi from 2019.9.11 to 2022.12.7.

    Commits

    Dependabot compatibility score

    Dependabot will resolve any conflicts with this PR as long as you don't alter it yourself. You can also trigger a rebase manually by commenting @dependabot rebase.


    Dependabot commands and options

    You can trigger Dependabot actions by commenting on this PR:

    • @dependabot rebase will rebase this PR
    • @dependabot recreate will recreate this PR, overwriting any edits that have been made to it
    • @dependabot merge will merge this PR after your CI passes on it
    • @dependabot squash and merge will squash and merge this PR after your CI passes on it
    • @dependabot cancel merge will cancel a previously requested merge and block automerging
    • @dependabot reopen will reopen this PR if it is closed
    • @dependabot close will close this PR and stop Dependabot recreating it. You can achieve the same result by closing it manually
    • @dependabot ignore this major version will close this PR and stop Dependabot creating any more for this major version (unless you reopen the PR or upgrade to it yourself)
    • @dependabot ignore this minor version will close this PR and stop Dependabot creating any more for this minor version (unless you reopen the PR or upgrade to it yourself)
    • @dependabot ignore this dependency will close this PR and stop Dependabot creating any more for this dependency (unless you reopen the PR or upgrade to it yourself)
    • @dependabot use these labels will set the current labels as the default for future PRs for this repo and language
    • @dependabot use these reviewers will set the current reviewers as the default for future PRs for this repo and language
    • @dependabot use these assignees will set the current assignees as the default for future PRs for this repo and language
    • @dependabot use this milestone will set the current milestone as the default for future PRs for this repo and language

    You can disable automated security fix PRs for this repo from the Security Alerts page.

    CLA Signed dependencies 
    opened by dependabot[bot] 0
  • Use spanbert model for Named Entity Recognition to predict on data

    Use spanbert model for Named Entity Recognition to predict on data

    I am using spanbert model ( I do not fine-tune it) downloaded from https://github.com/facebookresearch/SpanBERT to test it on some text samples.

    The result I get is in this format using HF:

    token_classifier = pipeline("token-classification", model=model, aggregation_strategy="max",tokenizer=tokenizer,grouped_entities=True)

    Label_0, Label_1 How to map these Labels to entity names? Is there any function, documents where it mentions about entity type mapping?

    ​ ​

    opened by pratikchhapolika 0
  • Bump pillow from 6.1.0 to 9.3.0

    Bump pillow from 6.1.0 to 9.3.0

    Bumps pillow from 6.1.0 to 9.3.0.

    Release notes

    Sourced from pillow's releases.

    9.3.0

    https://pillow.readthedocs.io/en/stable/releasenotes/9.3.0.html

    Changes

    ... (truncated)

    Changelog

    Sourced from pillow's changelog.

    9.3.0 (2022-10-29)

    • Limit SAMPLESPERPIXEL to avoid runtime DOS #6700 [wiredfool]

    • Initialize libtiff buffer when saving #6699 [radarhere]

    • Inline fname2char to fix memory leak #6329 [nulano]

    • Fix memory leaks related to text features #6330 [nulano]

    • Use double quotes for version check on old CPython on Windows #6695 [hugovk]

    • Remove backup implementation of Round for Windows platforms #6693 [cgohlke]

    • Fixed set_variation_by_name offset #6445 [radarhere]

    • Fix malloc in _imagingft.c:font_setvaraxes #6690 [cgohlke]

    • Release Python GIL when converting images using matrix operations #6418 [hmaarrfk]

    • Added ExifTags enums #6630 [radarhere]

    • Do not modify previous frame when calculating delta in PNG #6683 [radarhere]

    • Added support for reading BMP images with RLE4 compression #6674 [npjg, radarhere]

    • Decode JPEG compressed BLP1 data in original mode #6678 [radarhere]

    • Added GPS TIFF tag info #6661 [radarhere]

    • Added conversion between RGB/RGBA/RGBX and LAB #6647 [radarhere]

    • Do not attempt normalization if mode is already normal #6644 [radarhere]

    ... (truncated)

    Commits

    Dependabot compatibility score

    Dependabot will resolve any conflicts with this PR as long as you don't alter it yourself. You can also trigger a rebase manually by commenting @dependabot rebase.


    Dependabot commands and options

    You can trigger Dependabot actions by commenting on this PR:

    • @dependabot rebase will rebase this PR
    • @dependabot recreate will recreate this PR, overwriting any edits that have been made to it
    • @dependabot merge will merge this PR after your CI passes on it
    • @dependabot squash and merge will squash and merge this PR after your CI passes on it
    • @dependabot cancel merge will cancel a previously requested merge and block automerging
    • @dependabot reopen will reopen this PR if it is closed
    • @dependabot close will close this PR and stop Dependabot recreating it. You can achieve the same result by closing it manually
    • @dependabot ignore this major version will close this PR and stop Dependabot creating any more for this major version (unless you reopen the PR or upgrade to it yourself)
    • @dependabot ignore this minor version will close this PR and stop Dependabot creating any more for this minor version (unless you reopen the PR or upgrade to it yourself)
    • @dependabot ignore this dependency will close this PR and stop Dependabot creating any more for this dependency (unless you reopen the PR or upgrade to it yourself)
    • @dependabot use these labels will set the current labels as the default for future PRs for this repo and language
    • @dependabot use these reviewers will set the current reviewers as the default for future PRs for this repo and language
    • @dependabot use these assignees will set the current assignees as the default for future PRs for this repo and language
    • @dependabot use this milestone will set the current milestone as the default for future PRs for this repo and language

    You can disable automated security fix PRs for this repo from the Security Alerts page.

    CLA Signed dependencies 
    opened by dependabot[bot] 0
  • pretrained model

    pretrained model

    I have trained a pretrained bert model, but I feel that many weights are not well trained. As a result, the output of different input texts is almost similar, and the difference may only be 7 decimal places behind. What is the cause

    opened by zhouzhong150 0
  • CVE-2007-4559 Patch

    CVE-2007-4559 Patch

    Patching CVE-2007-4559

    Hi, we are security researchers from the Advanced Research Center at Trellix. We have began a campaign to patch a widespread bug named CVE-2007-4559. CVE-2007-4559 is a 15 year old bug in the Python tarfile package. By using extract() or extractall() on a tarfile object without sanitizing input, a maliciously crafted .tar file could perform a directory path traversal attack. We found at least one unsantized extractall() in your codebase and are providing a patch for you via pull request. The patch essentially checks to see if all tarfile members will be extracted safely and throws an exception otherwise. We encourage you to use this patch or your own solution to secure against CVE-2007-4559. Further technical information about the vulnerability can be found in this blog.

    If you have further questions you may contact us through this projects lead researcher Kasimir Schulz.

    opened by TrellixVulnTeam 0
  • How to train model by changing the number of layers in the model?

    How to train model by changing the number of layers in the model?

    I want to train spanBert from scratch, for contextual span embedding. The architecture is quite large and I think only three layers will suffice for my task. Please help me with how can I reduce the size of the architecture and train it on the objective of spanbert. Thanks

    opened by RAJA-PARIKSHAT 0
Owner
Meta Research
Meta Research
A framework for training and evaluating AI models on a variety of openly available dialogue datasets.

ParlAI (pronounced “par-lay”) is a python framework for sharing, training and testing dialogue models, from open-domain chitchat, to task-oriented dia

Facebook Research 7k Feb 18, 2021
CrossNER: Evaluating Cross-Domain Named Entity Recognition (AAAI-2021)

CrossNER is a fully-labeled collected of named entity recognition (NER) data spanning over five diverse domains (Politics, Natural Science, Music, Literature, and Artificial Intelligence) with specialized entity categories for different domains.

Zihan Liu 89 Nov 10, 2022
Simple tool/toolkit for evaluating NLG (Natural Language Generation) offering various automated metrics.

Simple tool/toolkit for evaluating NLG (Natural Language Generation) offering various automated metrics. Jury offers a smooth and easy-to-use interface. It uses datasets for underlying metric computation, and hence adding custom metric is easy as adopting datasets.Metric.

Open Business Software Solutions 129 Jan 6, 2023
A framework for evaluating Knowledge Graph Embedding Models in a fine-grained manner.

A framework for evaluating Knowledge Graph Embedding Models in a fine-grained manner.

NEC Laboratories Europe 13 Sep 8, 2022
One Stop Anomaly Shop: Anomaly detection using two-phase approach: (a) pre-labeling using statistics, Natural Language Processing and static rules; (b) anomaly scoring using supervised and unsupervised machine learning.

One Stop Anomaly Shop (OSAS) Quick start guide Step 1: Get/build the docker image Option 1: Use precompiled image (might not reflect latest changes):

Adobe, Inc. 148 Dec 26, 2022
A python script to prefab your scripts/text files, and re create them with ease and not have to open your browser to copy code or write code yourself

Scriptfab - What is it? A python script to prefab your scripts/text files, and re create them with ease and not have to open your browser to copy code

DevNugget 3 Jul 28, 2021
This repository contains all the source code that is needed for the project : An Efficient Pipeline For Bloom’s Taxonomy Using Natural Language Processing and Deep Learning

Pipeline For NLP with Bloom's Taxonomy Using Improved Question Classification and Question Generation using Deep Learning This repository contains all

Rohan Mathur 9 Jul 17, 2021
Source code for CsiNet and CRNet using Fully Connected Layer-Shared feedback architecture.

FCS-applications Source code for CsiNet and CRNet using the Fully Connected Layer-Shared feedback architecture. Introduction This repository contains

Boyuan Zhang 4 Oct 7, 2022
This repository details the steps in creating a Part of Speech tagger using Trigram Hidden Markov Models and the Viterbi Algorithm without using external libraries.

POS-Tagger This repository details the creation of a Part-of-Speech tagger using Trigram Hidden Markov Models to predict word tags in a word sequence.

Raihan Ahmed 1 Dec 9, 2021
Creating an Audiobook (mp3 file) using a Ebook (epub) using BeautifulSoup and Google Text to Speech

epub2audiobook Creating an Audiobook (mp3 file) using a Ebook (epub) using BeautifulSoup and Google Text to Speech Input examples qual a pasta do seu

null 7 Aug 25, 2022
Code examples for my Write Better Python Code series on YouTube.

Write Better Python Code This repository contains the code examples used in my Write Better Python Code series published on YouTube: https:/

null 858 Dec 29, 2022
Code to use Augmented Shapiro Wilks Stopping, as well as code for the paper "Statistically Signifigant Stopping of Neural Network Training"

This codebase is being actively maintained, please create and issue if you have issues using it Basics All data files are included under losses and ea

Justin Terry 32 Nov 9, 2021
Code for the Python code smells video on the ArjanCodes channel.

7 Python code smells This repository contains the code for the Python code smells video on the ArjanCodes channel (watch the video here). The example

null 55 Dec 29, 2022
Code for CodeT5: a new code-aware pre-trained encoder-decoder model.

CodeT5: Identifier-aware Unified Pre-trained Encoder-Decoder Models for Code Understanding and Generation This is the official PyTorch implementation

Salesforce 564 Jan 8, 2023
Galois is an auto code completer for code editors (or any text editor) based on OpenAI GPT-2.

Galois is an auto code completer for code editors (or any text editor) based on OpenAI GPT-2. It is trained (finetuned) on a curated list of approximately 45K Python (~470MB) files gathered from the Github. Currently, it just works properly on Python but not bad at other languages (thanks to GPT-2's power).

Galois Autocompleter 91 Sep 23, 2022
Code-autocomplete, a code completion plugin for Python

Code AutoComplete code-autocomplete, a code completion plugin for Python.

xuming 13 Jan 7, 2023
Code associated with the "Data Augmentation using Pre-trained Transformer Models" paper

Data Augmentation using Pre-trained Transformer Models Code associated with the Data Augmentation using Pre-trained Transformer Models paper Code cont

null 44 Dec 31, 2022
Simplified diarization pipeline using some pretrained models - audio file to diarized segments in a few lines of code

simple_diarizer Simplified diarization pipeline using some pretrained models. Made to be a simple as possible to go from an input audio file to diariz

Chau 65 Dec 30, 2022