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_73877676 | stackoverflow | ARTIFICIAL_INTELLIGENCE | Hindi accent("मात्रा") issue in word cloud using Devnagri font(gargi.ttf) | Hindi accent("मात्रा") issue in word cloud using Devnagri font(gargi.ttf)
I am working on a Hindi dataset for a project and did the pre-processing of the data where I am creating a word cloud for the same. I have used "gargi" font to plot the Hindi words on word cloud where I am facing an issue of accent("ि ... | https://stackoverflow.com/questions/73877676/hindi-accent%e0%a4%ae%e0%a4%be%e0%a4%a4%e0%a5%8d%e0%a4%b0%e0%a4%be-issue-in-word-cloud-using-devnagri-fontgargi-ttf | python, machine-learning, nlp, word-cloud, hindi | 1,664,349,972 |
se_78365608 | stackoverflow | ARTIFICIAL_INTELLIGENCE | Fine-tuning BERT with deterministic masking instead of random masking | Fine-tuning BERT with deterministic masking instead of random masking
I want to fine-tune BERT on a specific dataset. My problem is that I do not want to mask some tokens of my training dataset randomly, but I already have chosen which tokens I want to mask (for certain reasons).
To do so, I created a dataset that has... | https://stackoverflow.com/questions/78365608/fine-tuning-bert-with-deterministic-masking-instead-of-random-masking | nlp, huggingface-transformers, bert-language-model | 1,713,782,345 |
se_66877729 | stackoverflow | ARTIFICIAL_INTELLIGENCE | Calculate coherence for non-gensim topic model | Calculate coherence for non-gensim topic model
I've built a topic model, with:
Input: list of tokenized lists
Output: a m x t matrix (with each cell indicating the probability of word i appearing in topic k).
Output: a k x n matrix (with each cell indicating the probability of topic k in document j).
To find the opt... | https://stackoverflow.com/questions/66877729/calculate-coherence-for-non-gensim-topic-model | python-3.x, nlp, package, topic-modeling | 1,617,134,576 |
se_78501001 | stackoverflow | ARTIFICIAL_INTELLIGENCE | TF accuracy metric wants a single value but gets a list of probabilities | TF accuracy metric wants a single value but gets a list of probabilities
I am performing a simple seq-to-seq transformer task. I have tried various loss and metrics but none are working. Currently, in model.compile() I am using these:
loss=tf.keras.losses.SparseCategoricalCrossentropy(from_logits=True),
metrics=['accu... | https://stackoverflow.com/questions/78501001/tf-accuracy-metric-wants-a-single-value-but-gets-a-list-of-probabilities | tensorflow, nlp, tensorflow2.0 | 1,716,066,476 |
se_78485347 | stackoverflow | ARTIFICIAL_INTELLIGENCE | Encode a list of sentences into embeddings using a HuggingFace model not in its hub | Encode a list of sentences into embeddings using a HuggingFace model not in its hub
I am trying to encode a list of sentences into a list of embeddings. When I use a model that is in the HuggingFace hub, it works as expected. But when I use a model not in the hub, in this case Facebook's M2M100 model, I do not get the... | https://stackoverflow.com/questions/78485347/encode-a-list-of-sentences-into-embeddings-using-a-huggingface-model-not-in-its | nlp, huggingface-transformers, encode, embedding, huggingface | 1,715,791,179 |
se_78501311 | stackoverflow | ARTIFICIAL_INTELLIGENCE | How to Reduce Snippet Length and Minimize Token Usage in Cohere API Webhook Responses? | How to Reduce Snippet Length and Minimize Token Usage in Cohere API Webhook Responses?
Problem Description:
I am integrating the Cohere API with Zapier to perform web searches and generate concise summaries. However, I am encountering an issue where the snippets in the webhook responses are extremely long, leading to ... | https://stackoverflow.com/questions/78501311/how-to-reduce-snippet-length-and-minimize-token-usage-in-cohere-api-webhook-resp | nlp, webhooks, tokenize, zapier | 1,716,078,103 |
se_78497850 | stackoverflow | ARTIFICIAL_INTELLIGENCE | Why does TensorFlow graph execution require different shapes than eager execution? | Why does TensorFlow graph execution require different shapes than eager execution?
I have 10-100 token inputs and ~1000 token outputs, so I have separate embeddings for them so I can have computational efficiency. I'm pretty sure the answer is that there's no way to have differently lengthed inputs and outputs in gra... | https://stackoverflow.com/questions/78497850/why-does-tensorflow-graph-execution-require-different-shapes-than-eager-executio | tensorflow, nlp, tensorflow2.0 | 1,715,978,215 |
se_78302020 | stackoverflow | ARTIFICIAL_INTELLIGENCE | Error.__init__() got an unexpected keyword argument 'trainable' when try to load a .keras model | Error.__init__() got an unexpected keyword argument 'trainable' when try to load a .keras model
I've trained a NER model and save it as .keras file, when I try to load the model, it pops up this error
TypeError: <class 'modeling.NERModel'> could not be deserialized properly. Please ensure that components that ... | https://stackoverflow.com/questions/78302020/error-init-got-an-unexpected-keyword-argument-trainable-when-try-to-load | python, tensorflow, keras, nlp, named-entity-recognition | 1,712,720,243 |
se_78371741 | stackoverflow | ARTIFICIAL_INTELLIGENCE | No Attention returned even when output_attentions= True | No Attention returned even when output_attentions= True
I'm using a pretrained model based BERT (github link:DNABERT-2)
It uses AutoModelForSequenceClassification and mosaicml/mosaic-bert-base.
I'm having the problem that I cannot extract the attention. I have read many posts which show ways of dealing with that by ac... | https://stackoverflow.com/questions/78371741/no-attention-returned-even-when-output-attentions-true | nlp, huggingface-transformers, bert-language-model, transformer-model, attention-model | 1,713,869,330 |
se_37967282 | stackoverflow | ARTIFICIAL_INTELLIGENCE | How to extract specific content, like name or DOB, from a document using NLP and python? | How to extract specific content, like name or DOB, from a document using NLP and python?
I want to extract very specific content like name, address and dob from a document (say for example, a resume). Assuming I have 1000 of such documents, I want to automate it using machine learning and natural language processing. ... | https://stackoverflow.com/questions/37967282/how-to-extract-specific-content-like-name-or-dob-from-a-document-using-nlp-and | python, machine-learning, nlp | 1,466,596,363 |
se_78396871 | stackoverflow | ARTIFICIAL_INTELLIGENCE | save and load keras transformer model | save and load keras transformer model
i am still new to deep learning right now i follow this keras tutorial to make an translation model using transformer here the link. Everything works just fine but i have no idea how to save the model, currently i have this implementation
transformer.save("models/transformer.h5")
... | https://stackoverflow.com/questions/78396871/save-and-load-keras-transformer-model | python, tensorflow, keras, deep-learning, nlp | 1,714,270,125 |
se_76921252 | stackoverflow | ARTIFICIAL_INTELLIGENCE | AttributeError: module 'chromadb' has no attribute 'config' | AttributeError: module 'chromadb' has no attribute 'config'
so i recently started to work on chromabd and i am facing this error:
"module 'chromadb' has no attribute 'config'"
here is my code:
from langchain.vectorstores import Chroma
from sentence_transformers import SentenceTransformer
... | https://stackoverflow.com/questions/76921252/attributeerror-module-chromadb-has-no-attribute-config | python, nlp, chatbot, langchain, chromadb | 1,692,273,136 |
se_78494220 | stackoverflow | ARTIFICIAL_INTELLIGENCE | Attention Tensor Shape meaning | Attention Tensor Shape meaning
While I'm trying to extract Attention from a model, I see that there is a part where the attention changes its shape after matmul() with v (value).
The shape goes from:
attention_probs 2 shape: torch.Size([1, 12, 464, 464])
To:
attention shape: torch.Size([1, 464, 12, 64])
And then rearr... | https://stackoverflow.com/questions/78494220/attention-tensor-shape-meaning | python, nlp, transformer-model, attention-model, self-attention | 1,715,932,152 |
se_78129126 | stackoverflow | ARTIFICIAL_INTELLIGENCE | TypeError: Exception encountered when calling layer 'embeddings' (type TFBertEmbeddings) | TypeError: Exception encountered when calling layer 'embeddings' (type TFBertEmbeddings)
My model was wholly workable two weeks back, but now it's showing the following error:
---------------------------------------------------------------------------
TypeError Traceback (most r... | https://stackoverflow.com/questions/78129126/typeerror-exception-encountered-when-calling-layer-embeddings-type-tfbertemb | tensorflow, deep-learning, nlp, bert-language-model, transformer-model | 1,709,916,511 |
se_78492843 | stackoverflow | ARTIFICIAL_INTELLIGENCE | Cardinality issue with graph execution in TensorFlow | Cardinality issue with graph execution in TensorFlow
I was using a TFRecord and couldn't get past a cardinality issue to get it to work with graph execution. I switched back to a regular dataset loading method and now I have another cardinality issue.
File "/opt/conda/lib/python3.10/site-packages/keras/src/trainers... | https://stackoverflow.com/questions/78492843/cardinality-issue-with-graph-execution-in-tensorflow | tensorflow, nlp, tensorflow2.0, tensorflow-datasets | 1,715,902,025 |
se_78490608 | stackoverflow | ARTIFICIAL_INTELLIGENCE | How can i make a transformer output a translation relative to a specific context | How can i make a transformer output a translation relative to a specific context
I am working a machine-translation-like project, where i have a transformer with the encoder-decoder structure, which is supposed to generate SQL queries from natural language commands, example:
Input: Count the number of aircrafts produc... | https://stackoverflow.com/questions/78490608/how-can-i-make-a-transformer-output-a-translation-relative-to-a-specific-context | machine-learning, nlp, transformer-model, machine-translation | 1,715,869,529 |
se_78491502 | stackoverflow | ARTIFICIAL_INTELLIGENCE | How to add label in config for ViLT model fine tunning | How to add label in config for ViLT model fine tunning
I am trying to fine-tune ViLT model for visual question and answering using this notebook. In my dataset, I have introduced some new labels and was wondering how can I add new label.
Referring code
for answer in answer_count:
if answer not in list(config.label... | https://stackoverflow.com/questions/78491502/how-to-add-label-in-config-for-vilt-model-fine-tunning | nlp, huggingface-transformers, fine-tuning, vqa | 1,715,879,070 |
se_78491317 | stackoverflow | ARTIFICIAL_INTELLIGENCE | Unexpected Attention dimension [nbr_layers, seq_length, hidden_layer_dim] | Unexpected Attention dimension [nbr_layers, seq_length, hidden_layer_dim]
I'm working on extracting Attention from a modified Bert model that originally did NOT output any attention. When I extracted it by getting it from the BertEncoder (and through all the intermediate classes: ModelLayer, SelfUnpaddedAttention...),... | https://stackoverflow.com/questions/78491317/unexpected-attention-dimension-nbr-layers-seq-length-hidden-layer-dim | pytorch, nlp, bert-language-model, transformer-model, attention-model | 1,715,876,707 |
se_71901851 | stackoverflow | ARTIFICIAL_INTELLIGENCE | ImportError: cannot import name '_LazyModule' from 'transformers.utils' | ImportError: cannot import name '_LazyModule' from 'transformers.utils'
I am trying to run a text summarization "t5-base" model. The code used to work when I first ran it but after installing/reinstalling some packages, it no longer works. Can anyone please tell me how to resolve this issue? 😭
Here is... | https://stackoverflow.com/questions/71901851/importerror-cannot-import-name-lazymodule-from-transformers-utils | python, nlp, pytorch, huggingface-transformers | 1,650,198,228 |
se_73629817 | stackoverflow | ARTIFICIAL_INTELLIGENCE | Got memory error while performing cosine similarity on a huge vector | Got memory error while performing cosine similarity on a huge vector
I was trying to build a content based recommendation system using bag of words model. The tutorial which I am following uses cosine similarity from sklearn library on a vector of size (4000,5000) where 4000 is the number of rows in dataset and 5000 ... | https://stackoverflow.com/questions/73629817/got-memory-error-while-performing-cosine-similarity-on-a-huge-vector | python, machine-learning, scikit-learn, nlp, cosine-similarity | 1,662,521,625 |
se_78455544 | stackoverflow | ARTIFICIAL_INTELLIGENCE | `AcceleratorState` object has no attribute `distributed_type` | `AcceleratorState` object has no attribute `distributed_type`
I am trying to use an Accelerator with a Trainer using the code bellow:
tokenizer = AutoTokenizer.from_pretrained(model_args.model_name_or_path)
config = AutoConfig.from_pretrained(model_args.model_name_or_path)
model = AutoModelForSeq2SeqLM.fr... | https://stackoverflow.com/questions/78455544/acceleratorstate-object-has-no-attribute-distributed-type | nlp, huggingface-transformers, accelerate, huggingface-trainer | 1,715,269,191 |
se_78482279 | stackoverflow | ARTIFICIAL_INTELLIGENCE | past key values from hidden states | past key values from hidden states
I'm trying to extract past key, value pair using attention_layers and hidden_state for a particular layer
import torch
import torch.nn.functional as F
from transformers import LlamaConfig
from transformers import LlamaModel, LlamaTokenizer, LlamaForCausalLM
tokenizer = LlamaTokenize... | https://stackoverflow.com/questions/78482279/past-key-values-from-hidden-states | python, nlp, huggingface-transformers, large-language-model | 1,715,757,962 |
se_78480367 | stackoverflow | ARTIFICIAL_INTELLIGENCE | Docker build taking too long and failing with requirements.txt containing TensorFlow and other packages | Docker build taking too long and failing with requirements.txt containing TensorFlow and other packages
I'm trying to build my Docker image, but it's taking forever. Even when I leave it to continue building, it fails after a long time. Here is my Dockerfile:
FROM ubuntu:24.04
# Install Python and pip
RUN apt-get upd... | https://stackoverflow.com/questions/78480367/docker-build-taking-too-long-and-failing-with-requirements-txt-containing-tensor | docker, tensorflow, pytorch, nlp, dockerfile | 1,715,716,142 |
se_61300904 | stackoverflow | ARTIFICIAL_INTELLIGENCE | Removing Narrow 'No-Break Space' Unicode Characters (U+00A0) in python nlp | Removing Narrow 'No-Break Space' Unicode Characters (U+00A0) in python nlp
Non-breaking spaces are printed as whitespace, but handled internally as \xa0. How do I remove all these characters at once?
So far I've replaced it directly:
text = text.replace('\u202f','')
text = text.replace('\u200d','')
text =... | https://stackoverflow.com/questions/61300904/removing-narrow-no-break-space-unicode-characters-u00a0-in-python-nlp | python-3.x, string, nlp, python-unicode, unicode-string | 1,587,281,052 |
se_43163959 | stackoverflow | ARTIFICIAL_INTELLIGENCE | Text classification. TFIDF and Naive Bayes? | Text classification. TFIDF and Naive Bayes?
I'm attempting a text classification task, where I have training data of around 500 restaurant reviews that are labelled across 12 categories. I spent longer than I should have implementing TF.IDF and cosine similarity for the classification of test data, only to get some ve... | https://stackoverflow.com/questions/43163959/text-classification-tfidf-and-naive-bayes | python, machine-learning, scikit-learn, nlp | 1,491,099,683 |
se_78418098 | stackoverflow | ARTIFICIAL_INTELLIGENCE | How can I build an accurate dataset in a short span of time? | How can I build an accurate dataset in a short span of time?
We are developing an iOS app that lets users send customizable digital cards. Users can choose from various card templates, enter their own text, and make edits to the card as they like. We also have a feature where users can provide a short message, like "h... | https://stackoverflow.com/questions/78418098/how-can-i-build-an-accurate-dataset-in-a-short-span-of-time | machine-learning, nlp, dataset, coreml | 1,714,641,534 |
se_15009656 | stackoverflow | ARTIFICIAL_INTELLIGENCE | How to use NLTK to generate sentences from an induced grammar? | How to use NLTK to generate sentences from an induced grammar?
I have a (large) list of parsed sentences (which were parsed using the Stanford parser), for example, the sentence "Now you can be entertained" has the following tree:
(ROOT
(S
(ADVP (RB Now))
(, ,)
(NP (PRP you))
(VP (MD can)
(VP ... | https://stackoverflow.com/questions/15009656/how-to-use-nltk-to-generate-sentences-from-an-induced-grammar | python, nlp, nltk | 1,361,471,257 |
se_77965060 | stackoverflow | ARTIFICIAL_INTELLIGENCE | Key matrix redundant in Transformer language models? | Key matrix redundant in Transformer language models?
Simple implementations of Transformer language models such as this one define 3 matrices K,Q,V to compute keys, queries and values. However matrices K and Q are never used separately: all Transformer computations form their product Q^t K. So I wonder why not learn t... | https://stackoverflow.com/questions/77965060/key-matrix-redundant-in-transformer-language-models | nlp, transformer-model | 1,707,430,461 |
se_78474156 | stackoverflow | ARTIFICIAL_INTELLIGENCE | in R converting a text file into a data frame | in R converting a text file into a data frame
in R have a .txt file that i would like to extract data from as a character string. my .txt file is formatted like the following with a list separated by numbers. 1. [text1] 2. [text2] 3. [text3] and so on to 400. i want each observation to be extracted so that the first o... | https://stackoverflow.com/questions/78474156/in-r-converting-a-text-file-into-a-data-frame | r, pdf, text, nlp | 1,715,624,691 |
se_78334712 | stackoverflow | ARTIFICIAL_INTELLIGENCE | Fine-tuned openAI API is giving NotFoundError: Error code: 404 | Fine-tuned openAI API is giving NotFoundError: Error code: 404
this is my first openAI fine-tuning job so I don't know much. I am trying to fine-tune OpenAI API to generate product ID based on the description. The code runs successfully and also generates model ID, I also got billed for it. However, when I want to use... | https://stackoverflow.com/questions/78334712/fine-tuned-openai-api-is-giving-notfounderror-error-code-404 | nlp, openai-api, fine-tuning | 1,713,272,261 |
se_78465648 | stackoverflow | ARTIFICIAL_INTELLIGENCE | How do I use a model that can be loaded with AutoModelForSequenceClassification with AutoModelForTokenClassification for Ner fine tuning? | How do I use a model that can be loaded with AutoModelForSequenceClassification with AutoModelForTokenClassification for Ner fine tuning?
While I can fine tune the BERT model with the custom data in the specific domain by loading it with AutoModelForTokenClassification, I can load another BERT model trained in that do... | https://stackoverflow.com/questions/78465648/how-do-i-use-a-model-that-can-be-loaded-with-automodelforsequenceclassification | nlp, bert-language-model, named-entity-recognition, fine-tuning | 1,715,451,223 |
se_78240828 | stackoverflow | ARTIFICIAL_INTELLIGENCE | Is BertForSequenceClassification using the CLS vector? | Is BertForSequenceClassification using the CLS vector?
In the hugging face source code, pooled_output = outputs[1] is used.
outputs = self.bert(
input_ids,
attention_mask=attention_mask,
token_type_ids=token_type_ids,
position_ids=position_ids,
head_m... | https://stackoverflow.com/questions/78240828/is-bertforsequenceclassification-using-the-cls-vector | nlp, huggingface-transformers, bert-language-model | 1,711,659,257 |
se_78463290 | stackoverflow | ARTIFICIAL_INTELLIGENCE | How to make LLMs answer in certain pattern | How to make LLMs answer in certain pattern
How can I design the LLM program so that the LLM will answer in some preset pattern?For example, if I want to use the LLM to promote some products or collect some information from the user, what adjustment should I try on the LLM program? Thx~
I tried modifying the prompts bu... | https://stackoverflow.com/questions/78463290/how-to-make-llms-answer-in-certain-pattern | nlp, artificial-intelligence, openai-api, large-language-model | 1,715,398,081 |
se_54512264 | stackoverflow | ARTIFICIAL_INTELLIGENCE | Use Spacy to find Lemma of Russian (Those langs which don't have model) | Use Spacy to find Lemma of Russian (Those langs which don't have model)
I have downloaded Spacy English model and finding lemma using this code.
import spacy
nlp = spacy.load('en')
doc = nlp(u'Two apples')
for token in doc:
print(token, token.lemma, token.lemma_)
Output:
Two 11711838292424000352 two
apples... | https://stackoverflow.com/questions/54512264/use-spacy-to-find-lemma-of-russian-those-langs-which-dont-have-model | nlp, spacy, lemmatization | 1,549,268,126 |
se_64881478 | stackoverflow | ARTIFICIAL_INTELLIGENCE | Passing multiple sentences to BERT? | Passing multiple sentences to BERT?
I have a dataset with paragraphs that I need to classify into two classes. These paragraphs are usually 3-5 sentences long. The overwhelming majority of them are less than 500 words long. I would like to make use of BERT to tackle this problem.
I am wondering how I should use BERT t... | https://stackoverflow.com/questions/64881478/passing-multiple-sentences-to-bert | nlp, text-classification, bert-language-model, huggingface-transformers | 1,605,639,015 |
se_78191029 | stackoverflow | ARTIFICIAL_INTELLIGENCE | Python spacy 2.3.5 installation error within the subprocesses | Python spacy 2.3.5 installation error within the subprocesses
The error i got when installing the spacy 2.3.5 version
I ran the command pip install spacy==2.3.5
i got error for multiple lines and here is the end of the error message
Cython.Compiler.Errors.CompileError: thinc/extra/eg.pyx
[end of output]
note: This... | https://stackoverflow.com/questions/78191029/python-spacy-2-3-5-installation-error-within-the-subprocesses | python, pip, nlp, spacy | 1,710,913,083 |
se_78455102 | stackoverflow | ARTIFICIAL_INTELLIGENCE | Why doesn't fuzzywuzzy's process.extractBests give a 100% score when the tested string 100% contains the query string? | Why doesn't fuzzywuzzy's process.extractBests give a 100% score when the tested string 100% contains the query string?
I'm testing fuzzywuzzy's process.extractBests() as follows:
from fuzzywuzzy import process
# Define the query string
query = "Apple"
# Define the list of choices
choices = ["Apple", "Apple I... | https://stackoverflow.com/questions/78455102/why-doesnt-fuzzywuzzys-process-extractbests-give-a-100-score-when-the-tested | python, nlp, string-matching, fuzzywuzzy | 1,715,264,676 |
se_32733510 | stackoverflow | ARTIFICIAL_INTELLIGENCE | NLTK agreement with distance metric | NLTK agreement with distance metric
I have a task to calculate inter-annotator agreement in multi-label classification, where for each example more than one label can be assigned. I found that NLTK can measure agreement based on a distance metric.
I am looking for an example of calculating krippendorff alpha with MASI... | https://stackoverflow.com/questions/32733510/nltk-agreement-with-distance-metric | python, machine-learning, nlp, nltk | 1,442,993,289 |
se_78453549 | stackoverflow | ARTIFICIAL_INTELLIGENCE | AttributeError: 'Tensor' object has no attribute 'embed_documents' | AttributeError: 'Tensor' object has no attribute 'embed_documents'
I have uploaded PDF file and split file into chunks, then apply tokenizer to each chunck and created embeddings. But when i try to store my embedding in FIASS, it give me AttributeError: 'Tensor' object has no attribute 'embed_documents... | https://stackoverflow.com/questions/78453549/attributeerror-tensor-object-has-no-attribute-embed-documents | python, nlp, chatbot, langchain, vectorstore | 1,715,247,702 |
se_78453294 | stackoverflow | ARTIFICIAL_INTELLIGENCE | why gradient scaling used in mix-precision training could lead to bigger Learning Rate in float32 model? | why gradient scaling used in mix-precision training could lead to bigger Learning Rate in float32 model?
Background:
Gradient Scaling original is used in mix-precision training like (part of model weights are float16 and part of them are float 32), which its purpose is to reduce underflow of small gradients stored wit... | https://stackoverflow.com/questions/78453294/why-gradient-scaling-used-in-mix-precision-training-could-lead-to-bigger-learnin | machine-learning, nlp, artificial-intelligence, large-language-model | 1,715,244,582 |
se_78398489 | stackoverflow | ARTIFICIAL_INTELLIGENCE | AttributeError: module 'click.utils' has no attribute '_expand_args' | AttributeError: module 'click.utils' has no attribute '_expand_args'
I am following a nlp tutorial this is the video I am on: https://www.youtube.com/watch?v=h2kBNEShsiE&list=PLeo1K3hjS3uuvuAXhYjV2lMEShq2UYSwX&index=7
In the video the instructor asks us to run the command python -m spacy download en bu... | https://stackoverflow.com/questions/78398489/attributeerror-module-click-utils-has-no-attribute-expand-args | python, pip, nlp, spacy | 1,714,314,141 |
se_78443980 | stackoverflow | ARTIFICIAL_INTELLIGENCE | FastText language_identification in R returns too many arguments - how to match to texts? | FastText language_identification in R returns too many arguments - how to match to texts?
FastText language_identification returns multiple predictions per original text, and also fails to indicate which belong to which original document.
There are differing numbers of predictions per original document too -- their Gi... | https://stackoverflow.com/questions/78443980/fasttext-language-identification-in-r-returns-too-many-arguments-how-to-match | r, nlp, fasttext, language-detection | 1,715,100,381 |
se_76528610 | stackoverflow | ARTIFICIAL_INTELLIGENCE | 403 Forbidden 453 - You currently have access to a subset of Twitter API v2 endpoints and limited v1.1 endpoints only | 403 Forbidden 453 - You currently have access to a subset of Twitter API v2 endpoints and limited v1.1 endpoints only
I had recently registered for the free level Twitter API, and I would like to use Tweepy to help me extract tweets from users.
api_key = config['twitter']['api_key']
api_secret = config['twitter']['api... | https://stackoverflow.com/questions/76528610/403-forbidden-453-you-currently-have-access-to-a-subset-of-twitter-api-v2-endp | python, twitter, nlp, tweepy | 1,687,408,245 |
se_78430524 | stackoverflow | ARTIFICIAL_INTELLIGENCE | Determining contents of decoder_hidden_states from T5ForConditionalGeneration | Determining contents of decoder_hidden_states from T5ForConditionalGeneration
I'm using the Huggingface T5ForConditionalGeneration model without modification.
I want to compute mean pooling over the last hidden state of the T5 decoder, but I can't determine which part of the decoder_hidden_states contains what I'm loo... | https://stackoverflow.com/questions/78430524/determining-contents-of-decoder-hidden-states-from-t5forconditionalgeneration | pytorch, nlp, huggingface-transformers | 1,714,860,817 |
se_78445559 | stackoverflow | ARTIFICIAL_INTELLIGENCE | LDA over time in R | LDA over time in R
I'm trying to apply LDA over a large sample of documents. My dataset is the speeches given by Yellen and Powell taken from this website
My code looks like this
library(topicmodels)
library(tidytext)
library(dplyr)
library(ggplot2)
library(quanteda)
library(tm)
library(lsa)
library(lubridate)
bis_spe... | https://stackoverflow.com/questions/78445559/lda-over-time-in-r | r, nlp, lda | 1,715,126,652 |
se_54495502 | stackoverflow | ARTIFICIAL_INTELLIGENCE | How to get all words from spacy vocab? | How to get all words from spacy vocab?
I need all the words from Spacy vocab. Suppose, I initialize my spacy model as
nlp = spacy.load('en')
How do I get the text of words from nlp.vocab? | https://stackoverflow.com/questions/54495502/how-to-get-all-words-from-spacy-vocab | python-3.x, nlp, spacy | 1,549,127,905 |
se_23704510 | stackoverflow | ARTIFICIAL_INTELLIGENCE | How do I test whether an nltk resource is already installed on the machine running my code? | How do I test whether an nltk resource is already installed on the machine running my code?
I just started my first NLTK project and am confused about the proper setup. I need several resources like the Punkt Tokenizer and the maxent pos tagger. I myself downloaded them using the GUI nltk.download(). For my collaborat... | https://stackoverflow.com/questions/23704510/how-do-i-test-whether-an-nltk-resource-is-already-installed-on-the-machine-runni | python, nlp, nltk | 1,400,274,223 |
se_64112358 | stackoverflow | ARTIFICIAL_INTELLIGENCE | Transformer: cannot import name 'AutoModelWithLMHead' from 'transformers' | Transformer: cannot import name 'AutoModelWithLMHead' from 'transformers'
I was referring to this answer from stackoverflow but I can't get any leads regarding my problem: [https://stackoverflow.com/questions/63141267/importerror-cannot-import-name-automodelwithlmhead-from-transformers][1]
This is the ... | https://stackoverflow.com/questions/64112358/transformer-cannot-import-name-automodelwithlmhead-from-transformers | python, nlp, huggingface-transformers | 1,601,349,426 |
se_62332815 | stackoverflow | ARTIFICIAL_INTELLIGENCE | How to remove duplicate sentences from paragraph using NLTK? | How to remove duplicate sentences from paragraph using NLTK?
I had a huge document with many repeated sentences such as (footer text, hyperlinks with alphanumeric chars), I need to get rid of those repeated hyperlinks or Footer text. I have tried with the below code but unfortunately couldn't succeed. Please review an... | https://stackoverflow.com/questions/62332815/how-to-remove-duplicate-sentences-from-paragraph-using-nltk | python-3.x, nlp, nltk | 1,591,906,568 |
se_51663068 | stackoverflow | ARTIFICIAL_INTELLIGENCE | Tensorflow.js tokenizer | Tensorflow.js tokenizer
I'm new to Machine Learning and Tensorflow, since I don't know python so I decide to use there javascript version (maybe more like a wrapper).
The problem is I tried to build a model that process the Natural Language. So the first step is tokenizer the text in order to feed the data to model.... | https://stackoverflow.com/questions/51663068/tensorflow-js-tokenizer | javascript, machine-learning, tensorflow.js, nlp | 1,533,249,612 |
se_43649359 | stackoverflow | ARTIFICIAL_INTELLIGENCE | Machine Learning Libraries For Android | Machine Learning Libraries For Android
I am trying build a small text mining tool for my android app. I am checking for a machine learning library that will allow me to cluster, classify etc.
Are there any machine learning libraries for android? I came across tensorflow but I need a bit more access to common ML funct... | https://stackoverflow.com/questions/43649359/machine-learning-libraries-for-android | android, machine-learning, nlp, artificial-intelligence, text-mining | 1,493,271,232 |
se_77006406 | stackoverflow | ARTIFICIAL_INTELLIGENCE | Flan-T5 params clarification | Flan-T5 params clarification
this is a general guidance question. I want a clear explanation of 2 parameters of Flan-T5 :
max_length
num_return_sequences
Also what is the input limit for flan-t5 ? | https://stackoverflow.com/questions/77006406/flan-t5-params-clarification | nlp, large-language-model | 1,693,385,575 |
se_78426720 | stackoverflow | ARTIFICIAL_INTELLIGENCE | When I try to perform testing in my knowledge base, the model does not load in amazon bedrock | When I try to perform testing in my knowledge base, the model does not load in amazon bedrock
When I try to perform testing using my knowledge base for RAG in amazon bedrock, when I have to select the model, it keeps loading forever
I tried activating the claude model by antrophic, because I know that is the only mode... | https://stackoverflow.com/questions/78426720/when-i-try-to-perform-testing-in-my-knowledge-base-the-model-does-not-load-in-a | amazon-web-services, nlp, large-language-model, amazon-bedrock | 1,714,766,252 |
se_78393709 | stackoverflow | ARTIFICIAL_INTELLIGENCE | Performance of textSimilarity() from R's text library | Performance of textSimilarity() from R's text library
I have a large data.frame with about 4 million rows and 2 columns.
The two columns contain long character strings, texts representing recipes.
For each row, I am comparing the similarity of the recipes in column A and column B, using textSimilarity() from the t... | https://stackoverflow.com/questions/78393709/performance-of-textsimilarity-from-rs-text-library | r, performance, nlp, huggingface-transformers | 1,714,187,758 |
se_78419227 | stackoverflow | ARTIFICIAL_INTELLIGENCE | AttributeError: 'Namespace' object has no attribute 'inference_server_address' in Python script | AttributeError: 'Namespace' object has no attribute 'inference_server_address' in Python script
Hello Stack Overflow community,
I am encountering an error while trying to run the 'lighteval' framework to evaluate "meta-llama/Llama-2-7b-chat-hf" on the "GSM8K" dataset.
I use accelarate as an entry point... | https://stackoverflow.com/questions/78419227/attributeerror-namespace-object-has-no-attribute-inference-server-address-i | python, nlp, accelerate | 1,714,653,635 |
se_78419191 | stackoverflow | ARTIFICIAL_INTELLIGENCE | (TraceBack (most recent call last)):Error When Trying to Download en_core_web_md from spacy in CommandPrompt | (TraceBack (most recent call last)):Error When Trying to Download en_core_web_md from spacy in CommandPrompt
I recently started a tutorial on nlp and we i reached word vectors, the spacy library was required specifically en_core_web_md the , in this part i keep getting this error (when i try to download en_core_web_md... | https://stackoverflow.com/questions/78419191/traceback-most-recent-call-lasterror-when-trying-to-download-en-core-web-md | python, nlp, command-prompt, spacy | 1,714,653,311 |
se_28033882 | stackoverflow | ARTIFICIAL_INTELLIGENCE | Determining whether a word is a noun or not | Determining whether a word is a noun or not
Given an input word, I want to determine whether it is a noun or not (in case of ambiguity, for instance cook can be a noun or a verb, the word must be identified as a noun).
Actually I use the POS tagger from the Stanford Parser (i give it a single word as input, and i ext... | https://stackoverflow.com/questions/28033882/determining-whether-a-word-is-a-noun-or-not | python, nlp, stanford-nlp | 1,421,703,419 |
se_78417490 | stackoverflow | ARTIFICIAL_INTELLIGENCE | Optimal Learning Rate and Batch Size for LLM Training | Optimal Learning Rate and Batch Size for LLM Training
What are the best practices for optimizing batch size and learning rate in training Large Language Models (LLMs)?
How should these hyperparameters be adjusted relative to each other for efficient convergence and improved performance?
Additionally, could you provide... | https://stackoverflow.com/questions/78417490/optimal-learning-rate-and-batch-size-for-llm-training | nlp, large-language-model, batchsize, learning-rate | 1,714,634,327 |
se_78399811 | stackoverflow | ARTIFICIAL_INTELLIGENCE | Error trying to unpack tuple output into two dataframe column | Error trying to unpack tuple output into two dataframe column
I have a function, tokenize:
def tokenize(text,max_len=MAX_LEN):
encoded = tokenizer.encode_plus(
text,
add_special_tokens=True,
max_length = max_len,
padding='max_length',
return_attention_ma... | https://stackoverflow.com/questions/78399811/error-trying-to-unpack-tuple-output-into-two-dataframe-column | pandas, dataframe, nlp | 1,714,343,336 |
se_77915556 | stackoverflow | ARTIFICIAL_INTELLIGENCE | Disable Vertex AI Gemini API safety attributes | Disable Vertex AI Gemini API safety attributes
I am currently developing an application using vertexai API where I am uploading research paper and use prompt engineering to get the major content of the paper.
While I am triggering basic prompt like describe the context of the paper, I receive error HARM_CATEGORY_UNSPE... | https://stackoverflow.com/questions/77915556/disable-vertex-ai-gemini-api-safety-attributes | python, nlp, google-cloud-vertex-ai, google-gemini, google-generativeai | 1,706,724,340 |
se_78213588 | stackoverflow | ARTIFICIAL_INTELLIGENCE | usage of vllm for extracting embeddings | usage of vllm for extracting embeddings
Following is a little piece of code to extract embeddings from a certain layer of LLM:
def process_row(prompt: str, model, tokenizer, layers_to_use: list, remove_period: bool):
"""
Processes a row of data and returns the embeddings.
"""
if remove_period:
... | https://stackoverflow.com/questions/78213588/usage-of-vllm-for-extracting-embeddings | python, nlp, huggingface-transformers, large-language-model | 1,711,261,806 |
se_78413374 | stackoverflow | ARTIFICIAL_INTELLIGENCE | I keep getting Wrong API key error 403 from pinecone | I keep getting Wrong API key error 403 from pinecone
it’s my first time using VDB and I wrote some basic scraping and embedding code for the test. I can’t understand what’s wrong with API, but I keep getting the same error. Here’s my code and the output. Additionally, if you could recommend VDB for newcomers it would... | https://stackoverflow.com/questions/78413374/i-keep-getting-wrong-api-key-error-403-from-pinecone | nlp, openai-api, vector-database, pinecone | 1,714,561,403 |
se_78084503 | stackoverflow | ARTIFICIAL_INTELLIGENCE | Matching strings containing 'and' in different languages and ampersands | Matching strings containing 'and' in different languages and ampersands
Suppose that in 2 different data frames df1, df2 I have 2 columns
df1['film'] = pd.Series(['Beavis & Butthead', 'Bonnie e Clyde', 'Adam & Eve'])
df2['film'] = pd.Series(['Beavis und Butthead', 'Bonnie & Clyde', 'Adam et Eve'])
of film ti... | https://stackoverflow.com/questions/78084503/matching-strings-containing-and-in-different-languages-and-ampersands | python, pandas, string, join, nlp | 1,709,243,902 |
se_72126722 | stackoverflow | ARTIFICIAL_INTELLIGENCE | Why is my word lemmatization not working as expected? | Why is my word lemmatization not working as expected?
Hi stackoverflow community!
Long-time reader but first-time poster. I'm currently trying my hand at NLP and after reading a few forum posts touching upon this topic, I can't seem to get the lemmatizer to work properly (function pasted below). Comparing my original ... | https://stackoverflow.com/questions/72126722/why-is-my-word-lemmatization-not-working-as-expected | python, nlp, lemmatization | 1,651,751,605 |
se_78404768 | stackoverflow | ARTIFICIAL_INTELLIGENCE | NefTune Receiving 0 Training Loss on Transformers | NefTune Receiving 0 Training Loss on Transformers
I'm basically trying to fine-tune my model with Neftune. Model is based on Turkish Language. But there I'm receiving zero training lose. I've tried to another model like Turkish-GPT2 there is no issue everything is okay. I think probably there is problem with model. I ... | https://stackoverflow.com/questions/78404768/neftune-receiving-0-training-loss-on-transformers | machine-learning, deep-learning, nlp, huggingface-transformers | 1,714,418,584 |
se_78397201 | stackoverflow | ARTIFICIAL_INTELLIGENCE | Extracting only technical keywords from a text using RAKE library in Python | Extracting only technical keywords from a text using RAKE library in Python
I want to use rake to extract technical keywords from a job description that I've found on Linkedin, which looks like this:
input = "In-depth understanding of the Python software development stacks, ecosystems, frameworks and tools such as Num... | https://stackoverflow.com/questions/78397201/extracting-only-technical-keywords-from-a-text-using-rake-library-in-python | python, python-3.x, nlp, nltk, rake | 1,714,283,530 |
se_61473330 | stackoverflow | ARTIFICIAL_INTELLIGENCE | CUDA error: CUBLAS_STATUS_ALLOC_FAILED when calling cublasCreate(handle) | CUDA error: CUBLAS_STATUS_ALLOC_FAILED when calling cublasCreate(handle)
I got the following error when I ran my PyTorch deep learning model in Google Colab
/usr/local/lib/python3.6/dist-packages/torch/nn/functional.py in linear(input, weight, bias)
1370 ret = torch.addmm(bias, input, weight.t())
1371 ... | https://stackoverflow.com/questions/61473330/cuda-error-cublas-status-alloc-failed-when-calling-cublascreatehandle | python, pytorch, nlp, cuda, bert-language-model | 1,588,052,382 |
se_78399335 | stackoverflow | ARTIFICIAL_INTELLIGENCE | fix error " With n_samples=0, test_size=0.1 and train_size=None, the resulting train set will be empty. Adjust any of the aforementioned parameters." | fix error " With n_samples=0, test_size=0.1 and train_size=None, the resulting train set will be empty. Adjust any of the aforementioned parameters."
I wrote a program in python and I want to implement NLP by BERT algorithm.I have a dataset and the below code but when I ran the program at colab I encounter b... | https://stackoverflow.com/questions/78399335/fix-error-with-n-samples-0-test-size-0-1-and-train-size-none-the-resulting-t | python, nlp, runtime-error, bert-language-model, transformer-model | 1,714,331,060 |
se_78394225 | stackoverflow | ARTIFICIAL_INTELLIGENCE | Langchain sql agent with context | Langchain sql agent with context
I am working on a langchain based SQL chat application and wanted my agent to understand context w.r.t the user session. For e.g.
User - What is highest order placed in last placed?
Bot - Order id : XYZ
User - When was this placed?
Here, bot should be able to deduce that 'this' refers ... | https://stackoverflow.com/questions/78394225/langchain-sql-agent-with-context | text, nlp, langchain | 1,714,204,199 |
se_78377343 | stackoverflow | ARTIFICIAL_INTELLIGENCE | converting json data to vector for better langchain chatbot results | converting json data to vector for better langchain chatbot results
im creating a chatbot for my university website as a project.
for the last 3 days i've been searching all over the internet how to use Langchain with json data such that my chatbot is fast. i came up with this:
from langchain_google_genai import ChatG... | https://stackoverflow.com/questions/78377343/converting-json-data-to-vector-for-better-langchain-chatbot-results | python, json, nlp, langchain, large-language-model | 1,713,950,979 |
se_78398574 | stackoverflow | ARTIFICIAL_INTELLIGENCE | How to specify the schema per table for query with llama_index | How to specify the schema per table for query with llama_index
When running below script I get this error:
It appears there was an error in the SQL query provided. The correct query should be:
SELECT e.employee_id, e.employee_name, w.worked_hours
FROM employees e
JOIN worked_hours w ON e.employee_id = w.employee_id;
... | https://stackoverflow.com/questions/78398574/how-to-specify-the-schema-per-table-for-query-with-llama-index | python, nlp, llama-index | 1,714,315,956 |
se_78354136 | stackoverflow | ARTIFICIAL_INTELLIGENCE | How to Send a Streaming Response via LlamaIndex to a FastAPI Endpoint? | How to Send a Streaming Response via LlamaIndex to a FastAPI Endpoint?
I need to send a streaming response using LlamaIndex to my FastAPI endpoint. Below is the code I've written so far:
@bot_router.post("/bot/pdf_convo")
async def pdf_convo(query: QuestionInput):
chat_engine = cache["chat_engine"]
user_questi... | https://stackoverflow.com/questions/78354136/how-to-send-a-streaming-response-via-llamaindex-to-a-fastapi-endpoint | python, nlp, openai-api, large-language-model, llama-index | 1,713,534,556 |
se_78394266 | stackoverflow | ARTIFICIAL_INTELLIGENCE | Issue with Phi-3 model in Jupyter Notebook | Issue with Phi-3 model in Jupyter Notebook
I am facing an issue while working with the Phi-3 model in Jupyter Notebook. I am getting an error related to the Phi3Config object not having the attribute _attn_implementation.
Here is the relevant code snippet:
# Load model directly
from transformers import AutoTokenizer, ... | https://stackoverflow.com/questions/78394266/issue-with-phi-3-model-in-jupyter-notebook | python, jupyter-notebook, nlp, huggingface-transformers | 1,714,205,101 |
se_78393551 | stackoverflow | ARTIFICIAL_INTELLIGENCE | How does one use vllm with pytorch 2.2.2 and python 3.11? | How does one use vllm with pytorch 2.2.2 and python 3.11?
Title: How does one use vllm with pytorch 2.2.2 and python 3.11?
I'm trying to use the vllm library with pytorch 2.2.2 and python 3.11. Based on the GitHub issues, it seems vllm 0.4.1 supports python 3.11.
However, I'm running into issues with incompatible pyto... | https://stackoverflow.com/questions/78393551/how-does-one-use-vllm-with-pytorch-2-2-2-and-python-3-11 | python, pytorch, nlp, huggingface-transformers, vllm | 1,714,181,659 |
se_78382220 | stackoverflow | ARTIFICIAL_INTELLIGENCE | DFS search sibling node in specific condition else search children node | DFS search sibling node in specific condition else search children node
I have to do a DFS to search a tree, the DFS will first generate a result by the value of the node. The function check_for_three_kind_of_response is a function that checks if a question is related to a sentence. The result would be three responses... | https://stackoverflow.com/questions/78382220/dfs-search-sibling-node-in-specific-condition-else-search-children-node | python-3.x, if-statement, nlp, tree, depth-first-search | 1,714,018,872 |
se_75320868 | stackoverflow | ARTIFICIAL_INTELLIGENCE | AttributeError: module 'click.utils' has no attribute '_expand_args', when i'm tring to install en_core_web_sm | AttributeError: module 'click.utils' has no attribute '_expand_args', when i'm tring to install en_core_web_sm
I am trying to install "en_core_web_sm",
the commands i ran is:
pip install spacy ( which ran perfectly and got installed)
python -m spacy download en_core_web_sm ( here i'm getting error... | https://stackoverflow.com/questions/75320868/attributeerror-module-click-utils-has-no-attribute-expand-args-when-im-t | python-3.x, nlp, spacy, spacy-3 | 1,675,329,058 |
se_78271686 | stackoverflow | ARTIFICIAL_INTELLIGENCE | "Text Input in Streamlit Removes Entered Text Upon Hitting Enter Key: How to Fix?" | "Text Input in Streamlit Removes Entered Text Upon Hitting Enter Key: How to Fix?"
the input stored in user_question i need when press enter the txt in textbox getting clear and the output displing what can i did i tried js and streamlit function but when enter input and press send btn or press enter no outp... | https://stackoverflow.com/questions/78271686/text-input-in-streamlit-removes-entered-text-upon-hitting-enter-key-how-to-fix | python, nlp, artificial-intelligence, streamlit, large-language-model | 1,712,205,118 |
se_75357936 | stackoverflow | ARTIFICIAL_INTELLIGENCE | How to install Detectron2 | How to install Detectron2
I am installing layout-parser and following this link. Did not face any issues with the following packages.
pip install layoutparser
pip install "layoutparser[effdet]"
pip install layoutparser torchvision
pip install "layoutparser[paddledetection]"
pip install "layoutparser... | https://stackoverflow.com/questions/75357936/how-to-install-detectron2 | python, nlp, data-science, ocr, python-3.10 | 1,675,664,351 |
se_78388910 | stackoverflow | ARTIFICIAL_INTELLIGENCE | Is there any way to standardize different text that represents the same thing? | Is there any way to standardize different text that represents the same thing?
I am collecting product data from different supermarket's website. But I found that each store uses different name to represent the product.
For example:
Product name
Store
Link
360° Toothbrush With Tongue And Cheek Cleaner
NoFrills
... | https://stackoverflow.com/questions/78388910/is-there-any-way-to-standardize-different-text-that-represents-the-same-thing | python, machine-learning, nlp, word-embedding | 1,714,116,979 |
se_78383619 | stackoverflow | ARTIFICIAL_INTELLIGENCE | How to Generate Text with Specific Length Using AI API | How to Generate Text with Specific Length Using AI API
I am attempting to generate text outputs that are exactly a certain number of characters or words long using AI API (OpenAI GPT, Claude, Gemini...), but I'm facing difficulties. Here's what I've tried so far:
Setting Max Tokens: I've used the max_tokens parameter ... | https://stackoverflow.com/questions/78383619/how-to-generate-text-with-specific-length-using-ai-api | python, nlp, openai-api, text-generation | 1,714,037,456 |
se_78383583 | stackoverflow | ARTIFICIAL_INTELLIGENCE | Training a LLM to execute functions | Training a LLM to execute functions
I want develop a chatbot that is able to perform actions and answer questions in a given Smart Home environment.
I am curious how to do this with an LLM. How can I customize/train a model to execute code?
Just a simple example: When I tell the chatbot "turn on the light in the livin... | https://stackoverflow.com/questions/78383583/training-a-llm-to-execute-functions | python, machine-learning, nlp, chatbot, large-language-model | 1,714,036,987 |
se_78374847 | stackoverflow | ARTIFICIAL_INTELLIGENCE | Python Libraries for Sentence Classification Based on Keyword | Python Libraries for Sentence Classification Based on Keyword
I want to separate a list of sentences into two lists based on whether they match the sentiment of a specific keyword. For example:
valid_keyword = "Guest Accepted"
sentences = [
"Guest Allowed", "Max Guest Allowed 1", "Guest Not Allowed",
"No Gue... | https://stackoverflow.com/questions/78374847/python-libraries-for-sentence-classification-based-on-keyword | python, nlp, sentiment-analysis | 1,713,904,232 |
se_48925328 | stackoverflow | ARTIFICIAL_INTELLIGENCE | How to get all noun phrases in Spacy | How to get all noun phrases in Spacy
I am new to Spacy and I would like to extract "all" the noun phrases from a sentence. I'm wondering how I can do it. I have the following code:
import spacy
nlp = spacy.load("en")
file = open("E:/test.txt", "r")
doc = nlp(file.read())
for np in doc.noun_chunks:
print(np.text... | https://stackoverflow.com/questions/48925328/how-to-get-all-noun-phrases-in-spacy | python, python-3.x, nlp, spacy | 1,519,296,064 |
se_73279102 | stackoverflow | ARTIFICIAL_INTELLIGENCE | Custom Name Entity Regognition | Custom Name Entity Regognition
I have the following sentence:
text="The weather is extremely severe in England"
I want to perform a custom Name Entity Recognition (NER) procedure
First a normal NER procedure will output England with a GPE label
pip install spacy
!python -m spacy download en_core_web_lg
import spacy... | https://stackoverflow.com/questions/73279102/custom-name-entity-regognition | python, python-3.x, nlp, spacy, named-entity-recognition | 1,659,967,187 |
se_78375631 | stackoverflow | ARTIFICIAL_INTELLIGENCE | ValueError: Cannot use a compiled regex as replacement pattern with regex=False | ValueError: Cannot use a compiled regex as replacement pattern with regex=False
I'm doing a project, on Google Colab, where I use the following version:
!pip install "gensim==4.2.0" !pip install "texthero==1.0.5"
Until recently, I received the following warning:
FutureWarning: The default value of regex will change fr... | https://stackoverflow.com/questions/78375631/valueerror-cannot-use-a-compiled-regex-as-replacement-pattern-with-regex-false | python, text, nlp | 1,713,923,527 |
se_78373462 | stackoverflow | ARTIFICIAL_INTELLIGENCE | tokenize multilple files python | tokenize multilple files python
I am currently trying to attempting to tokenize large text, however I have a lot of files in the directory that I want to tokenize as this is very time consuming to do 1 by 1.
from transformers import AutoTokenizer, AutoModelForSequenceClassification, pipeline
import torch
tokenizer =... | https://stackoverflow.com/questions/78373462/tokenize-multilple-files-python | python, nlp, token, huggingface-transformers, huggingface-tokenizers | 1,713,885,578 |
se_78329328 | stackoverflow | ARTIFICIAL_INTELLIGENCE | converting safe.tensor to pytorch bin files | converting safe.tensor to pytorch bin files
I fine-tuned my transformer model with HuggingFace. It has provided me a model.safetensor file for later use.
I want to plug-in the model to a old framework which takes pytorch.bin files only. I wonder how can I downgrade my model to fit the framework.
I am not sure what is ... | https://stackoverflow.com/questions/78329328/converting-safe-tensor-to-pytorch-bin-files | pytorch, nlp, huggingface-transformers, tensor | 1,713,193,450 |
se_78368945 | stackoverflow | ARTIFICIAL_INTELLIGENCE | BERT models are working slow on production | BERT models are working slow on production
I have trained three BERT models using huggingface transformers. Let's call these models S, T and I models.
The model.py file is as below. init_model() function is for initializing the models. I will be calling that function in main.py
import torch
from transformers import Au... | https://stackoverflow.com/questions/78368945/bert-models-are-working-slow-on-production | python, flask, pytorch, nlp, huggingface-transformers | 1,713,821,320 |
se_78365846 | stackoverflow | ARTIFICIAL_INTELLIGENCE | Text conversion processing and extracting information | Text conversion processing and extracting information
I have a call center software which consist of industry specific calls, in which all calls are recorded and then all calls transform into text. After transforming into text, every calls is passed to other agent who is human, who extract all information from text. I... | https://stackoverflow.com/questions/78365846/text-conversion-processing-and-extracting-information | python, nlp, bots, artificial-intelligence | 1,713,784,630 |
se_78359652 | stackoverflow | ARTIFICIAL_INTELLIGENCE | Preprocessing a large dataset with tf.layers.TextVectorization gives Memory Errors | Preprocessing a large dataset with tf.layers.TextVectorization gives Memory Errors
I have around 300k files, which is around 9GB of medical literature.
My goal is to establish the frequency of ALL tokens in the dataset and serialize them to a csv file (token, frequency).
To achieve this, I used layers.TextVectorizatio... | https://stackoverflow.com/questions/78359652/preprocessing-a-large-dataset-with-tf-layers-textvectorization-gives-memory-erro | python, tensorflow, keras, nlp, vectorization | 1,713,645,691 |
se_78344850 | stackoverflow | ARTIFICIAL_INTELLIGENCE | How to tag words that not include one specific symbol in Spacy? | How to tag words that not include one specific symbol in Spacy?
I'm trying to tag one word in Spacy using regex, but I want to add one condition: it can't contain symbol '/' in any place inside. My code looks like this:
[{'lower': {"regex": "^.*(word).*?"}}]
I tried using ^ to exclude this but It didn't work.
So exam... | https://stackoverflow.com/questions/78344850/how-to-tag-words-that-not-include-one-specific-symbol-in-spacy | python, nlp, pattern-matching, spacy | 1,713,414,070 |
se_78335317 | stackoverflow | ARTIFICIAL_INTELLIGENCE | Unable to read docx file using python-docx | Unable to read docx file using python-docx
I have this code:
import os
import traceback
import pdfplumber
from docx import Document
def read_docx(file_path):
try:
doc = Document(file_path)
content = [paragraph.text for paragraph in doc.paragraphs]
return '\n'.join(content)
except Exce... | https://stackoverflow.com/questions/78335317/unable-to-read-docx-file-using-python-docx | python, file, ms-word, nlp, python-docx | 1,713,277,742 |
se_78347415 | stackoverflow | ARTIFICIAL_INTELLIGENCE | How to remove negation from japanese sentence and extract keywords (tfidf search )? | How to remove negation from japanese sentence and extract keywords (tfidf search )?
I want to remove negation from user query and extarct keywords from it for a search engine, for example .
`NISAを除いてリストを見せ
English translation : Show me the list excluding NISA
For this I don't want nisa as a keyword as user is excludin... | https://stackoverflow.com/questions/78347415/how-to-remove-negation-from-japanese-sentence-and-extract-keywords-tfidf-search | node.js, nlp, search-engine, tf-idf, large-language-model | 1,713,443,093 |
se_67997713 | stackoverflow | ARTIFICIAL_INTELLIGENCE | ModuleNotFoundError: No java install detected. Please install java to use language-tool-python | ModuleNotFoundError: No java install detected. Please install java to use language-tool-python
I would like to check the number if issues in a given sentence.
my code is
import language_tool_python
tl = language_tool_python.LanguageTool('en-US')
txt = "good mooorning sirr and medam my namee anderen i am from amerecia... | https://stackoverflow.com/questions/67997713/modulenotfounderror-no-java-install-detected-please-install-java-to-use-langua | python, nlp, grammar | 1,623,826,229 |
se_78344999 | stackoverflow | ARTIFICIAL_INTELLIGENCE | Stanford NLP Annotation pipeline.annotate resulting into OutOfMemoryError in Java | Stanford NLP Annotation pipeline.annotate resulting into OutOfMemoryError in Java
So we are using Stanford NLP to annotate input text, and these input texts are laughably small. Below is one example of the same.
"Can you give me details about Mohammad Siva John with identifiers
6745-3876-1354-8790 and 313-31-333"
Be... | https://stackoverflow.com/questions/78344999/stanford-nlp-annotation-pipeline-annotate-resulting-into-outofmemoryerror-in-jav | java, nlp, out-of-memory | 1,713,417,210 |
se_67328345 | stackoverflow | ARTIFICIAL_INTELLIGENCE | How to use forward() method instead of model.generate() for T5 model | How to use forward() method instead of model.generate() for T5 model
For my use case, I need to use the model.forward() instead of the model.generate() method
i.e instead of the below code
outs = model.model.generate(input_ids=batch['source_ids'],
attention_mask=batch['source_mask'],
... | https://stackoverflow.com/questions/67328345/how-to-use-forward-method-instead-of-model-generate-for-t5-model | nlp, huggingface-transformers | 1,619,758,184 |
se_78334159 | stackoverflow | ARTIFICIAL_INTELLIGENCE | BERT MLM model fine-tuning bad results on new dataset | BERT MLM model fine-tuning bad results on new dataset
I'm trying to fine tune a MLM model on new kind of small data (train.csv 43285 lines, validation.csv 3597), my data looks like this:
text
בראשית ברא אלהים את השמים ואת הארץ
והארץ היתה תהו ובהו וחשך על פני תהום ורוח אלהים מרחפת על פני המים
ויאמר אלהים יהי אור ויהי א... | https://stackoverflow.com/questions/78334159/bert-mlm-model-fine-tuning-bad-results-on-new-dataset | nlp, huggingface-transformers, bert-language-model, huggingface-tokenizers | 1,713,266,426 |
se_76877410 | stackoverflow | ARTIFICIAL_INTELLIGENCE | How to use spaCy Matcher to create a pattern for rule-based matching for a sequence that is only interpreted as a single token | How to use spaCy Matcher to create a pattern for rule-based matching for a sequence that is only interpreted as a single token
I am new to nlp and spaCy but I am using it for my project. I am trying to use spaCy's Matcher class to create a pattern to extract information from clinical summaries, specifically mentions o... | https://stackoverflow.com/questions/76877410/how-to-use-spacy-matcher-to-create-a-pattern-for-rule-based-matching-for-a-seque | regex, nlp, pattern-matching, spacy, tokenize | 1,691,682,848 |
se_78330385 | stackoverflow | ARTIFICIAL_INTELLIGENCE | Error when uploading files using Streamlit and Langchain | Error when uploading files using Streamlit and Langchain
I'mtrying to build a Chatbot with langchain and when I'm trying to use streamlit to interact with it, I have an error as follows:
File "/mount/src/cenace-llm/streamlit_app.py", line 33, in load_pdf
pdf_loader = PyPDFLoader(file)
^^^^^^^^^^^^... | https://stackoverflow.com/questions/78330385/error-when-uploading-files-using-streamlit-and-langchain | python, nlp, streamlit, langchain | 1,713,205,717 |
se_78317989 | stackoverflow | ARTIFICIAL_INTELLIGENCE | Is it possible to fine-tune a pretrained word embedding model like vec2word? | Is it possible to fine-tune a pretrained word embedding model like vec2word?
I'm working on semantic matching in my search engine system. I saw that word embedding can be used for this task. However, my dataset is very limited and small, so I don't think that training a word embedding model such as word2vec from scrat... | https://stackoverflow.com/questions/78317989/is-it-possible-to-fine-tune-a-pretrained-word-embedding-model-like-vec2word | python, nlp, artificial-intelligence, word2vec, word-embedding | 1,712,944,676 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.