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_76755300 | stackoverflow | ARTIFICIAL_INTELLIGENCE | NLembedding for iOS returning nil | NLembedding for iOS returning nil
I'm currently implementing on-device vector search using Apple's Natural Language Library. However, I'm facing an issue where the iOS SentenceEmbedding function is returning nil. It was working fine on macOS and iOS until recently.
I've attached the terminal output and the code line w... | https://stackoverflow.com/questions/76755300/nlembedding-for-ios-returning-nil | ios, swift, machine-learning, nlp | 1,690,207,753 |
se_78407025 | stackoverflow | ARTIFICIAL_INTELLIGENCE | Trying to cluster short survey answers (1 to 10 words). Am I on the right track? | Trying to cluster short survey answers (1 to 10 words). Am I on the right track?
Here's the explanation of what I want to fully make (it's a project for school):
A user just puts in a file with just the answers to whatever question was asked in the survey
The machine finds similar answers and groups them under one l... | https://stackoverflow.com/questions/78407025/trying-to-cluster-short-survey-answers-1-to-10-words-am-i-on-the-right-track | machine-learning, text, nlp, cluster-analysis | 1,714,463,457 |
se_79859374 | stackoverflow | ARTIFICIAL_INTELLIGENCE | Text embedding generation with LLMs for a specific usecase | Text embedding generation with LLMs for a specific usecase
I'm dealing with titles for media files, and the task is to separate duplicates. To do this, the plan is to generate embeddings for those titles.
I've tried several models for this, and most of them work in a similar way. You give them a sentence, and they gen... | https://stackoverflow.com/questions/79859374/text-embedding-generation-with-llms-for-a-specific-usecase | machine-learning, nlp | 1,767,379,664 |
se_79449168 | stackoverflow | ARTIFICIAL_INTELLIGENCE | MiniBatchKMeans BERTopic not returning topics for half of data | MiniBatchKMeans BERTopic not returning topics for half of data
I am trying to topic a dataset of tweets. I have around 50 million tweets. Unfortunately, such a large dataset will not fit in ram (even 128GB) due to the embeddings. Therefore, I have been working on making an incremental BERTopic as per the docs
As such:... | https://stackoverflow.com/questions/79449168/minibatchkmeans-bertopic-not-returning-topics-for-half-of-data | python, machine-learning, nlp, data-science, topic-modeling | 1,739,900,579 |
se_79464254 | stackoverflow | ARTIFICIAL_INTELLIGENCE | Understanding the Difference Between Entropy and Cross-Entropy in Language Models: Practical Example with Character-Level Unigram Model | Understanding the Difference Between Entropy and Cross-Entropy in Language Models: Practical Example with Character-Level Unigram Model
I'm trying to understand the difference between entropy and cross-entropy, as I often hear about the entropy of a language and the cross-entropy of a language model, and I want to und... | https://stackoverflow.com/questions/79464254/understanding-the-difference-between-entropy-and-cross-entropy-in-language-model | nlp | 1,740,414,911 |
se_79858333 | stackoverflow | ARTIFICIAL_INTELLIGENCE | R Code to recognize speaker turns in verbatim records with inconsistent formatting | R Code to recognize speaker turns in verbatim records with inconsistent formatting
I am trying to perform text analysis on large character strings that include multiple different speakers. I need to create a dataframe of 2 columns, speaker and turn, which have the person speaking and the text spoken. I have very long ... | https://stackoverflow.com/questions/79858333/r-code-to-recognize-speaker-turns-in-verbatim-records-with-inconsistent-formatti | r, string, text, nlp | 1,767,206,195 |
se_65460699 | stackoverflow | ARTIFICIAL_INTELLIGENCE | Where does the downloaded models in JupyterNotebook locat at? | Where does the downloaded models in JupyterNotebook locat at?
When I run this command, I can see that I download the model. So, where are these kind of downloaded model/data/tokenizers stored in my machine ?
Thanks ! | https://stackoverflow.com/questions/65460699/where-does-the-downloaded-models-in-jupyternotebook-locat-at | python, pip, nlp, jupyter-notebook, pytorch | 1,609,016,661 |
se_79850156 | stackoverflow | ARTIFICIAL_INTELLIGENCE | Making a interactive wordcloud in Dash + 2 different wordclouds for different clicks | Making a interactive wordcloud in Dash + 2 different wordclouds for different clicks
I'm trying to make an interactive wordcloud in Dash. Is it even possible?
Also, I'm trying to make two different wordclouds, with each click being a different wordcloud:
1 click -> shows one persistent wordcloud
2 click -> shows a d... | https://stackoverflow.com/questions/79850156/making-a-interactive-wordcloud-in-dash-2-different-wordclouds-for-different-cl | python, nlp, plotly, plotly-dash | 1,766,049,844 |
se_79853389 | stackoverflow | ARTIFICIAL_INTELLIGENCE | Cannot response as stream token-by-token when an agent is a part of a workflow in Langgraph | Cannot response as stream token-by-token when an agent is a part of a workflow in Langgraph
I am designing a complex workflow in Langgraph where there will be multiple agents. Some of the agents will be intermediary and some other will be user-facing (that is I will show the output of those agents to the user, i.e., t... | https://stackoverflow.com/questions/79853389/cannot-response-as-stream-token-by-token-when-an-agent-is-a-part-of-a-workflow-i | python, nlp, langchain, langgraph, langchain-agents | 1,766,467,982 |
se_79854504 | stackoverflow | ARTIFICIAL_INTELLIGENCE | Split in Half Long PDF Texts with Poor OCR-ing to Generate Speaker Turns in the Correct Order (R) | Split in Half Long PDF Texts with Poor OCR-ing to Generate Speaker Turns in the Correct Order (R)
I am trying to process text for quantitative text analysis. I need to read in pdfs of transcripts from WHO plenary meetings and process the text into a speaker turn dataframe, identifying the speaker and everything that t... | https://stackoverflow.com/questions/79854504/split-in-half-long-pdf-texts-with-poor-ocr-ing-to-generate-speaker-turns-in-the | r, pdf, text, nlp, ocr | 1,766,594,832 |
se_79849488 | stackoverflow | ARTIFICIAL_INTELLIGENCE | ImportError: cannot import name 'MistralCommonBackend' from 'transformers' | ImportError: cannot import name 'MistralCommonBackend' from 'transformers'
Given:
$ pip install transformers mistral-common -Uq
$ pip show transformers mistral-common torch # to verify
Name: transformers
Version: 4.57.3
Summary: State-of-the-art Machine Learning for JAX, PyTorch and TensorFlow
Home-pag... | https://stackoverflow.com/questions/79849488/importerror-cannot-import-name-mistralcommonbackend-from-transformers | python-3.x, nlp, huggingface-transformers, huggingface, mistral-ai | 1,765,976,949 |
se_79840954 | stackoverflow | ARTIFICIAL_INTELLIGENCE | Recommended way to create abstracted text embeddings from large text data? | Recommended way to create abstracted text embeddings from large text data?
I would like to use a LLM Encoder model to create vector embeddings for certain texts in my dataset. The texts are written as technical problem descriptions by experts who are trying to repair a hardware. The embeddings should then be used as a... | https://stackoverflow.com/questions/79840954/recommended-way-to-create-abstracted-text-embeddings-from-large-text-data | nlp, huggingface-transformers, large-language-model, summarization | 1,765,197,168 |
se_58419436 | stackoverflow | ARTIFICIAL_INTELLIGENCE | Extracting attention weights of each token at each layer of transformer in python | Extracting attention weights of each token at each layer of transformer in python
I am doing some NLP and I am interested in extracting attention weights of individual test token at each layer of transformer via Python (PyTorch, TensorFlow, etc.)
Is coding up a Transformer (any transformers like Transformer-XL, OpenA... | https://stackoverflow.com/questions/58419436/extracting-attention-weights-of-each-token-at-each-layer-of-transformer-in-pytho | tensorflow, keras, deep-learning, nlp, pytorch | 1,571,249,871 |
se_79841847 | stackoverflow | ARTIFICIAL_INTELLIGENCE | Huggingface caching stops during download without any error | Huggingface caching stops during download without any error
I am trying to run an example from z-image-turbo
(https://huggingface.co/Tongyi-MAI/Z-Image-Turbo)
import os
os.environ["HF_HOME"] = "E:/MyCustomHFCache"
os.environ["TRANSFORMERS_CACHE"] = "E:/MyTransformersCache"
import torch
from diffusers import ZImagePip... | https://stackoverflow.com/questions/79841847/huggingface-caching-stops-during-download-without-any-error | nlp, huggingface-transformers | 1,765,278,530 |
se_58876630 | stackoverflow | ARTIFICIAL_INTELLIGENCE | How to export a fasttext model created by gensim, to a binary file? | How to export a fasttext model created by gensim, to a binary file?
I'm trying to export the fasttext model created by gensim to a binary file. But the docs are unclear about how to achieve this.
What I've done so far:
model.wv.save_word2vec_format('model.bin')
But this does not seems like the best solution. Sinc... | https://stackoverflow.com/questions/58876630/how-to-export-a-fasttext-model-created-by-gensim-to-a-binary-file | python, nlp, gensim, fasttext | 1,573,819,271 |
se_79527785 | stackoverflow | ARTIFICIAL_INTELLIGENCE | SFTTrainer Error : prepare_model_for_kbit_training() got an unexpected keyword argument 'gradient_checkpointing_kwargs' | SFTTrainer Error : prepare_model_for_kbit_training() got an unexpected keyword argument 'gradient_checkpointing_kwargs'
I'm trying to fine-tune a model using SFTTrainer from trl.
This is how my SFTConfig arguments look like,
from trl import SFTConfig
training_arguments = SFTConfig(
output_dir=output_dir... | https://stackoverflow.com/questions/79527785/sfttrainer-error-prepare-model-for-kbit-training-got-an-unexpected-keyword-a | python, nlp, large-language-model, transformer-model | 1,742,662,727 |
se_62217163 | stackoverflow | ARTIFICIAL_INTELLIGENCE | What is the best Python library to get morphemes (including the stem) from a word? | What is the best Python library to get morphemes (including the stem) from a word?
I'm currently using the Polyglot library, however I would to be able to break down words like writing into write and ing. Polyglot is able to break down words like reading successfully into read and ing, but it fails when the stem is wo... | https://stackoverflow.com/questions/62217163/what-is-the-best-python-library-to-get-morphemes-including-the-stem-from-a-wor | python, python-3.x, python-2.7, nlp, polyglot | 1,591,365,834 |
se_79375332 | stackoverflow | ARTIFICIAL_INTELLIGENCE | How does `llm.bind_tools` work in langchain? | How does `llm.bind_tools` work in langchain?
I need to understand how exactly does langchain convert information from code to LLM prompt, because end of the day, the LLM will need only text to be passed to it.
If I am incorrect somewhere in my understanding, kindly point it out as well when answering the question
This... | https://stackoverflow.com/questions/79375332/how-does-llm-bind-tools-work-in-langchain | nlp, openai-api, langchain, large-language-model, py-langchain | 1,737,479,739 |
se_63157909 | stackoverflow | ARTIFICIAL_INTELLIGENCE | How to determine if two sentences talk about similar topics? | How to determine if two sentences talk about similar topics?
I would like to ask you a question. Is there any algorithm/tool which can allow me to do some association between words?
For example: I have the following group of sentences:
(1)
"My phone is on the table"
"I cannot find the charger". # no reference ... | https://stackoverflow.com/questions/63157909/how-to-determine-if-two-sentences-talk-about-similar-topics | python, algorithm, nlp, sentence-similarity | 1,596,039,109 |
se_2444953 | stackoverflow | ARTIFICIAL_INTELLIGENCE | How to use ngram to do word similarity? | How to use ngram to do word similarity?
I hear that google uses up to 7-grams for their semantic-similarity comparison. I am interested in finding words that are similar in context (i.e. cat and dog) and I was wondering how do I compute the similarity of two words on a n-gram model given that n > 2.
So basically given... | https://stackoverflow.com/questions/2444953/how-to-use-ngram-to-do-word-similarity | machine-learning, nlp, artificial-intelligence, n-gram | 1,268,624,348 |
se_62272056 | stackoverflow | ARTIFICIAL_INTELLIGENCE | What are the differences between contextual embedding and word embedding | What are the differences between contextual embedding and word embedding
I am trying to understand the concept of embedding for the deep learning models.
I understand how employing word2vec can address the limitations of using the one-hot vectors.
However, recently I see a plethora of blog posts stating ELMo, BERT, ... | https://stackoverflow.com/questions/62272056/what-are-the-differences-between-contextual-embedding-and-word-embedding | machine-learning, deep-learning, nlp, artificial-intelligence, word-embedding | 1,591,654,630 |
se_76639815 | stackoverflow | ARTIFICIAL_INTELLIGENCE | Can't get the text separated by words when I'm doing data cleaning in NLP | Can't get the text separated by words when I'm doing data cleaning in NLP
I'm trying to do an exercise of NLP in Kaggle and when I'm doing the data cleaning of the text that I have to use to predict the output I can't get it to be separated by words, instead I get one sentence with all the words attached.
This... | https://stackoverflow.com/questions/76639815/cant-get-the-text-separated-by-words-when-im-doing-data-cleaning-in-nlp | regex, nlp, data-cleaning, nltokenizer | 1,688,758,889 |
se_79818037 | stackoverflow | ARTIFICIAL_INTELLIGENCE | Organisation/Person tagging using Spacy | Organisation/Person tagging using Spacy
We’re working on a problem where our master dataset contains names of organizations and individuals, but some entries are untagged. We only have the names (no additional details such as email or address) and need to classify each as Organization or Person.
My current approach is... | https://stackoverflow.com/questions/79818037/organisation-person-tagging-using-spacy | python, nlp, spacy, named-entity-recognition | 1,762,967,002 |
se_37467779 | stackoverflow | ARTIFICIAL_INTELLIGENCE | Trie with association between words | Trie with association between words
I have a usecase where i want to correct words.
I have set of correct and incorrect words[spelling mistake].
I populate the trie with all words.
i have both the correct and incorrect version of every word.
Now in case if i get word as "a" for correction ,
-- i search it in trie.i... | https://stackoverflow.com/questions/37467779/trie-with-association-between-words | algorithm, nlp, trie | 1,464,284,796 |
se_77903080 | stackoverflow | ARTIFICIAL_INTELLIGENCE | Finding embedding dimentions of the HuggingFace model | Finding embedding dimentions of the HuggingFace model
I try to figure out how to use faiss Vectore Store with LlamaIndex.
Instruction says, that I must indicate vector dimensions in advance. Here is the code:
import faiss
# dimensions of text-ada-embedding-002
d = 1536
faiss_index = faiss.IndexFlatL2(... | https://stackoverflow.com/questions/77903080/finding-embedding-dimentions-of-the-huggingface-model | nlp, huggingface-transformers, llama-index, faiss | 1,706,569,086 |
se_79804104 | stackoverflow | ARTIFICIAL_INTELLIGENCE | Memory usage keeps increasing when extracting embeddings via sentence-transformers | Memory usage keeps increasing when extracting embeddings via sentence-transformers
I have a set of about 100M paragraph-sized strings (multilingual) I am extracting embeddings for, but the memory usage keeps increasing until I start overflowing into disk swap:
model = SentenceTransformer("Qwen/Qwen3-Embedding-0.6B",
... | https://stackoverflow.com/questions/79804104/memory-usage-keeps-increasing-when-extracting-embeddings-via-sentence-transforme | python, macos, nlp, apple-silicon, sentence-transformers | 1,761,761,392 |
se_79740215 | stackoverflow | ARTIFICIAL_INTELLIGENCE | how to efficiently use spacy for pos tagging and ner | how to efficiently use spacy for pos tagging and ner
I am having 200 documents and I want to do NER and pos_tagging. However I find spacy to be too slow(I am running this code in google colab):
for doc in nlp.pipe(dataset["text"], batch_size=20):
pass
I have removed the loop code and replaced with pass still it... | https://stackoverflow.com/questions/79740215/how-to-efficiently-use-spacy-for-pos-tagging-and-ner | nlp, spacy | 1,755,623,425 |
se_77778146 | stackoverflow | ARTIFICIAL_INTELLIGENCE | How can I leverage LLMs to refine and clean text without additional comments? | How can I leverage LLMs to refine and clean text without additional comments?
I am trying to get ChatGPT 3.5 to refine a dataset I have extracted from PDF files. The dataset will act as a knowledge base for an RAG system.
The initial tests show great improvement, except for the bot returning the answer with a comment ... | https://stackoverflow.com/questions/77778146/how-can-i-leverage-llms-to-refine-and-clean-text-without-additional-comments | nlp, data-cleaning, large-language-model, retrieval-augmented-generation | 1,704,704,379 |
se_78781003 | stackoverflow | ARTIFICIAL_INTELLIGENCE | Score Profiles Azure AI search not working | Score Profiles Azure AI search not working
I have configured on my Index a default score profile to use on all of my searches, I have an test index that has a field named 'source' if the filed is == to 'reviewed' I want those docs to be moved up in the scoring over other docs, since they are peer-reviewed (I work for ... | https://stackoverflow.com/questions/78781003/score-profiles-azure-ai-search-not-working | azure, nlp, azure-ai-search, rag | 1,721,688,343 |
se_79718582 | stackoverflow | ARTIFICIAL_INTELLIGENCE | In pandas, how to write the word "nan" as string with to_excel? | In pandas, how to write the word "nan" as string with to_excel?
I have the reverse problem as described in Prevent pandas from interpreting 'NA' as NaN in a string.
I work with older English text data and want to write the word "nan" (i.e. Modern English 'non(e)') into an Excel file.
I want Excel to show thi... | https://stackoverflow.com/questions/79718582/in-pandas-how-to-write-the-word-nan-as-string-with-to-excel | python, pandas, string, nlp, nan | 1,753,790,921 |
se_17386394 | stackoverflow | ARTIFICIAL_INTELLIGENCE | Determining geo location by arbitrary body of text | Determining geo location by arbitrary body of text
I am working on a project that I am not exactly sure how to approach. The problem can be summarized as following:
Given an arbitrary body of text(kind of like a report), determine what geographic location that each part of the report is referring to.
Geographic lo... | https://stackoverflow.com/questions/17386394/determining-geo-location-by-arbitrary-body-of-text | machine-learning, nlp | 1,372,557,152 |
se_79795624 | stackoverflow | ARTIFICIAL_INTELLIGENCE | Torch example transformer with TransformerDecoder | Torch example transformer with TransformerDecoder
In the torch example provided here https://github.com/pytorch/examples/tree/main/word_language_model, tansformer only uses torch.TransformerEncoder and torch.TransformerDecoder is overwritten with a simple Linear layer. I wanted to implement torch's Decoder in my code ... | https://stackoverflow.com/questions/79795624/torch-example-transformer-with-transformerdecoder | pytorch, nlp, large-language-model, transformer-model | 1,761,036,534 |
se_79795253 | stackoverflow | ARTIFICIAL_INTELLIGENCE | T5-small generates only padding tokens during validation/test in PyTorch Lightning | T5-small generates only padding tokens during validation/test in PyTorch Lightning
I'm fine-tuning T5-small using PyTorch Lightning and encountering a strange issue during validation and test steps.
The Problem:
During validation_step and test_step, model.generate() consistently produces batches of only padding tokens... | https://stackoverflow.com/questions/79795253/t5-small-generates-only-padding-tokens-during-validation-test-in-pytorch-lightni | pytorch, nlp, huggingface-transformers, pytorch-lightning, seq2seq | 1,760,991,078 |
se_79791269 | stackoverflow | ARTIFICIAL_INTELLIGENCE | Utilizing GPU with RNN models which takes it's output as input [torch] | Utilizing GPU with RNN models which takes it's output as input [torch]
I have a machine-translation model. In this model, I calculate a vector for a given sentence and I take this vector, aggregate with each generated output of RNN and put it into RNN again for calculating next hidden state and generating next out... | https://stackoverflow.com/questions/79791269/utilizing-gpu-with-rnn-models-which-takes-its-output-as-input-torch | deep-learning, nlp, gpu, torch, multi-gpu | 1,760,538,024 |
se_79788929 | stackoverflow | ARTIFICIAL_INTELLIGENCE | Streamlit app throwing "NotFittedError: idf vector is not fitted" even though TF-IDF pipeline is fitted and works locally | Streamlit app throwing "NotFittedError: idf vector is not fitted" even though TF-IDF pipeline is fitted and works locally
I trained a sentiment classification model using a scikit-learn Pipeline that includes a TfidfVectorizer and LogisticRegression classifier.
Everything works perfectly on my local machine,... | https://stackoverflow.com/questions/79788929/streamlit-app-throwing-notfittederror-idf-vector-is-not-fitted-even-though-tf | python, tensorflow, deployment, nlp, streamlit | 1,760,331,307 |
se_73734318 | stackoverflow | ARTIFICIAL_INTELLIGENCE | What is nlp in spacy? | What is nlp in spacy?
Usually we start from:
nlp = spacy.load('en_encore_web_sm') # or medium, or large
or
nlp = English()
then:
doc = nlp('my text')
Then we can do a lot of fun with that even not knowing the nature of the first line.
But what exactly is 'nlp'? What is going on under the hood? Is "nlp" a pretrained... | https://stackoverflow.com/questions/73734318/what-is-nlp-in-spacy | python-3.x, machine-learning, nlp, spacy | 1,663,257,993 |
se_79788321 | stackoverflow | ARTIFICIAL_INTELLIGENCE | Angle Embedder in Python Messing Up Logging Config | Angle Embedder in Python Messing Up Logging Config
I wrote another question on this earlier, but could not pinpoint the issue on my side, here, I am giving a minimal reproducible code.
System
Angle version 0.5.6
UV 0.8.22
Python 3.12
Ubuntu 24.04
I have used the python logging library for sometime, and recently, it is... | https://stackoverflow.com/questions/79788321/angle-embedder-in-python-messing-up-logging-config | python, nlp, python-logging, text-embedding-ada-002 | 1,760,230,996 |
se_79786174 | stackoverflow | ARTIFICIAL_INTELLIGENCE | ONNX Runtime Helsinki-NLP in Java | ONNX Runtime Helsinki-NLP in Java
has anyone managed to translate something using Helsinki-NLP and ONNX Runtime in Java? Using a Python script, I generated these files:
├── encoder_model.onnx
├── decoder_model.onnx
├── decoder_with_past_model.onnx
├── config.json
├── generation_config.json
├── tokenizer_config.json
├─... | https://stackoverflow.com/questions/79786174/onnx-runtime-helsinki-nlp-in-java | java, nlp, huggingface, onnx | 1,759,997,765 |
se_69230690 | stackoverflow | ARTIFICIAL_INTELLIGENCE | How to increase row height in Pandas? | How to increase row height in Pandas?
There are good answers on how to change column width in pandas dataframes, for example here but I couldn't find anything describing how we can change row height?
I'm trying to view two long texts side by side to compare them and I'd like to increase the row height to make it easie... | https://stackoverflow.com/questions/69230690/how-to-increase-row-height-in-pandas | python, pandas, nlp | 1,631,925,292 |
se_78873304 | stackoverflow | ARTIFICIAL_INTELLIGENCE | How to sample multiple completions (n) directly from Claude API without a for loop | How to sample multiple completions (n) directly from Claude API without a for loop
I'm using the Anthropic Claude API and I'm trying to generate multiple completions (n completions) for a given prompt in a single API call. OpenAI's API provides an n parameter in their sampling settings to achieve this, but I can't fin... | https://stackoverflow.com/questions/78873304/how-to-sample-multiple-completions-n-directly-from-claude-api-without-a-for-lo | python, machine-learning, nlp, large-language-model, claude | 1,723,682,273 |
se_79778613 | stackoverflow | ARTIFICIAL_INTELLIGENCE | How to reconstruct sentences from mean-pooled embeddings (embedding inversion) | How to reconstruct sentences from mean-pooled embeddings (embedding inversion)
I’m working on a research problem where I want to reconstruct or paraphrase sentences starting from synthetic embeddings.
The embeddings are global (mean-pooled), not token-level, so they lose structural and syntactic information.
The goal ... | https://stackoverflow.com/questions/79778613/how-to-reconstruct-sentences-from-mean-pooled-embeddings-embedding-inversion | nlp, large-language-model, embedding, decoder, encoder-decoder | 1,759,190,522 |
se_76602355 | stackoverflow | ARTIFICIAL_INTELLIGENCE | I am using langchain to chat with my database I want json format as output which includes fieldname as key | I am using langchain to chat with my database I want json format as output which includes fieldname as key
I am working on Natural language to query your SQL Database using LangChain powered by ChatGPT.I am using Langchain's SQL database to chat with my database, it returns answers in the sentence I want the answer i... | https://stackoverflow.com/questions/76602355/i-am-using-langchain-to-chat-with-my-database-i-want-json-format-as-output-which | python, machine-learning, nlp, openai-api, langchain | 1,688,366,209 |
se_1741347 | stackoverflow | ARTIFICIAL_INTELLIGENCE | Natural language rendering | Natural language rendering
Do you know any frameworks that implement natural language rendering concept ?
I've found several NLP oriented frameworks like Anthelope or Open NLP but they have only parsers but not renderers or builders. For example I want to render a question about smth. I'm constructing sentence object,... | https://stackoverflow.com/questions/1741347/natural-language-rendering | frameworks, artificial-intelligence, nlp | 1,258,367,885 |
se_21518534 | stackoverflow | ARTIFICIAL_INTELLIGENCE | natural language query processing | natural language query processing
I have a NLP (natural language processing application) running that gives me a tree of the parsed sentence, the questions is then how should I proceed with that.
What is the time
\-SBAR - Suborginate clause
|-WHNP - Wh-noun phrase
| \-WP - Wh-pronoun
| \-What
\-S - Simple dec... | https://stackoverflow.com/questions/21518534/natural-language-query-processing | c#, nlp, artificial-intelligence | 1,391,391,142 |
se_34253493 | stackoverflow | ARTIFICIAL_INTELLIGENCE | How to extract numbers from a text file and multiply them together? | How to extract numbers from a text file and multiply them together?
I have a text file which contains 800 words with a number in front of each (each word and its number are separated by a tab and written on a single line. This means the file has 800 lines). I have to find the numbers and then multiply them together. B... | https://stackoverflow.com/questions/34253493/how-to-extract-numbers-from-a-text-file-and-multiply-them-together | python, nlp, numbers, text-extraction, farsi | 1,450,024,651 |
se_73132769 | stackoverflow | ARTIFICIAL_INTELLIGENCE | What is the right way to get unit vector to index Elasticsearch ann dot_product? | What is the right way to get unit vector to index Elasticsearch ann dot_product?
I am trying to index word embedding vectors to Elasticsearch V8 ann dense_vector dot_product.
I can successfully index vec to cosine, so I converted it to unit vector with numpy for dot_product.
unit_vector = vec / np.linalg.norm(vec)... | https://stackoverflow.com/questions/73132769/what-is-the-right-way-to-get-unit-vector-to-index-elasticsearch-ann-dot-product | python, elasticsearch, nlp | 1,658,900,641 |
se_43455043 | stackoverflow | ARTIFICIAL_INTELLIGENCE | How to vectorize whole text using fasttext? | How to vectorize whole text using fasttext?
To get vector of a word, I can use:
model["word"]
but if I want to get the vector of a sentence, I need to either sum vectors of all words or get average of all vectors.
Does FastText provide a method to do this? | https://stackoverflow.com/questions/43455043/how-to-vectorize-whole-text-using-fasttext | facebook, nlp, fasttext | 1,492,445,174 |
se_79771930 | stackoverflow | ARTIFICIAL_INTELLIGENCE | How to integrate a lightweight image-to-text model into a React Native app? | How to integrate a lightweight image-to-text model into a React Native app?
I am trying to integrate an image-to-text model into a React Native mobile app.
My requirements:
The model should support image + text input → text output.
It should be lightweight enough to run on mobile devices.
What I tried
moondream-0.5b (... | https://stackoverflow.com/questions/79771930/how-to-integrate-a-lightweight-image-to-text-model-into-a-react-native-app | react-native, machine-learning, pytorch, nlp, onnx | 1,758,564,305 |
se_79768147 | stackoverflow | ARTIFICIAL_INTELLIGENCE | How can I extract symptoms/diseases from a running transcription? | How can I extract symptoms/diseases from a running transcription?
I'm working on a project where I'm attempting to extract medical symptoms from a running transcription. I'm using SocketIO to get mic audio and then using Whisper to transcribe the audio into text which is saved as a file or on a MongoDB database.
I cam... | https://stackoverflow.com/questions/79768147/how-can-i-extract-symptoms-diseases-from-a-running-transcription | python, nlp, spacy | 1,758,182,779 |
se_79681718 | stackoverflow | ARTIFICIAL_INTELLIGENCE | Normalizing large free text input data | Normalizing large free text input data
Here is the case, i have data coming from free text input source, it is related to the degree and education level of the users
There are many typos, many crazy stuff going on in the data, there are over 10m records, the data could be anything from typos, some their industry, some... | https://stackoverflow.com/questions/79681718/normalizing-large-free-text-input-data | python, machine-learning, nlp, data-science, spell-checking | 1,751,016,774 |
se_65273410 | stackoverflow | ARTIFICIAL_INTELLIGENCE | Issue in creating Semgrex patterns with relation names containing ":" colon | Issue in creating Semgrex patterns with relation names containing ":" colon
I am trying to perform Semgrex in https://corenlp.run/ on the below sentence to extract the transition event. Since the dependency relation "obl:from" has a colon in it, I get an error. But instead, if I used nsubj, I get the desired... | https://stackoverflow.com/questions/65273410/issue-in-creating-semgrex-patterns-with-relation-names-containing-colon | parsing, nlp, constants, stanford-nlp, dependency-parsing | 1,607,845,174 |
se_79768968 | stackoverflow | ARTIFICIAL_INTELLIGENCE | I need a Python implementation of my Longest Possible Common Subsequence (LPCS) algorithm | I need a Python implementation of my Longest Possible Common Subsequence (LPCS) algorithm
Please be merciful - I've never asked a question here (I've answered a few) and am a total Python noob.
I developed an algorithm in SQL Server to compute the Longest Possible Common Subsequence (LPCS) between two strings and am s... | https://stackoverflow.com/questions/79768968/i-need-a-python-implementation-of-my-longest-possible-common-subsequence-lpcs | python, algorithm, nlp | 1,758,233,811 |
se_26262222 | stackoverflow | ARTIFICIAL_INTELLIGENCE | Named entity recognition : For new/latest entities | Named entity recognition : For new/latest entities
I'm new to NLP concepts, so I used NER demo (http://cogcomp.cs.illinois.edu/demo/ner/results.php). Now the issue is that "how & in what ways" can I use these taggings done by NER. I mean these what answers or inferences can one draw from these named-entities which hav... | https://stackoverflow.com/questions/26262222/named-entity-recognition-for-new-latest-entities | python, nlp, nltk, named-entity-recognition | 1,412,786,964 |
se_78486911 | stackoverflow | ARTIFICIAL_INTELLIGENCE | How to Load an Already Instantiated Hugging Face Model into vLLM for Inference? | How to Load an Already Instantiated Hugging Face Model into vLLM for Inference?
I am working on a project where I need to utilize a model that has already been loaded and instantiated on the GPU using Hugging Face's Transformers library. The goal is to pass this loaded model into the vLLM framework for further process... | https://stackoverflow.com/questions/78486911/how-to-load-an-already-instantiated-hugging-face-model-into-vllm-for-inference | nlp, huggingface-transformers, huggingface, huggingface-hub, vllm | 1,715,815,067 |
se_77737679 | stackoverflow | ARTIFICIAL_INTELLIGENCE | Create a multilingual chatbot | Create a multilingual chatbot
I created a chatbot using PyTorch an I want to make it support the French language. Note that I want to train the chatbot so that it can respond to technical questions.
One of the things that came to my mind is to use translation APIs but since the chatbot is expected to respond to techni... | https://stackoverflow.com/questions/77737679/create-a-multilingual-chatbot | python, machine-learning, pytorch, nlp, chatbot | 1,703,977,527 |
se_79763224 | stackoverflow | ARTIFICIAL_INTELLIGENCE | RuntimeError: Expected all tensors to be on the same device when using local HuggingFace model in LangChain Agent | RuntimeError: Expected all tensors to be on the same device when using local HuggingFace model in LangChain Agent
I'm building a simple agent using LangChain that leverages a locally-hosted HuggingFace model (gpt-oss-20b). I'm using the transformers pipeline and wrapping it in LangChain's HuggingFacePipeline.
The mode... | https://stackoverflow.com/questions/79763224/runtimeerror-expected-all-tensors-to-be-on-the-same-device-when-using-local-hug | python, nlp, huggingface-transformers, langchain | 1,757,699,349 |
se_77190942 | stackoverflow | ARTIFICIAL_INTELLIGENCE | Why can we set LLM's input and output to be the same when fine tuning on text generation task? | Why can we set LLM's input and output to be the same when fine tuning on text generation task?
I'm trying to fine tune my GPT-2 model for song lyrics text generation, and I have a couple of song lyrics on hand. However, I'm confused about how to fine tune GPT-2 model that doesn't have standard input and outputs fo... | https://stackoverflow.com/questions/77190942/why-can-we-set-llms-input-and-output-to-be-the-same-when-fine-tuning-on-text-ge | machine-learning, nlp, large-language-model, fine-tuning, gpt-2 | 1,695,849,301 |
se_79732531 | stackoverflow | ARTIFICIAL_INTELLIGENCE | Is HuggingFace Accelerate's init_empty_weights Context Manager (Properly) Implemented for a Diffuser? | Is HuggingFace Accelerate's init_empty_weights Context Manager (Properly) Implemented for a Diffuser?
Discussion
HuggingFace accelerate's init_empty_weights() properly loads all text encoders I tested to the PyTorch meta device and consumes no apparent memory or disk space while loaded.
However, it worked differen... | https://stackoverflow.com/questions/79732531/is-huggingface-accelerates-init-empty-weights-context-manager-properly-implem | python, nlp, huggingface, diffusers | 1,754,949,264 |
se_79736395 | stackoverflow | ARTIFICIAL_INTELLIGENCE | How to interpret cosine similarity using EmbeddingSimilarityEvaluator | How to interpret cosine similarity using EmbeddingSimilarityEvaluator
I am reading about Text embeddings in LLM from the book Hands-On Large Language Models. It is mentioned that as follows:
from sentence_transformers.evaluation import EmbeddingSimilarityEvaluator
from sentence_transformers import SentenceTransformer
... | https://stackoverflow.com/questions/79736395/how-to-interpret-cosine-similarity-using-embeddingsimilarityevaluator | nlp, huggingface-transformers, huggingface, cosine-similarity, sentence-transformers | 1,755,258,583 |
se_65332165 | stackoverflow | ARTIFICIAL_INTELLIGENCE | Loss is “nan” when fine-tuning HuggingFace NLI model (both RoBERTa/BART) | Loss is “nan” when fine-tuning HuggingFace NLI model (both RoBERTa/BART)
I'm using HuggingFace's Transformer's library and I’m trying to fine-tune a pre-trained NLI model (ynie/roberta-large-snli_mnli_fever_anli_R1_R2_R3-nli) on a dataset of around 276.000 hypothesis-premise pairs. I’m following the instructions from ... | https://stackoverflow.com/questions/65332165/loss-is-nan-when-fine-tuning-huggingface-nli-model-both-roberta-bart | python, nlp, pytorch, huggingface-transformers, huggingface-tokenizers | 1,608,158,492 |
se_79747909 | stackoverflow | ARTIFICIAL_INTELLIGENCE | Convert SentencePiece tokenizer to ONNX | Convert SentencePiece tokenizer to ONNX
I'm developing (Python) an FAQ system based on embeddings to perform similarity queries between a user's question and the FAQ knowledge base. The FAQ needs to run on Android smartphones.
I'm using the model "intfloat/multilingual-e5-small" to generate the embeddings.
I successfu... | https://stackoverflow.com/questions/79747909/convert-sentencepiece-tokenizer-to-onnx | nlp, tokenize, onnx | 1,756,293,433 |
se_79743002 | stackoverflow | ARTIFICIAL_INTELLIGENCE | How do I create a Pytorch Dataset from multiple files where each file has multiple batches | How do I create a Pytorch Dataset from multiple files where each file has multiple batches
How do I create an dataset that reads in data from multiple files, but where each file has lots of rows or batches.
For example, I have a partitioned parquet dataset (created with pandas.to_parquet), with text or embeddings in e... | https://stackoverflow.com/questions/79743002/how-do-i-create-a-pytorch-dataset-from-multiple-files-where-each-file-has-multip | python, machine-learning, pytorch, nlp | 1,755,840,923 |
se_48115965 | stackoverflow | ARTIFICIAL_INTELLIGENCE | Cosine Similarity and LDA topics | Cosine Similarity and LDA topics
I want to compute Cosine Similarity between LDA topics. In fact, gensim function .matutils.cossim can do it but I dont know which parameter (vector ) I can use for this function?
Here is a snap of code :
import numpy as np
import lda
from sklearn.feature_extraction.text import Coun... | https://stackoverflow.com/questions/48115965/cosine-similarity-and-lda-topics | python, nlp, gensim, lda | 1,515,163,858 |
se_76946217 | stackoverflow | ARTIFICIAL_INTELLIGENCE | How to highlight the differences between two strings in Python? | How to highlight the differences between two strings in Python?
I want to highlight the differences between two strings in a colour using Python code.
Example 1:
sentence1 = "I'm enjoying the summer breeze on the beach while I do some pilates."
sentence2 = "I am enjoying the summer breeze on the beach while I am doing... | https://stackoverflow.com/questions/76946217/how-to-highlight-the-differences-between-two-strings-in-python | python, string, colors, nlp, difference | 1,692,627,819 |
se_79738413 | stackoverflow | ARTIFICIAL_INTELLIGENCE | spaCy spancat won’t learn (zero F-score) while NER on same data scores 0.40 — Prodigy-generated KPI/target corpus | spaCy spancat won’t learn (zero F-score) while NER on same data scores 0.40 — Prodigy-generated KPI/target corpus
I am traing to train a spaCy v 3.8.7 spancat model on ~100 sustainability reports (annotated with Prodigy) to extract KPIs and targets.
An NER pipeline trained on the same data reaches F≈0.40, but spancat ... | https://stackoverflow.com/questions/79738413/spacy-spancat-won-t-learn-zero-f-score-while-ner-on-same-data-scores-0-40-pr | nlp, spacy, spancat | 1,755,504,005 |
se_405161 | stackoverflow | ARTIFICIAL_INTELLIGENCE | Detecting syllables in a word | Detecting syllables in a word
I need to find a fairly efficient way to detect syllables in a word. E.g.,
Invisible -> in-vi-sib-le
There are some syllabification rules that could be used:
V
CV
VC
CVC
CCV
CCCV
CVCC
*where V is a vowel and C is a consonant.
E.g.,
Pronunciation (5 Pro-nun-ci-a-tion; CV-CVC-CV-V-CVC)
I'v... | https://stackoverflow.com/questions/405161/detecting-syllables-in-a-word | nlp, spell-checking, hyphenation | 1,230,829,721 |
se_79451974 | stackoverflow | ARTIFICIAL_INTELLIGENCE | word/ sentence similarities | word/ sentence similarities
I am trying to find if a given word/ set of words are similar to a definition.
Example - Definition - "vegetarian User"
Now, if I want to check a set of sentences like below
sentences = ['vegetarian User',
'user sometimes eats chicken',
'user is vegetarian',
... | https://stackoverflow.com/questions/79451974/word-sentence-similarities | python, python-3.x, nlp | 1,739,980,065 |
se_74518261 | stackoverflow | ARTIFICIAL_INTELLIGENCE | How to create a simple Italian Model for a Named Entity Extraction of Persons using OpenNLP? | How to create a simple Italian Model for a Named Entity Extraction of Persons using OpenNLP?
I have to do a project with OpenNLP, strictly in italian language. Since it's almost impossible to find some existing structures in this language, my idea is to create a simple model myself. Reading some posts on this platform... | https://stackoverflow.com/questions/74518261/how-to-create-a-simple-italian-model-for-a-named-entity-extraction-of-persons-us | java, nlp, named-entity-recognition, opennlp | 1,669,030,403 |
se_79727860 | stackoverflow | ARTIFICIAL_INTELLIGENCE | how to solve ValueError: Failed to construct dataset "imdb_reviews"? | how to solve ValueError: Failed to construct dataset "imdb_reviews"?
ValueError: Failed to construct dataset "imdb_reviews",
builder_kwargs "{'config': 'subwords8k', 'data_dir': None}":
BuilderConfig subwords8k not found with version None.
Here are 10 BuilderConfigs whose name closely match:
I've got thi... | https://stackoverflow.com/questions/79727860/how-to-solve-valueerror-failed-to-construct-dataset-imdb-reviews | python, tensorflow, machine-learning, nlp, artificial-intelligence | 1,754,514,942 |
se_68349833 | stackoverflow | ARTIFICIAL_INTELLIGENCE | Pip can't install pyicu | Pip can't install pyicu
I am running a AWS that runs Ubuntu 20.04. I am trying to install the package pyicu, but I am facing problems. I tried running sudo apt install libicu-dev, but I still can't install pyicu. I am not able to install brew on the aws server. Any other suggestions? This is the erro message:
... | https://stackoverflow.com/questions/68349833/pip-cant-install-pyicu | python, pip, nlp, polyglot, pyicu | 1,626,102,970 |
se_41906774 | stackoverflow | ARTIFICIAL_INTELLIGENCE | CoreNLP: Parsing of sentence failed, possibly because of out of memory | CoreNLP: Parsing of sentence failed, possibly because of out of memory
While running Stanford's CoreNLP 3.7.0, I'm ocaisionally seeing this:
WARNING: Parsing of sentence failed, possibly because of out of memory.
Will ignore and continue: Just a year ago , the public outrage was over
Sovaldi , a new hepatitis C drug... | https://stackoverflow.com/questions/41906774/corenlp-parsing-of-sentence-failed-possibly-because-of-out-of-memory | java, nlp, out-of-memory, stanford-nlp | 1,485,582,495 |
se_79719714 | stackoverflow | ARTIFICIAL_INTELLIGENCE | Saving embeddings from encoder efficiently with fast random access | Saving embeddings from encoder efficiently with fast random access
I have embeddings (about 160 Million) that I created with a BERT-based encoder model.
Right now they are in a .pt format and takes about 500GB in the disk.
I want 2 things:
To save them in an efficient way if possible (minimum disk space as possible)
... | https://stackoverflow.com/questions/79719714/saving-embeddings-from-encoder-efficiently-with-fast-random-access | data-structures, deep-learning, nlp, word-embedding, encoder | 1,753,867,885 |
se_77113484 | stackoverflow | ARTIFICIAL_INTELLIGENCE | AIML chatbot not learning from aiml file | AIML chatbot not learning from aiml file
I am making a voice-assistant for food ordering in fast-food restaurants. For dialog management tasks I am making aiml chatbot.
This is my std-startup.xml code:
<aiml version="1.0.1" encoding="UTF-8">
<!-- std-startup.xml -->
<!-- Category is an atomic AIML unit -->
... | https://stackoverflow.com/questions/77113484/aiml-chatbot-not-learning-from-aiml-file | python, nlp, chatbot, aiml | 1,694,790,460 |
se_79727371 | stackoverflow | ARTIFICIAL_INTELLIGENCE | Chroma.from_documents() hangs indefinitely when loading documents split by newline | Chroma.from_documents() hangs indefinitely when loading documents split by newline
I'm working with LangChain and trying to create a vector database from a text file containing book descriptions and ISBNs. Each line in the text file is a separate book description, so I split the loaded text by newline. Here's my code ... | https://stackoverflow.com/questions/79727371/chroma-from-documents-hangs-indefinitely-when-loading-documents-split-by-newli | python, nlp, text-classification, chromadb, vector-database | 1,754,487,788 |
se_79721064 | stackoverflow | ARTIFICIAL_INTELLIGENCE | What does True positive, FP, TN, FN corresponds when you do NER (Named Entity Recognition) in NLP? | What does True positive, FP, TN, FN corresponds when you do NER (Named Entity Recognition) in NLP?
I have been struggling with the concept of TP, TN, FP, FN
Here is a text :
My age is 25 years old, I am born on 20/02 of 2000
Let's say we have a nlp model (BERT) that extract the year you are born
In this case a true po... | https://stackoverflow.com/questions/79721064/what-does-true-positive-fp-tn-fn-corresponds-when-you-do-ner-named-entity-re | nlp, named-entity-recognition, confusion-matrix | 1,753,953,896 |
se_42510512 | stackoverflow | ARTIFICIAL_INTELLIGENCE | Regex - Lookbehind with not fixed-length | Regex - Lookbehind with not fixed-length
I am trying to match a name in a sentence using Java RegEx. A name should be matched only if it is surrounded by normal text and not other names. For example, I would like to match the word Obama in the following sentence:
Americans said that Obama is ...
But not in the foll... | https://stackoverflow.com/questions/42510512/regex-lookbehind-with-not-fixed-length | java, regex, string, nlp | 1,488,289,757 |
se_60785113 | stackoverflow | ARTIFICIAL_INTELLIGENCE | NLP Named Entity Recognition | NLP Named Entity Recognition
I want to use Named Entity Recognition algorithm for extract the names and locations from the text without using any libraries.
Example:
American Airlines said it would launch a direct flight to Bengaluru.
Answer:
Entity: American Airlines
Location: Bengaluru
What is the best practice ... | https://stackoverflow.com/questions/60785113/nlp-named-entity-recognition | machine-learning, nlp, stanford-nlp, named-entity-recognition | 1,584,772,381 |
se_72291650 | stackoverflow | ARTIFICIAL_INTELLIGENCE | Contextual Tokenizer that depends on the context in Transformer NLP | Contextual Tokenizer that depends on the context in Transformer NLP
I would like to create a tokenizer that tokenizes words in a sentence depending on its surroundings. So one word could have different tokens depending on its neighbor words. For example, if I have these two sentences: "Soccer is fun" and "She plays so... | https://stackoverflow.com/questions/72291650/contextual-tokenizer-that-depends-on-the-context-in-transformer-nlp | deep-learning, nlp, token, huggingface-transformers | 1,652,886,294 |
se_3854900 | stackoverflow | ARTIFICIAL_INTELLIGENCE | How can I find whether a word is a noun or a verb using the Stanford parser? | How can I find whether a word is a noun or a verb using the Stanford parser?
I need to find whether a word is a verb, a noun, or it is both.
For example, the word is "search". It can be both a noun and a verb, but the Stanford parser gives the NN tag to it.
Is there a way that the Stanford parser will give that "searc... | https://stackoverflow.com/questions/3854900/how-can-i-find-whether-a-word-is-a-noun-or-a-verb-using-the-stanford-parser | java, nlp, stanford-nlp | 1,286,192,673 |
se_79699193 | stackoverflow | ARTIFICIAL_INTELLIGENCE | How can I train a multilingual Word2Vec model with aligned embeddings? | How can I train a multilingual Word2Vec model with aligned embeddings?
I'm working on a cross-lingual project involving semantic search in both Persian and English.
I want to create a single Word2Vec model where semantically equivalent words (e.g., "خانه" ↔︎ "house") have close vector representations. | https://stackoverflow.com/questions/79699193/how-can-i-train-a-multilingual-word2vec-model-with-aligned-embeddings | nlp, multilingual, word2vec | 1,752,315,904 |
se_64671500 | stackoverflow | ARTIFICIAL_INTELLIGENCE | Difference between ne_chunk from NLTK and stanza for NER? | Difference between ne_chunk from NLTK and stanza for NER?
I am starting named entity recognition on python and have used ne_chunk and stanza.
I would like to know what the difference is between their pre-trained models for the NER. How do they recognize named entities? | https://stackoverflow.com/questions/64671500/difference-between-ne-chunk-from-nltk-and-stanza-for-ner | python, nlp, nltk, stanford-nlp, named-entity-recognition | 1,604,441,736 |
se_77771824 | stackoverflow | ARTIFICIAL_INTELLIGENCE | Why Python ignores the sign in the column name? | Why Python ignores the sign in the column name?
I have a dataframe of text that looks like this
RepID, Txt
1, +83 -193 -380 +55 +901
2, -94 +44 +2892 -60
3, +7010 -3840 +3993
Although the Txt field have +282 and -829 but these are string values not numeric
The problem is that when I use Bag of words function
def BOW(... | https://stackoverflow.com/questions/77771824/why-python-ignores-the-sign-in-the-column-name | python, dataframe, nlp | 1,704,598,458 |
se_79708967 | stackoverflow | ARTIFICIAL_INTELLIGENCE | Python NLTK: LookupError for 'averaged_perceptron_tagger_eng' after download | Python NLTK: LookupError for 'averaged_perceptron_tagger_eng' after download
I'm attempting to perform Part-of-Speech (POS) tagging in a Jupyter Notebook using the NLTK package. The averaged_perceptron_tagger resource cannot be located, according to the LookupError I keep receiving.
The odd thing is that NLTK... | https://stackoverflow.com/questions/79708967/python-nltk-lookuperror-for-averaged-perceptron-tagger-eng-after-download | python, jupyter-notebook, nlp, nltk, stanford-nlp | 1,753,095,966 |
se_79557313 | stackoverflow | ARTIFICIAL_INTELLIGENCE | No attention output in jinaai/jina-embeddings-v3 embedding model | No attention output in jinaai/jina-embeddings-v3 embedding model
When I use this model like so -
from transformers import AutoModel, AutoTokenizer
model_id = "jinaai/jina-embeddings-v3"
tokenizer = AutoTokenizer.from_pretrained(model_id, trust_remote_code=True)
model = AutoModel.from_pretrained(model_id, trust_remote... | https://stackoverflow.com/questions/79557313/no-attention-output-in-jinaai-jina-embeddings-v3-embedding-model | machine-learning, nlp, artificial-intelligence, huggingface-transformers, sentence-transformers | 1,743,874,155 |
se_56280657 | stackoverflow | ARTIFICIAL_INTELLIGENCE | Create synonyms and use regular expressions to find keyword | Create synonyms and use regular expressions to find keyword
Background:
I want to use regular expressions to search for a keyword. However, my keyword has multiple synonyms. For example, the keyword positive can have the following words that I consider as equal to positive: "+", "pos", "POS", "Positive", "POSITIVE" ... | https://stackoverflow.com/questions/56280657/create-synonyms-and-use-regular-expressions-to-find-keyword | python-3.x, regex, nlp, corpus | 1,558,634,347 |
se_32423369 | stackoverflow | ARTIFICIAL_INTELLIGENCE | What's the difference between WordNet 3.1 and WordNet 3.0? | What's the difference between WordNet 3.1 and WordNet 3.0?
There doesn't seem to be a changelog or something of that sort available at wordnet.princeton.edu | https://stackoverflow.com/questions/32423369/whats-the-difference-between-wordnet-3-1-and-wordnet-3-0 | nlp, wordnet | 1,441,541,179 |
se_76707715 | stackoverflow | ARTIFICIAL_INTELLIGENCE | stucking at downloading shards for loading LLM model from huggingface | stucking at downloading shards for loading LLM model from huggingface
I am just using huggingface example to use their LLM model, but it stuck at the:
downloading shards: 0%| | 0/5 [00:00<?, ?it/s]
(I am using Jupiter notebook, python 3.11, and all requirements were installed)
from transformers import Auto... | https://stackoverflow.com/questions/76707715/stucking-at-downloading-shards-for-loading-llm-model-from-huggingface | python, nlp, huggingface-transformers | 1,689,623,840 |
se_78598905 | stackoverflow | ARTIFICIAL_INTELLIGENCE | How to pass a pytorch DataLoader to huggingface Trainer? Is that even possble? | How to pass a pytorch DataLoader to huggingface Trainer? Is that even possble?
The usual steps to use the Trainer from huggingface requires that:
Load the data
Tokenize the data
Pass tokenized data to Trainer
MWE:
data = generate_random_data(10000) # Generate 10,000 samples
df = pd.DataFrame(data)
dataset = Dataset... | https://stackoverflow.com/questions/78598905/how-to-pass-a-pytorch-dataloader-to-huggingface-trainer-is-that-even-possble | nlp, huggingface, pytorch-dataloader, dataloader, huggingface-trainer | 1,717,945,140 |
se_79691715 | stackoverflow | ARTIFICIAL_INTELLIGENCE | Can I use a custom attention layer while still leveraging a pre-trained BERT model? | Can I use a custom attention layer while still leveraging a pre-trained BERT model?
In the paper “Using Prior Knowledge to Guide BERT’s Attention in Semantic Textual Matching Tasks”, they multiply a similarity matrix with the attention scores inside the attention layer. I want to apply a similar customization, but I a... | https://stackoverflow.com/questions/79691715/can-i-use-a-custom-attention-layer-while-still-leveraging-a-pre-trained-bert-mod | pytorch, nlp, huggingface-transformers, bert-language-model, transformer-model | 1,751,802,422 |
se_79699359 | stackoverflow | ARTIFICIAL_INTELLIGENCE | Custom NER to extract header, request and response from API document | Custom NER to extract header, request and response from API document
I'm trying to extract API integration parameters like Authorization headers, query params, and request body fields from API documentation. This is essentially a custom NER task.
I’ve experimented with LLaMA 3.1 and Mistral using Ollama, but both run ... | https://stackoverflow.com/questions/79699359/custom-ner-to-extract-header-request-and-response-from-api-document | nlp, large-language-model, mistral-7b, llama3, api-documentation | 1,752,331,348 |
se_78059837 | stackoverflow | ARTIFICIAL_INTELLIGENCE | unable to implement tgt_mask and tgt_key_padding mask properly in transformer decoder model | unable to implement tgt_mask and tgt_key_padding mask properly in transformer decoder model
I have implemented a transformer decoder for next token prediction. I am passing the tgt_mask and tgt_key_padding mask to not attend the future tokens and to ignore the padding. but I am constantly receiving the error
Training ... | https://stackoverflow.com/questions/78059837/unable-to-implement-tgt-mask-and-tgt-key-padding-mask-properly-in-transformer-de | python, pytorch, nlp, transformer-model, attention-model | 1,708,939,721 |
se_13853584 | stackoverflow | ARTIFICIAL_INTELLIGENCE | list of english verbs and their tenses, various forms, etc | list of english verbs and their tenses, various forms, etc
Is there a huge CSV/XML or whatever file somewhere that contains a list of english verbs and their variations (e.g sell -> sold, sale, selling, seller, sellee)?
I imagine this will be useful for NLP systems, but there doesn't seem to be a listing anywhere, or... | https://stackoverflow.com/questions/13853584/list-of-english-verbs-and-their-tenses-various-forms-etc | nlp | 1,355,376,786 |
se_79485259 | stackoverflow | ARTIFICIAL_INTELLIGENCE | Spacy rules matching entities before text | Spacy rules matching entities before text
I'm trying to write a spacy parser to extract the names and terms of a contract.
To do that, I've written a rule to extract the sellers and buyers, except it's extracting multiple times over a simple sentence.
Here's my rule
[{"label": "seller", "pattern": [{"ENT_TYPE": "PERSO... | https://stackoverflow.com/questions/79485259/spacy-rules-matching-entities-before-text | python, nlp, spacy | 1,741,138,463 |
se_69938317 | stackoverflow | ARTIFICIAL_INTELLIGENCE | How to add index to python FAISS incrementally | How to add index to python FAISS incrementally
I am using Faiss to index my huge dataset embeddings, embedding generated from bert model. I want to add the embeddings incrementally, it is working fine if I only add it with faiss.IndexFlatL2 , but the problem is while saving it the size of it is too large.
So I tried w... | https://stackoverflow.com/questions/69938317/how-to-add-index-to-python-faiss-incrementally | python, python-3.x, nlp, bert-language-model, faiss | 1,636,694,588 |
se_79681283 | stackoverflow | ARTIFICIAL_INTELLIGENCE | Vertex AI TEI Deployment Fails for Private Hugging Face Model - "Could not download model artifacts" | Vertex AI TEI Deployment Fails for Private Hugging Face Model - "Could not download model artifacts"
I'm trying to deploy a Hugging Face model to Vertex AI using the Text Embeddings Inference (TEI) workflow, but I'm getting consistent errors during deployment. This same deployment approach worked for me 3 da... | https://stackoverflow.com/questions/79681283/vertex-ai-tei-deployment-fails-for-private-hugging-face-model-could-not-downl | google-cloud-platform, nlp, huggingface-transformers, google-cloud-vertex-ai | 1,750,982,171 |
se_79681038 | stackoverflow | ARTIFICIAL_INTELLIGENCE | Language Model Evaluation with Custom Task - Hugging Face Lighteval | Language Model Evaluation with Custom Task - Hugging Face Lighteval
I am creating a benchmark to evaluate a language model. First, I generated the dataset that I'm gonna prompt the Language model with. Subsequently, I tried to evaluate any tiny language model just to get a end-to-end small functioning app. I followed ... | https://stackoverflow.com/questions/79681038/language-model-evaluation-with-custom-task-hugging-face-lighteval | python, machine-learning, nlp, large-language-model, huggingface | 1,750,964,642 |
se_76314229 | stackoverflow | ARTIFICIAL_INTELLIGENCE | How to download spaCy models in a Poetry managed environment | How to download spaCy models in a Poetry managed environment
I am writing a Python Jupyter notebook that does some NLP processing on Italian texts.
I have installed spaCy 3.5.3 via Poetry and then attempt to run the following code:
import spacy
load_model = spacy.load('it_core_news_sm')
The import line works as expec... | https://stackoverflow.com/questions/76314229/how-to-download-spacy-models-in-a-poetry-managed-environment | python, nlp, spacy, python-poetry, virtual-environment | 1,684,841,350 |
se_71481711 | stackoverflow | ARTIFICIAL_INTELLIGENCE | OSError for huggingface model | OSError for huggingface model
I am trying to use a huggingface model (CamelBERT), but I am getting an error when loading the tokenizer:
Code:
from transformers import AutoTokenizer, AutoModelForMaskedLM
tokenizer = AutoTokenizer.from_pretrained("CAMeL-Lab/bert-base-arabic-camelbert-ca")
model = AutoModelForMaskedLM.fr... | https://stackoverflow.com/questions/71481711/oserror-for-huggingface-model | python, deep-learning, nlp, huggingface-transformers, bert-language-model | 1,647,344,879 |
se_71916613 | stackoverflow | ARTIFICIAL_INTELLIGENCE | ModuleNotFoundError: No module named 'haystack.document_store.elasticsearch'; 'haystack.document_store' is not a package | ModuleNotFoundError: No module named 'haystack.document_store.elasticsearch'; 'haystack.document_store' is not a package
I am building a Q&A webapp with elasticsearch. I have just successfully installed farm-haystack==1.3.0 and farm with requirements.txt.
Now when I import the library, it pops up an er... | https://stackoverflow.com/questions/71916613/modulenotfounderror-no-module-named-haystack-document-store-elasticsearch-h | python, elasticsearch, nlp, document-store, haystack | 1,650,312,908 |
se_79377676 | stackoverflow | ARTIFICIAL_INTELLIGENCE | How to create a Natural Language Inference pipeline in Haystack | How to create a Natural Language Inference pipeline in Haystack
I want to use the Haystack framework to create a pipeline for Natural Language Inference on the response from a Retrieval-Augmented Generation (RAG) application
Because I'm using haystack-ai , I cannot use farm-haystack. If I could use farm-haystack (v1.0... | https://stackoverflow.com/questions/79377676/how-to-create-a-natural-language-inference-pipeline-in-haystack | nlp, huggingface, haystack | 1,737,548,267 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.