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_79321551
stackoverflow
ARTIFICIAL_INTELLIGENCE
getting an error: object of type 'float' has no len()
getting an error: object of type 'float' has no len() I am a naive in python and started learning python few months ago I am working on twitter data in my local, it has 4 columns. ID, brand, sentiment, comment def data_clean_pipeline(text): #removing html tags text = str(BeautifulSoup(text).get_text())...
https://stackoverflow.com/questions/79321551/getting-an-error-object-of-type-float-has-no-len
python, python-3.x, twitter, nlp, project
1,735,732,880
se_75127920
stackoverflow
ARTIFICIAL_INTELLIGENCE
How do I combine lists in column of dataframe to a single list
How do I combine lists in column of dataframe to a single list Some context, I have some data that I'm doing some text analysis on, I have just tokenized them and I want to combine all the lists in the dataframe column for some further processing. My df is as: df = pd.DataFrame({'title': ['issue regarding app', 'graph...
https://stackoverflow.com/questions/75127920/how-do-i-combine-lists-in-column-of-dataframe-to-a-single-list
python, pandas, list, dataframe, nlp
1,673,811,691
se_79315936
stackoverflow
ARTIFICIAL_INTELLIGENCE
Is n-gram precision the number of elements in the intersection of one hypothesis and possibly many references?
Is n-gram precision the number of elements in the intersection of one hypothesis and possibly many references? I was trying to understand how BLEU score works and noticed that if I had to compute the n-gram precisions and have multiple reference sentences, it makes more sense to turn everything into sets to remove dup...
https://stackoverflow.com/questions/79315936/is-n-gram-precision-the-number-of-elements-in-the-intersection-of-one-hypothesis
nlp, nltk, bleu
1,735,489,512
se_35281004
stackoverflow
ARTIFICIAL_INTELLIGENCE
How to make api.ai agent learn something dynamically?
How to make api.ai agent learn something dynamically? I am currently using api.ai , to create agent to perform specific tasks, but one question i don't have answer to is , can i make it learn something while chatting , mean that i speak my name is 'John Cena' and she should store it and then whenever i ask her again b...
https://stackoverflow.com/questions/35281004/how-to-make-api-ai-agent-learn-something-dynamically
android, json, nlp, artificial-intelligence, dialogflow-es
1,454,972,473
se_70778039
stackoverflow
ARTIFICIAL_INTELLIGENCE
Split each line in a file based on delimitters
Split each line in a file based on delimitters This is the sample data in a file. I want to split each line in the file and add it to a dataframe. In some cases they have more than 1 child. So whenever they have more than one child new set of column have to be added child2 Name and DOB (P322) Rashmika Chadda 15/05/199...
https://stackoverflow.com/questions/70778039/split-each-line-in-a-file-based-on-delimitters
python, split, nlp, delimiter
1,642,628,131
se_79312133
stackoverflow
ARTIFICIAL_INTELLIGENCE
Getting all leaf words (reverse stemming) into one Python List
Getting all leaf words (reverse stemming) into one Python List On the same lines as the solution provided in this link, I am trying to get all leaf words of one stem word. I am using the community-contributed (@Divyanshu Srivastava) package get_word_forms Imagine I have a shorter sample word list as follows: my_list =...
https://stackoverflow.com/questions/79312133/getting-all-leaf-words-reverse-stemming-into-one-python-list
python, nlp, nltk
1,735,311,845
se_79274184
stackoverflow
ARTIFICIAL_INTELLIGENCE
How to split and spelling correct arabic text without spaces into list of words
How to split and spelling correct arabic text without spaces into list of words I'm looking for a way to split the Arabic text and correct the spelling. Whitespace is the first splitting criterion, then, Maybe based on a dictionary of correct words the splitting should done, considering spelling issues: تشرابالقطط الح...
https://stackoverflow.com/questions/79274184/how-to-split-and-spelling-correct-arabic-text-without-spaces-into-list-of-words
algorithm, deep-learning, nlp
1,733,988,889
se_69135038
stackoverflow
ARTIFICIAL_INTELLIGENCE
How to label review having both positive and negative sentiment words
How to label review having both positive and negative sentiment words I have used vader library for labeling of amazon's reviews but it doesn't handle these types of reviews "No problems with it and does job well. Using it for Apple TV and works great. I would buy again no problem". This is positive sentence but the c...
https://stackoverflow.com/questions/69135038/how-to-label-review-having-both-positive-and-negative-sentiment-words
python-3.x, nlp, sentiment-analysis, review, vader
1,631,290,010
se_79302218
stackoverflow
ARTIFICIAL_INTELLIGENCE
torch.nn.functional.softmax giving inaccurate softmax output
torch.nn.functional.softmax giving inaccurate softmax output I am trying to implement masked self-attention from scratch but when calculating the softmax for the similarity scores I get odd results. I looked at the documentation and other questions posted on here but I still cant figure out what I am doing wrong. Belo...
https://stackoverflow.com/questions/79302218/torch-nn-functional-softmax-giving-inaccurate-softmax-output
python, pytorch, nlp, softmax
1,734,931,097
se_79300733
stackoverflow
ARTIFICIAL_INTELLIGENCE
How to apply semantic tokenize on sentence in java by NLP?
How to apply semantic tokenize on sentence in java by NLP? Can an NLP model be used to tokenize a sentence based on its semantic meaning? For example, for the sentence: If the driver's age is more than 20, the tokens would be: Token1: if Token2: driver age Token3: more than Token4: 20
https://stackoverflow.com/questions/79300733/how-to-apply-semantic-tokenize-on-sentence-in-java-by-nlp
java, nlp, stanford-nlp
1,734,859,237
se_79260748
stackoverflow
ARTIFICIAL_INTELLIGENCE
How to install spacy?
How to install spacy? I am using trying to install spacy library using 'pip install -U spacy' in the command prompt (run as admin) in Windows-11 O.S., but it shows some error I don't understand. I am using Python 3.13.0, gcc 13.2.0 and make 4.4.1. What could be the problem? Or is there any other way to install spacy? ...
https://stackoverflow.com/questions/79260748/how-to-install-spacy
python, pip, nlp, spacy
1,733,580,474
se_56071689
stackoverflow
ARTIFICIAL_INTELLIGENCE
What's the major difference between glove and word2vec?
What's the major difference between glove and word2vec? What is the difference between word2vec and glove? Are both the ways to train a word embedding? if yes then how can we use both?
https://stackoverflow.com/questions/56071689/whats-the-major-difference-between-glove-and-word2vec
machine-learning, nlp, word2vec, word-embedding, glove
1,557,468,619
se_79298368
stackoverflow
ARTIFICIAL_INTELLIGENCE
Inspect all probabilities of BERTopic model
Inspect all probabilities of BERTopic model Say I build a BERTopic model using from bertopic import BERTopic topic_model = BERTopic(n_gram_range=(1, 1), nr_topics=20) topics, probs = topic_model.fit_transform(docs) Inspecting probs gives me just a single value for each item in docs. probs array([0.51914467, 0. ...
https://stackoverflow.com/questions/79298368/inspect-all-probabilities-of-bertopic-model
python, nlp, topic-modeling
1,734,727,774
se_52799472
stackoverflow
ARTIFICIAL_INTELLIGENCE
How to make an AI bot of Natural Language Processing?
How to make an AI bot of Natural Language Processing? I want to make AI bot which can understand only 4 words "Up", "Down", "Left", "Right". as my friend make a python script which executes some task by the voice like to open youtube just say "Youtube" and Chrome browser will open with youtube.com URL. But the system ...
https://stackoverflow.com/questions/52799472/how-to-make-an-ai-bot-of-natural-language-processing
python, machine-learning, nlp, artificial-intelligence, opennlp
1,539,491,401
se_35556433
stackoverflow
ARTIFICIAL_INTELLIGENCE
Any tutorial for developing spoken dialogue system in prolog?
Any tutorial for developing spoken dialogue system in prolog? I would like to implement a human-machine spoken dialogue system in a context of bar, which takes as input a text phrase from the user (a request for a given product: chips, cola, water, coffee, etc.) and return as output the corresponding response (Beyond ...
https://stackoverflow.com/questions/35556433/any-tutorial-for-developing-spoken-dialogue-system-in-prolog
prolog, nlp, artificial-intelligence
1,456,152,027
se_78585519
stackoverflow
ARTIFICIAL_INTELLIGENCE
Benepar for syntactic segmentation
Benepar for syntactic segmentation I want to use Benepar with a French model to do a syntactic segmentation. I followed the tutorial but I have always have this error RuntimeError: Error(s) in loading state_dict for ChartParser: Unexpected key(s) in state_dict: "pretrained_model.embeddings.position_ids". I tried to ...
https://stackoverflow.com/questions/78585519/benepar-for-syntactic-segmentation
text, nlp, text-segmentation, french, benepar
1,717,664,245
se_79293889
stackoverflow
ARTIFICIAL_INTELLIGENCE
catelog sentences into 5 words that represent them
catelog sentences into 5 words that represent them I have dataframe with 1000 text rows. df['text'] I also have 5 words that I want to know for each one of them how much they represnt the text (between 0 to 1) every score will be in df["word1"] ,df["word2"] and etc I will glad for recomendations how to do that edit r...
https://stackoverflow.com/questions/79293889/catelog-sentences-into-5-words-that-represent-them
python, pandas, nlp, text-mining, similarity
1,734,603,407
se_79293919
stackoverflow
ARTIFICIAL_INTELLIGENCE
Determining most popular words in the English dictionary within a dictionary of words
Determining most popular words in the English dictionary within a dictionary of words Forgive me if my wording is awful, but I'm trying to figure out how to determine the most used words in the English language from a set of words in a dictionary I've made. I've done some research on NLTK but can't seem to find a func...
https://stackoverflow.com/questions/79293919/determining-most-popular-words-in-the-english-dictionary-within-a-dictionary-of
python, nlp, nltk, detection
1,734,603,844
se_71215965
stackoverflow
ARTIFICIAL_INTELLIGENCE
How to save checkpoints for thie transformer gpt2 to continue training?
How to save checkpoints for thie transformer gpt2 to continue training? I am retraining the GPT2 language model, and am following this blog : https://towardsdatascience.com/train-gpt-2-in-your-own-language-fc6ad4d60171 Here, they have trained a network on GPT2, and I am trying to recreate a same. However, my dataset i...
https://stackoverflow.com/questions/71215965/how-to-save-checkpoints-for-thie-transformer-gpt2-to-continue-training
tensorflow, nlp, gpt-2
1,645,504,561
se_79287799
stackoverflow
ARTIFICIAL_INTELLIGENCE
How to correctly identify entity types for tokens using spaCy using python?
How to correctly identify entity types for tokens using spaCy using python? I'm using spaCy to extract and identify entity types (like ORG, GPE, DATE, etc.) from a text description. However, I am noticing some incorrect results, and I'm unsure how to fix this. Here is the code I am using: import spacy nlp = spacy.loa...
https://stackoverflow.com/questions/79287799/how-to-correctly-identify-entity-types-for-tokens-using-spacy-using-python
python, machine-learning, nlp, spacy
1,734,437,389
se_76238212
stackoverflow
ARTIFICIAL_INTELLIGENCE
Bert model splits words by its own
Bert model splits words by its own I am tokenizing the input words using bert model. The code is : tokenizer = BertTokenizer.from_pretrained('bert-base-multilingual-cased',do_lower_case = False) model = BertModel.from_pretrained("bert-base-multilingual-cased", add_pooling_layer=False, output_hidden_states=True, output...
https://stackoverflow.com/questions/76238212/bert-model-splits-words-by-its-own
python, nlp, huggingface-transformers, bert-language-model
1,683,908,223
se_79279045
stackoverflow
ARTIFICIAL_INTELLIGENCE
Recommending a pre-train NER model for geospatial entities
Recommending a pre-train NER model for geospatial entities I am trying to find the best pre-trained Hugging Face Transformer model exclusively dedicated to geospatial or location entities to extract location entities in English from a text. Does it work way better than roberta-large?
https://stackoverflow.com/questions/79279045/recommending-a-pre-train-ner-model-for-geospatial-entities
nlp, geolocation, pipeline, geospatial, huggingface-transformers
1,734,108,820
se_79283846
stackoverflow
ARTIFICIAL_INTELLIGENCE
--user-dir in Fairseq in failing
--user-dir in Fairseq in failing I’m trying to fine-tune the IndicTrans2 model using fairseq-train, but I keep encountering the following error: fairseq-train: error: argument --user-dir: invalid Optional value: 'C:/Users/sasid/Downloads/en-indic-exp/model_configs' I’ve provided the --user-dir argument as the path to ...
https://stackoverflow.com/questions/79283846/user-dir-in-fairseq-in-failing
python, nlp, huggingface-transformers, large-language-model, fairseq
1,734,332,595
se_77028326
stackoverflow
ARTIFICIAL_INTELLIGENCE
Searching for specific words in Corpus with R (tm package)
Searching for specific words in Corpus with R (tm package) I have a Corpus (tm package), containing a collection of 1.300 different text documents [Content: documents: 1.300]. My goal is now to search the frequency of a specific wordlist in each of those documents. E.g. if my wordlist contains the words "january, feb...
https://stackoverflow.com/questions/77028326/searching-for-specific-words-in-corpus-with-r-tm-package
r, nlp, tm, corpus
1,693,658,469
se_79057082
stackoverflow
ARTIFICIAL_INTELLIGENCE
Avoiding overlap in frequency and document frequency count in Quanteda
Avoiding overlap in frequency and document frequency count in Quanteda Below is a dummy corpus of 4 documents. The dictionary was developed to identify the frequency of words or phrases in the corpus, as well as the number of documents a word or phrases occurs in. The world 'Australians' occurs in two dictionary keys ...
https://stackoverflow.com/questions/79057082/avoiding-overlap-in-frequency-and-document-frequency-count-in-quanteda
r, count, nlp, overlap, quanteda
1,728,132,232
se_76780201
stackoverflow
ARTIFICIAL_INTELLIGENCE
RuntimeError: "element 0 of tensors does not require grad and does not have a grad_fn"
RuntimeError: "element 0 of tensors does not require grad and does not have a grad_fn" I am facing an issue while training a comment classification model using PyTorch Lightning with a pre-trained BERT model. I encountered the following error during the training process: RuntimeError: element 0 of tensors do...
https://stackoverflow.com/questions/76780201/runtimeerror-element-0-of-tensors-does-not-require-grad-and-does-not-have-a-gr
machine-learning, nlp, model, training-data, kaggle
1,690,464,166
se_79264247
stackoverflow
ARTIFICIAL_INTELLIGENCE
similarity from word to sentence after doing words Embedding
similarity from word to sentence after doing words Embedding I have dataframe with 1000 text rows. I did word2vec . Now I want to create a new field which give me the distance from each sentence to the word that i want, lets say the word "king". I thought about taking in each sentence the 4 closet words to the word ki...
https://stackoverflow.com/questions/79264247/similarity-from-word-to-sentence-after-doing-words-embedding
python, nlp, text-mining, word2vec, similarity
1,733,732,044
se_75897180
stackoverflow
ARTIFICIAL_INTELLIGENCE
Langchain Chatbot with Memory + Vector Database
Langchain Chatbot with Memory + Vector Database In Langchain, what is the suggested way to build a chatbot with memory and retrieval from a vector embedding database at the same time? The examples in the docs add memory modules to chains that do not have a vector database. Related issue.
https://stackoverflow.com/questions/75897180/langchain-chatbot-with-memory-vector-database
nlp, chatbot, language-model, langchain
1,680,256,745
se_78039417
stackoverflow
ARTIFICIAL_INTELLIGENCE
Questions about training LLMs on large text datasets for text generation from scratch
Questions about training LLMs on large text datasets for text generation from scratch I made a fully custom made GPT in Jax (with Keras 3), using Tensorflow for the data pipeline. I've trained the model on the Shakespeare dataset and got good results (so no problem with the model). Now I want to train it on the Tiny-S...
https://stackoverflow.com/questions/78039417/questions-about-training-llms-on-large-text-datasets-for-text-generation-from-sc
python, tensorflow, deep-learning, nlp, tf.data.dataset
1,708,590,835
se_74692176
stackoverflow
ARTIFICIAL_INTELLIGENCE
Huggingface: Fine-tuning (not enough values to unpack (expected 2, got 1))
Huggingface: Fine-tuning (not enough values to unpack (expected 2, got 1)) I'm trying to fine-tune erfan226/persian-t5-paraphraser paraphrase generator model for Persian sentences. I used the Persian dataset of tapaco and reformatted it to match the glue (mrpc) dataset which is used in the fine-tuning documentation. I...
https://stackoverflow.com/questions/74692176/huggingface-fine-tuning-not-enough-values-to-unpack-expected-2-got-1
nlp, huggingface, fine-tuning
1,670,261,701
se_60142937
stackoverflow
ARTIFICIAL_INTELLIGENCE
HuggingFace Transformers For Text Generation with CTRL with Google Colab's free GPU
HuggingFace Transformers For Text Generation with CTRL with Google Colab's free GPU I wanted to test TextGeneration with CTRL using PyTorch-Transformers, before using it for fine-tuning. But it doesn't prompt anything like it does with GPT-2 and other similar language generation models. I'm very new for this and a...
https://stackoverflow.com/questions/60142937/huggingface-transformers-for-text-generation-with-ctrl-with-google-colabs-free
python, deep-learning, nlp, pytorch, huggingface-transformers
1,581,297,261
se_70698947
stackoverflow
ARTIFICIAL_INTELLIGENCE
How to import and use stopwords list from NLTK?
How to import and use stopwords list from NLTK? I already imported stopwords from nltk.corpus, but I get STOPWORDS is not defined error. Below is my code: import nltk from nltk.corpus import stopwords #Create stopword list: stopwords = set(STOPWORDS) The above gives the following error: NameError: name 'STOPWORDS' is...
https://stackoverflow.com/questions/70698947/how-to-import-and-use-stopwords-list-from-nltk
python, machine-learning, nlp, nltk, stop-words
1,642,087,128
se_65927060
stackoverflow
ARTIFICIAL_INTELLIGENCE
Fine-tune BERT for a specific domain on a different language?
Fine-tune BERT for a specific domain on a different language? I want to fine-tune on a pre-trained BERT model. However, my task uses data within a specific domain (say biomedical data). Additionally, my data is also in a language different from English (say Dutch). Now I could fine-tune the Dutch bert-base-dutch-cased...
https://stackoverflow.com/questions/65927060/fine-tune-bert-for-a-specific-domain-on-a-different-language
python-3.x, deep-learning, nlp, bert-language-model
1,611,780,045
se_79253283
stackoverflow
ARTIFICIAL_INTELLIGENCE
Counting the Frequency of Some Words within some other Key Words in Text
Counting the Frequency of Some Words within some other Key Words in Text I have two sets of word lists - first one I called search words and the second one I called key words. My goal is to calculate the frequency of search words within 10 words of key words. For example, assume that the word - acquire - is in key wor...
https://stackoverflow.com/questions/79253283/counting-the-frequency-of-some-words-within-some-other-key-words-in-text
python, pandas, nlp
1,733,367,906
se_37646254
stackoverflow
ARTIFICIAL_INTELLIGENCE
Keyword/phrase extraction from free text using NLTK and Python for structured queries
Keyword/phrase extraction from free text using NLTK and Python for structured queries I want to interpret specific keywords from a free text such as "I want to order boiled eggs and spinach soup from nearest restaurants' and use them to search content from my database. For e.g i want to extract following specific keyw...
https://stackoverflow.com/questions/37646254/keyword-phrase-extraction-from-free-text-using-nltk-and-python-for-structured-qu
python, nlp, nltk, information-retrieval
1,465,157,129
se_69718376
stackoverflow
ARTIFICIAL_INTELLIGENCE
NLP - Specific Text Extraction
NLP - Specific Text Extraction I have to identify the country name from a random text. I have the country list. I am struggling to find a solution that can train the model on the country list and when I provide a random text to that model as an input, it identifies the country name as an output. eg:- "I live in India...
https://stackoverflow.com/questions/69718376/nlp-specific-text-extraction
nlp, text-extraction
1,635,229,839
se_76495143
stackoverflow
ARTIFICIAL_INTELLIGENCE
What does surface form mean in relation extraction?
What does surface form mean in relation extraction? The term "entity surface form" is repeatedly mentioned in most of relation extraction papers. What does it mean? For example, in the REBEL paper, the author mentions that "a relation is considered correct only if the head and tail entity surface forms are correctly e...
https://stackoverflow.com/questions/76495143/what-does-surface-form-mean-in-relation-extraction
machine-learning, nlp, relation-extraction
1,686,986,112
se_77410116
stackoverflow
ARTIFICIAL_INTELLIGENCE
How to decide correct NLP approach for a project
How to decide correct NLP approach for a project I'm working on an NLP project. My task is to determine the category and Sentiment Score of Turkish Call Center conversations from the conversations themselves. We are using Python as our programming language. However, I'm stuck in the initial stages of the project among...
https://stackoverflow.com/questions/77410116/how-to-decide-correct-nlp-approach-for-a-project
machine-learning, text, nlp
1,698,932,726
se_7248372
stackoverflow
ARTIFICIAL_INTELLIGENCE
NLP software for classification of large datasets
NLP software for classification of large datasets For years I've been using my own Bayesian-like methods to categorize new items from external sources based on a large and continually updated training dataset. There are three types of categorization done for each item: 30 categories, where each item must belong to on...
https://stackoverflow.com/questions/7248372/nlp-software-for-classification-of-large-datasets
machine-learning, nlp
1,314,730,810
se_79227390
stackoverflow
ARTIFICIAL_INTELLIGENCE
How to extract specific entities from unstructured text
How to extract specific entities from unstructured text Given a generic text sentence (in a specific context) how can I extract word/entities of interest belonging to a specific "category" using python and any NLP library? For example given a step for a culinary recipe Add an onion to a bowl of carrots as input text, ...
https://stackoverflow.com/questions/79227390/how-to-extract-specific-entities-from-unstructured-text
python, machine-learning, nlp, nltk, spacy
1,732,636,008
se_79256257
stackoverflow
ARTIFICIAL_INTELLIGENCE
Why does moving ML model initialization into a function prevent GPU OOM errors when del, gc.collect(), and torch.cuda.empty_cache() fail?
Why does moving ML model initialization into a function prevent GPU OOM errors when del, gc.collect(), and torch.cuda.empty_cache() fail? for model_name in model_list: model = LLM(model_name, trust_remote_code=True) results = evaluate_model(model, task) del model gc.collect() torch.cuda.empty_cache...
https://stackoverflow.com/questions/79256257/why-does-moving-ml-model-initialization-into-a-function-prevent-gpu-oom-errors-w
python-3.x, nlp, garbage-collection, huggingface-transformers, vllm
1,733,433,542
se_77607529
stackoverflow
ARTIFICIAL_INTELLIGENCE
Output probabilities of tokens generated by Llama 2 using Transformers
Output probabilities of tokens generated by Llama 2 using Transformers Given input tokens, LLMs output the tokens in their vocabulary that have the highest probability of coming after the input tokens. I would like to print the probability of each token generated by the model in response to a prompt to see how confide...
https://stackoverflow.com/questions/77607529/output-probabilities-of-tokens-generated-by-llama-2-using-transformers
nlp, huggingface-transformers, large-language-model, llama
1,701,791,429
se_79249400
stackoverflow
ARTIFICIAL_INTELLIGENCE
Installing SpaCy in Fedora 41
Installing SpaCy in Fedora 41 I am getting into troubles as I try to install spaCy in a Fedora 41, AMD Ryzen machine. I got this: Preparing metadata (pyproject.toml): finished with status 'error' error: subprocess-exited-with-error × Preparing metadata (pyproject.toml) did not run successfully. │ e...
https://stackoverflow.com/questions/79249400/installing-spacy-in-fedora-41
python, nlp, spacy, fedora
1,733,266,113
se_70693229
stackoverflow
ARTIFICIAL_INTELLIGENCE
How to get Bigram/Trigram of word from prelisted unigram from a document corpus / dataframe column
How to get Bigram/Trigram of word from prelisted unigram from a document corpus / dataframe column I have a dataframe with text in one of its columns. I have listed some predefined keywords which I need for analysis and words associated with it (and later make a wordcloud and counter of occurrences) to understand topi...
https://stackoverflow.com/questions/70693229/how-to-get-bigram-trigram-of-word-from-prelisted-unigram-from-a-document-corpus
python, nlp, nltk
1,642,061,175
se_70727739
stackoverflow
ARTIFICIAL_INTELLIGENCE
TfidfVectorizer seems to be giving incorrect results
TfidfVectorizer seems to be giving incorrect results I have a list of length 7 (7 subjectes) Each element in the list contains a long string of words. Each element of the list can be viewed as a topic with a long sentence that sets it apart I want to check which words make each topic unique (each element in the list) ...
https://stackoverflow.com/questions/70727739/tfidfvectorizer-seems-to-be-giving-incorrect-results
python, scikit-learn, nlp, tf-idf, tfidfvectorizer
1,642,312,988
se_79247672
stackoverflow
ARTIFICIAL_INTELLIGENCE
Error in getting Captum text explanations for text classification
Error in getting Captum text explanations for text classification I have the following code that I am using to identify the most influential words used to correctly predict the text in the test dataset import pandas as pd import torch from torch.utils.data import DataLoader from transformers import BertTokenizer, Bert...
https://stackoverflow.com/questions/79247672/error-in-getting-captum-text-explanations-for-text-classification
machine-learning, pytorch, nlp, huggingface-transformers, text-classification
1,733,230,065
se_79247594
stackoverflow
ARTIFICIAL_INTELLIGENCE
euclidian distance from word to sentence after doing Vectorizer
euclidian distance from word to sentence after doing Vectorizer I have dataframe with 1000 text rows. I did TfidfVectorizer. Now I want to create a new field which give me the distance from each sentence to the word that i want, lets say the word "king". df['king'] I thought about taking in each sentence the 5 close...
https://stackoverflow.com/questions/79247594/euclidian-distance-from-word-to-sentence-after-doing-vectorizer
pandas, dataframe, nlp, text-classification, tf-idf
1,733,228,705
se_79234004
stackoverflow
ARTIFICIAL_INTELLIGENCE
Llama-3.2-1B-Instruct generate inconsistent output
Llama-3.2-1B-Instruct generate inconsistent output I want to use Llama-3.2-1B-Instruct model, and although I have set "temperature": 0.0, "top_p":0.0 and "top_k":0, it still generates inconsistent output. This is how my pipeline looks like: pipe = pipeline( "text-generation", model=model_id, torch_dtype=to...
https://stackoverflow.com/questions/79234004/llama-3-2-1b-instruct-generate-inconsistent-output
python, nlp, huggingface-transformers, large-language-model
1,732,798,957
se_61770847
stackoverflow
ARTIFICIAL_INTELLIGENCE
Split Sentences at Bullets and Numbering?
Split Sentences at Bullets and Numbering? I am trying to input text into my word processor to be split into sentences first and then into words. An example paragraph: When the blow was repeated,together with an admonition in childish sentences, he turned over upon his back, and held his paws in a peculiar manner. 1...
https://stackoverflow.com/questions/61770847/split-sentences-at-bullets-and-numbering
python, nlp, nltk, sentence
1,589,361,781
se_69561535
stackoverflow
ARTIFICIAL_INTELLIGENCE
Split text into sentences by and/or
Split text into sentences by and/or Text String: text = ‘Turn left and take the door between stairs and elevator. Turn right to the corridor.’ Desire Output: splitted_sentences= [‘turn left’, ‘take the door between stairs and elevator’, ‘turn right to the corridor’] How can we split this text into sentences as shown...
https://stackoverflow.com/questions/69561535/split-text-into-sentences-by-and-or
python, text, split, nlp, sentence
1,634,154,550
se_79178041
stackoverflow
ARTIFICIAL_INTELLIGENCE
Normalization of token embeddings in BERT encoder blocks
Normalization of token embeddings in BERT encoder blocks Following the multi-headed attention layer in a BERT encoder block, is layer normalization done separately on the embedding of each token (i.e., one mean and variance per token embedding), or on the concatenated vector of all token embeddings (the same mean and ...
https://stackoverflow.com/questions/79178041/normalization-of-token-embeddings-in-bert-encoder-blocks
nlp, normalization, bert-language-model, attention-model
1,731,335,431
se_79180131
stackoverflow
ARTIFICIAL_INTELLIGENCE
How to parse a resume with few shot method using the specified models from HuggingFace and Langchain?
How to parse a resume with few shot method using the specified models from HuggingFace and Langchain? Model selection confusion and some errors while trying to parse a resume with the following codes Trying to do a few shot prompting with a google flan t5 base model While Doing so I am getting an error ERROR:Service....
https://stackoverflow.com/questions/79180131/how-to-parse-a-resume-with-few-shot-method-using-the-specified-models-from-huggi
nlp, prompt, langchain, large-language-model, huggingface
1,731,396,000
se_64109483
stackoverflow
ARTIFICIAL_INTELLIGENCE
How to recognize if string is human name?
How to recognize if string is human name? So I have some text data that's been messily parsed, and due to that I get names mixed in with the actual data. Is there any kind of package/library that helps identify whether a word is a name or not? (In this case, I would be assuming US/western/euro-centric names) Otherwise...
https://stackoverflow.com/questions/64109483/how-to-recognize-if-string-is-human-name
python, nlp
1,601,326,405
se_78895710
stackoverflow
ARTIFICIAL_INTELLIGENCE
NER versus LLM to extract name, gender, role and company from text
NER versus LLM to extract name, gender, role and company from text I need to extract the name, gender, job title and employer/company name from newspaper articles, running the process on local hardware (no Cloud allowed) due to copyright reasons. I've been playing around with Llama 3.1 but I'm finding I don't get usea...
https://stackoverflow.com/questions/78895710/ner-versus-llm-to-extract-name-gender-role-and-company-from-text
nlp, large-language-model, named-entity-recognition
1,724,225,953
se_77603219
stackoverflow
ARTIFICIAL_INTELLIGENCE
Get attention masks from HF pipelines
Get attention masks from HF pipelines How should returned attention masks be accessed from the FeatureExtractionPipeline in Huggingface? The code below takes an embedding model, distributes it and a huggingface dataset across 8 GPUs on a single node, and performs inference on the inputs. The code requires the attentio...
https://stackoverflow.com/questions/77603219/get-attention-masks-from-hf-pipelines
nlp, huggingface-transformers, huggingface, huggingface-tokenizers, accelerate
1,701,735,642
se_79225465
stackoverflow
ARTIFICIAL_INTELLIGENCE
Montreal Forced Aligner(MFA) taking too much time(almost 18 days still going on) to train a 33 GB corpus
Montreal Forced Aligner(MFA) taking too much time(almost 18 days still going on) to train a 33 GB corpus WE are using Montreal Forced Aligner (MFA) 3.x to train an acoustic model on a large dataset (~33GB of audio and transcripts in an Indian language). The training process takes an extremely long time(almost 18 days...
https://stackoverflow.com/questions/79225465/montreal-forced-alignermfa-taking-too-much-timealmost-18-days-still-going-on
python, nlp, speech-recognition, kaldi, phoneme
1,732,600,419
se_79224081
stackoverflow
ARTIFICIAL_INTELLIGENCE
Encoder Decoder Transformer model generate a repetitive token as output in text summarization
Encoder Decoder Transformer model generate a repetitive token as output in text summarization I implemented a transformer Encoder Decoder (Bert2Bert) for text summarization task. In train phase train loss decreases but in prediction phase it generate a repetitive token as output for example [2,2,2,2,.....]. what shoul...
https://stackoverflow.com/questions/79224081/encoder-decoder-transformer-model-generate-a-repetitive-token-as-output-in-text
deep-learning, nlp, huggingface-transformers, bert-language-model
1,732,556,341
se_79213439
stackoverflow
ARTIFICIAL_INTELLIGENCE
How to get domain of words using WordNet in R?
How to get domain of words using WordNet in R? I am trying to use WordNet in R to determine the domain of a list of words (e.g., sports, biology) and represent the results in a dataframe. The goal is to create a dataframe where each domain is a column, and each cell contains 0 or 1 depending on whether the word is ass...
https://stackoverflow.com/questions/79213439/how-to-get-domain-of-words-using-wordnet-in-r
r, nlp, wordnet
1,732,241,422
se_11962955
stackoverflow
ARTIFICIAL_INTELLIGENCE
Extracting data from natural language text
Extracting data from natural language text I have a set of text newspaper ads, I'd like to extract information like the item being sold and its price. These ads don't follow any structured format. I have access to many thousands of these ads. Where should I start on this project? Is there some library that would help ...
https://stackoverflow.com/questions/11962955/extracting-data-from-natural-language-text
machine-learning, nlp
1,344,993,713
se_59409984
stackoverflow
ARTIFICIAL_INTELLIGENCE
Is there a way to extract information from contracts using ML with including contract files and targeted strings as inputs and outputs?
Is there a way to extract information from contracts using ML with including contract files and targeted strings as inputs and outputs? I'm studying whether we could extract certain fields of information (e.g. contract parties, start and end dates) from contracts automatically. I am wondering if those pieces of inform...
https://stackoverflow.com/questions/59409984/is-there-a-way-to-extract-information-from-contracts-using-ml-with-including-con
machine-learning, nlp, information-extraction
1,576,759,123
se_7693470
stackoverflow
ARTIFICIAL_INTELLIGENCE
Strategy for parsing natural language descriptions into structured data
Strategy for parsing natural language descriptions into structured data I have a set of requirements and I'm looking for the best Java-based strategy / algorthm / software to use. Basically, I want to take a set of recipe ingredients entered by real people in natural english and parse out the meta-data into a structu...
https://stackoverflow.com/questions/7693470/strategy-for-parsing-natural-language-descriptions-into-structured-data
java, nlp, dsl, text-parsing
1,318,026,651
se_79202614
stackoverflow
ARTIFICIAL_INTELLIGENCE
Understanding byte-pair encoding tokenization for Greek characters
Understanding byte-pair encoding tokenization for Greek characters I am trying to train a new tokenizer with Greek text to later add the new tokens into the Llama 3.1 tokenizer using tokenizer.add_tokens(list(new_tokens)). However, upon training the byte-pair encoding tokenizer on Greek and Spanish text, the result l...
https://stackoverflow.com/questions/79202614/understanding-byte-pair-encoding-tokenization-for-greek-characters
encoding, nlp, tokenize, byte-pair-encoding
1,732,005,086
se_76050901
stackoverflow
ARTIFICIAL_INTELLIGENCE
Haystack: save InMemoryDocumentStore and load it in retriever later to save embedding generation time
Haystack: save InMemoryDocumentStore and load it in retriever later to save embedding generation time I am using InMemory Document Store and an Embedding retriever for the Q/A pipeline. from haystack.document_stores import InMemoryDocumentStore document_store = InMemoryDocumentStore(embedding_dim =768,use_bm25=True) ...
https://stackoverflow.com/questions/76050901/haystack-save-inmemorydocumentstore-and-load-it-in-retriever-later-to-save-embe
python, nlp, haystack
1,681,880,670
se_66919407
stackoverflow
ARTIFICIAL_INTELLIGENCE
Calculating words similarity score in python
Calculating words similarity score in python I'm trying to calculate books similarity by comparing the topics lists. Need to get similarity score from the 2 lists between 0-1. Example: book1_topics = ["god", "bible", "book", "holy", "religion", "Christian"] book2_topics = ["god", "Christ", "idol", "Jesus"] Tried usi...
https://stackoverflow.com/questions/66919407/calculating-words-similarity-score-in-python
python, nlp, wordnet, cosine-similarity, sentence-similarity
1,617,366,808
se_79190601
stackoverflow
ARTIFICIAL_INTELLIGENCE
Pyspark sentiment analysis invalid output
Pyspark sentiment analysis invalid output I am trying to perform sentiment analysis for a use case. Most of the time, it is giving correct results, but in some cases, even positive comments are being marked as negative. How can I fix my code to achieve better accuracy? My code from pyspark.sql.functions import udf, co...
https://stackoverflow.com/questions/79190601/pyspark-sentiment-analysis-invalid-output
pyspark, nlp, nltk, huggingface-transformers
1,731,623,094
se_60990897
stackoverflow
ARTIFICIAL_INTELLIGENCE
Best way of using hugging face's Mask Filling for more than 1 masked token at a time
Best way of using hugging face's Mask Filling for more than 1 masked token at a time I am able to use hugging face's mask filling pipeline to predict 1 masked token in a sentence using the below: !pip install -q transformers from __future__ import print_function import ipywidgets as widgets from transformers impo...
https://stackoverflow.com/questions/60990897/best-way-of-using-hugging-faces-mask-filling-for-more-than-1-masked-token-at-a
python, neural-network, nlp, huggingface-transformers
1,585,828,203
se_76937361
stackoverflow
ARTIFICIAL_INTELLIGENCE
When to set `add_special_tokens=False` in huggingface transformers tokenizer?
When to set `add_special_tokens=False` in huggingface transformers tokenizer? this is the default way of setting tokenizer in the Hugging Face "transformers" library: from transformers import BertForSequenceClassification,BertTokenizer tokenizer=BertTokenizer.from_pretrained('ProsusAI/finbert') tokens=tokenizer.encode...
https://stackoverflow.com/questions/76937361/when-to-set-add-special-tokens-false-in-huggingface-transformers-tokenizer
python, nlp, tokenize, huggingface-transformers
1,692,486,428
se_78911175
stackoverflow
ARTIFICIAL_INTELLIGENCE
A language model for machine translation between a low-resource language and Portuguese using Tensorflow
A language model for machine translation between a low-resource language and Portuguese using Tensorflow I'm trying to train a language model for machine translation between a low-resource language and Portuguese using Tensorflow. unfortunately, I'm getting the following error: PS C:\Users\myuser\PycharmProjects\teste...
https://stackoverflow.com/questions/78911175/a-language-model-for-machine-translation-between-a-low-resource-language-and-por
python, tensorflow, machine-learning, nlp
1,724,587,615
se_79177228
stackoverflow
ARTIFICIAL_INTELLIGENCE
DASK to_csv() problems due to memory
DASK to_csv() problems due to memory I'm cleaning my text data and afterwards want to save it to csv. Defined cleaning functions work fine, but when to_csv() part comes, here come the problems as well. Maybe someone have faced similar problem and has a trick to share with me how it would be possible to solve it? Maybe...
https://stackoverflow.com/questions/79177228/dask-to-csv-problems-due-to-memory
csv, text, nlp, export-to-csv, dask
1,731,320,013
se_79176535
stackoverflow
ARTIFICIAL_INTELLIGENCE
Using sub-classes as anchors and classes as positives and negatives in a Siamese network with triplet loss?
Using sub-classes as anchors and classes as positives and negatives in a Siamese network with triplet loss? I’m experimenting with a Siamese network using triplet loss to categorize sub-classes into broader classes. My setup differs from traditional triplet loss models: It involves using the sub-class as the anchor an...
https://stackoverflow.com/questions/79176535/using-sub-classes-as-anchors-and-classes-as-positives-and-negatives-in-a-siamese
nlp, distance, bert-language-model, semantics, triplet
1,731,304,679
se_67283506
stackoverflow
ARTIFICIAL_INTELLIGENCE
Hugging face tokenizer cannot load files properly
Hugging face tokenizer cannot load files properly I am trying to train a translation model from sratch using HuggingFace's BartModel architecture. I am using a ByteLevelBPETokenizer to tokenize things. The issue that I am facing is that when I save the tokenizer after training it is not loaded properly even though it ...
https://stackoverflow.com/questions/67283506/hugging-face-tokenizer-cannot-load-files-properly
python, nlp, huggingface-tokenizers
1,619,528,175
se_79173053
stackoverflow
ARTIFICIAL_INTELLIGENCE
How to convert character indices to BERT token indices
How to convert character indices to BERT token indices I am working with a question-answer dataset UCLNLP/adversarial_qa. from datasets import load_dataset ds = load_dataset("UCLNLP/adversarial_qa", "adversarialQA") How do I map character-based answer indices to token-based indices after tokenizing the context and qu...
https://stackoverflow.com/questions/79173053/how-to-convert-character-indices-to-bert-token-indices
python, nlp, dataset, large-language-model, bert-language-model
1,731,165,333
se_79165649
stackoverflow
ARTIFICIAL_INTELLIGENCE
Handling Multiple Entity Candidates in Short Texts for Entity Linking with SciSpacy
Handling Multiple Entity Candidates in Short Texts for Entity Linking with SciSpacy I am working on linking short texts to entities in a biomedical knowledge graph (UMLS CUIs) using SciSpacy for a research project. The goal is to analyze the relationship between the linked entity and a separate predefined entity. My c...
https://stackoverflow.com/questions/79165649/handling-multiple-entity-candidates-in-short-texts-for-entity-linking-with-scisp
nlp, data-science, spacy, named-entity-recognition, entity-linking
1,730,969,534
se_79144325
stackoverflow
ARTIFICIAL_INTELLIGENCE
How to Separate Text and Code in Python Strings?
How to Separate Text and Code in Python Strings? I've encountered an issue in python. I have a string that contains both a message and code, and I need to separate them and pass each to different functions. An example: text = """ Can you change sum operation to multiplication? def process(a: int, b: int): print(a...
https://stackoverflow.com/questions/79144325/how-to-separate-text-and-code-in-python-strings
python, regex, string, nlp, text-processing
1,730,370,069
se_79159805
stackoverflow
ARTIFICIAL_INTELLIGENCE
How can I share a complex spaCy NLP model across multiple Python processes to minimize memory usage?
How can I share a complex spaCy NLP model across multiple Python processes to minimize memory usage? I'm working on a multiprocessing python application where multiple processes need access to a large, pre-loaded spaCy NLP model (e.g., en_core_web_lg). Since the model is memory-intensive, I want to avoid loading it se...
https://stackoverflow.com/questions/79159805/how-can-i-share-a-complex-spacy-nlp-model-across-multiple-python-processes-to-mi
nlp, multiprocessing, python-multiprocessing, spacy
1,730,821,773
se_78437749
stackoverflow
ARTIFICIAL_INTELLIGENCE
Error 404 while calling customised assistant with ChatGPT API in R
Error 404 while calling customised assistant with ChatGPT API in R To analyse sentences, I've trained a ChatGPT assistant that I'm calling from an R function to classify sentences: library(openai) Sys.setenv( OPENAI_API_KEY = 'XXXXXXXXXXXXXXXXXX' ) score_sentence_CSM <- function(mySentence) { myScore <- creat...
https://stackoverflow.com/questions/78437749/error-404-while-calling-customised-assistant-with-chatgpt-api-in-r
r, nlp, openai-api, chatgpt-api, assistant
1,715,010,482
se_52631965
stackoverflow
ARTIFICIAL_INTELLIGENCE
Text Classification + NLP + Data-mining + Data Science: Should I do stop word removal and stemming before applying tf-idf?
Text Classification + NLP + Data-mining + Data Science: Should I do stop word removal and stemming before applying tf-idf? I am working on a text classification problem. The problem is explained below: I have a dataset of events which contains three columns - name of the event, description of the event, category of t...
https://stackoverflow.com/questions/52631965/text-classification-nlp-data-mining-data-science-should-i-do-stop-word-re
nlp, data-mining, data-science, text-classification, tf-idf
1,538,585,194
se_79148979
stackoverflow
ARTIFICIAL_INTELLIGENCE
Finding Root Form of Verbs using Curiosity-AI/Catalyst
Finding Root Form of Verbs using Curiosity-AI/Catalyst I'm trying to find the root form of a verb. I run text through the pipeline and can identify all tokens which match PartOfSpeech.VERB but I don't know how to continue from there. This is what I have so far: const string text = "The disastrous cat runs after the fa...
https://stackoverflow.com/questions/79148979/finding-root-form-of-verbs-using-curiosity-ai-catalyst
c#, nlp
1,730,483,881
se_78758312
stackoverflow
ARTIFICIAL_INTELLIGENCE
DSPy can&#39;t retrieve passage with text embeddings in ChromaDB
DSPy can&#39;t retrieve passage with text embeddings in ChromaDB I am working on a RAG application using DSPy and ChromaDB for pdf files. At first I fetched the text from the pdf and add it to the Chromadb as chunks. Also added the embeddings of the chunks. And tried to Retrieve the chunk that is related to the query ...
https://stackoverflow.com/questions/78758312/dspy-cant-retrieve-passage-with-text-embeddings-in-chromadb
machine-learning, nlp, large-language-model, chromadb, dspy
1,721,203,410
se_39643391
stackoverflow
ARTIFICIAL_INTELLIGENCE
Good-Turing smoothing implementation problems
Good-Turing smoothing implementation problems I want to implement the Good-Turing smoothing method which will improve my language model. Let's start with the theory (for simplicity, consider the unigram model). There is a corpus (e.g. a literary work or any huge text). Through it we are building a language model. Af...
https://stackoverflow.com/questions/39643391/good-turing-smoothing-implementation-problems
python, scipy, nlp, nltk, smoothing
1,474,558,885
se_79145419
stackoverflow
ARTIFICIAL_INTELLIGENCE
Is it possible to get embeddings from NV-Embed using Candle?
Is it possible to get embeddings from NV-Embed using Candle? What I want to do is a CLI program that outputs embeddings of an arbitrary input. To do that, I want to do an inference with an embeddings model, and I chose NV-Embed-v2. My framework of choice is Candle, but I also looked at Mistral-RS. Basically, what I'm ...
https://stackoverflow.com/questions/79145419/is-it-possible-to-get-embeddings-from-nv-embed-using-candle
machine-learning, rust, nlp
1,730,390,149
se_79155290
stackoverflow
ARTIFICIAL_INTELLIGENCE
Dutch sentiment analysis RobBERTje outputs just positive/negative labels, netural label is missing
Dutch sentiment analysis RobBERTje outputs just positive/negative labels, netural label is missing When I run Dutch sentiment analysis RobBERTje, it outputs just positive/negative labels, netural label is missing in the data. https://huggingface.co/DTAI-KULeuven/robbert-v2-dutch-sentiment There are obvious neutral sen...
https://stackoverflow.com/questions/79155290/dutch-sentiment-analysis-robbertje-outputs-just-positive-negative-labels-netura
python, nlp, bert-language-model, roberta-language-model
1,730,720,195
se_76768226
stackoverflow
ARTIFICIAL_INTELLIGENCE
Target modules for applying PEFT / LoRA on different models
Target modules for applying PEFT / LoRA on different models I am looking at a few different examples of using PEFT on different models. The LoraConfig object contains a target_modules array. In some examples, the target modules are ["query_key_value"], sometimes it is ["q", "v"], sometimes something else. I don't quit...
https://stackoverflow.com/questions/76768226/target-modules-for-applying-peft-lora-on-different-models
nlp, huggingface-transformers, huggingface, fine-tuning, peft
1,690,348,998
se_79148620
stackoverflow
ARTIFICIAL_INTELLIGENCE
Path_To_Connection Error when reading in Docx file to R with Officer and Docxtractor
Path_To_Connection Error when reading in Docx file to R with Officer and Docxtractor I have several hundred documents from a legal database in ".docx" format. I am trying to do some NLP work on the docs, but can't seem to get past 0. Don't want to post the test doc because of copyright. I keep getting an xml2 path_to_...
https://stackoverflow.com/questions/79148620/path-to-connection-error-when-reading-in-docx-file-to-r-with-officer-and-docxtra
r, nlp, docx, officer, xml2
1,730,475,861
se_60937617
stackoverflow
ARTIFICIAL_INTELLIGENCE
How to reconstruct text entities with Hugging Face&#39;s transformers pipelines without IOB tags?
How to reconstruct text entities with Hugging Face&#39;s transformers pipelines without IOB tags? I've been looking to use Hugging Face's Pipelines for NER (named entity recognition). However, it is returning the entity labels in inside-outside-beginning (IOB) format but without the IOB labels. So I'm not able to map ...
https://stackoverflow.com/questions/60937617/how-to-reconstruct-text-entities-with-hugging-faces-transformers-pipelines-with
nlp, tokenize, transformer-model, named-entity-recognition, huggingface-transformers
1,585,594,683
se_42003560
stackoverflow
ARTIFICIAL_INTELLIGENCE
How to get training dataset of OpenNLP models?
How to get training dataset of OpenNLP models? I am using the following models of OpenNLP: en-parser-chunking.bin en-ner-person.bin en-ner-location.bin en-ner-organization.bin I want to append my data in the training dataset on which these models are trained. So please tell me from where I can get that raw dataset?
https://stackoverflow.com/questions/42003560/how-to-get-training-dataset-of-opennlp-models
machine-learning, nlp, text-mining, opennlp
1,486,042,355
se_79136808
stackoverflow
ARTIFICIAL_INTELLIGENCE
Why is Keras pretrained BERT MaskedLM producing inconsistent predictions?
Why is Keras pretrained BERT MaskedLM producing inconsistent predictions? I am trying to use keras-nlp with a pretrained masked BERT model to predict some tokens in a sequence. However the model produces inconsistent results. What could be wrong or am i misunderstanding something? import keras import keras_nlp import...
https://stackoverflow.com/questions/79136808/why-is-keras-pretrained-bert-maskedlm-producing-inconsistent-predictions
python, keras, nlp, bert-language-model, keras-nlp
1,730,198,185
se_77544604
stackoverflow
ARTIFICIAL_INTELLIGENCE
Importing deepspeech error: Module not found
Importing deepspeech error: Module not found I am trying to install DeepSearch library so that I can use the pretrained model to build the Speech to Text Project. ModuleNotFoundError Traceback (most recent call last) <ipython-input-8-a1bcd52700aa> in <cell line: 1>() ----> 1 import deepspeech ...
https://stackoverflow.com/questions/77544604/importing-deepspeech-error-module-not-found
python, deep-learning, nlp, mozilla-deepspeech
1,700,844,483
se_79132332
stackoverflow
ARTIFICIAL_INTELLIGENCE
KV caching for varying length texts
KV caching for varying length texts I am trying to do some strucutured text extraction using some kv caching tricks. For this example I will use the following model and data: model_name = "Qwen/Qwen2.5-0.5B-Instruct" model = AutoModelForCausalLM.from_pretrained( model_name, torch_dtype="auto", device_map=...
https://stackoverflow.com/questions/79132332/kv-caching-for-varying-length-texts
pytorch, nlp, huggingface-transformers, transformer-model
1,730,098,675
se_79139698
stackoverflow
ARTIFICIAL_INTELLIGENCE
Clustering for grouping sentences and then caption the cluster with a short name
Clustering for grouping sentences and then caption the cluster with a short name I have a series of text utterances in summary form (form of sentences). I am trying to perform clustering and group them with similarity in context (not in literal meaning) and report the clusters with the common group items. The below co...
https://stackoverflow.com/questions/79139698/clustering-for-grouping-sentences-and-then-caption-the-cluster-with-a-short-name
nlp, cluster-analysis, sentence-transformers
1,730,264,303
se_46001910
stackoverflow
ARTIFICIAL_INTELLIGENCE
What&#39;s the best way to compare several corpora in natural language?
What&#39;s the best way to compare several corpora in natural language? I've been doing LDA topic models of narrative reports in natural language for a research project (using Gensim with python). I have several smallish corpora (from 1400 to 200 docs each – I know, that's tiny!) that I'd like to compare, but I don't ...
https://stackoverflow.com/questions/46001910/whats-the-best-way-to-compare-several-corpora-in-natural-language
python, nlp, nltk, lda, topic-modeling
1,504,274,490
se_75417127
stackoverflow
ARTIFICIAL_INTELLIGENCE
Implementing tf-idf in wordclouds
Implementing tf-idf in wordclouds I have some google reviews for some universities in a dataframe like below df_unis. The column uni_name contains the university names. I wish to create word clouds for each university separately but in such a way that words appear larger in the word cloud of a university if they not o...
https://stackoverflow.com/questions/75417127/implementing-tf-idf-in-wordclouds
nlp, text-mining, tf-idf, word-cloud
1,676,072,585
se_77182311
stackoverflow
ARTIFICIAL_INTELLIGENCE
Question about data_collator throwing a key error in Hugging face
Question about data_collator throwing a key error in Hugging face I am trying to use data_collator function in hugging face using this code: datasets = dataset.train_test_split(test_size=0.1) train_dataset = datasets["train"] val_dataset = datasets["test"] print(type(train_dataset)) def data_collator(data): # Initia...
https://stackoverflow.com/questions/77182311/question-about-data-collator-throwing-a-key-error-in-hugging-face
python, pytorch, nlp, huggingface-transformers, huggingface-tokenizers
1,695,750,166
se_79136628
stackoverflow
ARTIFICIAL_INTELLIGENCE
How to Log Custom Metrics with Metadata in Hugging Face Trainer during Evaluation?
How to Log Custom Metrics with Metadata in Hugging Face Trainer during Evaluation? I'm working on a sentence regression task using Hugging Face’s Trainer. Each sample consists of: input_ids: The tokenized sentence. labels: A numerical scalar target (for regression). metadata: A categorical string field (e.g., project_...
https://stackoverflow.com/questions/79136628/how-to-log-custom-metrics-with-metadata-in-hugging-face-trainer-during-evaluatio
python, nlp, huggingface-transformers, huggingface, huggingface-trainer
1,730,195,414
se_79120086
stackoverflow
ARTIFICIAL_INTELLIGENCE
NLTK Conditional Frequency Distribution with Aggregation
NLTK Conditional Frequency Distribution with Aggregation I'm trying to write an NLTK ConditionalFreqDist with some aggregated fields based on data from the fileid. Basically, I have a corpus of documents with fileids consisting of a DATE-TITLE format, e.g., '2024-10-23 TitleName'. Multiple fileids can share the same d...
https://stackoverflow.com/questions/79120086/nltk-conditional-frequency-distribution-with-aggregation
nlp, nltk, frequency-distribution
1,729,730,095
se_79130588
stackoverflow
ARTIFICIAL_INTELLIGENCE
Geometric visulalization of Cosine Similarity
Geometric visulalization of Cosine Similarity I have calculated the cosine similarity between two documents in a very basic way by using TF-IDF vectorization in Python. But I want to visualize the documents as a vectorized graph in a 3D space. Like this: Here's the code I used for calculating cosine similarity: from ...
https://stackoverflow.com/questions/79130588/geometric-visulalization-of-cosine-similarity
python, nlp, tf-idf, cosine-similarity, tfidfvectorizer
1,730,032,352
se_79132073
stackoverflow
ARTIFICIAL_INTELLIGENCE
word2vec download taking too long
word2vec download taking too long Windows10, IDLE, The download time is too long for the below code. import gensim.downloader as api word_vec_list = api.load('word2vec-google-news-300') Is it possible that I download only fewer words? Is it possible to download the dataset as csv and use it later in the program?
https://stackoverflow.com/questions/79132073/word2vec-download-taking-too-long
nlp, gensim, word2vec
1,730,090,317
se_59330597
stackoverflow
ARTIFICIAL_INTELLIGENCE
How to obtain BERT sentence embeddings vector?
How to obtain BERT sentence embeddings vector? I'm using the module bert-for-tf2 in order to wrap BERT model as Keras layer in Tensorflow 2.0 I've followed your guide for implementing BERT model as Keras layer. I'm trying to extract embeddings from a sentence; in my case, the sentence is "Hello" I have a question abou...
https://stackoverflow.com/questions/59330597/how-to-obtain-bert-sentence-embeddings-vector
keras, nlp, embedding, word-embedding, sentence
1,576,276,314
se_58168936
stackoverflow
ARTIFICIAL_INTELLIGENCE
Bert sentence embeddings
Bert sentence embeddings Im trying to obtain sentence embeddings for Bert but Im not quite sure if Im doing it properly... and yes Im aware that exist such tools already such as bert-as-service but I want to do it myself and understand how it works. Lets say I want to extract a sentence embedding from word embeddings...
https://stackoverflow.com/questions/58168936/bert-sentence-embeddings
machine-learning, nlp, word-embedding
1,569,850,158
se_78920095
stackoverflow
ARTIFICIAL_INTELLIGENCE
cannot import name &#39;split_torch_state_dict_into_shards&#39; from &#39;huggingface_hub&#39;
cannot import name &#39;split_torch_state_dict_into_shards&#39; from &#39;huggingface_hub&#39; I've been using LLAMA 2 for research for a few months now and I import as follows: from transformers import AutoModelForCausalLM, AutoTokenizer device = torch.device("cuda") tokenizer = AutoTokenizer.from_pretrained("meta-ll...
https://stackoverflow.com/questions/78920095/cannot-import-name-split-torch-state-dict-into-shards-from-huggingface-hub
python, nlp, huggingface-transformers, transformer-model, llama
1,724,779,242