Questions tagged [bert]

BERT stands for Bidirectional Encoder Representations from Transformers and is designed to pre-train deep bidirectional representations by jointly conditioning on both left and right context in all layers

Filter by
Sorted by
Tagged with
0
votes
1answer
11 views

Is LSTM or pretrained BERTForMasked LM usable for predicting changed word in a sentence using a small dataset? (2000 samples)

I have a small (2000 samples) dataset of newspaper headlines and their humorous conterparts where only one word is changed to sound silly, for example: Original headline: Police <officer> ...
0
votes
1answer
16 views

Where can I find documentation or paper mentioning pre-trained distilbert-base-nli-mean-tokens model?

I am trying to find more information about pre-trained model distilbert-base-nli-mean-tokens. Can someone please point me to it's paper or documentation? Is it ...
0
votes
1answer
12 views

Normalized 2D tensor values are not in range 0-1

Below function takes in 2D tensor and normalizes it using broadcasting .The issue is except all values to be in range 0-1 but the result has values outside this range . How to get all values in 2D ...
1
vote
0answers
19 views

About Natural Question (NQ) benchmark in NLP [closed]

I recently learned that there is a benchmark called NQ. https://ai.google.com/research/NaturalQuestions/visualization Unlike other QA benchmarks which relevant document is povided with query, it has ...
0
votes
1answer
21 views

XLNET how to deal with text with more than 512 tokens?

From what I searched online, XLNET model is pre-trained with 512 tokens, and https://github.com/zihangdai/xlnet/issues/80 , I didn't find too much useful information on that either. How does XLnet ...
0
votes
1answer
20 views

How to use BERT in seq2seq model? [closed]

I would like to use pretrained BERT as encoder of transformer model. The decoder has the same vocabulary as encoder and I am going to use shared embeddings. But I need ...
2
votes
0answers
16 views

Medical NER for French language

I'm currently exploring the options to extract medical NER specifically for French language. I tried SpaCy's general French NER but it wasn't helpful to the cause (...
1
vote
0answers
11 views

Extracting layer output from Classification model of SimpleTransformer

I have fine tuned a bert base model for text classification task. Now, I want to extract hidden layer output so as to combine this output with other features to train a random forest model. Problem ...
1
vote
2answers
41 views

Would there be any reason to pretrain BERT on specific texts?

So the official BERT English model is trained on Wikipedia and BookCurpos (source). Now, for example, let's say I want to use BERT for Movies tag recommendation. Is there any reason for me to pretrain ...
0
votes
1answer
34 views

Are all 110 million parameter in bert are trainable

I am trying to understand are all these 110 million parameters trainable of bert uncased model. Is there any non trainable parameters in this image below? By trainable I understand they are ...
0
votes
1answer
39 views

Backpropagation of a transformer

when a transformer model is trained there is linear layer in the end of decoder which i understand is a fully connected neural network. During training of a transformer model when a loss is obtained ...
0
votes
0answers
12 views

How to train BERT (multi label) on imbalanced dataset for search query category classification

I have a dataset of 2 million search queries relative to 7000 categories. same query could have multiple categories. Aim is to predict category/categories for query with confidence score. I tried ...
0
votes
0answers
27 views

Use Categorical features in BERT model

I am trying to fine-tune BERT-base model for binary text classification using multiple features. 3 text features, 4 categorical features. Text features having more than 500 tokens length, and four ...
0
votes
0answers
11 views

Compact model for on-device next word prediction

I'm an iOS developer with no production ML experience besides some pet projects. The task is to create a model to predict the next word in English for a custom keyboard. I'd actually prefer to just ...
1
vote
1answer
27 views

what's the motivation behind BERT masking 2 words in a sentence?

bert and the more recent t5 ablation study, agree that using a denoising objective always results in better downstream task performance compared to a language model where denoising == masked-lm == ...
1
vote
1answer
30 views

Bert and SVM classification

I'm trying to understand the concepts in the title and how they fit into the task of binary classification. According to my understanding so far, you can encode text using various feature-extraction ...
0
votes
0answers
19 views

Is it possible to use unlabeled text articles for summarization when fine tuning BERT?

I know that unlabeled data could be used in pre-training but if I want to do a fine tuning of unlabeled articles for summarization, is it mandatory that the articles are labeled with existing ...
0
votes
0answers
24 views

How to determine sentence similarity labels for sentence transformer fine-tuning?

I'm using the Sentence Transformer library to fine-tune pre-trained transformer models. In the fine tuning documentation, the example provided requires labels (from 0 to 1) that indicate the ...
0
votes
0answers
10 views

In Roberta if there is no NSP how are the weights update during training

in Roberta if NSP loss is not used , what is the loss function for DOC-SENTENCES or FULL-SENTENCES task , on what basis will it update the weights ?
0
votes
1answer
37 views

Why does BERT embedding increase the number of tokens?

I am new to DataScience and trying to implement BERT embedding for one of my problems. But I am having one doubt here. I am trying to embed the following sentence with BERT - "Twinkle twinkle ...
0
votes
1answer
71 views

What is the difference between GPT blocks and BERT blocks

Nowadays many applications only use the Encoder and Decoder part of the Transformer respectively. I am having trouble understanding the difference though. If GPT uses Decoder only and BERT uses ...
0
votes
1answer
30 views

What is the number of neurons for the input layer of the BERT?

I think it is the vocab size. However I am not sure and I appreciate your help.
3
votes
1answer
25 views

Detecting grammatical errors with BERT

We fine-tuned BERT (bert-base-uncased) model with CoLA dataset for sentence classification task. The dataset is a mix of ...
4
votes
1answer
261 views

Is a BiLSTM layer required if we use BERT?

I am new to Deep learning based NLP and I have a doubt - I am trying to build a NER model and I found some journals where people are relying on BERT-BiLSTM-CRF model for it. As far as I know BERT is a ...
1
vote
1answer
24 views

Inference order in BERT masking task

In BERT, multiple words in a single sentence can be masked at once. Does the model infer all of those words at once or iterate over them in either left to right or some other order? For example: The ...
1
vote
0answers
33 views

How do I handle class imbalance for text data when using pretrained models like BERT?

I have a skewed dataset consisting of samples of the form: Category 1 10000 Category 2 2000 Category 3 400 Category 4 300 Category 5 100 The dataset ...
4
votes
2answers
141 views

how to run bert's pretrained model word embeddings faster?

I'm trying to get word embeddings for clinical data using microsoft/pubmedbert. I have 3.6 million text rows. Converting texts to vectors for 10k rows takes around 30 minutes. So for 3.6 million rows, ...
0
votes
1answer
140 views

BERT :dropout(): argument 'input' (position 1) must be Tensor, not str

I am new to NLP and would like to build a BERT model for sentiment analysis so I am following this tutorial. However, I am getting the error below: ...
0
votes
1answer
121 views

BERT uses WordPiece, RoBERTa uses BPE

In the original BERT paper, section 'A.2 Pre-training Procedure', it is mentioned: The LM masking is applied after WordPiece tokenization with a uniform masking rate of 15%, and no special ...
3
votes
1answer
35 views

Trained BERT models perform unpredictably on test set

We are training a BERT model (using the Huggingface library) for a sequence labeling task with six labels: five labels indicate that a token belongs to a class that is interesting to us, and one label ...
0
votes
0answers
65 views

BERT for classification model degenerates into all-positive predictions

As a learning project, I'm training a BERT model with the CoLA dataset to detect sentence acceptability. Unfortunately my model is learning to classify every instance as "acceptable", and I'...
0
votes
0answers
6 views

Does transformer learn from context to context

We are fine-tuning a transformer-based question answering model to answer the questions about the novels with the chronological plot. We are breaking up the novel into chapters and then using them as ...
0
votes
0answers
12 views

Where does BERT fit in the Machine Learning Hierarchy?

I am a newbie in the machine learning world and I need guidance from the professionals. I am trying to make a hierarchy starting from machine learning, then to deep learning and to BERT. I have read ...
2
votes
1answer
249 views

What is the difference between BERT architecture and vanilla Transformer architecture

I'm doing some research for the summarization task and found out BERT is derived from the Transformer model. In every blog about BERT that I have read, they focus on explaining what is a bidirectional ...
0
votes
0answers
28 views

Using bert (or fitbert) for predicting masked words from word candidates

Fitbert (which is based on Bert) can be used to predict (fill in) a masked word from a list of candidates as below: ...
0
votes
1answer
53 views

BERT minimal batch size

Is there a minimum batch size for training/re-fining a BERT model on custom data? Could you name any cases where a mini batch size between 1-8 would make sense? Would a batch size of 1 make sense at ...
0
votes
0answers
27 views

BERT data cleaning [duplicate]

I am wondering which data cleaning steps should be performed if you want to re-fine a BERT model on custom text data. Which steps should be performed? Does it make sense to perform a stemming or ...
0
votes
1answer
17 views

Using BERT for the first time, what are the two columns of my test_results.tsv?

I followed the steps to feed in both dev, test, train.tsv to the model, trained it, then tried to classify test data, and I only have 1 feature, and the classification is binary, 1 or 0. I assumed my ...
2
votes
1answer
458 views

How pre-trained BERT model generates word embeddings for out of vocabulary words?

Currently, I am reading BERT: Pre-training of Deep Bidirectional Transformers for Language Understanding. I want to understand how pre-trained BERT generates word embeddings for out of vocabulary ...
1
vote
1answer
39 views

From where does BERT get the tokens it predicts?

When BERT is used for masked language modeling, it masks a token and then tries to predict it. What are the candidate tokens BERT can choose from? Does it just predict an integer (like a regression ...
1
vote
1answer
88 views

Can I fine-tune the BERT on a dissimilar/unrelated task?

In the original BERT paper, section 3 (arXiv:1810.04805) it is mentioned: "During pre-training, the model is trained on unlabeled data over different pre-training tasks." I am not sure if I ...
1
vote
0answers
43 views

NLP Bert model to to calculate text similarity, same sentence but not close similarity

Dear expert here: I have a simple program to calculate text similarity. The program is copied from internet. Initially, I have a list of sentences or stored in db and fetched from db, then I make the ...
1
vote
0answers
72 views

How to apply pruning on a BERT model?

I have trained a BERT model using ktrain (tensorflow wrapper) to recognize emotion on text, it works but it suffers from really slow inference. That makes my model not suitable for a production ...
0
votes
1answer
276 views

Using pretrained LSTM and Bert Models in CPU Only Environment - How to speed up Predictions?

I have trained two text classification models using GPU on Azure. The models are the following Bert (ktrain) Lstm Word2Vec (tensorflow) Exaples of the code can be found here: nlp I saved the models ...
1
vote
1answer
41 views

If i use use BERT embeddings for if cosine(sent1,sent2) > 0.9, then is it fair to assume s1 and s2 are similar

According to BERT author Jacob Devlin: I'm not sure what these vectors are, since BERT does not generate meaningful sentence vectors. It seems that this is doing average pooling over the word tokens ...
0
votes
1answer
50 views

Is it possible to predict sentiment of unlabelled dataset using BERT?

I have a large unlabeled dataset and I want to predict sentiment for each document in this dataset. I want to know, is it possible that I can use BERT for sentiment analysis of unlabeled data? I have ...
-3
votes
1answer
33 views

Generative chatbots with BERT pretrained vectors

Most places seem to train generative chatbots with one hot encoded vectors. See here for example, and even the official tutorial on pytorch. But using one hot encoded vectors are undoubtedly the worst ...
0
votes
0answers
42 views

Visualization of transformed features in BERT

So I'm trying the Intent Recognition with BERT using Keras and TensorFlow 2 available at kdnuggets.com and this is the code for the results evaluation. ...
0
votes
0answers
90 views

What is the typical accuracy of masked language models during BERT pretraining?

I was reading the BERT paper but I didn't find any tables concerning the performance of the masked language models during pretraining. Does anyone know the accuracy of BERT's masked language model?
4
votes
1answer
204 views

Bert for QuestionAnswering input exceeds 512

I'm training Bert on question answering (in Spanish) and i have a large context, only the context exceeds 512, the total question + context is 10k, i found that longformer is bert like for long ...