All Questions
56 questions
0
votes
0
answers
104
views
How to use BERT for identify words unrelated to the content of a sentence and replace them with suitable words?
For this question we can see below example:
A: Jack continues to pray well.
B: Jack continues to play well.
In the first sentence, the word "pray" is written in a typographical error and the ...
1
vote
0
answers
144
views
Why using lime with BERT giving memory error
I am using LIME to visualize my finetuned BERT model. I don't know why it is taking too much memory and killed by the system. Here is my code:
tokenizer = BertTokenizer.from_pretrained('bert-base-...
1
vote
0
answers
336
views
How to get prediction value for serving mlflow bert model?
Got Error messing for predicting after serving the model. I want my output in pytorch tensor.
I am using bert for classification in pytorch and mlflow for model tracking and model serving.
I have ...
1
vote
0
answers
489
views
Pytorch BertForSequenceClassification model always predicts 0
I am using Bert on the https://www.kaggle.com/datasets/deepcontractor/supreme-court-judgment-prediction dataset to perform binary classification and am having problems with my model predicting all 0's....
2
votes
1
answer
203
views
bert_vocab.bert_vocab_from_dataset returning wrong vocabulary [closed]
i'm trying to build a tokenizer following the tf's tutorial https://www.tensorflow.org/text/guide/subwords_tokenizer. I'm basically doing the same thing only with a different dataset. The dataset in ...
0
votes
1
answer
629
views
Bert model for word similarity
I'm quite new to NLP, and I want to calculate the similarity between a given word and each word in a given list.
I have the following code
# Load the BERT model
model_name = 'bert-base-uncased'
...
2
votes
0
answers
221
views
How can I implement this BERT model for sequential sentences classification using HuggingFace?
I want to classify the functions of sentences in the abstracts of scientific papers, and the function of a sentence is related to the functions of its surrounding sentences.
I found the model proposed ...
-1
votes
1
answer
186
views
not enough value to unpack in BERT
I am training a FinBERT model (trained on Finance corpus), this is my code for training process:
for epoch in range(EPOCHS):
# Show details
print(f"Epoch {epoch + 1}/{EPOCHS}")
...
1
vote
0
answers
3k
views
RuntimeError: each element in list of batch should be of equal size in BERT
Now i want to train bert model.
But runtimeError occured.
I don't know how to solve this error.
Please give me some help.
Here is my code.
I excute this code in
python = 3.8.10
pytorch = 1.8.0
I used ...
4
votes
1
answer
11k
views
There appear to be 1 leaked semaphore objects to clean up at shutdown
I am using MacOS & used DistilBert model using Sentence Transformer for chatbot implementation and generated the API in VS code.
But after giving 3 inputs it pop’s up this error:
UserWarning: ...
1
vote
0
answers
140
views
'Functional' object has no attribute 'predict_classes' error when we use cross_val_predict
I want to use Bert through Tensorflow.
My plan is to use Bert with 5-fold cross validation, batch_size = 64, epoch = 100, and early stopping.
I have 5 classes in my data.
Therefore, I wrote the ...
0
votes
1
answer
2k
views
Target Data Missing from tensorflow fit()
So I have a problem when train deep learning with BERT with tensorflow which contain text dataset. So i want to fit() the model but got an error when training. I think it happen because the data_train ...
-1
votes
1
answer
2k
views
Warning while loading the BertModel
I load a BERT model using the following code snippet:
name = "bert-base-uncased"
from transformers import BertModel
from transformers import BertTokenizer
...
0
votes
0
answers
167
views
Why my Bert pre-trained model's loss can't reduce?
I tried to write a Bert pre-trained model to fine-tune it for a specific task. Here is my model:
model_path = config.model_path
class BertForCWS(transformers.BertPreTrainedModel):
def __init__(...
10
votes
4
answers
48k
views
OSError for huggingface model
I am trying to use a huggingface model (CamelBERT), but I am getting an error when loading the tokenizer:
Code:
from transformers import AutoTokenizer, AutoModelForMaskedLM
tokenizer = AutoTokenizer....