Run this model with HF Jobs

Run iproskurina/tda-bert-en-cola on Hugging Face's managed compute, monitor its progress, and retrieve the results when it's done.

Paste one of these prompts into your coding agent:

Fine-tune on my dataset

Use HF Jobs to fine-tune https://huggingface.co/iproskurina/tda-bert-en-cola. Ask me which dataset to train on, then push the fine-tuned model to a new model repo. Run `hf jobs --help` first to learn the CLI.

Run batch inference

Use HF Jobs to run batch inference with https://huggingface.co/iproskurina/tda-bert-en-cola on the inputs in a mounted HF Bucket. Ask me which Bucket to use, then write the outputs back to it and keep each input ID. Run `hf jobs --help` first to learn the CLI.
How to use from the
Use from the
Transformers library
# Use a pipeline as a high-level helper
from transformers import pipeline

pipe = pipeline("text-classification", model="iproskurina/tda-bert-en-cola")
# pip install -U transformers accelerate
# Load model directly
from transformers import AutoTokenizer, AutoModelForSequenceClassification

tokenizer = AutoTokenizer.from_pretrained("iproskurina/tda-bert-en-cola")
model = AutoModelForSequenceClassification.from_pretrained("iproskurina/tda-bert-en-cola", device_map="auto")
Quick Links

Official repository

BERT-TDA

This model is a version of bert-base-cased fine-tuned on CoLA. It achieves the following results on the evaluation set:

  • Loss: 0.6809
  • Accuracy: 0.8501
  • Mcc: 0.6337

Features extracted from Transformer

The features extracted from attention maps include the following:

  1. Topological features are properties of attention graphs. Features of directed attention graphs include the number of strongly connected components, edges, simple cycles and average vertex degree. The properties of undirected graphs include the first two Betti numbers: the number of connected components and the number of simple cycles, the matching number and the chordality.

  2. Features derived from barcodes include descriptive characteristics of 0/1-dimensional barcodes and reflect the survival (death and birth) of connected components and edges throughout the filtration.

  3. Distance-to-pattern features measure the distance between attention matrices and identity matrices of pre-defined attention patterns, such as attention to the first token [CLS] and to the last [SEP] of the sequence, attention to previous and next token and to punctuation marks.

The computed features and barcodes can be found in the subdirectories of the repository. test_sub features and barcodes were computed on the out of domain test CoLA dataset. Refer to notebooks 4* and 5* from the repository to construct the classification pipeline with TDA features.

Training procedure

Training hyperparameters

The following hyperparameters were used during training:

  • learning_rate: 3e-05
  • train_batch_size: 32
  • eval_batch_size: 8
  • seed: 42
  • optimizer: Adam with betas=(0.9,0.999) and epsilon=1e-08
  • lr_scheduler_type: linear
  • num_epochs: 3.0

Framework versions

  • Transformers 4.23.0.dev0
  • Pytorch 1.12.1+cu113
  • Datasets 2.5.1
  • Tokenizers 0.13.0
Downloads last month
101
Safetensors
Model size
0.1B params
Tensor type
I64
·
F32
·
Inference Providers NEW
This model isn't deployed by any Inference Provider. 🙋 Ask for provider support

Dataset used to train iproskurina/tda-bert-en-cola

Collection including iproskurina/tda-bert-en-cola