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_78916012
stackoverflow
ARTIFICIAL_INTELLIGENCE
Layer expects 2 input(s), but it received 1 input tensors
Layer expects 2 input(s), but it received 1 input tensors I am trying to build model to predict posts likes, the model takes text and content type which is one hot encoded column. I have made a TensorFlow dataset but when trying to fit the model I got this error: Layer "functional_13" expects 2 input(s), but it receiv...
https://stackoverflow.com/questions/78916012/layer-expects-2-inputs-but-it-received-1-input-tensors
python, tensorflow, machine-learning, deep-learning, nlp
1,724,700,262
se_74124714
stackoverflow
ARTIFICIAL_INTELLIGENCE
What is the best way to remove rare words from a large text?
What is the best way to remove rare words from a large text? The dataset contains 2.14M words The following is my code. uni = get_unique(ds) #to get all unique words c = Counter(uni) #using counter from Collections to create a dictionary v = list(c.values()) #dict value ky = list(c.keys()) #dicks keys junk = [] #in...
https://stackoverflow.com/questions/74124714/what-is-the-best-way-to-remove-rare-words-from-a-large-text
python-3.x, nlp
1,666,179,728
se_78900149
stackoverflow
ARTIFICIAL_INTELLIGENCE
My LSTM model returns empty with no output and no parameters captured
My LSTM model returns empty with no output and no parameters captured I am building an LSTM model for sentiment analysis using a hotel review dataset. However, the model always returns empty with empty output and parameters each time I run the code. I have followed many processes from cleaning to tokenization, vectori...
https://stackoverflow.com/questions/78900149/my-lstm-model-returns-empty-with-no-output-and-no-parameters-captured
python, nlp, vectorization, lstm, sequencing
1,724,309,938
se_78917743
stackoverflow
ARTIFICIAL_INTELLIGENCE
How to Process Data on GPU Instead of RAM for This Python Code?
How to Process Data on GPU Instead of RAM for This Python Code? I'm currently using the following code to process audio data, but it runs on the RAM. I want to offload the processing to the GPU to improve performance. my code : def prepare_dataset(batch): audio = batch["audio"] batch["input_features"] = featur...
https://stackoverflow.com/questions/78917743/how-to-process-data-on-gpu-instead-of-ram-for-this-python-code
nlp, gpu, torch, openai-whisper
1,724,745,808
se_78905620
stackoverflow
ARTIFICIAL_INTELLIGENCE
TypeError: ForwardRef._evaluate() missing 1 required keyword-only argument: 'recursive_guard'
TypeError: ForwardRef._evaluate() missing 1 required keyword-only argument: 'recursive_guard' Pls help. I need help setting up spacy inside jupyter enviornment I am trying to use spacy to summarize youtube transcripts but finding lots of problems with spacy and python 3.12.4/3.12.3. I started with 3.12.4, then...
https://stackoverflow.com/questions/78905620/typeerror-forwardref-evaluate-missing-1-required-keyword-only-argument-rec
python, python-3.x, nlp, spacy, sentence
1,724,411,655
se_78892215
stackoverflow
ARTIFICIAL_INTELLIGENCE
Spacy/Torch fbgemm dependency
Spacy/Torch fbgemm dependency I'm trying to work with spacy to do some nlp in Python. Just for some background, I'm running on a windows PC with an Intel UHD Graphics card (So no cuda). I tried installing the cpu form of pytorch with pip3 install torch torchvision torchaudio as per the website, and I tried pip install...
https://stackoverflow.com/questions/78892215/spacy-torch-fbgemm-dependency
python, pytorch, nlp, spacy
1,724,153,755
se_75912852
stackoverflow
ARTIFICIAL_INTELLIGENCE
Input 0 of layer "lstm_1" is incompatible with the layer: expected ndim=3, found ndim=2. Full shape received: (None, 256)
Input 0 of layer "lstm_1" is incompatible with the layer: expected ndim=3, found ndim=2. Full shape received: (None, 256) I am trying to build a generative LSTM model using tensorflow2. I am new to using LSTM layer in tensorflow. the code is given below:: vec = layers.TextVectorization(output_sequence_length...
https://stackoverflow.com/questions/75912852/input-0-of-layer-lstm-1-is-incompatible-with-the-layer-expected-ndim-3-found
keras, nlp, lstm, tensorflow2.0
1,680,448,274
se_78912171
stackoverflow
ARTIFICIAL_INTELLIGENCE
How to Visualize Cross-Attention Matrices in MarianMTModel During Output Generation
How to Visualize Cross-Attention Matrices in MarianMTModel During Output Generation I am working on a machine translation task using the MarianMTModel from the Hugging Face transformers library. Specifically, I want to visualize the cross-attention matrices during the model's translation process. However, I encountere...
https://stackoverflow.com/questions/78912171/how-to-visualize-cross-attention-matrices-in-marianmtmodel-during-output-generat
python, pytorch, nlp, huggingface-transformers
1,724,616,834
se_78661728
stackoverflow
ARTIFICIAL_INTELLIGENCE
implement a search engine chain using tavily in langchain
implement a search engine chain using tavily in langchain I want to implement a search engine chain using tavily in langchain. This chain gives user's query as an input and returns up to 5 related documents. Each retrieved document must have the content of the document as page_content and the url of the corresponding ...
https://stackoverflow.com/questions/78661728/implement-a-search-engine-chain-using-tavily-in-langchain
python, nlp, search-engine, langchain, chain
1,719,223,266
se_68114414
stackoverflow
ARTIFICIAL_INTELLIGENCE
How to load a percentage of data from huggingface load_dataset
How to load a percentage of data from huggingface load_dataset I am trying to download the "librispeech_asr" dataset which totals 29GB, but due to limited space in google colab, I'm not able to download/load the dataset i.e. the notebook crashes. So I did some research and found the split argument that we can pass in ...
https://stackoverflow.com/questions/68114414/how-to-load-a-percentage-of-data-from-huggingface-load-dataset
python, nlp, speech-recognition, huggingface-transformers, huggingface-datasets
1,624,532,112
se_78905614
stackoverflow
ARTIFICIAL_INTELLIGENCE
Why doesn't permuting positional encodings in BERT affect the output as expected?
Why doesn't permuting positional encodings in BERT affect the output as expected? I am working on a Jupyter notebook about Transformers. In the section on positional encodings, I want to demonstrate that the Transformer relies entirely on positional encoding to understand the order of the sequence. I previously le...
https://stackoverflow.com/questions/78905614/why-doesnt-permuting-positional-encodings-in-bert-affect-the-output-as-expected
python, pytorch, nlp, huggingface-transformers
1,724,411,528
se_78901998
stackoverflow
ARTIFICIAL_INTELLIGENCE
How does OpenAIEmbeddings() work? Is it creating a single vector of size 1536 for whole text corpus?
How does OpenAIEmbeddings() work? Is it creating a single vector of size 1536 for whole text corpus? I'm working with the OpenAIEmbeddings() class from OpenAI, which uses the text-embedding-3-small model. According to the documentation, it generates a 1536-dimensional vector for any input text. However, I'm a bit conf...
https://stackoverflow.com/questions/78901998/how-does-openaiembeddings-work-is-it-creating-a-single-vector-of-size-1536-fo
deep-learning, nlp, openai-api, openaiembeddings
1,724,335,765
se_78901247
stackoverflow
ARTIFICIAL_INTELLIGENCE
UDPipe 2 Models in R
UDPipe 2 Models in R I am not entirely happy with udpipe 2.5. Latin models available through the library udpipe, and looking for a way to use newer (2.12 or 2.14) models listed here. However, it seems that they are only available in Python: Compared to UDPipe 1, it is Python-only, it does not perform tokenization, an...
https://stackoverflow.com/questions/78901247/udpipe-2-models-in-r
r, nlp, udpipe
1,724,325,104
se_74494620
stackoverflow
ARTIFICIAL_INTELLIGENCE
spacy doc.char_span raises error whenever there is any number in string
spacy doc.char_span raises error whenever there is any number in string I was trying to train a model from spacy. I have strings and their token offsets saved into the JSON file. I have read that file using utf-8 encoding and there is no special character in it. But it raises TypeError: object of type 'NoneType' has n...
https://stackoverflow.com/questions/74494620/spacy-doc-char-span-raises-error-whenever-there-is-any-number-in-string
python, json, nlp, spacy, spacy-3
1,668,800,709
se_72298933
stackoverflow
ARTIFICIAL_INTELLIGENCE
RuntimeError: Expected 3-dimensional tensor, but got 2-dimensional tensor for argument
RuntimeError: Expected 3-dimensional tensor, but got 2-dimensional tensor for argument I have two tensors names: wy and x, both of them with size 8: import torch wy = torch.tensor([[7.2, -2.9, 5.2, -8.4, -3.8, -6.9, 7.4, -8.1]]) x = torch.tensor([[70., 77., 101., 75., 40., 83., 48., 73.]]) Now, I want to do bmm to ...
https://stackoverflow.com/questions/72298933/runtimeerror-expected-3-dimensional-tensor-but-got-2-dimensional-tensor-for-ar
python, pytorch, nlp, matrix-multiplication, allennlp
1,652,937,210
se_57543359
stackoverflow
ARTIFICIAL_INTELLIGENCE
Poor lemmatization in Apple's Natural Language framework
Poor lemmatization in Apple's Natural Language framework I did a quick experiment to check the accuracy of lemmatization in Apple's Natural Language framework and the results are quite poor. I wonder if I am doing something wrong or if the framework is really that bad. For the experiment, I used code straight fr...
https://stackoverflow.com/questions/57543359/poor-lemmatization-in-apples-natural-language-framework
ios, macos, nlp, lemmatization
1,566,121,568
se_77094149
stackoverflow
ARTIFICIAL_INTELLIGENCE
How to use both gpus in kaggle for training in pytorch?
How to use both gpus in kaggle for training in pytorch? I was training a model in kaggle gpu. But as I can see only one GPU is working. I use the ordinary method for training like device = torch.device('cuda') if torch.cuda.is_available() else torch.device('cpu') model = model.to(device) How can I use both the gpus?
https://stackoverflow.com/questions/77094149/how-to-use-both-gpus-in-kaggle-for-training-in-pytorch
machine-learning, deep-learning, nlp, gpu, kaggle
1,694,580,984
se_78887743
stackoverflow
ARTIFICIAL_INTELLIGENCE
Does Padding in a Batch of Sequences Affect Performance? How Effective is the Attention Mask?
Does Padding in a Batch of Sequences Affect Performance? How Effective is the Attention Mask? In Transformer models, sequences of variable lengths are typically padded to the maximum length in a batch. However, if my sequence lengths vary significantly, the batch may contain a substantial amount of padding (potentiall...
https://stackoverflow.com/questions/78887743/does-padding-in-a-batch-of-sequences-affect-performance-how-effective-is-the-at
pytorch, nlp, huggingface-transformers, transformer-model
1,724,068,146
se_74593919
stackoverflow
ARTIFICIAL_INTELLIGENCE
How to evaluate SciSpaCy's entity linking
How to evaluate SciSpaCy's entity linking I'm using SciSpaCy's Entity Linker with a custom knowledge base. As I'm updating some components of my application (e.g. the underlying language model, sentence tokenization pipeline, the knowledge base itself, etc), I'm noticing that (1) the number of entities that the ap...
https://stackoverflow.com/questions/74593919/how-to-evaluate-scispacys-entity-linking
nlp, spacy, entity-linking
1,669,584,443
se_78461078
stackoverflow
ARTIFICIAL_INTELLIGENCE
How to optimize this function and improve running time?
How to optimize this function and improve running time? I have function aimed at creating a data-frame with three columns; bigram-phrase, count (of the bigram-phrase), and PMI score (for the bigram-phrase). Since I want to run this on a large dataset with over a million phrases, the compute time is incredibly long. I ...
https://stackoverflow.com/questions/78461078/how-to-optimize-this-function-and-improve-running-time
python, performance, optimization, nlp, nltk
1,715,354,280
se_61221751
stackoverflow
ARTIFICIAL_INTELLIGENCE
Why does importing NLTK in python gives error
Why does importing NLTK in python gives error I upgraded NLTK to latest version and while import nltk, I get the following error import nltk File "C:\ProgramData\Anaconda2\lib\site-packages\nltk\tag\sequential.py", line 210 print("[Trained Unigram tagger:", end=" ") ^ Sy...
https://stackoverflow.com/questions/61221751/why-does-importing-nltk-in-python-gives-error
nlp, nltk, token
1,586,927,514
se_78884336
stackoverflow
ARTIFICIAL_INTELLIGENCE
How to parse multiple chunks in nltk?
How to parse multiple chunks in nltk? is it possible to parse multiple chunks in a single nltk.regexp parser? can grammar have multiple chunks define like this? def parser(s): grammar = """ NP: {<DT>?<JJ>*<NN>+} VN: {<VB.?><DT>?<NN>} """ words = nltk.word_tokenize(s) tagged_words = nltk.pos_tag...
https://stackoverflow.com/questions/78884336/how-to-parse-multiple-chunks-in-nltk
python, regex, nlp, nltk
1,723,977,006
se_52039847
stackoverflow
ARTIFICIAL_INTELLIGENCE
Excluding the Header and Footer Contents of a page of a PDF file while extracting text?
Excluding the Header and Footer Contents of a page of a PDF file while extracting text? Is it possible to exclude the contents of footers and headers of a page from a pdf file during extracting the text from it. As these contents are least important and almost redundant. Note: For extracting the text from the .pdf fi...
https://stackoverflow.com/questions/52039847/excluding-the-header-and-footer-contents-of-a-page-of-a-pdf-file-while-extractin
python-3.x, pdf, text, nlp, pypdf
1,535,374,402
se_78878132
stackoverflow
ARTIFICIAL_INTELLIGENCE
how to extract data from website including all of its internal links in Python
how to extract data from website including all of its internal links in Python I want to extract all the information from a website including from its internal links for the purpose of ceating chatbot for this website . how can i do this ? I have scrap the main site like https://www.uetmardan.edu.pk/uetm/ but i want t...
https://stackoverflow.com/questions/78878132/how-to-extract-data-from-website-including-all-of-its-internal-links-in-python
web-scraping, nlp, chatbot, langchain, rag
1,723,794,751
se_25735644
stackoverflow
ARTIFICIAL_INTELLIGENCE
Python - RegEx for splitting text into sentences (sentence-tokenizing)
Python - RegEx for splitting text into sentences (sentence-tokenizing) I want to make a list of sentences from a string and then print them out. I don't want to use NLTK to do this. So it needs to split on a period at the end of the sentence and not at decimals or abbreviations or title of a name or if the sentence h...
https://stackoverflow.com/questions/25735644/python-regex-for-splitting-text-into-sentences-sentence-tokenizing
python, regex, nlp, tokenize
1,410,227,757
se_78862691
stackoverflow
ARTIFICIAL_INTELLIGENCE
`mlflow.transformers.log_model()` does not finish
`mlflow.transformers.log_model()` does not finish Problem I want to use mlflow.transformers.log_model() to log a finetuned huggingface model. However, when the mlflow.transformers.log_model method is running, it simply does not finish - runs forever - throws no errors. I suspect my configuration is not right, the mode...
https://stackoverflow.com/questions/78862691/mlflow-transformers-log-model-does-not-finish
python, nlp, huggingface-transformers, mlflow, mlops
1,723,480,052
se_78781354
stackoverflow
ARTIFICIAL_INTELLIGENCE
Azure AI Search Scoring Profiles are not modifying the score retrival
Azure AI Search Scoring Profiles are not modifying the score retrival I have been using Azure Ai search and scoring profiles to boost the documents of my index that come form the 'reviewed' source that means I want to send to the very TOP documents that have the string 'reviewed' on the field source, so I configured t...
https://stackoverflow.com/questions/78781354/azure-ai-search-scoring-profiles-are-not-modifying-the-score-retrival
python, azure, nlp, azure-ai-search
1,721,702,234
se_76678783
stackoverflow
ARTIFICIAL_INTELLIGENCE
langchain&#39;s chroma vectordb.similarity_search_with_score() and vectordb.similarity_search_with_relevancy_scores() returning the same output
langchain&#39;s chroma vectordb.similarity_search_with_score() and vectordb.similarity_search_with_relevancy_scores() returning the same output I have been working with langchain's chroma vectordb. It has two methods for running similarity search with scores. vectordb.similarity_search_with_score() vectordb.similarit...
https://stackoverflow.com/questions/76678783/langchains-chroma-vectordb-similarity-search-with-score-and-vectordb-similari
nlp, langchain
1,689,247,181
se_78823069
stackoverflow
ARTIFICIAL_INTELLIGENCE
HuggingFace LLM Evaluate: RuntimeError: isin_Tensor_Tensor_out only works on floating types on MPS for pre MacOS_14_0. Received dtype: Long
HuggingFace LLM Evaluate: RuntimeError: isin_Tensor_Tensor_out only works on floating types on MPS for pre MacOS_14_0. Received dtype: Long Context: I tried to create an evaluation pipeline for a text summary task using HuggingFace evaluate packages. I got the issue of receiving dtype Long for the tensor, but I did no...
https://stackoverflow.com/questions/78823069/huggingface-llm-evaluate-runtimeerror-isin-tensor-tensor-out-only-works-on-flo
pytorch, nlp, apple-m1, huggingface, huggingface-evaluate
1,722,547,156
se_76157465
stackoverflow
ARTIFICIAL_INTELLIGENCE
How to do NLP fill-mask with restricted possible inputs
How to do NLP fill-mask with restricted possible inputs I want to use NLP to fill in a masked word in a text, but instead of choosing from all possible words I want to find which is the more likely of two candidate words. For example, imagine I have a sentence "The [MASK] was stuck in the tree" and I want to evaluate ...
https://stackoverflow.com/questions/76157465/how-to-do-nlp-fill-mask-with-restricted-possible-inputs
nlp, mask, huggingface
1,683,048,830
se_78864545
stackoverflow
ARTIFICIAL_INTELLIGENCE
How to update an already Fine-tuned GPT2 model?
How to update an already Fine-tuned GPT2 model? I have trained my model using GPT-2 for my dataset. It has been trained and is giving the correct output. Now, I want to train my model on more data while retaining the previously trained model. I do not want to create a new model; I only want to use the previous one wit...
https://stackoverflow.com/questions/78864545/how-to-update-an-already-fine-tuned-gpt2-model
nlp, dataset, huggingface-transformers, gpt-2
1,723,527,888
se_78865486
stackoverflow
ARTIFICIAL_INTELLIGENCE
SpaCy Matcher with optional suffix in pattern reports multiple matches on same text
SpaCy Matcher with optional suffix in pattern reports multiple matches on same text Using the following Matcher rule: {'label': 'R-1', 'pattern': [{'TEXT': 'MyLabel'}, {'TEXT': ':', 'OP': '?'}], 'greedy': 'LONGEST', } on the text: 'MyLabel: Some Value' I get two matches: 'MyLabel' and 'MyLabel:' For me, that was qu...
https://stackoverflow.com/questions/78865486/spacy-matcher-with-optional-suffix-in-pattern-reports-multiple-matches-on-same-t
nlp, spacy, matcher
1,723,541,843
se_78870698
stackoverflow
ARTIFICIAL_INTELLIGENCE
Is it necessary for torch_dtype when loading a model and the precision for trainable weights to be different? If so, why?
Is it necessary for torch_dtype when loading a model and the precision for trainable weights to be different? If so, why? According to this comment in the huggingface/peft package, if a model is loaded in fp16, the trainable weights must be cast to fp32. From this comment, I understand that generally, the torch_dtype ...
https://stackoverflow.com/questions/78870698/is-it-necessary-for-torch-dtype-when-loading-a-model-and-the-precision-for-train
python, pytorch, nlp, huggingface-transformers, large-language-model
1,723,635,568
se_78462357
stackoverflow
ARTIFICIAL_INTELLIGENCE
How to use Spacy-PyTextRank in newer versions?
How to use Spacy-PyTextRank in newer versions? I'm trying to do key phrase extraction with TextRank, I have installed 3.3.0 version, nltk and the en_core_web_trf are on 3.7.3, i dont know if this is the problem. This is the error that I got import pytextrank nlp=spacy.load('en_core_web_trf') nlp.add_pipe("textrank") ...
https://stackoverflow.com/questions/78462357/how-to-use-spacy-pytextrank-in-newer-versions
python, nlp, artificial-intelligence, spacy, textrank
1,715,371,912
se_77636586
stackoverflow
ARTIFICIAL_INTELLIGENCE
Extracting titles from PDFs based on formatting via classification
Extracting titles from PDFs based on formatting via classification I have about 20000 pdfs with probably 100 different layouts. Unfortunately, not all PDFs contain clean metadata. People are often lazy and did not always provide the title with it or sometimes a very short one or even worse just the file name as title....
https://stackoverflow.com/questions/77636586/extracting-titles-from-pdfs-based-on-formatting-via-classification
python, pdf, nlp
1,702,245,060
se_78859329
stackoverflow
ARTIFICIAL_INTELLIGENCE
Fairseq Installation Fails: Missing version.txt Error During Build Pyhton 3.11 how to fix?
Fairseq Installation Fails: Missing version.txt Error During Build Pyhton 3.11 how to fix? I am trying to install the fairseq library using pip in a Conda environment, but the installation fails with the following error error: subprocess-exited-with-error × Getting requirements to build wheel did not run successfully...
https://stackoverflow.com/questions/78859329/fairseq-installation-fails-missing-version-txt-error-during-build-pyhton-3-11-h
nlp, huggingface-transformers, fairseq
1,723,407,646
se_78857426
stackoverflow
ARTIFICIAL_INTELLIGENCE
Error when using inputs_embeds with generate method
Error when using inputs_embeds with generate method I'm encountering a problem when trying to use inputs_embeds to pass the embedding to my model: ValueError: You passed `inputs_embeds` to `.generate()`, but the model class LlamaForCausalLM doesn't have its forwarding implemented. See the GPT2 implementation for an ex...
https://stackoverflow.com/questions/78857426/error-when-using-inputs-embeds-with-generate-method
nlp, huggingface-transformers, large-language-model, embedding, word-embedding
1,723,345,658
se_78853409
stackoverflow
ARTIFICIAL_INTELLIGENCE
NLLB Fine-Tuning Error: Missing data_prefix Configuration (English-German Translation)
NLLB Fine-Tuning Error: Missing data_prefix Configuration (English-German Translation) I'm attempting to fine-tune the NLLB model "facebook/nllb-200-distilled-600M" for a scientific translation task from English (eng_Latn) to German (deu_Latn). I followed the official guidelines for fine-tuning by authors of nllb. Doc...
https://stackoverflow.com/questions/78853409/nllb-fine-tuning-error-missing-data-prefix-configuration-english-german-transl
python, nlp, machine-translation, fine-tuning, fairseq
1,723,214,814
se_78520203
stackoverflow
ARTIFICIAL_INTELLIGENCE
what are from_messages, from_template, format, format_messages in language? Can someone simplify?
what are from_messages, from_template, format, format_messages in language? Can someone simplify? Can you give me the context on when to use and why of the above mentioned functions? I tried reading the docs but couldn't understand much. Any referecnces to blogs or links for this would be helpful as well. Here are the...
https://stackoverflow.com/questions/78520203/what-are-from-messages-from-template-format-format-messages-in-language-can
python, nlp, prompt, langchain
1,716,416,123
se_76878134
stackoverflow
ARTIFICIAL_INTELLIGENCE
Where to find spacy.py file to rename
Where to find spacy.py file to rename I am attempting to install spacy and have tried a number of methods using pip, conda, and installing directing from git. However, I am running into the same error: --------------------------------------------------------------------------- AttributeError ...
https://stackoverflow.com/questions/76878134/where-to-find-spacy-py-file-to-rename
python, nlp, spacy
1,691,689,245
se_28041012
stackoverflow
ARTIFICIAL_INTELLIGENCE
Closest match for job titles
Closest match for job titles I have master list of known job titles and looking for ways to extract the same from the searched term. For example: Searched job title: Senior Digital Marketing Specialist Extracted to: Senior Digital Marketing Searched job title: Retail In-Store Sales Assistant; Full Time Extracted to:...
https://stackoverflow.com/questions/28041012/closest-match-for-job-titles
java, nlp, extract, data-analysis, summarization
1,421,743,771
se_78836208
stackoverflow
ARTIFICIAL_INTELLIGENCE
Removing bi-grams after tokenization for TfidfVectorizer
Removing bi-grams after tokenization for TfidfVectorizer I'm attempting to remove bi-grams that are created by TfidfVectorizer. I'm using text.TfidfVectorizer so that I can use my own preprocessor function. Test strings and preprocessor function: doc2 = ['this is a test past performance here is another that has aa aa...
https://stackoverflow.com/questions/78836208/removing-bi-grams-after-tokenization-for-tfidfvectorizer
python, scikit-learn, nlp, preprocessor, tfidfvectorizer
1,722,887,200
se_68472183
stackoverflow
ARTIFICIAL_INTELLIGENCE
word-embedding: Convert supervised model into unsupervised model
word-embedding: Convert supervised model into unsupervised model I want to load an pre-trained embedding to initialize my own unsupervise FastText model and retrain with my dataset. The trained embedding file I have loads fine with gensim.models.KeyedVectors.load_word2vec_format('model.txt'). But when I try: FastText....
https://stackoverflow.com/questions/68472183/word-embedding-convert-supervised-model-into-unsupervised-model
python, nlp, gensim, unsupervised-learning, fasttext
1,626,880,722
se_78838899
stackoverflow
ARTIFICIAL_INTELLIGENCE
How to find a text name of Tool classes in LangChain?
How to find a text name of Tool classes in LangChain? The LangChain documentation states that it offers integrations with various services and APIs to let agents interact with the world. These agents are mostly available under langchain_community or langchain_core packages. Code examples show that tools can be loaded ...
https://stackoverflow.com/questions/78838899/how-to-find-a-text-name-of-tool-classes-in-langchain
nlp, langchain
1,722,945,373
se_50821166
stackoverflow
ARTIFICIAL_INTELLIGENCE
Difference between CBOW and Skipgram gradients in word2vec?
Difference between CBOW and Skipgram gradients in word2vec? Why are f values that are greater than or lower than MAX_EXP taken into account during the updates in CBOW, but ignored in Skipgram? I'm specifically looking at the Google implementation of word2vec, but the same functionality has been replicated throughout...
https://stackoverflow.com/questions/50821166/difference-between-cbow-and-skipgram-gradients-in-word2vec
c++, nlp, word2vec
1,528,818,501
se_78828397
stackoverflow
ARTIFICIAL_INTELLIGENCE
Polars/Spark/SQL Standardize similar company names in table column
Polars/Spark/SQL Standardize similar company names in table column I have a table with a column of company names. The same company can appear with a variety of names (e.g. 'Ciao', 'Ciao Inc', 'Ciao Inc User'). I want to provide the same company under different names with a unique identifier, as per the following examp...
https://stackoverflow.com/questions/78828397/polars-spark-sql-standardize-similar-company-names-in-table-column
python, sql, pyspark, nlp, python-polars
1,722,679,070
se_78823329
stackoverflow
ARTIFICIAL_INTELLIGENCE
Text summarization with deep learning
Text summarization with deep learning I'm finetuning the Mt5 model on the Arabic part of the Xl-sum data set For ten epochs and the resulted manipulation model was stored in hugging face library, there were good results on the training and the validation loss as well as the Rouge measure was around 60, but when doing...
https://stackoverflow.com/questions/78823329/text-summarization-with-deep-learning
python, pandas, dataframe, nlp, model
1,722,554,724
se_78822037
stackoverflow
ARTIFICIAL_INTELLIGENCE
Guidance on Extracting Compliance Items from PDF documents by fine-tuning a LLM
Guidance on Extracting Compliance Items from PDF documents by fine-tuning a LLM Need some guidance on extracting large compliance items from raw PDF documents. I have csv with these compliance items and I want to fine-tune a LLM such that if it reads any new PDF documents it can firstly identify the compliance items a...
https://stackoverflow.com/questions/78822037/guidance-on-extracting-compliance-items-from-pdf-documents-by-fine-tuning-a-llm
nlp, large-language-model, text-extraction
1,722,529,399
se_78424055
stackoverflow
ARTIFICIAL_INTELLIGENCE
&quot;torch.cuda.OutOfMemoryError: CUDA out of memory&quot; when loading llama model with Flan v2 dataset
&quot;torch.cuda.OutOfMemoryError: CUDA out of memory&quot; when loading llama model with Flan v2 dataset I am trying to fine tune the llama model meta-llama/Meta-Llama-3-8B-Instruct on the Flan v2 dataset FlanV2. I have an experiment function that is the first thing that will be run, where I try to load my model impo...
https://stackoverflow.com/questions/78424055/torch-cuda-outofmemoryerror-cuda-out-of-memory-when-loading-llama-model-with
python, pytorch, nlp, huggingface-transformers, llama
1,714,731,354
se_43377265
stackoverflow
ARTIFICIAL_INTELLIGENCE
Determine if text is in English?
Determine if text is in English? I am using both Nltk and Scikit Learn to do some text processing. However, within my list of documents I have some documents that are not in English. For example, the following could be true: [ "this is some text written in English", "this is some more text written in English", ...
https://stackoverflow.com/questions/43377265/determine-if-text-is-in-english
python, scikit-learn, nlp, nltk
1,492,022,492
se_76476765
stackoverflow
ARTIFICIAL_INTELLIGENCE
Training LLM to perform text classification
Training LLM to perform text classification I am trying to perform text classification using GPTNeo, using the tweet_eval dataset from huggingface. I am following this example https://huggingface.co/docs/transformers/tasks/sequence_classification, but there is some error. I am a beginner at LLMs and it will be very he...
https://stackoverflow.com/questions/76476765/training-llm-to-perform-text-classification
nlp, huggingface, large-language-model
1,686,769,102
se_78809281
stackoverflow
ARTIFICIAL_INTELLIGENCE
ImportError: cannot import name &#39;pre_init&#39; from &#39;langchain_core.utils&#39;
ImportError: cannot import name &#39;pre_init&#39; from &#39;langchain_core.utils&#39; When I want to install langchain libraries from requirements.txt I'm getting ImportError: cannot import name 'pre_init' from 'langchain_core.utils' I've tried to install libraries from terminal using these commands : pip install g...
https://stackoverflow.com/questions/78809281/importerror-cannot-import-name-pre-init-from-langchain-core-utils
python, pip, nlp, langchain, large-language-model
1,722,293,953
se_69874966
stackoverflow
ARTIFICIAL_INTELLIGENCE
How to process a very long document in spaCy?
How to process a very long document in spaCy? I'm trying to perform a NLP analysis of a text in Spanish. So, to do lemmatization I'm using Spacy, because NLTK has not a Spanish version for lemma. The problem with Spacy is that I a have restriction in the numbers of words that I can pass through Lemmatizer: ValueError...
https://stackoverflow.com/questions/69874966/how-to-process-a-very-long-document-in-spacy
nlp, spacy, lemmatization
1,636,306,633
se_78801734
stackoverflow
ARTIFICIAL_INTELLIGENCE
Classifying texts using word embeddings
Classifying texts using word embeddings I'm trying to train a model that is able to classify short texts (200-600 words per text). I got a training set with their corresponding labels, and a text might have one or more labels. My first approach was to use TF-IDF with Naive Bayes but it wasn't performing very well. But...
https://stackoverflow.com/questions/78801734/classifying-texts-using-word-embeddings
text, nlp, classification, text-classification, openaiembeddings
1,722,092,843
se_78801372
stackoverflow
ARTIFICIAL_INTELLIGENCE
Huggingface Mistral-Nemo-Instruct-2407 python script for text generation just hanging on Mac M3?
Huggingface Mistral-Nemo-Instruct-2407 python script for text generation just hanging on Mac M3? I installed pytorch, transformers, and python-dotenv to run this script: from transformers import pipeline from dotenv import load_dotenv import torch import os import json # from transformers import AutoTokenizer, AutoMo...
https://stackoverflow.com/questions/78801372/huggingface-mistral-nemo-instruct-2407-python-script-for-text-generation-just-ha
python, pytorch, nlp, huggingface-transformers, text-generation
1,722,083,080
se_77512691
stackoverflow
ARTIFICIAL_INTELLIGENCE
Retrieval-augmented generation without OpenAIEmbeddings
Retrieval-augmented generation without OpenAIEmbeddings I'm playing with HuggingFace and some of the models on there. I'm trying to achieve something along the lines of RAG. Seems like a pretty clear guide with all the needed ingredients and recipe. But the cooking sequence is what I need help. What I want to do: Hav...
https://stackoverflow.com/questions/77512691/retrieval-augmented-generation-without-openaiembeddings
python, nlp, artificial-intelligence, langchain
1,700,431,880
se_65939855
stackoverflow
ARTIFICIAL_INTELLIGENCE
Spacy Custom Name Entity Recognition (NER) &#39;catastrophic forgetting&#39; issue
Spacy Custom Name Entity Recognition (NER) &#39;catastrophic forgetting&#39; issue The model is unable to remember the previous labels on which it was trained i know that its 'catastrophic forgetting', but no example or blog seems to help this issue. the most common response for this is this blog is this https://explo...
https://stackoverflow.com/questions/65939855/spacy-custom-name-entity-recognition-ner-catastrophic-forgetting-issue
python, nlp, spacy, named-entity-recognition, doccano
1,611,846,477
se_78797321
stackoverflow
ARTIFICIAL_INTELLIGENCE
How to host NLP model as API?
How to host NLP model as API? I have trained a chatbot model and want to integrate it into an Android app. My goal is to enable chatbot functionality in the app by hosting the model as an API so users can interact with it. I'm looking for free solutions to host the model. Can you suggest some free hosting options and ...
https://stackoverflow.com/questions/78797321/how-to-host-nlp-model-as-api
android, nlp
1,721,987,114
se_78793489
stackoverflow
ARTIFICIAL_INTELLIGENCE
CPU Memory Leak While Inference Models in Infinite Loop
CPU Memory Leak While Inference Models in Infinite Loop I'm experiencing a CPU memory leak while running a Python script that processes text using various NLP models in an infinite loop. The script includes language translation, sentiment analysis, and topic classification. Here's a simplified version of the problemat...
https://stackoverflow.com/questions/78793489/cpu-memory-leak-while-inference-models-in-infinite-loop
pytorch, nlp, memory-leaks, gpu, huggingface-transformers
1,721,912,787
se_78786280
stackoverflow
ARTIFICIAL_INTELLIGENCE
execute lucene query in multiple language utilizing AI Model
execute lucene query in multiple language utilizing AI Model We have requirement to support multiple language search for the same field. for example title is "Badminton" and subject is "sports" I want to search in solr like title:Badminton AND subject:sports. this simply works for english but how do i search same docu...
https://stackoverflow.com/questions/78786280/execute-lucene-query-in-multiple-language-utilizing-ai-model
nlp, solr, artificial-intelligence, knn, huggingface
1,721,791,865
se_78794857
stackoverflow
ARTIFICIAL_INTELLIGENCE
LDA is predicting same topics for all data
LDA is predicting same topics for all data I'm using the German political speech dataset to train the LDA model. My goal here is to categorize each speech into some topics. But the problem is that the generated topics are too similar, and all speech prediction is predicting the same topic. Tried to play with parameter...
https://stackoverflow.com/questions/78794857/lda-is-predicting-same-topics-for-all-data
python, text, nlp, lda, speech
1,721,930,849
se_73963171
stackoverflow
ARTIFICIAL_INTELLIGENCE
ROUGE score metric for non-English (Arabic) language is not working
ROUGE score metric for non-English (Arabic) language is not working ROUGE score metric is not working for Arabic evaluation, what should I do? !pip install rouge_score from datasets import load_metric metric= load_metric("rouge") pred_str =['السلام عليكم كيف حالك'] label_str=['السلام عليكم صديقي كيف حالك'] metric.ad...
https://stackoverflow.com/questions/73963171/rouge-score-metric-for-non-english-arabic-language-is-not-working
nlp, metrics, huggingface-transformers, summarization, rouge
1,664,985,648
se_78778988
stackoverflow
ARTIFICIAL_INTELLIGENCE
Do I need to use Named Entity Recognition (NER) in tokenization?
Do I need to use Named Entity Recognition (NER) in tokenization? I am working on an NLP project for sentiment analysis. I am using SpaCy to tokenize sentences. As I was reading the documentation, I learned about NER. I've read that it can be used to extract entities from text for aiding a user's searching. The thing I...
https://stackoverflow.com/questions/78778988/do-i-need-to-use-named-entity-recognition-ner-in-tokenization
python, python-3.x, nlp, spacy, named-entity-recognition
1,721,654,894
se_18717536
stackoverflow
ARTIFICIAL_INTELLIGENCE
In python, how can I distinguish between a human readable word and a random string?
In python, how can I distinguish between a human readable word and a random string? Examples of words: ball encyclopedia tableau Examples of random strings: qxbogsac jgaynj rnnfdwpm Of course it may happen that a random string will actually be a word in some language or look like one. But basically a human bei...
https://stackoverflow.com/questions/18717536/in-python-how-can-i-distinguish-between-a-human-readable-word-and-a-random-stri
python, string, random, nlp, heuristics
1,378,811,943
se_71590785
stackoverflow
ARTIFICIAL_INTELLIGENCE
NLP: check if a detected sentence is a complete sentence
NLP: check if a detected sentence is a complete sentence In my NLP project I build my own model to identify sentences in a PDF document. Now I would like to check if my extracted sentences are complete sentences. During my research I have already come across this question, with the solutions presented there allowing q...
https://stackoverflow.com/questions/71590785/nlp-check-if-a-detected-sentence-is-a-complete-sentence
python, nlp, nltk, spacy, grammar
1,648,053,112
se_78779077
stackoverflow
ARTIFICIAL_INTELLIGENCE
Transformer models for contextual word embedding in large datasets
Transformer models for contextual word embedding in large datasets I'm interested in using contextual word embeddings generated by a transformer-based model to explore the similarity of certain words in a large dataset. Most transformer models only allow up to 512 tokens of input. So presumably I would need to break t...
https://stackoverflow.com/questions/78779077/transformer-models-for-contextual-word-embedding-in-large-datasets
python, nlp, transformer-model, word-embedding
1,721,656,131
se_78764467
stackoverflow
ARTIFICIAL_INTELLIGENCE
How to deal with word counts of zero when calculating Pointwise Mutual Information (PMI) for word cooccurrences in Natural Language Processing
How to deal with word counts of zero when calculating Pointwise Mutual Information (PMI) for word cooccurrences in Natural Language Processing I have a co-occurrence matrix of words in a text (two words x and y are considered co-occurring, if they both occur in a context window of w words). I want to calculate the Poi...
https://stackoverflow.com/questions/78764467/how-to-deal-with-word-counts-of-zero-when-calculating-pointwise-mutual-informati
nlp, statistics, divide-by-zero
1,721,306,161
se_47493897
stackoverflow
ARTIFICIAL_INTELLIGENCE
In spacy, Is it possible to get the corresponding rule id in a match of matches
In spacy, Is it possible to get the corresponding rule id in a match of matches In Spacy 2.x, I use the matcher to find specific tokens in my text corpus. Each rule has an ID ('class-1_0' for example). During parse, I use the callback on_match to handle each match. Is there a solution to retrieve the rule used to find...
https://stackoverflow.com/questions/47493897/in-spacy-is-it-possible-to-get-the-corresponding-rule-id-in-a-match-of-matches
nlp, matcher, spacy
1,511,680,897
se_78773758
stackoverflow
ARTIFICIAL_INTELLIGENCE
IndexError: list index out of range, when trying to predict from the fine tuned model using Hugginface
IndexError: list index out of range, when trying to predict from the fine tuned model using Hugginface i am trying to learn on how to fine tune a pretrained model and use it. this is my code from transformers import AutoModelForSequenceClassification, AutoTokenizer, TrainingArguments, Trainer from datasets import load...
https://stackoverflow.com/questions/78773758/indexerror-list-index-out-of-range-when-trying-to-predict-from-the-fine-tuned
nlp, huggingface-transformers, huggingface, fine-tuning
1,721,504,683
se_78739816
stackoverflow
ARTIFICIAL_INTELLIGENCE
Enhancing Document Layout Analysis by Adding Positional and Character Information to CNN Inputs
Enhancing Document Layout Analysis by Adding Positional and Character Information to CNN Inputs I am working on document layout analysis and have been exploring CNNs and transformer-based networks for this task. Typically, images are passed as 3-channel RGB inputs to these networks. However, my data source is in PDF f...
https://stackoverflow.com/questions/78739816/enhancing-document-layout-analysis-by-adding-positional-and-character-informatio
machine-learning, nlp, neural-network, conv-neural-network, ocr
1,720,779,449
se_72951775
stackoverflow
ARTIFICIAL_INTELLIGENCE
How to get rid of the &#39;nlp.max_length&#39; limit?
How to get rid of the &#39;nlp.max_length&#39; limit? I am trying to do custom NER using spacy for articles; but when I start to train the model I get the error saying, "[E088] Text of length 1021312 exceeds maximum of 1000000...." Tried the following solutions : i. Increasing nlp.max_length = 1500000 ii.Used spacy "...
https://stackoverflow.com/questions/72951775/how-to-get-rid-of-the-nlp-max-length-limit
nlp, spacy, named-entity-recognition, maxlength
1,657,626,307
se_78772541
stackoverflow
ARTIFICIAL_INTELLIGENCE
Identify starting row of actual data in Pandas DataFrame with merged header cells
Identify starting row of actual data in Pandas DataFrame with merged header cells My original df looks like this - df Note in the data frame: The headers are there till row 3 & from row 4 onwards, the values for those headers are starting. The numbers of rows & columns merged to create the headers are not same The va...
https://stackoverflow.com/questions/78772541/identify-starting-row-of-actual-data-in-pandas-dataframe-with-merged-header-cell
python, pandas, dataframe, nlp, bert-language-model
1,721,472,926
se_76199337
stackoverflow
ARTIFICIAL_INTELLIGENCE
How to add new language to NLLB tokenizer in Huggingface?
How to add new language to NLLB tokenizer in Huggingface? No Language Left Behind (NLLB) is the machine translation model available on https://huggingface.co/facebook/nllb-200-distilled-600M It supports a list of languages but to add a new language in the tokenizer, the follow code runs successfully but the language t...
https://stackoverflow.com/questions/76199337/how-to-add-new-language-to-nllb-tokenizer-in-huggingface
python, nlp, huggingface-tokenizers, machine-translation
1,683,538,947
se_78754664
stackoverflow
ARTIFICIAL_INTELLIGENCE
Why my nlp model reload many times when processing question?
Why my nlp model reload many times when processing question? After receiving question, my program calls the run_predict function then finds the best paragraph match with the question. After that, my model is constantly reloaded without knowing the reasons. from flask import Flask, render_template, request, jsonify fro...
https://stackoverflow.com/questions/78754664/why-my-nlp-model-reload-many-times-when-processing-question
python, flask, nlp, simpletransformers
1,721,133,825
se_68158379
stackoverflow
ARTIFICIAL_INTELLIGENCE
How to track progress with nlp.pipe function of spacy?
How to track progress with nlp.pipe function of spacy? I'm coding with Python and Spacy. I want to track the progress of the execution of nlp.pipe(sentences) because it lasts a lot. How to do that? nlp = spacy.load('en_core_web_sm') sentences = [...] docs = nlp.pipe(sentences, n_process=8)
https://stackoverflow.com/questions/68158379/how-to-track-progress-with-nlp-pipe-function-of-spacy
python, nlp, pipe, spacy, tracking
1,624,860,894
se_9879276
stackoverflow
ARTIFICIAL_INTELLIGENCE
How do I evaluate a text summarization tool?
How do I evaluate a text summarization tool? I have written a system that summarizes a long document containing thousands of words. Are there any norms on how such a system should be evaluated in the context of a user survey? In short, is there a metric for evaluating the time that my tool has saved a human? Currentl...
https://stackoverflow.com/questions/9879276/how-do-i-evaluate-a-text-summarization-tool
language-agnostic, nlp, information-retrieval, evaluation
1,332,793,564
se_55367637
stackoverflow
ARTIFICIAL_INTELLIGENCE
How to combine the results of multiple OCR tools to get better text recognition
How to combine the results of multiple OCR tools to get better text recognition Imagine, you have different OCR tools to read text from images but none of them gives you a 100% accurate output. Combined however, the result could come very close to the ground truth - What would be the best technique to "fuse" the text ...
https://stackoverflow.com/questions/55367637/how-to-combine-the-results-of-multiple-ocr-tools-to-get-better-text-recognition
nlp, computer-vision, ocr, sensor-fusion
1,553,642,911
se_78744975
stackoverflow
ARTIFICIAL_INTELLIGENCE
BERT embedding cosine similarities look very random and useless
BERT embedding cosine similarities look very random and useless I thought you can use BERT embeddings to determine semantic similarity. I was trying to group some words in categories using this, but the results were very bad. E.g. here is a small example with animals and fruits. Notice that the highest similarity is b...
https://stackoverflow.com/questions/78744975/bert-embedding-cosine-similarities-look-very-random-and-useless
python, machine-learning, nlp, bert-language-model, cosine-similarity
1,720,904,329
se_4806176
stackoverflow
ARTIFICIAL_INTELLIGENCE
What are the most challenging issues in Sentiment Analysis(opinion mining)?
What are the most challenging issues in Sentiment Analysis(opinion mining)? Opinion Mining/Sentiment Analysis is a somewhat recent subtask of Natural Language processing.Some compare it to text classification,some take a more deep stance towards it. What do you think about the most challenging issues in Sentiment Anal...
https://stackoverflow.com/questions/4806176/what-are-the-most-challenging-issues-in-sentiment-analysisopinion-mining
nlp, sentiment-analysis
1,296,054,934
se_61279917
stackoverflow
ARTIFICIAL_INTELLIGENCE
Multi-classification of Text using NLP python - Recall is relatively very less for 2 categories out of total categories
Multi-classification of Text using NLP python - Recall is relatively very less for 2 categories out of total categories I am having almost balanced dataset of 9 unique categories, each having almost 2200 rows with difference of +/-100 rows. To create model , i have used below mentioned urls approach but in each case m...
https://stackoverflow.com/questions/61279917/multi-classification-of-text-using-nlp-python-recall-is-relatively-very-less-f
python, machine-learning, nlp
1,587,154,357
se_77684999
stackoverflow
ARTIFICIAL_INTELLIGENCE
GooglePalm(). NotImplementedError: Need to determine which default deprecation schedule to use. within ?? minor releases
GooglePalm(). NotImplementedError: Need to determine which default deprecation schedule to use. within ?? minor releases this code was working fine before, and now it raise this error when calling GooglePalm with langchain. The error: ----> 8 llm = GooglePalm(). NotImplementedError: Need to determine which default dep...
https://stackoverflow.com/questions/77684999/googlepalm-notimplementederror-need-to-determine-which-default-deprecation-s
nlp, langchain, large-language-model, palm-pre
1,702,986,818
se_78738444
stackoverflow
ARTIFICIAL_INTELLIGENCE
Text summarizations of comments and replace the duplicates with the first occurrence if the meaning is comment is same
Text summarizations of comments and replace the duplicates with the first occurrence if the meaning is comment is same Context - Doing an NLP project to analyze comments column in a data frame. I want to replace the duplicates with the first occurrence if the meaning of the comments are same. I wants to compare all th...
https://stackoverflow.com/questions/78738444/text-summarizations-of-comments-and-replace-the-duplicates-with-the-first-occurr
nlp, transformer-model, summarization
1,720,754,289
se_68461204
stackoverflow
ARTIFICIAL_INTELLIGENCE
Continual pre-training vs. Fine-tuning a language model with MLM
Continual pre-training vs. Fine-tuning a language model with MLM I have some custom data I want to use to further pre-train the BERT model. I’ve tried the two following approaches so far: Starting with a pre-trained BERT checkpoint and continuing the pre-training with Masked Language Modeling (MLM) + Next Sentence Pr...
https://stackoverflow.com/questions/68461204/continual-pre-training-vs-fine-tuning-a-language-model-with-mlm
deep-learning, nlp, huggingface-transformers, bert-language-model, pre-trained-model
1,626,814,364
se_69270917
stackoverflow
ARTIFICIAL_INTELLIGENCE
OSError: [E050] Can&#39;t find model &#39;xx_ent_wiki_sm&#39;. It doesn&#39;t seem to be a Python package or a valid path to a data directory
OSError: [E050] Can&#39;t find model &#39;xx_ent_wiki_sm&#39;. It doesn&#39;t seem to be a Python package or a valid path to a data directory Hi I already learn ML at windows and try to migrate to ubuntu and learn NLP.I already install spacy and model via terminal and termintal in /usr/local/lib/python3.8/dist-package...
https://stackoverflow.com/questions/69270917/oserror-e050-cant-find-model-xx-ent-wiki-sm-it-doesnt-seem-to-be-a-pytho
python, nlp, pycharm, spacy
1,632,235,270
se_64533392
stackoverflow
ARTIFICIAL_INTELLIGENCE
How to get all string variations where two adjacent letters are switched / swapped
How to get all string variations where two adjacent letters are switched / swapped What is the most elegant way to get all possible variations of a string where two adjacent letters are switched? For Example, if we have the string 'stack' the desired result should be: ['tsack', 'satck', 'stcak', 'stakc'] My solution:...
https://stackoverflow.com/questions/64533392/how-to-get-all-string-variations-where-two-adjacent-letters-are-switched-swapp
python, string, list, nlp, autocorrect
1,603,699,523
se_78715101
stackoverflow
ARTIFICIAL_INTELLIGENCE
How is coherence score calculated in Mallet?
How is coherence score calculated in Mallet? I do understand how the diagnostics output shows the coherence values for each topic but my values range between -150 and -600 and other posts that I have seen where Mallet was used show coherence scores that seem to range between 0.0-1.0. Is there a command in Mallet (or a...
https://stackoverflow.com/questions/78715101/how-is-coherence-score-calculated-in-mallet
nlp, lda, topic-modeling, mallet, topicmodels
1,720,276,408
se_78710185
stackoverflow
ARTIFICIAL_INTELLIGENCE
not able END function using &quot;add_conditional_edges&quot; in lang graph
not able END function using &quot;add_conditional_edges&quot; in lang graph this is my code: import os from dotenv import load_dotenv load_ dotenv() from langchain_openai import ChatOpenAI from langgraph.graph import StateGraph, END from langgraph.graph import Graph, MessagesState from typing import Annotated, Any,...
https://stackoverflow.com/questions/78710185/not-able-end-function-using-add-conditional-edges-in-lang-graph
nlp, langchain, langgraph
1,720,164,558
se_78707861
stackoverflow
ARTIFICIAL_INTELLIGENCE
How to make dynamic API calls based on user input in a Gemini application python nlp?
How to make dynamic API calls based on user input in a Gemini application python nlp? I'm working on a Gemini application where I need to make dynamic API calls based on user input. Specifically, I want to perform different API requests depending on the user's query. For example, if the user asks for the latest news, ...
https://stackoverflow.com/questions/78707861/how-to-make-dynamic-api-calls-based-on-user-input-in-a-gemini-application-python
python, nlp, request, google-cloud-vertex-ai, google-gemini
1,720,105,878
se_78536420
stackoverflow
ARTIFICIAL_INTELLIGENCE
How to save python loop output to an excel file
How to save python loop output to an excel file I have an excel file (input.xlsx) that contains two columns (id and url). I performed webscrapping on all the url and performed text analysis on the texts. I have functions that calculates the positive score, negative score, polarity etc. I want to create an output file(...
https://stackoverflow.com/questions/78536420/how-to-save-python-loop-output-to-an-excel-file
python, excel, nlp
1,716,755,955
se_78637651
stackoverflow
ARTIFICIAL_INTELLIGENCE
Trying to run GermanSentiment in Python on 10k to 30k texts, keeps crashing? Possibly too large dataset?
Trying to run GermanSentiment in Python on 10k to 30k texts, keeps crashing? Possibly too large dataset? I want to do sentiment analysis on 2 datasets of tweets, one with 9k strings and one with 30k strings. I have imported GermanSentiment and it ran just fine with the demo code from GitHub, but when I applied it to t...
https://stackoverflow.com/questions/78637651/trying-to-run-germansentiment-in-python-on-10k-to-30k-texts-keeps-crashing-pos
python, nlp, sentiment-analysis, bert-language-model
1,718,716,003
se_64704561
stackoverflow
ARTIFICIAL_INTELLIGENCE
Exporting text sequences with labels from Inception Annotation engine
Exporting text sequences with labels from Inception Annotation engine I am using INCEpTION (https://inception-project.github.io/) to annotate my legal documents. Instead of any of the export formats provided in Inception, is there a way I could export the raw text sequences I labelled, along with their label names? Th...
https://stackoverflow.com/questions/64704561/exporting-text-sequences-with-labels-from-inception-annotation-engine
nlp, annotations, inception
1,604,606,684
se_78122448
stackoverflow
ARTIFICIAL_INTELLIGENCE
NLTagger.requestAssets(for: language, tagScheme: .lemma) never returns
NLTagger.requestAssets(for: language, tagScheme: .lemma) never returns I am new to NLP. I need to Lemmatise a sentence. But the request for assets never returns. Here is the code: if !NLTagger.availableTagSchemes(for: .word, language: .english).contains(.lemma) { NLTagger.requestAssets(for: .english, tagScheme: .l...
https://stackoverflow.com/questions/78122448/nltagger-requestassetsfor-language-tagscheme-lemma-never-returns
ios, swift, nlp
1,709,824,619
se_78697141
stackoverflow
ARTIFICIAL_INTELLIGENCE
GliNER finetuning - no validation loss is logging
GliNER finetuning - no validation loss is logging I am trying to fine-tune using this notebook: GLiNER/examples/finetune.ipynb at main · urchade/GLiNER (github.com) However, the logs only show 'loss' , which I assume is the training data set loss, but there is no recorded validation set loss training_args = TrainingAr...
https://stackoverflow.com/questions/78697141/gliner-finetuning-no-validation-loss-is-logging
python, pytorch, nlp, named-entity-recognition, huggingface-trainer
1,719,924,282
se_78693093
stackoverflow
ARTIFICIAL_INTELLIGENCE
How can I make my Hugging Face fine-tuned model&#39;s config.json file reference a specific revision/commit from the original pretrained model?
How can I make my Hugging Face fine-tuned model&#39;s config.json file reference a specific revision/commit from the original pretrained model? I uploaded this model: https://huggingface.co/pamessina/CXRFE, which is a fine-tuned version of this model: https://huggingface.co/microsoft/BiomedVLP-CXR-BERT-specialized Unf...
https://stackoverflow.com/questions/78693093/how-can-i-make-my-hugging-face-fine-tuned-models-config-json-file-reference-a-s
nlp, huggingface-transformers, bert-language-model, huggingface, huggingface-hub
1,719,848,128
se_78612251
stackoverflow
ARTIFICIAL_INTELLIGENCE
How do we add/modify the normalizer in a pretrained Huggingface tokenizer?
How do we add/modify the normalizer in a pretrained Huggingface tokenizer? Given a Huggingface tokenizer that already have a normalizer, e.g. "mistralai/Mistral-7B-v0.1", we can do this to modify the normalizer import json from transformers import AutoTokenizer from tokenizers.normalizers import Sequence, Replace, Pr...
https://stackoverflow.com/questions/78612251/how-do-we-add-modify-the-normalizer-in-a-pretrained-huggingface-tokenizer
python, nlp, large-language-model, huggingface-tokenizers
1,718,190,239
se_75975405
stackoverflow
ARTIFICIAL_INTELLIGENCE
Python, using pdfplumber, pdfminer packages extract text from pdf, bolded characters duplicates
Python, using pdfplumber, pdfminer packages extract text from pdf, bolded characters duplicates Goal: extract Chinese financial report text Implementation: Python pdfplumber/pdfminer package to extract PDF text to txt problem: for PDF text in bold, corresponding extracted text in txt duplicates Examples are as follows...
https://stackoverflow.com/questions/75975405/python-using-pdfplumber-pdfminer-packages-extract-text-from-pdf-bolded-charac
pdf, nlp, extract, cjk, pdfplumber
1,681,114,654
se_54905774
stackoverflow
ARTIFICIAL_INTELLIGENCE
why softmax get small gradient when the value is large in paper &#39;Attention is all you need&#39;
why softmax get small gradient when the value is large in paper &#39;Attention is all you need&#39; This is the screen of the original paper: the screen of the paper. I understand the meaning of the paper is that when the value of dot-product is large, the gradient of softmax will get very small. However, I tried to c...
https://stackoverflow.com/questions/54905774/why-softmax-get-small-gradient-when-the-value-is-large-in-paper-attention-is-al
deep-learning, nlp, softmax, attention-model
1,551,271,334
se_77893479
stackoverflow
ARTIFICIAL_INTELLIGENCE
Unable to upload documents in Chroma DB
Unable to upload documents in Chroma DB While uploading document chunks in chroma db using the following code - with tqdm(total = len(dataset["train"])) as pbar: for i in dataset["train"]: try: doc = Document(page_content = i["some_value"], metadata = {"video_id" : i["some_other_value"]}) doc_chunks ...
https://stackoverflow.com/questions/77893479/unable-to-upload-documents-in-chroma-db
nlp, embedding, chromadb
1,706,409,523
se_78685093
stackoverflow
ARTIFICIAL_INTELLIGENCE
Alternative to Receptive field in Transformers and what factors impact it
Alternative to Receptive field in Transformers and what factors impact it I have two transformer networks. One with 3 heads per attention and 15 layers in total and second one with 5 heads per layer and 30 layers in total. Given an arbitrary set of documents (2048 tokens per each), how to find out, which network is go...
https://stackoverflow.com/questions/78685093/alternative-to-receptive-field-in-transformers-and-what-factors-impact-it
nlp, huggingface-transformers, receptive-field
1,719,637,110
se_78678870
stackoverflow
ARTIFICIAL_INTELLIGENCE
&quot;KeyError: 0&quot; when calling model.fit() in Keras
&quot;KeyError: 0&quot; when calling model.fit() in Keras I am training a simple sequential model for NLP in keras. Here is the model architecture: from keras.models import Sequential from keras import layers from keras.layers import Embedding, Flatten, Dense embedding_dim = 500 model = Sequential() model.add(layer...
https://stackoverflow.com/questions/78678870/keyerror-0-when-calling-model-fit-in-keras
python, keras, nlp
1,719,505,912