1,677
questions
1
vote
0
answers
21
views
Using NER to label big parts of text
I'm trying to process a CV-like text, more exactly to split it into parts by their meaning (Description, Contacts, Experience, Education, Certifications etc).
Would NER be suitable for this purpose (...
-2
votes
0
answers
22
views
Classification model only predicts single class [closed]
I have a logistic regression model and I'm trying to make healthy predictions in my NLP project. I've done something and there is my classification report:
precision recall f1-...
-1
votes
0
answers
37
views
How Can I Implement Online/Incremental Learning with FastText? [closed]
I'm working on training FastText incrementally, as new individual data samples arrive. Since FastText is trained using SGD, I figured it should be possible. However, I haven't found a way to do this ...
0
votes
0
answers
41
views
Evaluation of LLM on Classification Tasks
currently I'm doing research on my training method and dataset for LLMs on classification tasks. What i'm wondering right now is how to properly evaluate the model for classification tasks
When I load ...
0
votes
0
answers
59
views
Classifying texts using word embeddings
I'm trying to train a model that is able to classify short texts (200-600 words per text). I got a training set with their corresponding labels, and a text might have one or more labels.
My first ...
0
votes
0
answers
20
views
Tensorflow lite android inference error "op_context->perm->dims->data[0] != dims (3 != 2)"
My .tflite model works on python but it dosen't work well on android project.
It seems no difference between python and android.
What kinds of layer or function changes demention of input?
Standalone ...
0
votes
0
answers
98
views
Fine tune Llama 2 model with custom dataset but getting zero training loss and validation loss
My problem is that the output of training loss and validation loss is 0 for the 3 epoch
Here I am using kaggle notebook
!pip install transformers datasets torch bitsandbytes peft accelerate
import ...
2
votes
0
answers
77
views
Classify data on unstructured texts using python
I'm going to give an introduction to the project surroundings so you have some context for helping me out.
I'm trying to parse out information of german organizational charts in pdf format. Right now ...
0
votes
1
answer
57
views
Text data labeling
Task: Classify customer emails into relevant categories based on their content.
Data: DataFrame containing customer emails.
I have a dataset of customer emails stored in a data frame. Each email ...
0
votes
1
answer
46
views
Efficient Methods for Updating a BERT Sequence Classification Model with New Classes?
I have a problem finding an effective method to update the classifier layer of my text classification model to include new classes. I am working on a classification task involving brand names based on ...
0
votes
0
answers
53
views
TypeError: 'numpy.bool_' object is not iterable when working with SetFit and Optuna
I am trying to train a few shot text classifier using SetFit and Optuna. When I run my code, I get the error TypeError: 'numpy.bool_' object is not iterable. I don't understand where the error comes ...
0
votes
1
answer
88
views
Enhance model performance in text classification task
I tried to build a model for multi-label text classification task in chinese, but the performance of the model is not good enough (about 60% accuracy), and I come for help about how to enhance it.
I ...
0
votes
0
answers
26
views
Fine-tuning pretrained model on 2 tasks with 2 labeled dataset
I am having difficulty using BERT for a sentiment analysis task that handles both aspect-based sentiment analysis (ABSA) and comment sentiment analysis. I know that using two separate classification ...
-2
votes
1
answer
33
views
How to Find accuracy of FastText model in text classification?
in machine learning, all models have the equation of accuracy while in the FastText model, we don't have please support.
1
vote
0
answers
40
views
Speeding up zero-shot headline categorization with BART on Huggingface
I’m working on a Flask web app that needs to categorize 300 headlines into 9-16 dynamic categories every hour very quickly. I'm using the Facebook BART model via Huggingface's API. My current ...
0
votes
0
answers
16
views
Can you use CreateML to extract text from a text blob?
I've been using CreateML to build a model via text classification. It needs to read in a blob of text, and extract a name from that text blob. (The blob is from an OCR result from an iPhone) The text ...
1
vote
1
answer
791
views
Batch and Epoch training metrics for transformers Trainer
There are several ways to get metrics for transformers.Trainer but only for the evaluation and not for the training. I read and found answers scattered in different posts such as this post.
But ...
0
votes
1
answer
418
views
True Inference with Layoutlmv3
I fine-tuned LayoutLMv3 for token classification to extract key entities. I prepared a dataset using LabelStudio to train and test, and it worked well. However, I want to know how I can get a true ...
0
votes
0
answers
20
views
Cannot replicate PECOS XR-Linear performance with TF-IDF features and a Fine-tune Embedding Model
I am trying to replicate the XR-Linear with TFIDF and pre-trained embeddings from the BGE model.
parsed_result = Preprocessor.load_data_from_file(input_text_path, output_text_path)
Y = parsed_result[&...
0
votes
0
answers
76
views
integrate huggingface inference endpoint with flowise
I am trying to integrate mode : mistralai/Mixtral-8x7B-Instruct-v0.1 from hugging dace which I have deployed as an inference endpoint already, and I got a URL which i can put into flowise Add Endpoint ...
0
votes
0
answers
75
views
Text clustering based on “stance” rather than the distribution of embeddings as the basis for clustering
I'm conducting public opinion analysis. The issue is that I want to utilize "stance" instead of the distribution of sentence embeddings as the basis for clustering. Specifically, I've ...
0
votes
1
answer
25
views
Not able to do grid search and train the model
I am working on a basic text classification problem, I want to use a stacking classifier along with some fine-tuning of the parameters of my base classifiers to get high-accuracy results.
My dataset ...
0
votes
0
answers
25
views
SVM algorithm training fitting doesnt work for text classification
I'm trying to fit the sentiment5 data which contains 2 varibales
"tweet" that has vectorized text data (using TF-IDF) and
"target" that has 1 and 0 for positive and negative.
I ...
0
votes
0
answers
136
views
How to use GradCAM for text classification with 1D CNN
I am conducting text classification using a 1D CNN, and I am unsure of how to apply Grad-CAM or any other XAI method to interpret the results. Most resources I've encountered focus on applying these ...
0
votes
0
answers
38
views
Getting different probability scores for same text when passed in batches at the time of prediction for custom tuned BERT in text classification
BERT (BASE UNCASED) custom model is trained on 1.2 million texts for text classification task for 97 categories. Validation and Test data sets are around 250k. Since predicting entire test data doesn'...
1
vote
0
answers
287
views
How to run Llama2 model on gpu in Macbook Pro M2 Max using Python
I have done the following steps:
Installed tensorflow-macos, tensorflow-metal and also set the model "meta-llama/Llama-2-7b-hf" model.to(device) after validating token from Hugging face.
...
0
votes
0
answers
25
views
Document Image Classification
I am working on a project for a document classification task by using the image. I have three target classes but the dataset contains images that are out of these classes and marked as others. Any ...
1
vote
1
answer
205
views
How to reset parameters from AutoModelForSequenceClassification?
Currently to reinitialize a model for AutoModelForSequenceClassification, we can do this:
from transformers import AutoModel, AutoConfig, AutoModelForSequenceClassification
m = "moussaKam/...
0
votes
0
answers
53
views
I can't get trainer accuracy
I've been using the following code but it only logs the train loss and test accuracy/loss to Weights & Biaeses.
It is not a neccesity to get the logs train accuracy logs in Weights & Biases; ...
0
votes
1
answer
495
views
Shap value for binary classification using Pre-Train Bert: How to extract summary graph?
I used pre-train bert model for binary classification. After training my model with my small data, I wanted to extract summary graph like this the graph I want. However, I want to replace these ...
0
votes
0
answers
238
views
Hugging Face - ValueError: `create_and_replace` does not support prompt learning and adaption prompt yet
Error stack
---------------------------------------------------------------------------
ValueError Traceback (most recent call last)
File <command-1698098128188718>...
0
votes
0
answers
198
views
speeding up zero-shot text classification in python
I'm currently using Hugging Face's transformers library for Zero Shot Classification to analyze Customer reviews of products (in Spanish), but I'm facing a scalability problem.
At first, I was using ...
0
votes
0
answers
67
views
Creating Embedding Matrix for LSTM Model with BERT Feature Representations on Arabic Dataset
I'm working on implementing an LSTM model for an Arabic dataset using BERT feature representations. I've utilized the 'asafaya/bert-base-arabic' model for this purpose:
bert_model = ...
0
votes
0
answers
70
views
How to show an example of text classification using SVM with and without SMO in it?
I'm trying to make a comparison of text classification between using Support Vector Machine (SVM) with and without Sequential Minimal Optimization (SMO) but I don't know what's the best way to do it.
...
2
votes
1
answer
95
views
Getting different score values between manual cross validation and cross_val_score
I created a python for loop to split the training dataset into stratified KFolds and used a classifier inside the loop to train it. Then used the trained model to predict with the validation data. The ...
0
votes
0
answers
39
views
Why do I get a long list of zeros in classification of text?
I have 500 comments in Russian from YouTube. I tokenized them using the youtokentome library.
df['textOriginal'].to_csv('text.txt', index=False, header=False)
model_path = 'tokenizer.model'
yttm.BPE....
-2
votes
1
answer
90
views
Best way to deal with uneven data in text classification
I'm trying to run a text classification model on some text data (Tweets) using sklearn and Python. I have hand coded near 1.5k cases, however the data is imbalanced.
Cases are coded for themes. One of ...
0
votes
0
answers
42
views
BERT classifier adding previous and next row as context
I'm working on a classifier in order to sort the text of a page into utterances and other textual information. I've annotated some training data and wondering if there is a way to pass this contextual,...
0
votes
0
answers
23
views
open_ai textclassification finetuning
'''openai.datalib.MissingDependencyError:
OpenAI error:
missing `pandas`
This feature requires additional dependencies:
$ pip install openai[datalib]'''
I tried "pip install openai[datalib]&...
0
votes
0
answers
31
views
How to properly prepare text data for processing it by already trained Naive Bayes multinomial model?
I trained a Naive Bayes multinomial model for binary classification of text for the presence of personal data in it.
model = MultinomialNB() model.fit(X_train, y_train)
I can't figure out how to use ...
0
votes
1
answer
229
views
Low recall and f1-score for LSTM Text classification
I am pretty new to Text Classificaiton with LSTM.
I am trying to classify social media data into hate (1) and nothate (0) using an LSTM without any pretrained word embeddings.
I did some pre-...
0
votes
0
answers
40
views
Importing a SequenceClassification model for an NLP taks to Python
I'm trying to use a SequenceClassification model for an NLP task and no matter which one I try if can be RoBERTaConvForSequenceClassification,SqueezeBertForSequenceClassification, ...
0
votes
0
answers
260
views
I can't download tflite-model-maker or get tflite model
I need a neural network to classify text into sentimentality, but I need it in the .tflite format, since this is the format that Android Studio and android in general accepts.
I'm new to neural ...
0
votes
0
answers
84
views
product classification problem , model should show product category but showing numerical value instead
train.py
import pandas as pd
import re
import nltk
from nltk.corpus import stopwords
from nltk.stem import PorterStemmer
from sklearn.model_selection import train_test_split
from sklearn.pipeline ...
0
votes
0
answers
150
views
how to apply text classification using Graph2Vec embeddings?
I got a collection of text documents, separated on directories based on the subject that they belong. I want to apply Graph2Vec and then use the embeddings of each document to train a text classifier.
...
1
vote
3
answers
66
views
Deterministic classification in R using regular expressions?
I have of list of regular expressions:
regex_list <- list("First Name" = "^[A-Za-z]+$",
"Postal Code" = "^[0-9]{5}$",
&...
0
votes
1
answer
996
views
How to Change Evaluation Metric from ROC AUC to Accuracy in Hugging Face Transformers Fine-Tuning?
I'm working on a text classification task using the Hugging Face Transformers library in Python. My code is set up to use ROC AUC as the evaluation metric, but I need to change it to accuracy. I've ...
0
votes
0
answers
113
views
Unusual results when using Bert model for binary text classification and cross validation
I'm working on binary text classification task with several pretrained model (bert, bigbird etc) along with cross validation with KFold. The code works but the result is kinda odd.
Take Bert for ...
0
votes
0
answers
27
views
Classification report while scoring on a multi-class production dataset
I built a multiclass model with top 5 classes using FRCB Consumer complaints dataset. Following is the distribution of train and test samples.
Volume Distr of Train and Test samples
After hyper ...
1
vote
1
answer
229
views
How to use different dataset for training and test in text classification while avoiding # of features mismatch?
I'm working on text classification using two distinct dataset, with the aim to use one dataset for training and other other for testing. Please note I do not wish to merge the dataset to prevent ...