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_78308640 | stackoverflow | ARTIFICIAL_INTELLIGENCE | Spacy matching countries in messy data | Spacy matching countries in messy data
I have some natural language text that I am trying to parse using spacy but having a hard time getting this to cover all possible variations.
Data is basically a set of recommendations for a set of countries, embedded together in a single text block. I want to extract the list of... | https://stackoverflow.com/questions/78308640/spacy-matching-countries-in-messy-data | python, nlp, spacy | 1,712,818,781 |
se_78324647 | stackoverflow | ARTIFICIAL_INTELLIGENCE | Sklearm FeatureHasher not working on a single column in a dataframe | Sklearm FeatureHasher not working on a single column in a dataframe
I tried performing the feature hasher on a single column in my dataframe but it keeps on giving the error:
ValueError: Samples can not be a single string. The input must be an iterable over iterables of strings.
from sklearn.feature_extraction impor... | https://stackoverflow.com/questions/78324647/sklearm-featurehasher-not-working-on-a-single-column-in-a-dataframe | pandas, machine-learning, scikit-learn, nlp | 1,713,115,217 |
se_78284866 | stackoverflow | ARTIFICIAL_INTELLIGENCE | What is the best function/stage to use tokenizer in Pytorch's data processing? | What is the best function/stage to use tokenizer in Pytorch's data processing?
I am subclassing torch.utils.data.Dataset and writing a collate function to be passed to Dataloader's dataset and collate_fn argument respectively.
Between Dataset's __getitem__ or collate_fn I was wondering what would be the best funct... | https://stackoverflow.com/questions/78284866/what-is-the-best-function-stage-to-use-tokenizer-in-pytorchs-data-processing | pytorch, nlp | 1,712,416,485 |
se_78304710 | stackoverflow | ARTIFICIAL_INTELLIGENCE | Can I appoint a Masked Language Model's outputs' range? | Can I appoint a Masked Language Model's outputs' range?
When different kinds of models are trained with masked language modeling, the input embeddings at masked positions are replaced with a MASK token. I'm wondering if I could appoint the range of a MASK token? For example:
1) "What a [MASK] weather!"
2) "Wh... | https://stackoverflow.com/questions/78304710/can-i-appoint-a-masked-language-models-outputs-range | nlp, huggingface-transformers, transformer-model, mlmodel | 1,712,754,713 |
se_78321558 | stackoverflow | ARTIFICIAL_INTELLIGENCE | I cannot get past data(stop_words) to analyze text in text mining | I cannot get past data(stop_words) to analyze text in text mining
It's my first attempt at text mining and I have run into a wall. This is what I have done thus far:
library(tm)
library(tidytext)
library(dplyr)
library(ggplot2)
text1 <- c("Dear land of Guyana, of rivers and plains,
Made rich by the sunshine, and lush... | https://stackoverflow.com/questions/78321558/i-cannot-get-past-datastop-words-to-analyze-text-in-text-mining | r, dplyr, nlp, text-mining, tidy | 1,713,031,358 |
se_76388696 | stackoverflow | ARTIFICIAL_INTELLIGENCE | Should I use model.eval() when using transformers.pipeline for inference with a fine-tuned BERT model in PyTorch? | Should I use model.eval() when using transformers.pipeline for inference with a fine-tuned BERT model in PyTorch?
When training transformer models with Trainer(), documentation shows the following usage:
model = AutoModelForSequenceClassification.from_pretrained("bert-base-cased", num_labels=5)
trainer = Trainer(
... | https://stackoverflow.com/questions/76388696/should-i-use-model-eval-when-using-transformers-pipeline-for-inference-with-a | python, machine-learning, pytorch, nlp, huggingface-transformers | 1,685,696,787 |
se_78321699 | stackoverflow | ARTIFICIAL_INTELLIGENCE | I am getting multiple tabs of figure when i input the year... i need only one animated tab and planet img must show in different tab | I am getting multiple tabs of figure when i input the year... i need only one animated tab and planet img must show in different tab
import numpy as np
import matplotlib.pyplot as plt
import matplotlib.animation as animation
from astropy.time import Time
from astropy.coordinates import solar_system_ephemeris, get_body... | https://stackoverflow.com/questions/78321699/i-am-getting-multiple-tabs-of-figure-when-i-input-the-year-i-need-only-one-an | python, tensorflow, image-processing, nlp, astronomy | 1,713,034,548 |
se_78318797 | stackoverflow | ARTIFICIAL_INTELLIGENCE | word2vec not working using gensim library | word2vec not working using gensim library
I am trying to vectorise my dataset using word2vec model provided by gensim. I am facing the error raised by scipy.
from gensim.models import Word2Vec
from nltk.tokenize import word_tokenize
import nltk
nltk.download('punkt')
# Sample sentences
sentences = [
"This is a sa... | https://stackoverflow.com/questions/78318797/word2vec-not-working-using-gensim-library | python-3.x, nlp, vectorization, gensim, word2vec | 1,712,957,437 |
se_78321328 | stackoverflow | ARTIFICIAL_INTELLIGENCE | Keras Fit Method 'Unrecognized Data Type' for NLP Classification Problem with TextVectorization | Keras Fit Method 'Unrecognized Data Type' for NLP Classification Problem with TextVectorization
I have an LSTM based model. I am using a text vectorization layer and an embedding layer prior to the LSTM layers. I am also using two Dense layers with a softmax output. I am trying to go for binary classificati... | https://stackoverflow.com/questions/78321328/keras-fit-method-unrecognized-data-type-for-nlp-classification-problem-with-te | tensorflow, keras, nlp, classification, lstm | 1,713,026,778 |
se_78320492 | stackoverflow | ARTIFICIAL_INTELLIGENCE | How to use BERT for identify words unrelated to the content of a sentence and replace them with suitable words? | How to use BERT for identify words unrelated to the content of a sentence and replace them with suitable words?
For this question we can see below example:
A: Jack continues to pray well.
B: Jack continues to play well.
In the first sentence, the word "pray" is written in a typographical error and the word "play" shou... | https://stackoverflow.com/questions/78320492/how-to-use-bert-for-identify-words-unrelated-to-the-content-of-a-sentence-and-re | python, deep-learning, nlp, huggingface-transformers, bert-language-model | 1,713,009,207 |
se_78319399 | stackoverflow | ARTIFICIAL_INTELLIGENCE | (NLP Modelling) How to get SpaCy matcher to parse names and education history from resumes to append to an Excel file | (NLP Modelling) How to get SpaCy matcher to parse names and education history from resumes to append to an Excel file
I am building an NLP model to parse through resumes for names and education history which I will then append to a larger Excel file with other applicant data to use for broader analysis. I am introduci... | https://stackoverflow.com/questions/78319399/nlp-modelling-how-to-get-spacy-matcher-to-parse-names-and-education-history-fr | python, parsing, nlp, pattern-matching, spacy | 1,712,975,962 |
se_78262529 | stackoverflow | ARTIFICIAL_INTELLIGENCE | Gensim's Doc2Vec with documents in multiple languages | Gensim's Doc2Vec with documents in multiple languages
I'm building a content based recommender system using similarities on vector representations of documents.
My documents are descriptions of books. Most of them are in English, but some of them are in other languages. I used gensim's Doc2Vec for building vector ... | https://stackoverflow.com/questions/78262529/gensims-doc2vec-with-documents-in-multiple-languages | python, nlp, gensim, recommendation-engine, doc2vec | 1,712,072,850 |
se_78314842 | stackoverflow | ARTIFICIAL_INTELLIGENCE | R Tidymodels textrecipes - tokenizing with spacyR - how to remove punctuations from produced list of tokens | R Tidymodels textrecipes - tokenizing with spacyR - how to remove punctuations from produced list of tokens
I would like to tokenize my text by using the step_tokenize with the spacyR engine before proceeding to lemmatisation using step_lemma. Following that, i would like to remove for example punctuations from the li... | https://stackoverflow.com/questions/78314842/r-tidymodels-textrecipes-tokenizing-with-spacyr-how-to-remove-punctuations-f | r, nlp, spacy, tidymodels | 1,712,907,594 |
se_78307073 | stackoverflow | ARTIFICIAL_INTELLIGENCE | LangChain agent parsing error with structured_chat_agent and Wikipedia tool, handle_parsing_errors hits limit | LangChain agent parsing error with structured_chat_agent and Wikipedia tool, handle_parsing_errors hits limit
I am trying to ask GPT 4 to use Wikipedia for a prompt, using agents and tools via LangChain.
The difficulty I'm running into is the book I've been using, Developing Apps with GPT-4 and ChatGPT: Build Intellig... | https://stackoverflow.com/questions/78307073/langchain-agent-parsing-error-with-structured-chat-agent-and-wikipedia-tool-han | python, nlp, openai-api, langchain, large-language-model | 1,712,782,354 |
se_47666699 | stackoverflow | ARTIFICIAL_INTELLIGENCE | Using word2vec to classify words in categories | Using word2vec to classify words in categories
BACKGROUND
I have vectors with some sample data and each vector has a category name (Places,Colors,Names).
['john','jay','dan','nathan','bob'] -> 'Names'
['yellow', 'red','green'] -> 'Colors'
['tokyo','bejing','washington','mumbai'] -> 'Places'
My objective is to tra... | https://stackoverflow.com/questions/47666699/using-word2vec-to-classify-words-in-categories | python, machine-learning, nlp, word2vec, gensim | 1,512,533,795 |
se_78273368 | stackoverflow | ARTIFICIAL_INTELLIGENCE | Pytesseract to return text inside bounding box | Pytesseract to return text inside bounding box
I am currently trying to do named entity extraction on a set of documents. My plan is:
Do OCR using pytesseract
Extract the text
Apply an LLM to get the entities like patient name, age etc.
One of the example scans look like this:
The output of pytesseract using: text ... | https://stackoverflow.com/questions/78273368/pytesseract-to-return-text-inside-bounding-box | nlp, tesseract, python-tesseract, named-entity-recognition, large-language-model | 1,712,228,246 |
se_78311910 | stackoverflow | ARTIFICIAL_INTELLIGENCE | Unable to locally save some models locally with SentenceTransformers | Unable to locally save some models locally with SentenceTransformers
Tried many times to have SentenceTransformers and having stripped down my code to the following:
from sentence_transformers import SentenceTransformer
modelPath = "/Users/bob/.cache"
model = SentenceTransformer("Salesforce/SFR-Embedding-Mistral")
mod... | https://stackoverflow.com/questions/78311910/unable-to-locally-save-some-models-locally-with-sentencetransformers | python, nlp, huggingface-transformers, large-language-model, sentence-transformers | 1,712,854,218 |
se_69756755 | stackoverflow | ARTIFICIAL_INTELLIGENCE | Tensorflow unicode text encoding-decoding | Tensorflow unicode text encoding-decoding
I just started working with cyrillic text. Cannot properly print russian text after text preprocessing. How can I set encoding during text loading?
import pathlib
text = pathlib.Path('rus.txt').read_text(encoding='utf-8')
lines = text.splitlines()
pairs = [line.split('\t') fo... | https://stackoverflow.com/questions/69756755/tensorflow-unicode-text-encoding-decoding | python, tensorflow, nlp, machine-translation | 1,635,434,346 |
se_78285447 | stackoverflow | ARTIFICIAL_INTELLIGENCE | What's inside inner vertices in Word2Vec Hierarchical Softmax? | What's inside inner vertices in Word2Vec Hierarchical Softmax?
I have a question about Hierarchical Softmax. Actually, I do not quite understand what is stored in inner vertices (which are not leaf vertices). I clearly understand the main idea of this algorithm, but each step we calculate dot product of input word... | https://stackoverflow.com/questions/78285447/whats-inside-inner-vertices-in-word2vec-hierarchical-softmax | machine-learning, nlp, word2vec, hierarchical, softmax | 1,712,427,341 |
se_78301339 | stackoverflow | ARTIFICIAL_INTELLIGENCE | How to train Hugging Face Model On Multiple Datasets? | How to train Hugging Face Model On Multiple Datasets?
I am trying to fine tune a model based on two datasets, following the example on the Hugging Face website, I have my model training on the Yelp Review dataset, but I also want to train my model on the Short Jokes dataset.
These two datasets are picked just to eximp... | https://stackoverflow.com/questions/78301339/how-to-train-hugging-face-model-on-multiple-datasets | python, nlp, huggingface-transformers, bert-language-model, huggingface-datasets | 1,712,701,698 |
se_76247802 | stackoverflow | ARTIFICIAL_INTELLIGENCE | Loading a safetensor file in transformers | Loading a safetensor file in transformers
I have downloaded this model from huggingface. I am trying to load this model in transformers so I can do inferencing:
from transformers import AutoTokenizer, AutoModelForCausalLM
tokenizer = AutoTokenizer.from_pretrained("path_to/TheBloke/vicuna-13B-1.1-GPTQ-4bit-128g")
mod... | https://stackoverflow.com/questions/76247802/loading-a-safetensor-file-in-transformers | python-3.x, machine-learning, nlp, huggingface-transformers | 1,684,071,978 |
se_55871850 | stackoverflow | ARTIFICIAL_INTELLIGENCE | Mosestokenizer issue: [WinError 2] The system cannot find the file specified | Mosestokenizer issue: [WinError 2] The system cannot find the file specified
Can't figure out why is this problem appearing.
from mosestokenizer import MosesDetokenizer
with MosesDetokenizer('en') as detokenize:
print(detokenize(["hi", 'my', 'name', 'is', 'artem']))
This is what I get:
stdbuf was not found; c... | https://stackoverflow.com/questions/55871850/mosestokenizer-issue-winerror-2-the-system-cannot-find-the-file-specified | python, nlp, anaconda, nltk, tokenize | 1,556,297,032 |
se_72480985 | stackoverflow | ARTIFICIAL_INTELLIGENCE | ImportError: cannot import name 'LayoutlmConfig' from 'layoutlm | ImportError: cannot import name 'LayoutlmConfig' from 'layoutlm
I am trying to save the predictions for the LayoutLM model.
paper - https://arxiv.org/abs/1912.13318
Notebook - https://www.kaggle.com/code/iamarjunchandra/layoutlm-document-sequence-labeling-model/notebook
The problem arises when I run the be... | https://stackoverflow.com/questions/72480985/importerror-cannot-import-name-layoutlmconfig-from-layoutlm | python, machine-learning, pdf, nlp, ocr | 1,654,195,640 |
se_77438251 | stackoverflow | ARTIFICIAL_INTELLIGENCE | Langchain ParentDocumetRetriever: Save and load | Langchain ParentDocumetRetriever: Save and load
I am using the PartentDocumentRetriever from Langchain.
Now I first want to build my vector database and then want to retrieve stuff.
Here is my file that builds the database:
# =========================
# Module: Vector DB Build
# =========================
import box
i... | https://stackoverflow.com/questions/77438251/langchain-parentdocumetretriever-save-and-load | python, nlp, langchain | 1,699,360,569 |
se_30746460 | stackoverflow | ARTIFICIAL_INTELLIGENCE | How to interpret scikit's learn confusion matrix and classification report? | How to interpret scikit's learn confusion matrix and classification report?
I have a sentiment analysis task, for this Im using this corpus the opinions have 5 classes (very neg, neg, neu, pos, very pos), from 1 to 5. So I do the classification as follows:
from sklearn.feature_extraction.text import TfidfVectoriz... | https://stackoverflow.com/questions/30746460/how-to-interpret-scikits-learn-confusion-matrix-and-classification-report | machine-learning, nlp, scikit-learn, svm, confusion-matrix | 1,433,905,922 |
se_78238315 | stackoverflow | ARTIFICIAL_INTELLIGENCE | Why does the Cloud Natural Language Model API return so many NULLs? | Why does the Cloud Natural Language Model API return so many NULLs?
I have been working with Google's Cloud Natural Language Model in BigQuery, and I have noticed that a significant percent of requests generate a NULL response. Why?
Here's an example...
This code creates a table with 54 movie reviews from the publicly... | https://stackoverflow.com/questions/78238315/why-does-the-cloud-natural-language-model-api-return-so-many-nulls | sql, google-cloud-platform, google-bigquery, nlp, google-natural-language | 1,711,630,354 |
se_77248199 | stackoverflow | ARTIFICIAL_INTELLIGENCE | How to convert Doccano exported JSONL format to spaCy formatοΌ | How to convert Doccano exported JSONL format to spaCy formatοΌ
I want to use my own data set to train a named entity recognition model. The data set is exported by the annotation tool Doccano. The format is JSONL (not JSON), but spaCy does not support such a data format input model. How do I convert it? ?
Here's what m... | https://stackoverflow.com/questions/77248199/how-to-convert-doccano-exported-jsonl-format-to-spacy-format | nlp, spacy, named-entity-recognition, doccano | 1,696,647,305 |
se_78091595 | stackoverflow | ARTIFICIAL_INTELLIGENCE | Error in importing SimpleInputPrompt from llama index | Error in importing SimpleInputPrompt from llama index
Code:
from llama_index.prompts.prompts import SimpleInputPrompt
ModuleNotFoundError Traceback (most recent call last)
in <cell line: 1>()
----> 1 from llama_index.prompts.prompts import SimpleInputPrompt
ModuleNotFoundError: No module named '... | https://stackoverflow.com/questions/78091595/error-in-importing-simpleinputprompt-from-llama-index | nlp, llama-index | 1,709,358,519 |
se_8772692 | stackoverflow | ARTIFICIAL_INTELLIGENCE | Semantic search with NLP and elasticsearch | Semantic search with NLP and elasticsearch
I am experimenting with elasticsearch as a search server and my task is to build a "semantic" search functionality. From a short text phrase like "I have a burst pipe" the system should infer that the user is searching for a plumber and return all plumbers indexed in elastics... | https://stackoverflow.com/questions/8772692/semantic-search-with-nlp-and-elasticsearch | search, nlp | 1,325,966,933 |
se_78210894 | stackoverflow | ARTIFICIAL_INTELLIGENCE | How to workaround an installation issue on installing the fastText library on Windows? | How to workaround an installation issue on installing the fastText library on Windows?
I am new to this field and experimenting different models in NLP domain. While am trying to install the fastText libary using the command prompt, it is showing an error:
pip install wheel
pip install pybind11
pip install fasttext
T... | https://stackoverflow.com/questions/78210894/how-to-workaround-an-installation-issue-on-installing-the-fasttext-library-on-wi | python, installation, cmd, nlp, fasttext | 1,711,197,840 |
se_78281982 | stackoverflow | ARTIFICIAL_INTELLIGENCE | Out of RAM while tokenize a 12GB xml with SpaCy | Out of RAM while tokenize a 12GB xml with SpaCy
I'm trying to tokenize a 12GB of text in xml. The file contains only "content words" with no stopwords. I am trying to implement a function in order to tokenize by chunks of text and clean the RAM. (I have a core i7 and 32GB of RAM)
I have tried the following without suc... | https://stackoverflow.com/questions/78281982/out-of-ram-while-tokenize-a-12gb-xml-with-spacy | nlp, spacy, tokenize | 1,712,345,028 |
se_78285241 | stackoverflow | ARTIFICIAL_INTELLIGENCE | Extracting dates from a sentence in spaCy | Extracting dates from a sentence in spaCy
I have a string like so:
"The dates are from 30 June 2019 to 1 January 2022 inclusive"
I want to extract the dates from this string using spaCy.
Here is my function so far:
def extract_dates_with_year(text):
doc = nlp(text)
dates_with_year = []
for ent in doc.ents... | https://stackoverflow.com/questions/78285241/extracting-dates-from-a-sentence-in-spacy | python, regex, nlp, spacy, named-entity-recognition | 1,712,423,559 |
se_78283056 | stackoverflow | ARTIFICIAL_INTELLIGENCE | GloVe embedding for empty string | GloVe embedding for empty string
It looks like the embedding for the empty string in the glove.twitter.27B.200d.txt file that's part of this zip file:
https://nlp.stanford.edu/data/glove.twitter.27B.zip
is provided on line 38523, but I'm not 100% sure this is what I think it is. I haven't worked with these embeddings ... | https://stackoverflow.com/questions/78283056/glove-embedding-for-empty-string | nlp, stanford-nlp, word-embedding | 1,712,371,495 |
se_78252488 | stackoverflow | ARTIFICIAL_INTELLIGENCE | Clarification on T5 Model Pre-training Objective and Denoising Process | Clarification on T5 Model Pre-training Objective and Denoising Process
I am currently developing a T5 model (encoder-decoder architecture) from scratch for educational purposes. While working on this project, I've encountered some confusion regarding the pre-training objective, specifically the denoising objective. I ... | https://stackoverflow.com/questions/78252488/clarification-on-t5-model-pre-training-objective-and-denoising-process | nlp, large-language-model | 1,711,911,359 |
se_78278080 | stackoverflow | ARTIFICIAL_INTELLIGENCE | Need Guidance on Implementing Stratified K-Fold for Sequence Labeling (NER) Dataset | Need Guidance on Implementing Stratified K-Fold for Sequence Labeling (NER) Dataset
I'm currently working on a Named Entity Recognition (NER) task and I'm looking to implement Stratified K-Fold cross-validation for my dataset. However, I'm struggling to find specific references or guidelines on how to perform this tec... | https://stackoverflow.com/questions/78278080/need-guidance-on-implementing-stratified-k-fold-for-sequence-labeling-ner-data | nlp, named-entity-recognition, k-fold | 1,712,298,072 |
se_74000154 | stackoverflow | ARTIFICIAL_INTELLIGENCE | How do I make sure answers are from a customized (fine-tuning) dataset? | How do I make sure answers are from a customized (fine-tuning) dataset?
I'm using customized text with 'Prompt' and 'Completion' to train new model.
Here's the tutorial I used to create customized model from my data:
beta.openai.com/docs/guides/fine-tuning/advanced-usage
However even after training the model and sendi... | https://stackoverflow.com/questions/74000154/how-do-i-make-sure-answers-are-from-a-customized-fine-tuning-dataset | nlp, customization, openai-api, gpt-3 | 1,665,259,087 |
se_78075486 | stackoverflow | ARTIFICIAL_INTELLIGENCE | Textual similarity between two tags in Nodejs | Textual similarity between two tags in Nodejs
I want to rate the similarity between two tags. For example the words technology, computer and chip should have high similarity, a word like food should be low similarity.
Given the recent advancements in AI and more traditional approaches from NLP, how would you solve tha... | https://stackoverflow.com/questions/78075486/textual-similarity-between-two-tags-in-nodejs | javascript, node.js, typescript, nlp, similarity | 1,709,132,687 |
se_78274859 | stackoverflow | ARTIFICIAL_INTELLIGENCE | Dynamic Filtering of Non-Descriptive Adjectives and Nouns in Text Data? | Dynamic Filtering of Non-Descriptive Adjectives and Nouns in Text Data?
How can I dynamically filter out non-descriptive adjectives and nouns from text data without relying on predefined lists?
I'm using spaCy for part-of-speech tagging and Named Entity Recognition, but I want a more dynamic approach. Any suggestions?... | https://stackoverflow.com/questions/78274859/dynamic-filtering-of-non-descriptive-adjectives-and-nouns-in-text-data | python, nlp, spacy | 1,712,243,932 |
se_78270697 | stackoverflow | ARTIFICIAL_INTELLIGENCE | Why sentencepiece tokenizer in nllb returns id's that differ by 1 when I specify model name or file? | Why sentencepiece tokenizer in nllb returns id's that differ by 1 when I specify model name or file?
When I'm using hf tokenizers and specify the model by name facebook/nllb-200-distilled-600M I get such tokens: 256047, 30311, 104, 253990 and so on. But when I take the sentencepiece.bpe.model from the repo and loa... | https://stackoverflow.com/questions/78270697/why-sentencepiece-tokenizer-in-nllb-returns-ids-that-differ-by-1-when-i-specify | nlp, huggingface-transformers, sentencepiece | 1,712,181,635 |
se_78237746 | stackoverflow | ARTIFICIAL_INTELLIGENCE | Is there any OCR or technique that can recognize/identify radio buttons printed out in the form of pdf document? | Is there any OCR or technique that can recognize/identify radio buttons printed out in the form of pdf document?
I have a pdf document with radio responses like attached screenshot. I want to extract the selected response only through python or any OCR technique. Is there any way of doing it?
(https://i.sstatic.net/3... | https://stackoverflow.com/questions/78237746/is-there-any-ocr-or-technique-that-can-recognize-identify-radio-buttons-printed | python, nlp, ocr, large-language-model, information-extraction | 1,711,624,264 |
se_72001249 | stackoverflow | ARTIFICIAL_INTELLIGENCE | How to get up and running with spaCy for Vietnamese? | How to get up and running with spaCy for Vietnamese?
I success with English
python -m spacy download en_core_web_lg
python -m spacy download en_core_web_sm
python -m spacy download en
I read https://spacy.io/models/xx . How to use with Vietnamese use xx? | https://stackoverflow.com/questions/72001249/how-to-get-up-and-running-with-spacy-for-vietnamese | python, nlp, spacy | 1,650,897,212 |
se_78270745 | stackoverflow | ARTIFICIAL_INTELLIGENCE | How to Predict New Data Topics with BERTopic Model Loaded from Hugging Face in Python? (Automated solution) | How to Predict New Data Topics with BERTopic Model Loaded from Hugging Face in Python? (Automated solution)
I've developed a BERTopic model for analyzing mobile app reviews and have successfully pushed it to Hugging Face. I'm able to load the model in my Python script but am facing challenges in predicting topics for ... | https://stackoverflow.com/questions/78270745/how-to-predict-new-data-topics-with-bertopic-model-loaded-from-hugging-face-in-p | python, nlp, huggingface | 1,712,182,261 |
se_78270146 | stackoverflow | ARTIFICIAL_INTELLIGENCE | How to create an Embedding Model for Recipe Dataset Using Deep Metric Learning? | How to create an Embedding Model for Recipe Dataset Using Deep Metric Learning?
I want to create an embedding model for my own dataset of recipes. The goal is to create a neural network that takes each recipe, represented by a list of its ingredients, a list of recipe tags, and its title, as input. The network should ... | https://stackoverflow.com/questions/78270146/how-to-create-an-embedding-model-for-recipe-dataset-using-deep-metric-learning | deep-learning, nlp, neural-network, embedding | 1,712,173,480 |
se_71691184 | stackoverflow | ARTIFICIAL_INTELLIGENCE | Huggingface pretrained model's tokenizer and model objects have different maximum input length | Huggingface pretrained model's tokenizer and model objects have different maximum input length
I'm using symanto/sn-xlm-roberta-base-snli-mnli-anli-xnli pretrained model from huggingface. My task requires to use it on pretty large texts, so it's essential to know maximum input length.
The following code is suppose... | https://stackoverflow.com/questions/71691184/huggingface-pretrained-models-tokenizer-and-model-objects-have-different-maximu | nlp, huggingface-transformers, huggingface-tokenizers, sentence-transformers | 1,648,723,791 |
se_77642444 | stackoverflow | ARTIFICIAL_INTELLIGENCE | How can you use an already created chromadb collection with a LLM using openai and langchain? | How can you use an already created chromadb collection with a LLM using openai and langchain?
I already have a chromadb collection created with its documents and metadata.
The problem is when I want to use langchain to create a llm and pass this chromadb collection to use as a knowledge base.
langchain_chroma = Chroma... | https://stackoverflow.com/questions/77642444/how-can-you-use-an-already-created-chromadb-collection-with-a-llm-using-openai-a | python, machine-learning, nlp, openai-api, langchain | 1,702,329,443 |
se_59956670 | stackoverflow | ARTIFICIAL_INTELLIGENCE | Parsing city of origin / destination city from a string | Parsing city of origin / destination city from a string
I have a pandas dataframe where one column is a bunch of strings with certain travel details. My goal is to parse each string to extract the city of origin and destination city (I would like to ultimately have two new columns titled 'origin' and 'destination').
... | https://stackoverflow.com/questions/59956670/parsing-city-of-origin-destination-city-from-a-string | python, regex, pandas, nlp, nltk | 1,580,243,964 |
se_78266192 | stackoverflow | ARTIFICIAL_INTELLIGENCE | Python Spacy Pattern- How to tag a word based on another word? | Python Spacy Pattern- How to tag a word based on another word?
I'm trying to write a pattern that would tag the whole word as unit based on one substring.
Here's example:
terms = [{'ent': "UNIT",
'patterns':[
[{'lemma':'liter'}]]}]
text = "There were 46 kiloliters of juice available"
I wanna tag... | https://stackoverflow.com/questions/78266192/python-spacy-pattern-how-to-tag-a-word-based-on-another-word | python, nlp, spacy | 1,712,131,629 |
se_49941646 | stackoverflow | ARTIFICIAL_INTELLIGENCE | Python Counter() function to count words in documents with more then one occurrence | Python Counter() function to count words in documents with more then one occurrence
I am working on an NLP (Natural Language Processing) project where I used the Python Counter() function from collections library. I am getting the results in the following form:
OUTPUT:
Counter({'due': 23, 'support': 20, 'ATM': 16, '... | https://stackoverflow.com/questions/49941646/python-counter-function-to-count-words-in-documents-with-more-then-one-occurre | python, python-3.x, nlp, words, python-collections | 1,524,227,225 |
se_78263004 | stackoverflow | ARTIFICIAL_INTELLIGENCE | How to fix this error No module named 'llama_index.llms.llama_cpp' | How to fix this error No module named 'llama_index.llms.llama_cpp'
I am trying to use mixtral-8x7b with my own data with no luck. Here is my code
import torch
from llama_index.llms.llama_cpp import LlamaCPP
from llama_index.llms.llama_cpp.llama_utils import messages_to_prompt, completion_to_prompt
llm = LlamaC... | https://stackoverflow.com/questions/78263004/how-to-fix-this-error-no-module-named-llama-index-llms-llama-cpp | machine-learning, nlp | 1,712,077,819 |
se_78049044 | stackoverflow | ARTIFICIAL_INTELLIGENCE | RAG: Injecting entire retrieved documents into prompt vs just the page_content | RAG: Injecting entire retrieved documents into prompt vs just the page_content
When using a rag chain, I realized that the entire Document is injected into the prompt. Would it not make more sense to just pass the page_content of the document? I am concerned that seeing [Document(page_content=' will affect the results... | https://stackoverflow.com/questions/78049044/rag-injecting-entire-retrieved-documents-into-prompt-vs-just-the-page-content | nlp, langchain | 1,708,707,851 |
se_64284835 | stackoverflow | ARTIFICIAL_INTELLIGENCE | Replace personal pronoun with previous person mentioned (noisy coref) | Replace personal pronoun with previous person mentioned (noisy coref)
I want to do a noisy resolution such that given a personal prounoun, that pronoun is replace by the previous(nearest) person.
For example:
Alex is looking at buying a U.K. startup for $1 billion. He is very confident that this is going to happen. Su... | https://stackoverflow.com/questions/64284835/replace-personal-pronoun-with-previous-person-mentioned-noisy-coref | python, python-3.x, nlp, spacy, coreference-resolution | 1,602,265,244 |
se_76880352 | stackoverflow | ARTIFICIAL_INTELLIGENCE | Updating old code with new torch vocab methods (stoi and itos methods changed) | Updating old code with new torch vocab methods (stoi and itos methods changed)
I am trying to create a Japanese-English translation model following this Medium article.
https://arusl.medium.com/japanese-english-language-translation-with-transformer-using-pytorch-243738146806
Everything runs perfectly until the second ... | https://stackoverflow.com/questions/76880352/updating-old-code-with-new-torch-vocab-methods-stoi-and-itos-methods-changed | python, pytorch, nlp, torchtext | 1,691,720,769 |
se_78256936 | stackoverflow | ARTIFICIAL_INTELLIGENCE | similarity_search with chromadb and default setting returns 4 identical document objects | similarity_search with chromadb and default setting returns 4 identical document objects
i'm new to vectorstore and in general doing my first steps with RAG
relevant pip freeze info:
chroma-hnswlib==0.7.3
chromadb==0.4.24
langchain==0.1.13
langchain-community==0.0.29
langchain-core==0.1.34
langchain-text-splitters==0.... | https://stackoverflow.com/questions/78256936/similarity-search-with-chromadb-and-default-setting-returns-4-identical-document | python, nlp, langchain, chromadb | 1,711,993,062 |
se_78262292 | stackoverflow | ARTIFICIAL_INTELLIGENCE | Error loading Hugging Face model: SafeTensorsInfo.__init__() got an unexpected keyword argument 'sharded' | Error loading Hugging Face model: SafeTensorsInfo.__init__() got an unexpected keyword argument 'sharded'
I have been using Hugging Face transformers quantized Llama2 model. Suddenly, code I was able to run earlier today is throwing an error when I try to load the model.
This code is straight from the docs:
fr... | https://stackoverflow.com/questions/78262292/error-loading-hugging-face-model-safetensorsinfo-init-got-an-unexpected-k | python, nlp, huggingface-transformers, huggingface, llama | 1,712,070,617 |
se_78258373 | stackoverflow | ARTIFICIAL_INTELLIGENCE | Get previous sentence while using SpaCy matcher | Get previous sentence while using SpaCy matcher
I am running a SpaCy Matcher line-by-line on a text file. My file has each text entry on a separate line. I am trying to extract 1) the matched instance, 2) the full sentence, and 3) the previous sentence. I am able to get the first two, but I am having trouble getting t... | https://stackoverflow.com/questions/78258373/get-previous-sentence-while-using-spacy-matcher | python, nlp, spacy | 1,712,016,891 |
se_78241665 | stackoverflow | ARTIFICIAL_INTELLIGENCE | How to detect if two sentences are simmilar, not in meaning, but in syllables/words? | How to detect if two sentences are simmilar, not in meaning, but in syllables/words?
Here are some examples of the types of sentences that need to be considered "similar"
there was a most extraordinary noise going on shrinking rapidly she soon made out
there was a most extraordinary noise going on shrinking rapid
tha... | https://stackoverflow.com/questions/78241665/how-to-detect-if-two-sentences-are-simmilar-not-in-meaning-but-in-syllables-wo | search, nlp, full-text-search, similarity, sentence-similarity | 1,711,678,118 |
se_78254013 | stackoverflow | ARTIFICIAL_INTELLIGENCE | How to use SpaCy NER? | How to use SpaCy NER?
I am working on a mini-project to cluster similar sentences together. Before I can achieve that, I have to perform pre-processing to the extremely dirty data (these data are all user inputs, free text).
One of the pre-processing step that I thought of is to identify each sentence and classify it ... | https://stackoverflow.com/questions/78254013/how-to-use-spacy-ner | python, nlp, spacy, named-entity-recognition | 1,711,953,692 |
se_50623129 | stackoverflow | ARTIFICIAL_INTELLIGENCE | Alternative to one-hot encoding for output to a model when vocabulary size is very large | Alternative to one-hot encoding for output to a model when vocabulary size is very large
I was following this blog. In it he talks about how to build a language model in keras. He shows how to build a simple model in keras.
After separating, we need to one hot encode the output word. This means converting it from an ... | https://stackoverflow.com/questions/50623129/alternative-to-one-hot-encoding-for-output-to-a-model-when-vocabulary-size-is-ve | nlp, keras, language-model | 1,527,765,647 |
se_78248470 | stackoverflow | ARTIFICIAL_INTELLIGENCE | Output of Cosine Similarity is not as expected | Output of Cosine Similarity is not as expected
I am trying to generate the Cosine similarity between two words in a sentence. The sentence is "The black cat sat on the couch and the brown dog slept on the rug".
My Python code is below:
from nltk.tokenize import sent_tokenize, word_tokenize
import warnings
warnings.f... | https://stackoverflow.com/questions/78248470/output-of-cosine-similarity-is-not-as-expected | python, nlp, transform, word2vec, cosine-similarity | 1,711,812,388 |
se_76857972 | stackoverflow | ARTIFICIAL_INTELLIGENCE | Error while installing medaCy package while following instructions from github repo | Error while installing medaCy package while following instructions from github repo
I wanted to run this command to install medaCy's Prediction and Model Training (stable version) :
! pip install git+https://github.com/NLPatVCU/medaCy.git
But I've encountered an error as shown below :
img1
img2
img3
img4
medaCy's gith... | https://stackoverflow.com/questions/76857972/error-while-installing-medacy-package-while-following-instructions-from-github-r | github, installation, pip, nlp, package | 1,691,485,086 |
se_77292954 | stackoverflow | ARTIFICIAL_INTELLIGENCE | 'Unknown Encoding' TikToken Error in exe that is compiled with Nuitka | 'Unknown Encoding' TikToken Error in exe that is compiled with Nuitka
I'm working with the tiktoken library in Python to count the number of tokens in a series of messages. My code runs well when executed as a Python script. However, when I compile it into an executable, I encounter an 'unknown encoding' error... | https://stackoverflow.com/questions/77292954/unknown-encoding-tiktoken-error-in-exe-that-is-compiled-with-nuitka | python, c, nlp, compiler-errors, nuitka | 1,697,289,383 |
se_69539466 | stackoverflow | ARTIFICIAL_INTELLIGENCE | How to speed up computation time for stopword removal and lemmatization in NLP | How to speed up computation time for stopword removal and lemmatization in NLP
As part of pre-processing for a text classification model, I have added stopword removal and lemmatization steps, using the NLTK library. The code is below:
import pandas as pd
import nltk; nltk.download("all")
from nltk.corpus import stopw... | https://stackoverflow.com/questions/69539466/how-to-speed-up-computation-time-for-stopword-removal-and-lemmatization-in-nlp | python, pandas, performance, nlp | 1,634,036,834 |
se_78204360 | stackoverflow | ARTIFICIAL_INTELLIGENCE | Upgrading accelerate while using Trainer class | Upgrading accelerate while using Trainer class
I am facing an issue whilst using Trainer class with Pytorch on Google Colab as it demands accelarate>=0.21.0 even though I have updated all the requirements, is there any alternative to it?
"Using the Trainer with PyTorch requires accelerate>=0.21.0: Please run pip insta... | https://stackoverflow.com/questions/78204360/upgrading-accelerate-while-using-trainer-class | deep-learning, pytorch, nlp, huggingface-transformers, huggingface-trainer | 1,711,088,285 |
se_77867577 | stackoverflow | ARTIFICIAL_INTELLIGENCE | How to create table of contents using unstructured (the python package) | How to create table of contents using unstructured (the python package)
tl;dr
How can I extract a clean table of contents from a pdf document that has hierarchical section headers using the unstructured package?
Some more details
I have a pdf document that is multiple pages long. The text in the document is organised ... | https://stackoverflow.com/questions/77867577/how-to-create-table-of-contents-using-unstructured-the-python-package | python, nlp | 1,706,024,944 |
se_78092126 | stackoverflow | ARTIFICIAL_INTELLIGENCE | ChatBot langchain, set memory+retriever+map_reduce | ChatBot langchain, set memory+retriever+map_reduce
I am new on this topics.I'd like to get a chain that allows me to use a retriever ,a memory and to set the chain_type = 'map_reduce'.In addition to that I'd like to know if is it possible to use the map_reduce only in the case in which the number of token exceeds the ... | https://stackoverflow.com/questions/78092126/chatbot-langchain-set-memoryretrievermap-reduce | python, nlp, chatbot, openai-api, langchain | 1,709,372,161 |
se_49889113 | stackoverflow | ARTIFICIAL_INTELLIGENCE | converting spacy token vectors into text | converting spacy token vectors into text
I am using spacy to create vectors of a sentence. If the sentence is 'I am working', it gives me a vector of shape (3, 300). Is there any way to get back the text in the sentence using those vectors?
Thank in advance,
Harathi | https://stackoverflow.com/questions/49889113/converting-spacy-token-vectors-into-text | python, vector, text, nlp, spacy | 1,524,009,239 |
se_78234568 | stackoverflow | ARTIFICIAL_INTELLIGENCE | Cleaning text data that has extra whitespaces between letters of a word | Cleaning text data that has extra whitespaces between letters of a word
Using R, I have read text from PDFs, and some words were read in with a space within the word, and I can't find any way to clean it.
For example, I need to turn "Then I cre ated a c h a r t using Excel" into "Then I created a chart using Excel"
Th... | https://stackoverflow.com/questions/78234568/cleaning-text-data-that-has-extra-whitespaces-between-letters-of-a-word | r, nlp | 1,711,573,334 |
se_78231313 | stackoverflow | ARTIFICIAL_INTELLIGENCE | Automatic Word Boundary Detection for German | Automatic Word Boundary Detection for German
I want to rephrase that: I need a corpus of German words so that I can check if a segment is a word. My solution so far is to take the string, check if it's in the dictionary and if not, delete the last character and check again, and so on. I just need a German word list no... | https://stackoverflow.com/questions/78231313/automatic-word-boundary-detection-for-german | python, nlp, linguistics, word-boundary | 1,711,538,646 |
se_78166781 | stackoverflow | ARTIFICIAL_INTELLIGENCE | How to assign topics to individual documents/ tweets in Bi-term Topic Modeling? | How to assign topics to individual documents/ tweets in Bi-term Topic Modeling?
I am a newbie at this, so I apologize if I am asking the obvious here. I ran a bi-term topic modeling algorithm to model short text data and discover topics among them. I am using LDAvis package to visualize and understand the data. Howeve... | https://stackoverflow.com/questions/78166781/how-to-assign-topics-to-individual-documents-tweets-in-bi-term-topic-modeling | r, nlp, lda, topic-modeling, libshorttext | 1,710,504,292 |
se_78219076 | stackoverflow | ARTIFICIAL_INTELLIGENCE | How to remove layers in Huggingface's transformers GPT2 pre-trained models? | How to remove layers in Huggingface's transformers GPT2 pre-trained models?
My code:
from transformers import GPT2Config, GPT2Model
from transformers import AutoTokenizer, AutoModelForMaskedLM, AutoModelForCausalLM
model = AutoModelForCausalLM.from_pretrained("openai-community/gpt2")
print(decoder)
Here is the ou... | https://stackoverflow.com/questions/78219076/how-to-remove-layers-in-huggingfaces-transformers-gpt2-pre-trained-models | python, machine-learning, deep-learning, nlp, transformer-model | 1,711,369,695 |
se_60026042 | stackoverflow | ARTIFICIAL_INTELLIGENCE | Swift Natural Language and CoreML: How to improve NLTagger to read Card Holder | Swift Natural Language and CoreML: How to improve NLTagger to read Card Holder
I am using Natural Language framework to find personal name on credit card.
Firstly I read credit card texts using Vision framework. Then I concatenate it.
So I have text that contains format similar to this:
"Citi 6011 1111 1111 1117 ... | https://stackoverflow.com/questions/60026042/swift-natural-language-and-coreml-how-to-improve-nltagger-to-read-card-holder | swift, nlp, coreml, createml | 1,580,646,095 |
se_78154849 | stackoverflow | ARTIFICIAL_INTELLIGENCE | Different embedding checksums after encoding with SentenceTransformers? | Different embedding checksums after encoding with SentenceTransformers?
I am calculating some embeddings with SentenceTransformers Library. However, I get different results when encoding the sentences and calculating their embeddings when checking the sum of their values. For instance:
In:
RANDOM_SEED = 42
np.random.... | https://stackoverflow.com/questions/78154849/different-embedding-checksums-after-encoding-with-sentencetransformers | python, jupyter-notebook, nlp, sentence-transformers | 1,710,342,476 |
se_78220956 | stackoverflow | ARTIFICIAL_INTELLIGENCE | NER grouping into objects | NER grouping into objects
Given a text, I am able to recognise all entities by using a discriminative NER model. Let us imagine that we have a page of text in which the different entities that make up a group of people are described and for each of them we have data such as 'first name', 'surname' and 'date of birth'.... | https://stackoverflow.com/questions/78220956/ner-grouping-into-objects | nlp, entity-relationship, named-entity-recognition, large-language-model, entity-linking | 1,711,389,798 |
se_78205960 | stackoverflow | ARTIFICIAL_INTELLIGENCE | Very long training times in pyTorch compared to Gensim | Very long training times in pyTorch compared to Gensim
I have trained a word2vec model using the Brown corpus with gensim as follows:
model = gensim.models.Word2Vec(brown.sents(),min_count = 5,
vector_size = 30, window = 5, negative=5)
This took just a couple of seconds to train.
Then I... | https://stackoverflow.com/questions/78205960/very-long-training-times-in-pytorch-compared-to-gensim | pytorch, nlp, gensim, word2vec | 1,711,107,470 |
se_78214553 | stackoverflow | ARTIFICIAL_INTELLIGENCE | How to calculate cosine similarity with bert over 1000 random example | How to calculate cosine similarity with bert over 1000 random example
I'm trying to calculate over random 1000 quest and 1000 answer using cosine similarity with bert-base-uncased, and after I want to find most similar 5 asnwer, after calculate top1 and top5 real answer accuracy. But im receiving output always 0.0 acc... | https://stackoverflow.com/questions/78214553/how-to-calculate-cosine-similarity-with-bert-over-1000-random-example | python, nlp, bert-language-model, cosine-similarity | 1,711,284,549 |
se_78210904 | stackoverflow | ARTIFICIAL_INTELLIGENCE | In which data type text data extracted from news site should be stored for NLP? | In which data type text data extracted from news site should be stored for NLP?
I extracted following text data using beautifulsoup
for data in soup2.find_all(class_="td-post-content"):
data.get_text()
In which type of data type should I store above extracted data?
I stored above extracted data into the list... | https://stackoverflow.com/questions/78210904/in-which-data-type-text-data-extracted-from-news-site-should-be-stored-for-nlp | python, web-scraping, beautifulsoup, nlp | 1,711,197,999 |
se_59877735 | stackoverflow | ARTIFICIAL_INTELLIGENCE | How to get probability of prediction per entity from Spacy NER model? | How to get probability of prediction per entity from Spacy NER model?
I used this official example code to train a NER model from scratch using my own training samples.
When I predict using this model on new text, I want to get the probability of prediction of each entity.
# test the saved model
print("Loa... | https://stackoverflow.com/questions/59877735/how-to-get-probability-of-prediction-per-entity-from-spacy-ner-model | python, deep-learning, nlp, spacy, named-entity-recognition | 1,579,779,617 |
se_76675018 | stackoverflow | ARTIFICIAL_INTELLIGENCE | How does one use accelerate with the hugging face (HF) trainer? | How does one use accelerate with the hugging face (HF) trainer?
What are the code changes one has to do to run accelerate with a trianer?
I keep seeing:
from accelerate import Accelerator
accelerator = Accelerator()
model, optimizer, training_dataloader, scheduler = accelerator.prepare(
model, optimizer, trainin... | https://stackoverflow.com/questions/76675018/how-does-one-use-accelerate-with-the-hugging-face-hf-trainer | pytorch, nlp, huggingface-transformers, huggingface, accelerate | 1,689,204,347 |
se_78211318 | stackoverflow | ARTIFICIAL_INTELLIGENCE | How can i get the first content of a python synsets list? | How can i get the first content of a python synsets list?
enter image description hereI have a scrapped text stored under the variable "message".
I have removed the StopWords and stored the result with the variable "without_stop_words".
I want to loop through each words in the 'without_stop_words' and get their MEANIN... | https://stackoverflow.com/questions/78211318/how-can-i-get-the-first-content-of-a-python-synsets-list | python, nlp, nltk, sentiment-analysis, synset | 1,711,205,598 |
se_78211192 | stackoverflow | ARTIFICIAL_INTELLIGENCE | How do non-LLM models compare to LLMs for Abstractive Summaries of HTML content? | How do non-LLM models compare to LLMs for Abstractive Summaries of HTML content?
I'm interested in utilizing an NLP model to provide short (one sentence in length) abstractive summaries of web pages, providing the model a set of commonly occurring HTML content from each web page (for example, heading tags, meta, the t... | https://stackoverflow.com/questions/78211192/how-do-non-llm-models-compare-to-llms-for-abstractive-summaries-of-html-content | html, nlp, summarization | 1,711,203,177 |
se_78209351 | stackoverflow | ARTIFICIAL_INTELLIGENCE | Subsampling when training word embeddings | Subsampling when training word embeddings
NLP newbie here with a question about word embeddings. As a learning exercise, I'm trying to train my own set of word embeddings based on word2vec. I have a corpus of english sentences that I've downloaded and cleaned and I think I have a decent grasp of how the training is su... | https://stackoverflow.com/questions/78209351/subsampling-when-training-word-embeddings | pytorch, nlp, word-embedding, torchtext | 1,711,153,407 |
se_78209199 | stackoverflow | ARTIFICIAL_INTELLIGENCE | ResourceExhaustedError In Tensorflow BERT Classifier | ResourceExhaustedError In Tensorflow BERT Classifier
I am trying to use the BertClassifier from the keras_nlp library but when I train the model I get this error:
2024-03-22 22:53:03.932926: W external/local_tsl/tsl/framework/bfc_allocator.cc:487] Allocator (GPU_0_bfc) ran out of memory trying to allocate 192.00MiB (r... | https://stackoverflow.com/questions/78209199/resourceexhaustederror-in-tensorflow-bert-classifier | python, tensorflow, keras, nlp, bert-language-model | 1,711,148,991 |
se_78205450 | stackoverflow | ARTIFICIAL_INTELLIGENCE | Non linear programming float decision variable in CPLEX | Non linear programming float decision variable in CPLEX
I m working in a non linear programming and got some problems that explain me that we can't use float decision variable in CPLEX when using solver CP. Help me, if there is some approach or other methods to solve this problem. Thanks
I had just try to use CP in CP... | https://stackoverflow.com/questions/78205450/non-linear-programming-float-decision-variable-in-cplex | nlp, mathematical-optimization | 1,711,102,269 |
se_78207480 | stackoverflow | ARTIFICIAL_INTELLIGENCE | is there any way to use RL for decoder only models | is there any way to use RL for decoder only models
Could you please assist me in finding resources related to training models like BERT using RLHF? Additionally, I'm curious about the scarcity of research on applying reinforcement learning to decoder-only models. Are there any specific challenges or issues associated ... | https://stackoverflow.com/questions/78207480/is-there-any-way-to-use-rl-for-decoder-only-models | nlp, transform, huggingface-transformers, reinforcement-learning, transformer-model | 1,711,123,550 |
se_78188879 | stackoverflow | ARTIFICIAL_INTELLIGENCE | Can I monitor progress of spacy parsing? | Can I monitor progress of spacy parsing?
I have a simple program to process English text with spacy and output some of the info about the tokens. For a big text it takes a long time for spacy to process it. Is there a way to see how far the processing has progressed ideally as a percentage? I'm not using my own models... | https://stackoverflow.com/questions/78188879/can-i-monitor-progress-of-spacy-parsing | python, nlp, monitoring, spacy, spacy-3 | 1,710,872,579 |
se_71865293 | stackoverflow | ARTIFICIAL_INTELLIGENCE | Extracting full-text research papers | Extracting full-text research papers
I am working on an NLP project which deals with full-text research papers. I have a list of DOIs and I want to store all the text of these research papers in one .txt file. Currently, I am downloading the pdfs from scihub, and then extracting text from these pdfs. But, this is very... | https://stackoverflow.com/questions/71865293/extracting-full-text-research-papers | python, web-scraping, nlp | 1,649,897,760 |
se_75840485 | stackoverflow | ARTIFICIAL_INTELLIGENCE | Can I use LoRa and Prompt Tuning at the same time for text summarization with GPT? | Can I use LoRa and Prompt Tuning at the same time for text summarization with GPT?
LoRA is to insert and learn the rank composition matrix created by dimensionally reducing the weight matrix in the transformer. Prompt Tuning, on the other hand, typically uses a soft prompt that encodes the prompt within the model to l... | https://stackoverflow.com/questions/75840485/can-i-use-lora-and-prompt-tuning-at-the-same-time-for-text-summarization-with-gp | nlp, huggingface-transformers, transformer-model, summarization, huggingface | 1,679,732,906 |
se_78197414 | stackoverflow | ARTIFICIAL_INTELLIGENCE | Error when I trying to run a trained ner model on local pc | Error when I trying to run a trained ner model on local pc
import re
import pickle
import keras
import tensorflow as tf
from keras.models import Sequential
from keras.layers import TFSMLayer
import numpy as np
class CustomNonPaddingTokenLoss(keras.losses.Loss):
def __init__(self, reduction=tf.keras.losses.Reducti... | https://stackoverflow.com/questions/78197414/error-when-i-trying-to-run-a-trained-ner-model-on-local-pc | python, tensorflow, keras, nlp, named-entity-recognition | 1,710,992,479 |
se_78084128 | stackoverflow | ARTIFICIAL_INTELLIGENCE | Using a BERT Model, I keep getting the error: Op type not registered 'CaseFoldUTF8' in binary running on MacBook-Pro-21.lan | Using a BERT Model, I keep getting the error: Op type not registered 'CaseFoldUTF8' in binary running on MacBook-Pro-21.lan
I am attempting to use a BERT model to help predict whether an update is urgent or not. I am able to tokenize the updates, with this output:
However, when I go to define the model, I keep... | https://stackoverflow.com/questions/78084128/using-a-bert-model-i-keep-getting-the-error-op-type-not-registered-casefoldut | python, nlp, data-mining, bert-language-model | 1,709,238,860 |
se_77879969 | stackoverflow | ARTIFICIAL_INTELLIGENCE | Is there a way to save a pre-compiled AutoTokenizer? | Is there a way to save a pre-compiled AutoTokenizer?
Sometimes, we'll have to do something like this to extend a pre-trained tokenizer:
from transformers import AutoTokenizer
from datasets import load_dataset
ds_de = load_dataset("mc4", 'de')
ds_fr = load_dataset("mc4", 'fr')
de_tokenizer = tokenizer.train_new_fro... | https://stackoverflow.com/questions/77879969/is-there-a-way-to-save-a-pre-compiled-autotokenizer | python, nlp, tokenize, huggingface, huggingface-tokenizers | 1,706,185,565 |
se_78195004 | stackoverflow | ARTIFICIAL_INTELLIGENCE | Adapters after QLoRA fine-tuning on a llama architecture model reach about 2 GB, which is very far from the general trend seen online | Adapters after QLoRA fine-tuning on a llama architecture model reach about 2 GB, which is very far from the general trend seen online
I was Fine Tuning a Llama Architecture Model that supports multiple languages: English, Hindi as well as Roman Hindi.
So, I loaded the model in quantized form using bitsandbytes in nf4 ... | https://stackoverflow.com/questions/78195004/adapters-after-qlora-fine-tuning-on-a-llama-architecture-model-reach-about-2-gb | nlp, chatbot, fine-tuning, quantization-aware-training | 1,710,952,982 |
se_78060857 | stackoverflow | ARTIFICIAL_INTELLIGENCE | Kaggle's packages missing many essential methods, for instance Kaggle's `Dataset` class has no `from_generator()` method | Kaggle's packages missing many essential methods, for instance Kaggle's `Dataset` class has no `from_generator()` method
I have been working on a particular NLP project for a month and have been running into error after error. I built a small model on my potato PC and it works perfectly. I upscaled it to Kaggl... | https://stackoverflow.com/questions/78060857/kaggles-packages-missing-many-essential-methods-for-instance-kaggles-dataset | python, nlp, kaggle | 1,708,949,896 |
se_19753945 | stackoverflow | ARTIFICIAL_INTELLIGENCE | TfidfVectorizer in sklearn how to specifically INCLUDE words | TfidfVectorizer in sklearn how to specifically INCLUDE words
I have some questions about the TfidfVectorizer.
It is unclear to me how the words are selected. We can give a minimum support, but after that, what will decide which features will be selected (e.g. higher support more chance)? If we say max_features = 1000... | https://stackoverflow.com/questions/19753945/tfidfvectorizer-in-sklearn-how-to-specifically-include-words | python, machine-learning, nlp, scikit-learn | 1,383,488,386 |
se_76459442 | stackoverflow | ARTIFICIAL_INTELLIGENCE | SpaCy v3 custom NER model training | SpaCy v3 custom NER model training
I am trying to create a NLP project using spacy and python that extracts entities from text.
I need some custom entities so I created a JSON file with annotated articles that I am using to train my model with.
The issue I am facing is that instead of creating a new custom model, I wa... | https://stackoverflow.com/questions/76459442/spacy-v3-custom-ner-model-training | python, nlp, spacy, named-entity-recognition | 1,686,595,296 |
se_37257386 | stackoverflow | ARTIFICIAL_INTELLIGENCE | how can I build the Jira AI chatbot? | how can I build the Jira AI chatbot?
My company has been using Jira for production issue tracking for last 6~8 years and as a result, there is a huge amount of production issue details logged in our Jira.
Usually each Jira ticket for any production support issues consist of some useful information such as:
Error Mess... | https://stackoverflow.com/questions/37257386/how-can-i-build-the-jira-ai-chatbot | nlp, neural-network, artificial-intelligence, jira, chatbot | 1,463,411,885 |
se_78184077 | stackoverflow | ARTIFICIAL_INTELLIGENCE | Solution to solve problem different results when run Doc2vec gensim? | Solution to solve problem different results when run Doc2vec gensim?
I try to find information about problem that Doc2vec returns different results when it runs. I saw many previous questions about this and I know It happens because vector is randomly initialize. However, I am creating a website which uses this result... | https://stackoverflow.com/questions/78184077/solution-to-solve-problem-different-results-when-run-doc2vec-gensim | nlp, doc2vec | 1,710,818,417 |
se_65514944 | stackoverflow | ARTIFICIAL_INTELLIGENCE | Tensorflow embeddings InvalidArgumentError: indices[18,16] = 11905 is not in [0, 11905) [[node sequential_1/embedding_1/embedding_lookup | Tensorflow embeddings InvalidArgumentError: indices[18,16] = 11905 is not in [0, 11905) [[node sequential_1/embedding_1/embedding_lookup
I am using TF 2.2.0 and trying to create a Word2Vec CNN text classification model. But however I tried there has been always an issue with the model or embedding layers. I could not ... | https://stackoverflow.com/questions/65514944/tensorflow-embeddings-invalidargumenterror-indices18-16-11905-is-not-in-0 | tensorflow, nlp, word2vec, embedding, word-embedding | 1,609,371,808 |
se_78174060 | stackoverflow | ARTIFICIAL_INTELLIGENCE | Word Frequency Analysis of .txt in R Not Returning Expected Output | Word Frequency Analysis of .txt in R Not Returning Expected Output
analyze_document <- function(filename) {
# Read text data
text <- readLines(filename, encoding = "UTF-8") %>% paste(collapse = " ")
# Preprocessing
text <- str_to_lower(text) # Use stringr's function
text <- gsub("[^[:alnum:]]", "", text)... | https://stackoverflow.com/questions/78174060/word-frequency-analysis-of-txt-in-r-not-returning-expected-output | r, nlp | 1,710,649,572 |
se_78165023 | stackoverflow | ARTIFICIAL_INTELLIGENCE | removing paywall language from piece of text (pandas) | removing paywall language from piece of text (pandas)
I'm trying to do some preprocessing on my dataset. Specifically, I'm trying to remove paywall language from the text (in bold below) but I keep getting an empty string as my output.
Here is the sample text:
In order to put a stop to the invasive bush honeysuckle o... | https://stackoverflow.com/questions/78165023/removing-paywall-language-from-piece-of-text-pandas | python, pandas, nlp, nltk | 1,710,484,216 |
se_78140912 | stackoverflow | ARTIFICIAL_INTELLIGENCE | SpaCy: Regex pattern does not work in rule-based matcher | SpaCy: Regex pattern does not work in rule-based matcher
I am trying to define a regular expression to use as text pattern in the entity ruler component in my spaCy model.
The aim is to add tokens with "COMP" label whenever it finds words structured like this:
XXX-Ynnn
XXX Ynnn
Where 'XXX' are trigrams from a list, '... | https://stackoverflow.com/questions/78140912/spacy-regex-pattern-does-not-work-in-rule-based-matcher | python, nlp, spacy, named-entity-recognition | 1,710,163,199 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.