id
stringlengths
7
11
source
stringclasses
1 value
category
stringclasses
11 values
title
stringlengths
15
214
text
stringlengths
70
30.5k
url
stringlengths
57
160
tags
stringlengths
3
113
created_at
int64
1.22B
1.79B
se_78631415
stackoverflow
ARTIFICIAL_INTELLIGENCE
Read Arabic pdf book using python
Read Arabic pdf book using python I am working on reading an Arabic book using python (the pdf is selectable it does not require any OCR (optical character recognition to extract text from images)) so I have used multiple libraries pdfplumber, pdfminer.six and flitz (PyMuPdf)) this is one of the code I have used: impo...
https://stackoverflow.com/questions/78631415/read-arabic-pdf-book-using-python
python, machine-learning, nlp, arabic
1,718,610,398
se_78645085
stackoverflow
ARTIFICIAL_INTELLIGENCE
How to use Llama3?
How to use Llama3? I'm using Ollama and llama 3 to build a ChatBot. However, right now, it can't remember chat history. For example, if my first query is "tell me about the theory of relativity," and if my next query is "can you simplify it," it throws a message saying it can't recall earlier conversations. Here is my...
https://stackoverflow.com/questions/78645085/how-to-use-llama3
nlp, large-language-model, llama, ollama
1,718,843,742
se_78660144
stackoverflow
ARTIFICIAL_INTELLIGENCE
Inconsistent Results When Running Python Mallet/Gibb's Sampling as a Soft-Clustering Method to Identify Optimal Number of Topics
Inconsistent Results When Running Python Mallet/Gibb's Sampling as a Soft-Clustering Method to Identify Optimal Number of Topics Sorry, but I am inexperienced with Mallet and could use some help. I am currently trying to use Mallet as a soft-clustering technique to assign group membership for a given set of terms ...
https://stackoverflow.com/questions/78660144/inconsistent-results-when-running-python-mallet-gibbs-sampling-as-a-soft-cluste
nlp, topic-modeling, mallet
1,719,188,113
se_78667039
stackoverflow
ARTIFICIAL_INTELLIGENCE
Generate Tags for a text given
Generate Tags for a text given I am trying to build an API using flask which will extract the text from a url given and generate valid tags for that text. Say for example, the text is for a recipe of chicken curry, valid tags can be recipe, Indian Cuisine, food etc. I have tried nltk library, TF-IDF vectorizer etc, bu...
https://stackoverflow.com/questions/78667039/generate-tags-for-a-text-given
python, machine-learning, nlp
1,719,314,538
se_76758299
stackoverflow
ARTIFICIAL_INTELLIGENCE
What is the difference between HuggingFace's TextGeneration and Text2TextGeneration pipelines
What is the difference between HuggingFace's TextGeneration and Text2TextGeneration pipelines I'm confused about the technical difference between the two huggingface pipelines TextGeneration and Text2TextGeneration. In the TextGeneration it is stated that: Language generation pipeline using any ModelWithLMHead. T...
https://stackoverflow.com/questions/76758299/what-is-the-difference-between-huggingfaces-textgeneration-and-text2textgenerat
nlp, huggingface-transformers, huggingface
1,690,236,452
se_78665255
stackoverflow
ARTIFICIAL_INTELLIGENCE
Why do I get two diffrent responses when using the Inference API feature on thee widget on hugging face compared to one when I run the api locally?
Why do I get two diffrent responses when using the Inference API feature on thee widget on hugging face compared to one when I run the api locally? I recently discovered hugging face and have been trying to work with it. When using text-to-text model, I came into the issue. no matter which model, i would get a differe...
https://stackoverflow.com/questions/78665255/why-do-i-get-two-diffrent-responses-when-using-the-inference-api-feature-on-thee
python, nlp, huggingface-transformers, large-language-model, huggingface
1,719,285,486
se_54430346
stackoverflow
ARTIFICIAL_INTELLIGENCE
Alexa skill requires two slots to be filled, however even when filling both slots in request, skill still requests them individually
Alexa skill requires two slots to be filled, however even when filling both slots in request, skill still requests them individually I am building a test alexa skill that will assist with purchasing products. It expects both the name of the product, and the number of units to purchase. These slots have been set up as ...
https://stackoverflow.com/questions/54430346/alexa-skill-requires-two-slots-to-be-filled-however-even-when-filling-both-slot
amazon-web-services, nlp, alexa-skills-kit
1,548,799,620
se_78660543
stackoverflow
ARTIFICIAL_INTELLIGENCE
BartForConditionalGeneration: Adding additional layers of embedding
BartForConditionalGeneration: Adding additional layers of embedding In this file: https://github.com/huggingface/transformers/blob/main/src/transformers/models/bart/modeling_bart.py I think- Inside the BartEncoder, on this line, I have to add other embeddings Could anyone tell me - are there any other places I need...
https://stackoverflow.com/questions/78660543/bartforconditionalgeneration-adding-additional-layers-of-embedding
pytorch, nlp, huggingface-transformers, bart
1,719,203,349
se_78659996
stackoverflow
ARTIFICIAL_INTELLIGENCE
HuggingFace's transformers I'm getting the message "Some non-default generation parameters are set in the model config"
HuggingFace's transformers I'm getting the message "Some non-default generation parameters are set in the model config" I need help with a problem. The template works but I want to correct this message so that everything is correct. The purpose of this code is to save the model before training. It sa...
https://stackoverflow.com/questions/78659996/huggingfaces-transformers-im-getting-the-message-some-non-default-generation
python, nlp, huggingface-transformers, huggingface-tokenizers
1,719,182,022
se_68086929
stackoverflow
ARTIFICIAL_INTELLIGENCE
How to get the size of a Hugging Face pretrained model?
How to get the size of a Hugging Face pretrained model? I keep getting a CUDA out of memory error when trying to fine-tune a Hugging Face pretrained XML Roberta model. So, the first thing I want to find out is the size of the pretrained model. model = XLMRobertaForCausalLM.from_pretrained('xlm-roberta-base', config=co...
https://stackoverflow.com/questions/68086929/how-to-get-the-size-of-a-hugging-face-pretrained-model
python, deep-learning, nlp, pytorch, huggingface-transformers
1,624,377,374
se_78655737
stackoverflow
ARTIFICIAL_INTELLIGENCE
LSTM forecasting predicts zeros
LSTM forecasting predicts zeros i'm building an LSTM model to forecast future total number of cases for covid 19 using OWID dataset i use a multivariate series of 6 columns including the date column, the Problem is i get all zero predictions however this not the case when i use univariate series using only single colu...
https://stackoverflow.com/questions/78655737/lstm-forecasting-predicts-zeros
tensorflow, deep-learning, nlp, lstm, forecasting
1,719,051,512
se_78658303
stackoverflow
ARTIFICIAL_INTELLIGENCE
FileNotFoundError when loading SQuAD dataset with datasets library
FileNotFoundError when loading SQuAD dataset with datasets library I am trying to load the SQuAD dataset using the datasets library in Python, but I am encountering a FileNotFoundError. Here is the code I am using: from datasets import load_dataset dataset = load_dataset("squad") However, this results in the followin...
https://stackoverflow.com/questions/78658303/filenotfounderror-when-loading-squad-dataset-with-datasets-library
python, nlp, huggingface, huggingface-datasets
1,719,135,574
se_6115677
stackoverflow
ARTIFICIAL_INTELLIGENCE
English grammar for parsing in NLTK
English grammar for parsing in NLTK Is there a ready-to-use English grammar that I can just load it and use in NLTK? I've searched around examples of parsing with NLTK, but it seems like that I have to manually specify grammar before parsing a sentence. Thanks a lot!
https://stackoverflow.com/questions/6115677/english-grammar-for-parsing-in-nltk
python, nlp, grammar, nltk
1,306,264,660
se_78639535
stackoverflow
ARTIFICIAL_INTELLIGENCE
Extract Keywords from Text Vector -- one set of keyworks for each element
Extract Keywords from Text Vector -- one set of keyworks for each element Please consider the reprex at the end of the post. It works along the lines of https://cran.r-project.org/web/packages/udpipe/vignettes/udpipe-usecase-postagging-lemmatisation.html It extracts a set of keywords from a text vector "texts", but I ...
https://stackoverflow.com/questions/78639535/extract-keywords-from-text-vector-one-set-of-keyworks-for-each-element
r, nlp, text-mining, udpipe
1,718,742,618
se_72935424
stackoverflow
ARTIFICIAL_INTELLIGENCE
Generate representative boolean queries from source text?
Generate representative boolean queries from source text? Within conventional information retrieval systems, we use a boolean query to generate a result set that matches that query. What does one call the 'task', where, given a known set of similar documents, determine the boolean query that best represents it? The ma...
https://stackoverflow.com/questions/72935424/generate-representative-boolean-queries-from-source-text
nlp, information-retrieval
1,657,526,631
se_43463792
stackoverflow
ARTIFICIAL_INTELLIGENCE
what is the difference between bigram and unigram text features extraction
what is the difference between bigram and unigram text features extraction I searched online to do bi-gram and unigram text features' extraction, but still didn't find something useful information, can someone tell me what is the difference between them? For example, if I have a text "I have a lovely dog" what will h...
https://stackoverflow.com/questions/43463792/what-is-the-difference-between-bigram-and-unigram-text-features-extraction
machine-learning, nlp
1,492,491,004
se_78648940
stackoverflow
ARTIFICIAL_INTELLIGENCE
Accuracy_score with same value in different classifiers methods
Accuracy_score with same value in different classifiers methods I'm doing a project, on Google Colab, for fake news classification with LIAR dataset. I am running with three differents features extractors (TF-IDF, DistilBERT and LLAMA 2) and seven classifiers (Logistic Regression, SVM, Naive Bayes, KNN, Random Forest,...
https://stackoverflow.com/questions/78648940/accuracy-score-with-same-value-in-different-classifiers-methods
python, text, nlp, classification
1,718,905,353
se_34351978
stackoverflow
ARTIFICIAL_INTELLIGENCE
NLTK RegEx Chunker not capturing defined grammar patterns with wildcards
NLTK RegEx Chunker not capturing defined grammar patterns with wildcards I am trying to chunk a sentence using NLTK's POS tags as regular expressions. 2 rules are defined to identify phrases, based on the tags of words in the sentence. Mainly, I wanted to capture the chunk of one or more verbs followed by an optional ...
https://stackoverflow.com/questions/34351978/nltk-regex-chunker-not-capturing-defined-grammar-patterns-with-wildcards
python, regex, nlp, nltk, text-chunking
1,450,429,675
se_78651887
stackoverflow
ARTIFICIAL_INTELLIGENCE
Classify data on unstructured texts using python
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 I can reliably read out the content of the rectangles from the PDF and...
https://stackoverflow.com/questions/78651887/classify-data-on-unstructured-texts-using-python
python, nlp, pattern-matching, spacy, text-classification
1,718,966,825
se_78640090
stackoverflow
ARTIFICIAL_INTELLIGENCE
How to handle the loss function decrease at some points but bounce back to keep increasing when fine-tune LLaMA?
How to handle the loss function decrease at some points but bounce back to keep increasing when fine-tune LLaMA? Preface I am new to fine-tuning an LLM model on binary classification tasks. I have tried fine-tuning LLaMA 2 and 3 with the causal inference task (next token prediction) with PEFT LoRA and 4-bit quantizati...
https://stackoverflow.com/questions/78640090/how-to-handle-the-loss-function-decrease-at-some-points-but-bounce-back-to-keep
python, pytorch, nlp, huggingface-transformers, large-language-model
1,718,757,197
se_73628064
stackoverflow
ARTIFICIAL_INTELLIGENCE
How can I prevent the benepar parser from splitting a specific substring when parsing a string?
How can I prevent the benepar parser from splitting a specific substring when parsing a string? I use the benepar parser to parse sentences into trees. How can I prevent the benepar parser from splitting a specific substring when parsing a string? E.g., the token gonna is split by benepar into two tokens gon and na, w...
https://stackoverflow.com/questions/73628064/how-can-i-prevent-the-benepar-parser-from-splitting-a-specific-substring-when-pa
python, nlp, tokenize, parse-tree, benepar
1,662,500,957
se_78639577
stackoverflow
ARTIFICIAL_INTELLIGENCE
Understanding the results of Transformers Learn In Context with Gradient Descent
Understanding the results of Transformers Learn In Context with Gradient Descent I'm trying to implement this paper: https://arxiv.org/pdf/2212.07677 (Here's their code): https://github.com/google-research/self-organising-systems/tree/master/transformers_learn_icl_by_gd I'm struggling to match their experimental resul...
https://stackoverflow.com/questions/78639577/understanding-the-results-of-transformers-learn-in-context-with-gradient-descent
machine-learning, nlp, large-language-model, transformer-model, meta-learning
1,718,743,425
se_78594832
stackoverflow
ARTIFICIAL_INTELLIGENCE
ImportError and TypeError Issues in Nougat OCR with BARTDecoder and cached_property
ImportError and TypeError Issues in Nougat OCR with BARTDecoder and cached_property I'm facing issues while running an OCR process using Nougat with two different errors for two different users. The errors are related to importing cached_property and an unexpected keyword argument cache_position. Below are the full er...
https://stackoverflow.com/questions/78594832/importerror-and-typeerror-issues-in-nougat-ocr-with-bartdecoder-and-cached-prope
machine-learning, pytorch, nlp, huggingface-transformers, huggingface
1,717,825,428
se_71284177
stackoverflow
ARTIFICIAL_INTELLIGENCE
How to remove words from a sentence that carry no positive or negative sentiment?
How to remove words from a sentence that carry no positive or negative sentiment? Im trying a sentiment analysis based approach on youtube comments, but the comments many times have words like mrbeast, tiger/'s, lion/'s, pewdiepie, james, etc which do not add any feeling in the sentence. I've gone through nltk's avera...
https://stackoverflow.com/questions/71284177/how-to-remove-words-from-a-sentence-that-carry-no-positive-or-negative-sentiment
python, machine-learning, nlp, sentiment-analysis
1,645,959,541
se_66518375
stackoverflow
ARTIFICIAL_INTELLIGENCE
How is transformers loss calculated for blank token predictions?
How is transformers loss calculated for blank token predictions? I'm currently trying to implement a transformer and have trouble understanding its loss calculation. My encoders input looks for batch_size=1 and max_sentence_length=8 like: [[Das, Wetter, ist, gut, <blank>, <blank>, <blank>, <blank>]] My decoders inpu...
https://stackoverflow.com/questions/66518375/how-is-transformers-loss-calculated-for-blank-token-predictions
machine-learning, nlp, transformer-model, language-model
1,615,132,276
se_78640686
stackoverflow
ARTIFICIAL_INTELLIGENCE
Handling Documentation Overlap in Product Feature Queries
Handling Documentation Overlap in Product Feature Queries I have two products, X and Y, each with its own set of documentation detailing their features and functionalities. I've processed these documents by dividing them into segments based on word count and stored these segments in vector database for both products. ...
https://stackoverflow.com/questions/78640686/handling-documentation-overlap-in-product-feature-queries
nlp, milvus
1,718,775,901
se_71481565
stackoverflow
ARTIFICIAL_INTELLIGENCE
How to save the output of constituency parsing diagram as an image?
How to save the output of constituency parsing diagram as an image? Using the svgling module I have generated the constituency parse tree. Here is the github link of svgling: svgling module github pip install svgling import svgling import nltk var ='(S (NP this tree) (VP (V is) (AdjP pretty)))' svgling.disable_nltk_pn...
https://stackoverflow.com/questions/71481565/how-to-save-the-output-of-constituency-parsing-diagram-as-an-image
python, nlp
1,647,344,068
se_78614543
stackoverflow
ARTIFICIAL_INTELLIGENCE
Text data labeling
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 pertains to a specific issue the customer encountered. My goal is to categorize these emails automaticall...
https://stackoverflow.com/questions/78614543/text-data-labeling
nlp, text-classification
1,718,219,002
se_28674417
stackoverflow
ARTIFICIAL_INTELLIGENCE
How to read constituency based parse tree
How to read constituency based parse tree I have a corpus of sentences that were preprocessed by Stanford's CoreNLP systems. One of the things it provides is the sentence's Parse Tree (Constituency-based). While I can understand a parse tree when it's drawn (like a tree), I'm not sure how to read it in this format: E...
https://stackoverflow.com/questions/28674417/how-to-read-constituency-based-parse-tree
python, parsing, nlp, parse-tree
1,424,696,445
se_78635719
stackoverflow
ARTIFICIAL_INTELLIGENCE
letter and bigram composition for each word in the dataframe
letter and bigram composition for each word in the dataframe I have a data frame with words and I want to extract the letter and bigram composition for each word. Data: df$text [1] "table" [2] "run" [3] "mug"` And in the end I want to receive the output: 1 a b c d e..z aa ab bb...zz table 1 1 0 0 0..0 0 1...
https://stackoverflow.com/questions/78635719/letter-and-bigram-composition-for-each-word-in-the-dataframe
r, nlp, n-gram
1,718,690,796
se_58971014
stackoverflow
ARTIFICIAL_INTELLIGENCE
How to get spaCy to use universal dependencies
How to get spaCy to use universal dependencies Spacy's site said they use universal dependencies scheme in their annotations specifications page. But when I parse "I love you", '''you''' was made a "dobj" of "love". There's no "dobj" in the universal dependency relations doc. So I have two questions : How to get sp...
https://stackoverflow.com/questions/58971014/how-to-get-spacy-to-use-universal-dependencies
nlp, spacy, dependency-parsing
1,574,327,177
se_78633924
stackoverflow
ARTIFICIAL_INTELLIGENCE
gensim for Political Ad verification?
gensim for Political Ad verification? I am trying to build a model that uses transcribed audio and on-screen text to classify a video ad as political or non-political, as well as extracts the name of the candidate and sponsor. How can I go about doing this? One possible solution I thought of was using a dictionary of ...
https://stackoverflow.com/questions/78633924/gensim-for-political-ad-verification
nlp, spacy, gensim, named-entity-recognition, phrase
1,718,645,121
se_78631769
stackoverflow
ARTIFICIAL_INTELLIGENCE
Problems with Named Entity Recognition in spaCy using German de_dep_news_trf Pipeline
Problems with Named Entity Recognition in spaCy using German de_dep_news_trf Pipeline I'm currently working on a project using spaCy with the German trained pipeline de_dep_news_trf. Unfortunately, I'm having issues with named entity recognition (NER). When I run a simple sentence like "Berlin ist die Hauptstadt von D...
https://stackoverflow.com/questions/78631769/problems-with-named-entity-recognition-in-spacy-using-german-de-dep-news-trf-pip
python, nlp, spacy
1,718,615,669
se_70447397
stackoverflow
ARTIFICIAL_INTELLIGENCE
How to solve import error for Azure text analytics
How to solve import error for Azure text analytics import error for TextAnalyticsClient I am following Microsoft official document for sentiment analysis. https://learn.microsoft.com/en-us/azure/cognitive-services/language-service/sentiment-opinion-mining/quickstart?pivots=programming-language-python However, I am hav...
https://stackoverflow.com/questions/70447397/how-to-solve-import-error-for-azure-text-analytics
python, azure, text, nlp
1,640,167,973
se_77764939
stackoverflow
ARTIFICIAL_INTELLIGENCE
Generating Vector Embeddings for Organization Names
Generating Vector Embeddings for Organization Names I have seen couple of Word2Vec Models that can generate embeddings for Company Names, and performs well when the different formats of the same company names are given. But what I want to do is a bit different. For example, I have a list of company names like: ["abc i...
https://stackoverflow.com/questions/77764939/generating-vector-embeddings-for-organization-names
python, nlp, word2vec
1,704,461,724
se_78628139
stackoverflow
ARTIFICIAL_INTELLIGENCE
Why is Perplexity not reliable for open domain text generation tasks?
Why is Perplexity not reliable for open domain text generation tasks? In the paper here, it says that perplexity as an automated metric is not reliable for open domain text generation tasks, but it instead uses lm-score, a model based metric to produce perplexity like values. What additional benefits does lm-score giv...
https://stackoverflow.com/questions/78628139/why-is-perplexity-not-reliable-for-open-domain-text-generation-tasks
nlp, gpt-2, perplexity
1,718,504,630
se_68383580
stackoverflow
ARTIFICIAL_INTELLIGENCE
spaCy incorrectly recognizing finger as verb
spaCy incorrectly recognizing finger as verb I am trying to investigate a way to fix (or alter) how spaCy identifies verbs/nouns. In the following example I would like to recognize finger as a NOUN not a VERB. import spacy nlp = spacy.load("en_core_web_lg") doc = nlp('over exertion to finger from pulling open a stuck ...
https://stackoverflow.com/questions/68383580/spacy-incorrectly-recognizing-finger-as-verb
python, nlp, spacy
1,626,288,150
se_67546911
stackoverflow
ARTIFICIAL_INTELLIGENCE
Python: BERT Error - Some weights of the model checkpoint at were not used when initializing BertModel
Python: BERT Error - Some weights of the model checkpoint at were not used when initializing BertModel I am creating an entity extraction model in PyTorch using bert-base-uncased but when I try to run the model I get this error: Some weights of the model checkpoint at D:\Transformers\bert-entity-extraction\input\bert-...
https://stackoverflow.com/questions/67546911/python-bert-error-some-weights-of-the-model-checkpoint-at-were-not-used-when
python, nlp, pytorch, bert-language-model, huggingface-transformers
1,621,083,032
se_76927485
stackoverflow
ARTIFICIAL_INTELLIGENCE
How to calculate the quality of comments using NLP
How to calculate the quality of comments using NLP How can I calculate the quality of comments a user receives on their posts and assign ratings based on the comments' quality score in a dataset I'm analyzing as part of my data science work? I've studied this, but NLP seems complex for beginners. Any suggestions for a...
https://stackoverflow.com/questions/76927485/how-to-calculate-the-quality-of-comments-using-nlp
nlp
1,692,345,717
se_77673353
stackoverflow
ARTIFICIAL_INTELLIGENCE
How to use adapter transformers with a Huggingface Pipeline
How to use adapter transformers with a Huggingface Pipeline I tried to run the model "AdapterHub/bert-base-uncased-pf-conll2003" (Model description here) for token classification in NLP. First I tried to install the adapter transformers pip install -U adapter-transformers The output of the above command was Collecti...
https://stackoverflow.com/questions/77673353/how-to-use-adapter-transformers-with-a-huggingface-pipeline
python, machine-learning, nlp, huggingface-transformers
1,702,788,568
se_78615842
stackoverflow
ARTIFICIAL_INTELLIGENCE
how to know the behavior of a sentence using NLP
how to know the behavior of a sentence using NLP I am trying to build the NLP model, using that nlp model i want to know the intention of text sentence. Hi, I am trying to build the NLP model, using that nlp model i want to know the intention of text sentence. For Ex- If the sentence is like "Create an incident for no...
https://stackoverflow.com/questions/78615842/how-to-know-the-behavior-of-a-sentence-using-nlp
c#, asp.net, azure, nlp, artificial-intelligence
1,718,253,495
se_78261781
stackoverflow
ARTIFICIAL_INTELLIGENCE
Issues with Generating Text from Fine-Tuned Mistral 7B Model on Georgian Dataset
Issues with Generating Text from Fine-Tuned Mistral 7B Model on Georgian Dataset I've fine-tuned the Mistral 7B model using a Georgian dataset with approximately 100,000 articles, including custom tokenizer fine-tuning. The fine-tuning process took about 9 hours. However, when I try to generate text, the output is not...
https://stackoverflow.com/questions/78261781/issues-with-generating-text-from-fine-tuned-mistral-7b-model-on-georgian-dataset
nlp, huggingface, language-model, fine-tuning, text-generation
1,712,065,589
se_78227301
stackoverflow
ARTIFICIAL_INTELLIGENCE
OpenAI API error: &quot;TypeError: Cannot read properties of undefined (reading &#39;create&#39;)&quot;
OpenAI API error: &quot;TypeError: Cannot read properties of undefined (reading &#39;create&#39;)&quot; I am creating a chat summarizer app where the input is an Excel file with chat transcripts. Each row of the Excel sheet corresponds to a new chat. The app summarizes the chat in the adjacent column. The problem is t...
https://stackoverflow.com/questions/78227301/openai-api-error-typeerror-cannot-read-properties-of-undefined-reading-crea
nlp, openai-api, chatgpt-api, chatgpt-function-call
1,711,475,519
se_78611808
stackoverflow
ARTIFICIAL_INTELLIGENCE
Efficient Methods for Updating a BERT Sequence Classification Model with New Classes?
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 their descriptions, with two col...
https://stackoverflow.com/questions/78611808/efficient-methods-for-updating-a-bert-sequence-classification-model-with-new-cla
pytorch, nlp, bert-language-model, text-classification
1,718,184,973
se_76448287
stackoverflow
ARTIFICIAL_INTELLIGENCE
How can i solve ImportError: Using the `Trainer` with `PyTorch` requires `accelerate&gt;=0.20.1` when using Huggingface&#39;s TrainArguments?
How can i solve ImportError: Using the `Trainer` with `PyTorch` requires `accelerate&gt;=0.20.1` when using Huggingface&#39;s TrainArguments? I'm using the transformers library in Google colab, and When i am using TrainingArguments from transformers library i'm getting Import error with this code: from transformers i...
https://stackoverflow.com/questions/76448287/how-can-i-solve-importerror-using-the-trainer-with-pytorch-requires-accele
python, nlp, importerror, huggingface-transformers, huggingface
1,686,433,863
se_78602828
stackoverflow
ARTIFICIAL_INTELLIGENCE
Which weights change when fine-tunning a pre-trained model? (Hugging Face)
Which weights change when fine-tunning a pre-trained model? (Hugging Face) I am using the AutoModelForSequenceClassification class to fine-tune a pre-trained model (which originally is based on GPT2 architecture) model = AutoModelForSequenceClassification.from_pretrained("Natooz/Maestro-REMI-bpe20k", trust_remote_code...
https://stackoverflow.com/questions/78602828/which-weights-change-when-fine-tunning-a-pre-trained-model-hugging-face
nlp, huggingface-transformers, huggingface, pre-trained-model
1,718,028,879
se_75256485
stackoverflow
ARTIFICIAL_INTELLIGENCE
Training / using OpenAI GPT-3 for translations
Training / using OpenAI GPT-3 for translations I'm trying to use OpenAI for translation of my products descriptions from one language to some other languages (EN, DE, CZ, SK, HU, PL, SI...). The translations, especially to SK/CZ/HU/PL languages are (mainly gramatically) quite bad (using text-davinci-003 model). I've g...
https://stackoverflow.com/questions/75256485/training-using-openai-gpt-3-for-translations
nlp, translate, openai-api, machine-translation, gpt-3
1,674,813,371
se_78607243
stackoverflow
ARTIFICIAL_INTELLIGENCE
Vosk Model for Speech to Text
Vosk Model for Speech to Text I want to train vosk model vosk-model-en-us-0.22 from https://alphacephei.com/vosk/models with an addition data of my voice with transcript of 1 hour so that the model gets overfit with my voice and don't get problem recognizing my voice properly. So how can I train it if someone can give...
https://stackoverflow.com/questions/78607243/vosk-model-for-speech-to-text
nlp, speech-to-text, vosk
1,718,105,777
se_75189805
stackoverflow
ARTIFICIAL_INTELLIGENCE
How do I implement a model that finds a correlation (not similarity) between query and target sentence?
How do I implement a model that finds a correlation (not similarity) between query and target sentence? When building an NLP model (I'm going to use an attention-based one), how can we implement one for finding the correlation, not similarity, between the query and target sentences? For instance, the two sentences "I ...
https://stackoverflow.com/questions/75189805/how-do-i-implement-a-model-that-finds-a-correlation-not-similarity-between-que
python, deep-learning, nlp, attention-model, sentence-similarity
1,674,252,873
se_36966019
stackoverflow
ARTIFICIAL_INTELLIGENCE
How areTF-IDF calculated by the scikit-learn TfidfVectorizer
How areTF-IDF calculated by the scikit-learn TfidfVectorizer I run the following code to convert the text matrix to TF-IDF matrix. text = ['This is a string','This is another string','TFIDF computation calculation','TfIDF is the product of TF and IDF'] from sklearn.feature_extraction.text import TfidfVectorizer vecto...
https://stackoverflow.com/questions/36966019/how-aretf-idf-calculated-by-the-scikit-learn-tfidfvectorizer
nlp, scikit-learn, tf-idf
1,462,101,384
se_78604184
stackoverflow
ARTIFICIAL_INTELLIGENCE
State of the art word sense disambiguation on WordNet synsets
State of the art word sense disambiguation on WordNet synsets I am trying to perform a simple task: given a corpus, identify all words that are hyponyms of a certain synset (e.g., «find every mention of a "plant" or a "bird"»). In order to do that accurately, I need to do word sense disambiguation on a group of synset...
https://stackoverflow.com/questions/78604184/state-of-the-art-word-sense-disambiguation-on-wordnet-synsets
nlp, nltk, spacy, wordnet, spacy-transformers
1,718,047,485
se_78601284
stackoverflow
ARTIFICIAL_INTELLIGENCE
Speed up semantic search for large dataset with custom search function
Speed up semantic search for large dataset with custom search function I am building a semantic search engine for short sentences where I want to know which sentence have the more similar sentences. For that, I need to know based on a threshold on the similarity score, how many similar sentences I have for each senten...
https://stackoverflow.com/questions/78601284/speed-up-semantic-search-for-large-dataset-with-custom-search-function
python, nlp, sentence-transformers, semantic-search
1,718,009,053
se_77476898
stackoverflow
ARTIFICIAL_INTELLIGENCE
Why replace the masked token with random token in bert?
Why replace the masked token with random token in bert? Masking in Bert is: Take 15% of all the tokens in the sequence. These are to be used in computing the MLM loss 80% of the time retain the mask 10% of the time replace the mask with the original token 10% of the time replace the mask with a random token I unders...
https://stackoverflow.com/questions/77476898/why-replace-the-masked-token-with-random-token-in-bert
nlp, bert-language-model, transformer-model
1,699,909,792
se_78182686
stackoverflow
ARTIFICIAL_INTELLIGENCE
Why does Seq2SeqTrainer produces error during evaluation when using T5?
Why does Seq2SeqTrainer produces error during evaluation when using T5? Following the tutorial here. I've tried to adapt it to my dataset. But, I've noticed that during evaluation the Seq2SeqTrainer calls the compute_metrics 3 times. The first time it passes the correct validation/test set, but the other 2 times I don...
https://stackoverflow.com/questions/78182686/why-does-seq2seqtrainer-produces-error-during-evaluation-when-using-t5
nlp, huggingface-transformers, huggingface, huggingface-trainer
1,710,791,259
se_78586621
stackoverflow
ARTIFICIAL_INTELLIGENCE
HuggingFace pipeline - Debug prompt
HuggingFace pipeline - Debug prompt I've defined a pipeline using Huggingface transformer library. pipe = pipeline( "text-generation", model=myllm, tokenizer=tokenizer, max_new_tokens=512, ) I'd like to test it: result = pipe("Some input prompt for the LLM") How can I debug the prompt actually sent t...
https://stackoverflow.com/questions/78586621/huggingface-pipeline-debug-prompt
python, nlp, huggingface-transformers
1,717,677,407
se_76850304
stackoverflow
ARTIFICIAL_INTELLIGENCE
Hugging face model not transcribing the entire length of the audio file
Hugging face model not transcribing the entire length of the audio file Brief: I'm unable to transcribe more than a few seconds of audio in a 5 minute audio file using hugging face open ai whisper(finetuned) model. I'm facing issues with transcribing a Indian local language audio file using this(https://huggingface.co...
https://stackoverflow.com/questions/76850304/hugging-face-model-not-transcribing-the-entire-length-of-the-audio-file
nlp, artificial-intelligence, google-colaboratory, huggingface-transformers, openai-whisper
1,691,399,749
se_77565949
stackoverflow
ARTIFICIAL_INTELLIGENCE
Using langchain and LLaMA2 to QA with a large SQL DB
Using langchain and LLaMA2 to QA with a large SQL DB I was working with a sqlite DB that I created for a large dataset (~150k rows). Code snippets: db = SQLDatabase.from_uri("sqlite:///MLdata.sqlite") SQLITE_PROMPT_TEXT = '''You are a SQLite expert. Given an input question, first create a syntactically correct SQLite...
https://stackoverflow.com/questions/77565949/using-langchain-and-llama2-to-qa-with-a-large-sql-db
nlp, langchain, large-language-model, llama
1,701,192,410
se_78552651
stackoverflow
ARTIFICIAL_INTELLIGENCE
How to fix error `OSError: &lt;model&gt; does not appear to have a file named config.json.` when loading custom fine-tuned model?
How to fix error `OSError: &lt;model&gt; does not appear to have a file named config.json.` when loading custom fine-tuned model? Preface I am new to implementing the NLP model. I have successfully fine-tuned LLaMA 3-8B variants with QLORA and uploaded them to HuggingFace. The directories are filled with these files: ...
https://stackoverflow.com/questions/78552651/how-to-fix-error-oserror-model-does-not-appear-to-have-a-file-named-config-j
pytorch, nlp, huggingface-transformers, large-language-model, peft
1,717,036,616
se_78575305
stackoverflow
ARTIFICIAL_INTELLIGENCE
AttributeError: &#39;TrainingArguments&#39; object has no attribute &#39;model_init_kwargs&#39;
AttributeError: &#39;TrainingArguments&#39; object has no attribute &#39;model_init_kwargs&#39; While finetuning Gemma2B model using QLoRA i'm getting error as AttributeError: 'TrainingArguments' object has no attribute 'model_init_kwargs' Code: Loading the libraries from enum import Enum from functools import partial...
https://stackoverflow.com/questions/78575305/attributeerror-trainingarguments-object-has-no-attribute-model-init-kwargs
python, nlp, huggingface-transformers, large-language-model, peft
1,717,502,794
se_78529739
stackoverflow
ARTIFICIAL_INTELLIGENCE
On-the-fly Deny List in Presidio?
On-the-fly Deny List in Presidio? Loading the Presidio analyzing engine takes some time. I want to filter out specific names but I want to filter out different names for every document. I don't understand how to perform this seemingly simple task with Presidio. Somehow I can pass an allow_list to the analyze function ...
https://stackoverflow.com/questions/78529739/on-the-fly-deny-list-in-presidio
python, nlp, named-entity-recognition, anonymize, presidio
1,716,568,294
se_78573280
stackoverflow
ARTIFICIAL_INTELLIGENCE
Unable to fit new documents without running out of memory in STM topic modeling
Unable to fit new documents without running out of memory in STM topic modeling I'm trying to label new texts based on a previous topic model using the fitNewDocuments() function form the stm package in R. I've tried fitting 10 new documents based on topic models trained on 20000, 10000 and 3000 documents, and the fun...
https://stackoverflow.com/questions/78573280/unable-to-fit-new-documents-without-running-out-of-memory-in-stm-topic-modeling
r, nlp, lda, stm
1,717,472,515
se_78572569
stackoverflow
ARTIFICIAL_INTELLIGENCE
How can I implement regression after multi-class multi-label classification?
How can I implement regression after multi-class multi-label classification? I have a dataset where some objects (15%) belong to different classes and have a property value for each of those classes. How can I make a model that predicts multi-label or multi-class and then make a regression prediction based on the outp...
https://stackoverflow.com/questions/78572569/how-can-i-implement-regression-after-multi-class-multi-label-classification
python, machine-learning, nlp, multilabel-classification, multiclass-classification
1,717,450,358
se_77601218
stackoverflow
ARTIFICIAL_INTELLIGENCE
Llama Index custom embeddings - difference between getting text embeddings vs query embeddings?
Llama Index custom embeddings - difference between getting text embeddings vs query embeddings? I'm looking here at the Llama index documentation to create custom embeddings: https://docs.llamaindex.ai/en/stable/examples/embeddings/custom_embeddings.html I'm confused at the documentation - what's the difference betwee...
https://stackoverflow.com/questions/77601218/llama-index-custom-embeddings-difference-between-getting-text-embeddings-vs-qu
python, nlp, llama-index
1,701,709,017
se_69677921
stackoverflow
ARTIFICIAL_INTELLIGENCE
Information extracting from plain text using NLP
Information extracting from plain text using NLP Me and my friends working on a hobby project and trying to extract data from plain text. Not something too complicated, just trying to extract name, birth date or somethings like that. Let's say that we have a text file like this, "Hello my name is John and I'm 22 years...
https://stackoverflow.com/questions/69677921/information-extracting-from-plain-text-using-nlp
nlp, text-mining
1,634,910,090
se_78521361
stackoverflow
ARTIFICIAL_INTELLIGENCE
How do I install the nltk library&#39;s &quot;averaged_perceptron_tagger&quot; on railway server?
How do I install the nltk library&#39;s &quot;averaged_perceptron_tagger&quot; on railway server? Hi I am building an API with django REST Framework for generating a PowerPoint slide using python pptx package. I'm also using NLTK(Natural Language Toolkit) library to process text by tokenizing and tagging the tokens, i...
https://stackoverflow.com/questions/78521361/how-do-i-install-the-nltk-librarys-averaged-perceptron-tagger-on-railway-serv
python, nlp, nltk, perceptron, railway
1,716,446,745
se_18902608
stackoverflow
ARTIFICIAL_INTELLIGENCE
Generating the plural form of a noun
Generating the plural form of a noun Given a word, which may or may not be a singular-form noun, how would you generate its plural form? Based on this NLTK tutorial and this informal list on pluralization rules, I wrote this simple function: def plural(word): """ Converts a word to its plural form. """ ...
https://stackoverflow.com/questions/18902608/generating-the-plural-form-of-a-noun
python, nlp, wordnet, linguistics
1,379,616,274
se_78554248
stackoverflow
ARTIFICIAL_INTELLIGENCE
Enhance model performance in text classification task
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 build a model based on a github project: import torch.nn as nn imp...
https://stackoverflow.com/questions/78554248/enhance-model-performance-in-text-classification-task
python, deep-learning, nlp, neural-network, text-classification
1,717,063,088
se_77132684
stackoverflow
ARTIFICIAL_INTELLIGENCE
What is the actual order of execution when Top-K, Top-P and Temperature are used together for NLP decoding?
What is the actual order of execution when Top-K, Top-P and Temperature are used together for NLP decoding? Let's say I use: sample_outputs = model.generate(**model_inputs,max_new_tokens=40,do_sample=True, top_k=3,top_p=0.51, temperature=0.6, num_return_sequences=3,) What is the order of execution in this one? Lo...
https://stackoverflow.com/questions/77132684/what-is-the-actual-order-of-execution-when-top-k-top-p-and-temperature-are-used
machine-learning, deep-learning, nlp, artificial-intelligence, huggingface-transformers
1,695,110,411
se_62261602
stackoverflow
ARTIFICIAL_INTELLIGENCE
Downloading transformers models to use offline
Downloading transformers models to use offline I have a trained transformers NER model that I want to use on a machine not connected to the internet. When loading such a model, currently it downloads cache files to the .cache folder. To load and run the model offline, you need to copy the files in the .cache folder to...
https://stackoverflow.com/questions/62261602/downloading-transformers-models-to-use-offline
python, nlp, pytorch, huggingface-transformers
1,591,617,640
se_78545464
stackoverflow
ARTIFICIAL_INTELLIGENCE
PyABSA for Aspect Based Sentiment ANalysis
PyABSA for Aspect Based Sentiment ANalysis I am working on Aspect based Sentiment Analysis and came across this nice package - PyABSA. I've found that version 2 is problematic with the models not getting loaded, so I'm using version 1. There is a slight problem being that it works with downloading the checkpoints from...
https://stackoverflow.com/questions/78545464/pyabsa-for-aspect-based-sentiment-analysis
nlp, huggingface-transformers, sentiment-analysis
1,716,914,762
se_78546693
stackoverflow
ARTIFICIAL_INTELLIGENCE
Why loading AutoTokenizer takes so much RAM?
Why loading AutoTokenizer takes so much RAM? I was measuring the RAM that is used by my script and I was surprised that it takes about 300Mb of RAM, while the tokenizer file itself is about 9MB. Why is that? I tried: from transformers import AutoTokenizer from memory_profiler import profile @profile def load_tokenize...
https://stackoverflow.com/questions/78546693/why-loading-autotokenizer-takes-so-much-ram
machine-learning, deep-learning, nlp, huggingface-transformers, sentence-transformers
1,716,936,250
se_78492910
stackoverflow
ARTIFICIAL_INTELLIGENCE
How to remove stop words in Power Query Editor in Power BI
How to remove stop words in Power Query Editor in Power BI I've loaded an Excel file with reviews into Power BI Desktop. I want to do Sentiment Analysis on the file. I've already turned everything in the reviews column(named Column3) to lowercase and removed punctuation marks using the Power Query Editor by inserting ...
https://stackoverflow.com/questions/78492910/how-to-remove-stop-words-in-power-query-editor-in-power-bi
nlp, powerquery, powerbi-desktop, sentiment-analysis, m
1,715,904,057
se_78550266
stackoverflow
ARTIFICIAL_INTELLIGENCE
Pretrained Translation model(french to english) for food related data
Pretrained Translation model(french to english) for food related data I am working on a project that involves mapping between two food-related datasets. One dataset is in French, and the other is in English. Both datasets have a "food name" field, but I am not fluent in French and would prefer not to use Google Transl...
https://stackoverflow.com/questions/78550266/pretrained-translation-modelfrench-to-english-for-food-related-data
nlp, translation, bert-language-model, large-language-model, french
1,716,993,316
se_78550856
stackoverflow
ARTIFICIAL_INTELLIGENCE
transformer model error index out of range in self
transformer model error index out of range in self I am trying to run a transformer model using my own dataset import json import torch import torch.nn as nn from torch.utils.data import Dataset, DataLoader, random_split from transformers import BertTokenizer, BertModel import math # Load JSON data with open('/Users/...
https://stackoverflow.com/questions/78550856/transformer-model-error-index-out-of-range-in-self
nlp
1,717,000,543
se_78540071
stackoverflow
ARTIFICIAL_INTELLIGENCE
Find exact and similar phrases in a string with millions of characters
Find exact and similar phrases in a string with millions of characters I have a list of phrases and a corpus which is a string of text with millions of words. For each phrase in my phrase list, I want to find and record the most similar phrases found in the corpus-string. For my purposes I need to use SBERT similarity...
https://stackoverflow.com/questions/78540071/find-exact-and-similar-phrases-in-a-string-with-millions-of-characters
python, algorithm, nlp, sentence-similarity, sentence-transformers
1,716,825,332
se_78548098
stackoverflow
ARTIFICIAL_INTELLIGENCE
Chunking text with bounding box values
Chunking text with bounding box values I have used the Azure OCR service to extract text from PDFs. For each page in a PDF, the OCR output contains a list of text lines along with the bounding box values for that line. My original approach to chunk the text in each page was to firstly combine the strings in the list o...
https://stackoverflow.com/questions/78548098/chunking-text-with-bounding-box-values
python, text, nlp, langchain
1,716,969,288
se_78547727
stackoverflow
ARTIFICIAL_INTELLIGENCE
Semantic chunking of an audio
Semantic chunking of an audio I need to perform semantic chunking of an audio file. So far, I have resampled the audio to 16000 Hz and then used wav2vec2 for getting transcriptions of the audio. I need to Time-Align Transcript with Audio: Describe the methodology and steps for aligning the transcript with the audio. ...
https://stackoverflow.com/questions/78547727/semantic-chunking-of-an-audio
nlp, speech-recognition, speech-to-text
1,716,964,677
se_55100037
stackoverflow
ARTIFICIAL_INTELLIGENCE
How to extract text from two column pdf with Python?
How to extract text from two column pdf with Python? I have : I have a PDF which are in two-column format.Is there a way to read each PDF according to the two-column format without cropping each PDF individually?
https://stackoverflow.com/questions/55100037/how-to-extract-text-from-two-column-pdf-with-python
python, nlp
1,552,301,034
se_78538749
stackoverflow
ARTIFICIAL_INTELLIGENCE
Not able to install spacy==2.3.5 version
Not able to install spacy==2.3.5 version I tried to install spacy==2.3.5 for a resume analyser program. Encountered with a pip subprocess to install build dependencies did not run successfully error. Using Python 3.12.3 Also it gives a E053 config file error when running the program regarding pyresparser: "OSError: [E...
https://stackoverflow.com/questions/78538749/not-able-to-install-spacy-2-3-5-version
python, parsing, pip, nlp, spacy
1,716,808,809
se_78545928
stackoverflow
ARTIFICIAL_INTELLIGENCE
Is there a method to load caseless models to Stanford&#39;s NLP sentiment analysis?
Is there a method to load caseless models to Stanford&#39;s NLP sentiment analysis? In the Stanford documentation, the authors mention using caseless models to process case-insensitive text. Namely the ability to load the GATE Twitter POS annotator. It is a POS annotator, but it doesn't mention that sentiment analysis...
https://stackoverflow.com/questions/78545928/is-there-a-method-to-load-caseless-models-to-stanfords-nlp-sentiment-analysis
nlp, stanford-nlp
1,716,922,126
se_78540836
stackoverflow
ARTIFICIAL_INTELLIGENCE
Fasttext pre-trained model is not producing OOV word vectors when using gensim downloader
Fasttext pre-trained model is not producing OOV word vectors when using gensim downloader I am having A LOT of trouble when trying to use all the fasttext libraries (in Jupyter with Anaconda3 on Windows 11) that I have found so far but this question is mainly about gensim's implementation. I simply can't get it to wor...
https://stackoverflow.com/questions/78540836/fasttext-pre-trained-model-is-not-producing-oov-word-vectors-when-using-gensim-d
python, nlp, gensim, word-embedding, fasttext
1,716,838,820
se_59327637
stackoverflow
ARTIFICIAL_INTELLIGENCE
How do I train gpt 2 from scratch?
How do I train gpt 2 from scratch? I want to train gpt 2 from scratch but there is only fine-tuning approach based on pretrained models in articles I found. I've used this https://github.com/nshepperd/gpt-2 for train with existing model. Should I edit these Python scripts to train from scratch?
https://stackoverflow.com/questions/59327637/how-do-i-train-gpt-2-from-scratch
python, machine-learning, nlp, nlg
1,576,259,866
se_78540296
stackoverflow
ARTIFICIAL_INTELLIGENCE
How to automatically choose the &quot;best&quot; K for a STM model based on multiple diagnostic variables
How to automatically choose the &quot;best&quot; K for a STM model based on multiple diagnostic variables In structural topic modeling using the stm R package, the function searchK allows the user to run multiple models with different numbers of topics, and then returns the diagnostic properties for each model, so tha...
https://stackoverflow.com/questions/78540296/how-to-automatically-choose-the-best-k-for-a-stm-model-based-on-multiple-diagn
r, nlp, stm
1,716,829,153
se_71512301
stackoverflow
ARTIFICIAL_INTELLIGENCE
ERROR: Could not build wheels for spacy, which is required to install pyproject.toml-based projects
ERROR: Could not build wheels for spacy, which is required to install pyproject.toml-based projects Hi Guys, I am trying to install spacy model == 2.3.5 but I am getting this error, please help me!
https://stackoverflow.com/questions/71512301/error-could-not-build-wheels-for-spacy-which-is-required-to-install-pyproject
python, python-3.x, pip, nlp, spacy
1,647,520,185
se_75067335
stackoverflow
ARTIFICIAL_INTELLIGENCE
What does GlobalAveragePooling1D do in keras?
What does GlobalAveragePooling1D do in keras? In the embedding example here: https://www.tensorflow.org/text/guide/word_embeddings result = embedding_layer(tf.constant([[0, 1, 2], [3, 4, 5]])) result.shape TensorShape([2, 3, 5]) Then it explains: When given a batch of sequences as input, an embedding layer returns a...
https://stackoverflow.com/questions/75067335/what-does-globalaveragepooling1d-do-in-keras
keras, nlp, embedding
1,673,339,642
se_77283759
stackoverflow
ARTIFICIAL_INTELLIGENCE
ERROR: Could not build wheels for neuralcoref, which is required to install pyproject.toml-based projects
ERROR: Could not build wheels for neuralcoref, which is required to install pyproject.toml-based projects I am running spacy 3.6.1 on google colab. After all requirements installation, I got an error when I tried to install tokenizer I am trying to use NeuralCoref4.0 to perform coreference resolution on google colab. ...
https://stackoverflow.com/questions/77283759/error-could-not-build-wheels-for-neuralcoref-which-is-required-to-install-pypr
python, pip, nlp, google-colaboratory, spacy
1,697,143,577
se_78534830
stackoverflow
ARTIFICIAL_INTELLIGENCE
chatbot memory problem for langchain using ConversationalRetrievalChain
chatbot memory problem for langchain using ConversationalRetrievalChain i have build a chatbot on custom data using langchain, but the chatbot can not remember my previous questions, I found it difficult with the ConversationalRetrievalChain. My code is as below: `class MyBot(ActivityHandler): def __init__(self, c...
https://stackoverflow.com/questions/78534830/chatbot-memory-problem-for-langchain-using-conversationalretrievalchain
nlp, chatbot, openai-api, langchain, conversational-ai
1,716,715,908
se_76599034
stackoverflow
ARTIFICIAL_INTELLIGENCE
How can I solve installation error of texthero?
How can I solve installation error of texthero? When I tried to !pip install texthero on Google Colab, below error happen therefore I cannot import texthero. code of pip install !pip install texthero result message with error after pip install Collecting texthero Downloading texthero-1.1.0-py3-none-any.whl (24 ...
https://stackoverflow.com/questions/76599034/how-can-i-solve-installation-error-of-texthero
python, nlp, gensim, data-preprocessing
1,688,303,095
se_7113008
stackoverflow
ARTIFICIAL_INTELLIGENCE
Fuzzy sentence search algorithms
Fuzzy sentence search algorithms Suppose I have a set of phrases - about 10 000 - of average length - 7-20 words in which I want to find some given phrase. The phrase I am looking for could have some errors - for example miss one or two words, have some words misplaced, or some random words - for example my database c...
https://stackoverflow.com/questions/7113008/fuzzy-sentence-search-algorithms
nlp, fuzzy-search
1,313,695,772
se_76932312
stackoverflow
ARTIFICIAL_INTELLIGENCE
Fine tuning T5 not converging
Fine tuning T5 not converging I am new in this world of transformers and NLP, and I am having a problem when fine tuning T5 for my specific use case. What I want to achieve, is that the model receives an input text, and outputs a JSON (as a string) of the relevant information in the text. There are 3 formats that the ...
https://stackoverflow.com/questions/76932312/fine-tuning-t5-not-converging
nlp, huggingface-transformers
1,692,389,289
se_78529019
stackoverflow
ARTIFICIAL_INTELLIGENCE
Calculating weighted cosine similarity between vectors of words
Calculating weighted cosine similarity between vectors of words I have two word lists, where each word makes up a topic, and has a tf-idf weight for that topic: topic1 = [('blue',.1), ('red',.05), ('sky',.01)] topic2 = [('water',.5), ('fire',.1), ('earth',.02)] I am trying to calculate the cosine similarity between t...
https://stackoverflow.com/questions/78529019/calculating-weighted-cosine-similarity-between-vectors-of-words
python, nlp, cosine-similarity
1,716,558,858
se_78525770
stackoverflow
ARTIFICIAL_INTELLIGENCE
Filtering stop words out of a multiple text files (using a list of stop words)
Filtering stop words out of a multiple text files (using a list of stop words) I have a folder named cleaned_texts. The folder contains text files(a.txt, b.txt, c.txt etc) and each text file contains tokenized words in this format:['Rise', 'of', 'e-health', 'and', 'its', 'Germany', 'dollar']. Example: a.txt contains [...
https://stackoverflow.com/questions/78525770/filtering-stop-words-out-of-a-multiple-text-files-using-a-list-of-stop-words
python, nlp
1,716,502,512
se_54717449
stackoverflow
ARTIFICIAL_INTELLIGENCE
Mapping word vector to the most similar/closest word using spaCy
Mapping word vector to the most similar/closest word using spaCy I am using spaCy as part of a topic modelling solution and I have a situation where I need to map a derived word vector to the "closest" or "most similar" word in a vocabulary of word vectors. I see gensim has a function (WordEmbeddingsKeyedVectors.simi...
https://stackoverflow.com/questions/54717449/mapping-word-vector-to-the-most-similar-closest-word-using-spacy
nlp, spacy, word2vec, word-embedding
1,550,267,001
se_69233467
stackoverflow
ARTIFICIAL_INTELLIGENCE
How to use tflite model coverted from TFMarianMTModel on huggingface
How to use tflite model coverted from TFMarianMTModel on huggingface I am looking for a en-zh translate model that can be used in TFLite, and i found one on huggingface: https://huggingface.co/Helsinki-NLP/opus-mt-en-zh I have coverted the model to .tflite by follow code: import tensorflow as tf from transformers impo...
https://stackoverflow.com/questions/69233467/how-to-use-tflite-model-coverted-from-tfmarianmtmodel-on-huggingface
nlp, tensorflow-lite, transformer-model
1,631,958,238
se_78520478
stackoverflow
ARTIFICIAL_INTELLIGENCE
ValueError: too many values to unpack (expected 2) or not enough values to unpack (expected 2, got 1)
ValueError: too many values to unpack (expected 2) or not enough values to unpack (expected 2, got 1) I am trying to train T5 model binary classification. When I am trying to define data class, I am getting batch_size, seq_length = input_shape 1017 # required mask seq length can be calculated via length of past 1018 m...
https://stackoverflow.com/questions/78520478/valueerror-too-many-values-to-unpack-expected-2-or-not-enough-values-to-unpac
python, nlp, huggingface-transformers, pytorch-lightning, pytorch-dataloader
1,716,424,238
se_78452739
stackoverflow
ARTIFICIAL_INTELLIGENCE
How to convert a AutoModelForCausalLM object to a dspy model object?
How to convert a AutoModelForCausalLM object to a dspy model object? import dspy llm = dspy.HFModel(model='model') This method takes a string as input for the model if i have a quantized model object of the class AutoModelForCausalLM How i can convert the model object to dspy object? direct assignment gives error o...
https://stackoverflow.com/questions/78452739/how-to-convert-a-automodelforcausallm-object-to-a-dspy-model-object
nlp, large-language-model, llama, autoclass, dspy
1,715,237,122
se_78370305
stackoverflow
ARTIFICIAL_INTELLIGENCE
How to import tensorflow-text correctly
How to import tensorflow-text correctly I have bundle of errors in importing tensorflow-text. I was first trying to import the below versions which were working correctly. !pip install tensorflow==2.8 but now it says like this `import tensorflow as tf ModuleNotFoundError: No module named 'tensorflow.tsl'` with this ...
https://stackoverflow.com/questions/78370305/how-to-import-tensorflow-text-correctly
tensorflow, keras, deep-learning, nlp
1,713,854,433
se_78513763
stackoverflow
ARTIFICIAL_INTELLIGENCE
ValueError: Expected input batch_size (2) to match target batch_size (4)
ValueError: Expected input batch_size (2) to match target batch_size (4) Here is the code for a text classification task I am doing. The issue seems to lie here. This is a multi class problem. I have 3 labels. I tried several things. I changed the format of the labels to integers and tried looking into the loss functi...
https://stackoverflow.com/questions/78513763/valueerror-expected-input-batch-size-2-to-match-target-batch-size-4
python, pytorch, nlp, torch
1,716,316,339
se_73179717
stackoverflow
ARTIFICIAL_INTELLIGENCE
Find the most likely word alignment between two strings in Python
Find the most likely word alignment between two strings in Python I have 2 similar strings. How can I find the most likely word alignment between these two strings in Python? Example of input: string1 = 'my channel is youtube dot com slash example and then I also do live streaming on twitch.' string2 = 'my channel is ...
https://stackoverflow.com/questions/73179717/find-the-most-likely-word-alignment-between-two-strings-in-python
python, text, nlp, alignment, text-alignment
1,659,223,659
se_66655023
stackoverflow
ARTIFICIAL_INTELLIGENCE
Longformer get last_hidden_state
Longformer get last_hidden_state I am trying to follow this example in the huggingface documentation here https://huggingface.co/transformers/model_doc/longformer.html: import torch from transformers import LongformerModel, LongformerTokenizer model = LongformerModel.from_pretrained('allenai/longformer-base-4096') tok...
https://stackoverflow.com/questions/66655023/longformer-get-last-hidden-state
python, nlp, pytorch, huggingface-transformers
1,615,896,854