All Questions
18 questions
1
vote
2
answers
70
views
Identify starting row of actual data in Pandas DataFrame with merged header cells
My original df looks like this -
df
Note in the data frame:
The headers are there till row 3 & from row 4 onwards, the values for those headers are starting.
The numbers of rows & columns ...
0
votes
0
answers
55
views
Value Error when using add_tokens, 'the truth value of an array with more than one element is ambiguous'
I'm trying to improve a basic BERT, pretrained tokenizer model. Im adding new tokens using add_tokens, but running into issues with the built in method.
Namely:
ValueError ...
0
votes
1
answer
301
views
AttributeError: 'list' object has no attribute 'ents' in building NER using BERT
I'm trying to build a NER model using Bert-base-NER for a tweets dataset and ending up getting this error . Please help
This is what I have done
from transformers import AutoTokenizer, ...
0
votes
1
answer
116
views
Can't get 'bert' model to run using ktrain and pandas dataframe
I try to work with ktrain to finetune bert model. I'm using pandas dataframe named train_df to store my data.
x_train, x_val, y_train, y_val = train_test_split(train_df['text'], train_df['target'], ...
1
vote
1
answer
1k
views
How do I solve this float error when using bertopic
I am getting sequence item 18: expected str instance, float found error when running 1 line of code. The data source consistence of 2 columns. Column #1 is generic id of 1 through 600. The second ...
0
votes
1
answer
1k
views
Apply Bert encoding on all values of pandas dataframe
I am trying to get the bert embeddings for all the values present in dataframe.
My code looks like:
from sentence_transformers import SentenceTransformer, util
model = SentenceTransformer('sentence-...
1
vote
1
answer
424
views
Scikit Learn fit(): Setting an array element with a sequence fit
I am trying to call scikit learn fit functions on dataframes where the elements of each column are numpy arrays. However, I get the error "setting an array element with a sequence," ...
0
votes
0
answers
57
views
how do i convert my series object into string? i think thats the prblem
i have saved my dataset in two lists
hi_list=df['hindi_lyrics'] and
en_list=df['english_lyrics']
the output for these list are (en_lyrics)
Mere ishaare pe
1 Tak dhina dhin naacha jo
2 ...
0
votes
2
answers
5k
views
Convert column of lists to integer
Trying to convert after encoding to integers but they are objects so i first turn them into strings
train_df["labels"] = train_df["labels"].astype(str).astype(int)
I am getting ...
0
votes
1
answer
2k
views
BERT Word Embedding for column of pandas data frame
I m working on a NLP project using Tamil Universal Dependency dataset. I have preprocessed the data into a data frame, of which columns are tokens and its dependency tags. I would like to perform word ...
3
votes
1
answer
2k
views
How to find the similarity of sentences in 2 columns of a dataframe using spacy
I pulled this code from https://spacy.io/universe/project/spacy-sentence-bert
import spacy_sentence_bert
# load one of the models listed at https://github.com/MartinoMensio/spacy-sentence-bert/
nlp = ...
1
vote
1
answer
669
views
Looping cosine similarity formula from one dataframe to another dataframe using pandas & BERT
I am building a NLP project which compares sentence similarities between two different dataframes. Here is an example of the dataframes:
df = pd.DataFrame({'Element Detail':['Too many competitors in ...
0
votes
1
answer
2k
views
Cosine similarity between columns of two different DataFrame
I wanted to compute the cosine similarity between two DataFrame(for a different sizes) and store the result in the new data. The similarity is calculated using BERT embeddings
df1
title
Lorem ipsum ...
2
votes
2
answers
6k
views
"Input is not valid. Should be a string, a list/tuple of strings or a list/tuple of integers." ValueError: Input is not valid
I am using Bert tokenizer for french and I am getting this error but I do not seems to solutionated it. If you have a suggestion.
Traceback (most recent call last):
File "training_cross_data_2....
2
votes
1
answer
331
views
BERT model bug encountered during training
So, I made a custom dataset consisting of reviews form several E-learning sites. What I am trying to do is build a model that can recognize emotions based on text and for training I am using the ...