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_78347994 | stackoverflow | ARTIFICIAL_INTELLIGENCE | What is the easiest way of converting json to vector database | What is the easiest way of converting json to vector database
I need to convert a json file to vector database. I use chromadb.
collection.add(
documents=["This is a document", "This is another document"],
metadatas=[{"source": "my_source"}, {"source": "my_source"}],
ids=["id1", "id2"]
)
This code is used... | https://stackoverflow.com/questions/78347994/what-is-the-easiest-way-of-converting-json-to-vector-database | python, nlp, large-language-model, vector-database | 1,713,448,463 |
se_79669458 | stackoverflow | ARTIFICIAL_INTELLIGENCE | OpenCC Not Accepting Any Segmentation Type | OpenCC Not Accepting Any Segmentation Type
I've been trying to use OpenCC on Mac OS Sequoia. The default conversion works without any issues, however, trying to use a custom glossary (I've successfully created my .json and .ocd2 files), I keep running into the following error:
$ opencc -c "/Users/f/Downloads/zh-test/c... | https://stackoverflow.com/questions/79669458/opencc-not-accepting-any-segmentation-type | nlp, chinese-locale, machine-translation | 1,750,177,238 |
se_79583668 | stackoverflow | ARTIFICIAL_INTELLIGENCE | Can older spaCy models be ported to future spaCy versions? | Can older spaCy models be ported to future spaCy versions?
The latest spaCy versions have better performance and compatibility for GPU acceleration on Apple devices, but I have an existing project that depends on spaCy 3.1.4 and some of the specific behavior of the 3.1.0 models (web lg, web trf).
Would it be possible ... | https://stackoverflow.com/questions/79583668/can-older-spacy-models-be-ported-to-future-spacy-versions | python, nlp, gpu, spacy | 1,745,176,202 |
se_74279005 | stackoverflow | ARTIFICIAL_INTELLIGENCE | Tokenizer.from_file() HUGGINFACE : Exception: data did not match any variant of untagged enum ModelWrapper | Tokenizer.from_file() HUGGINFACE : Exception: data did not match any variant of untagged enum ModelWrapper
I am having issue loading a Tokenizer.from_file() BPE tokenizer.
When I try I am encountering this error where the line 11743 is the last last one:
Exception: data did not match any variant of untagged enum Model... | https://stackoverflow.com/questions/74279005/tokenizer-from-file-hugginface-exception-data-did-not-match-any-variant-of | json, nlp, huggingface-transformers, huggingface-tokenizers, huggingface | 1,667,320,481 |
se_1003326 | stackoverflow | ARTIFICIAL_INTELLIGENCE | Is there a natural language parser for date/times in javascript? | Is there a natural language parser for date/times in javascript?
Is there a natural language parser for date/times in javascript? | https://stackoverflow.com/questions/1003326/is-there-a-natural-language-parser-for-date-times-in-javascript | javascript, datetime, nlp | 1,245,178,480 |
se_47917287 | stackoverflow | ARTIFICIAL_INTELLIGENCE | How to hand-engineer features of TfidfVectorizer in Scikit-learn? | How to hand-engineer features of TfidfVectorizer in Scikit-learn?
I am trying to cluster documents by keywords. I'm using the following code to make a tdidf-matrix:
from sklearn.feature_extraction.text import TfidfVectorizer
tfidf_vectorizer = TfidfVectorizer(max_df=.8, max_features=1000,
... | https://stackoverflow.com/questions/47917287/how-to-hand-engineer-features-of-tfidfvectorizer-in-scikit-learn | python, scikit-learn, nlp | 1,513,825,085 |
se_23053688 | stackoverflow | ARTIFICIAL_INTELLIGENCE | How to detect duplicates among text documents and return the duplicates' similarity? | How to detect duplicates among text documents and return the duplicates' similarity?
I'm writing a crawler to get content from some website, but the content can duplicated, I want
to avoid that. So I need a function can return the same percent between two text to detect two content maybe duplicated Example:
Te... | https://stackoverflow.com/questions/23053688/how-to-detect-duplicates-among-text-documents-and-return-the-duplicates-similar | algorithm, information-retrieval, text-analysis | 1,397,458,224 |
se_31902283 | stackoverflow | ARTIFICIAL_INTELLIGENCE | CLIPS command line prompt for Mac | CLIPS command line prompt for Mac
I have downloaded the dmg file for CLIPS, the rule based language system due to NASA. But I am not able to find any executable that lets me run the command prompt version of CLIPS on mac. I have thoroughly checked all the folders and have googled to no end.
Also, is there any other m... | https://stackoverflow.com/questions/31902283/clips-command-line-prompt-for-mac | nlp, clips | 1,439,108,368 |
se_34907456 | stackoverflow | ARTIFICIAL_INTELLIGENCE | How can I get a morphological variation of a lemma in a Java program? | How can I get a morphological variation of a lemma in a Java program?
I'm currently using Stanford Core NLP to get word lemmas from text. Is there any way using Java to run this "in reverse"? For example, suppose I have the lemma "come" and I want to get the gerund form ('VBG' POS tag) "coming". | https://stackoverflow.com/questions/34907456/how-can-i-get-a-morphological-variation-of-a-lemma-in-a-java-program | java, nlp, stanford-nlp, lemmatization | 1,453,313,580 |
se_79660191 | stackoverflow | ARTIFICIAL_INTELLIGENCE | Can't iterare Textblob classifier in a dataframe | Can't iterare Textblob classifier in a dataframe
I've been successful in training a TextBlob NaiveBayes sentiment classifier, with fairly high accuracy, and I'm trying to iterate it in a comment dataset to do a coder reliability test. The only issue is that the method listed on the TextBlob documentation only appl... | https://stackoverflow.com/questions/79660191/cant-iterare-textblob-classifier-in-a-dataframe | python, nlp, naivebayes, textblob, iterated-function | 1,749,548,767 |
se_79658561 | stackoverflow | ARTIFICIAL_INTELLIGENCE | What is the appropriate shape and values of the tensor expected by ModernBertSequentialClassification? with Candle in Rust | What is the appropriate shape and values of the tensor expected by ModernBertSequentialClassification? with Candle in Rust
I don't understand appropriate shape and values of the tensor expected by ModernBertSequentialClassification finetuning in Candle of Rust.
Is there a formula to determine the appropriate shape an... | https://stackoverflow.com/questions/79658561/what-is-the-appropriate-shape-and-values-of-the-tensor-expected-by-modernbertseq | nlp, bert-language-model | 1,749,456,588 |
se_77440953 | stackoverflow | ARTIFICIAL_INTELLIGENCE | LLM Question answer models for yes or no answers | LLM Question answer models for yes or no answers
imagine I have the following dataset:
import pandas as pd
# Positive and negative sentences
positive_sentences = [
"I love this product!",
"The weather is beautiful today.",
"The team did an excellent job.",
"She is a very talented musician."
]
negativ... | https://stackoverflow.com/questions/77440953/llm-question-answer-models-for-yes-or-no-answers | nlp, huggingface-transformers, large-language-model, nlp-question-answering | 1,699,385,289 |
se_58062557 | stackoverflow | ARTIFICIAL_INTELLIGENCE | Matching two-word variants with each other if they don't match alphabetically | Matching two-word variants with each other if they don't match alphabetically
I'm doing a NLP project with my university, collecting data on words in Icelandic that exist both spelled with an i and with a y (they sound the same in Icelandic fyi) where the variants are both actual words but do not mean the same thi... | https://stackoverflow.com/questions/58062557/matching-two-word-variants-with-each-other-if-they-dont-match-alphabetically | python, nlp, word-list | 1,569,242,010 |
se_79381185 | stackoverflow | ARTIFICIAL_INTELLIGENCE | Is it possible to evaluate Machine Translations using Sentence BERT? | Is it possible to evaluate Machine Translations using Sentence BERT?
I'm not referring to BERTScore. BERTScore uses token-level word embeddings, you compute pairwise cosine similarity of word embeddings and obtain scores using greedy matching.
I'm referring to Sentence BERT. I.e., pure cosine similarity to compare sem... | https://stackoverflow.com/questions/79381185/is-it-possible-to-evaluate-machine-translations-using-sentence-bert | machine-learning, nlp, bert-language-model, machine-translation, sentence-similarity | 1,737,638,287 |
se_79502509 | stackoverflow | ARTIFICIAL_INTELLIGENCE | Difference between TfIdf vectorizer and kwx | Difference between TfIdf vectorizer and kwx
I am looking at querying a text database based on keywords and getting the relevant chunks. I want to know what is the difference between python's kwx package and sklearn's tfidfvectoriser in implementing this. Even though kwx extracts keywords and topics, looks like I can't... | https://stackoverflow.com/questions/79502509/difference-between-tfidf-vectorizer-and-kwx | nlp, large-language-model, tf-idf, tfidfvectorizer, keyword-search | 1,741,745,999 |
se_52787309 | stackoverflow | ARTIFICIAL_INTELLIGENCE | Removing nonsense words in python | Removing nonsense words in python
I want to remove nonsense words in my dataset.
I tried which I saw StackOverflow something like this:
import nltk
words = set(nltk.corpus.words.words())
sent = "Io andiamo to the beach with my amico."
" ".join(w for w in nltk.wordpunct_tokenize(sent) \
if w.lower() in words or... | https://stackoverflow.com/questions/52787309/removing-nonsense-words-in-python | python, machine-learning, nlp, nltk | 1,539,380,327 |
se_79652783 | stackoverflow | ARTIFICIAL_INTELLIGENCE | no_grad causing problem in Pytorch NN model | no_grad causing problem in Pytorch NN model
I'm building regression neural network model for my NLP data.
But can't get through this error: RuntimeError: element 0 of tensors does not require grad and does not have a grad_fn
What should I do?
ChatGPT says:
it's requires_grad=False somewhere in the code which isn't tr... | https://stackoverflow.com/questions/79652783/no-grad-causing-problem-in-pytorch-nn-model | python, pytorch, nlp | 1,749,040,793 |
se_57532679 | stackoverflow | ARTIFICIAL_INTELLIGENCE | Why "GELU" activation function is used instead of ReLu in BERT? | Why "GELU" activation function is used instead of ReLu in BERT?
The activation function Gaussian Error Linear Units(GELUs) is used in the popular NLP model BERT. Is there any solid reason ? | https://stackoverflow.com/questions/57532679/why-gelu-activation-function-is-used-instead-of-relu-in-bert | deep-learning, nlp | 1,566,005,661 |
se_63617007 | stackoverflow | ARTIFICIAL_INTELLIGENCE | Analysing YouTube comments using Python -- parameter has disabled comments | Analysing YouTube comments using Python -- parameter has disabled comments
I'm trying to get into text analysis using YouTube comments. I've been using the code from the following website to scrape YouTube:
https://www.pingshiuanchua.com/blog/post/using-youtube-api-to-analyse-youtube-comments-on-python
The script star... | https://stackoverflow.com/questions/63617007/analysing-youtube-comments-using-python-parameter-has-disabled-comments | python, youtube, nlp | 1,598,534,666 |
se_79647877 | stackoverflow | ARTIFICIAL_INTELLIGENCE | Appending list for NLP (stopwords) | Appending list for NLP (stopwords)
I am using this Twitter dataset for NLP analysis.
To do a text analysis for text mining classes I wanted to remove unnecessary words.
Therefore I downloaded stopwords dataset.
nltk.download('stopwords')
stop=set(stopwords.words('english'))
In the dataset I'm using there are lots of ... | https://stackoverflow.com/questions/79647877/appending-list-for-nlp-stopwords | python, nlp, data-mining, text-mining | 1,748,807,501 |
se_76029717 | stackoverflow | ARTIFICIAL_INTELLIGENCE | Having trouble correctly importing tensorflow Tokenizer and tensorflow padded_sequences | Having trouble correctly importing tensorflow Tokenizer and tensorflow padded_sequences
I have a neural network that takes data from a txt file and uses nlp to learn how to speak like a human. But whenever I load Tokenizer and padded_sequences, (which are both needed)
they do not correctly import.
I believe that there... | https://stackoverflow.com/questions/76029717/having-trouble-correctly-importing-tensorflow-tokenizer-and-tensorflow-padded-se | python, tensorflow, neural-network, nlp | 1,681,670,862 |
se_27975767 | stackoverflow | ARTIFICIAL_INTELLIGENCE | What are `lexpr` and `ApplicationExpression` nltk? | What are `lexpr` and `ApplicationExpression` nltk?
What exactly does lexpr mean and what do the folloring r'/F x.x mean? Also what is Application Expression?
from nltk.sem.logic import *
lexpr = Expression.fromstring
zero = lexpr(r'\F x.x')
one = lexpr(r'\F x.F(x)')
two = lexpr(r'\F x.F(F(x))')
three = lexpr(r'\F x.... | https://stackoverflow.com/questions/27975767/what-are-lexpr-and-applicationexpression-nltk | python, nlp, nltk, semantics, first-order-logic | 1,421,370,117 |
se_29476963 | stackoverflow | ARTIFICIAL_INTELLIGENCE | comparing synonyms NLTK | comparing synonyms NLTK
I can't come up with a stranger problem, guess you'll help me.
for p in wn.synsets('change'):<br>
print(p)
Getting:
Synset('change.n.01')
Synset('change.n.02')
Synset('change.n.03')
Synset('change.n.04')
Synset('change.n.05')
Synset('change.n.06')
Synset('change.n.07')
Synset('change.n.... | https://stackoverflow.com/questions/29476963/comparing-synonyms-nltk | python, nlp, nltk, wordnet, synonym | 1,428,343,983 |
se_79640408 | stackoverflow | ARTIFICIAL_INTELLIGENCE | What's the most efficient way to calculate word counts for 4m records and a word list containing 1 and 2 grams? | What's the most efficient way to calculate word counts for 4m records and a word list containing 1 and 2 grams?
Here is my problem. I have a very large file with about 4m rows, where each row has something like a paragraph of text. Then I have a word list with about 150 terms, some are 1-grams and some are 2-grams... | https://stackoverflow.com/questions/79640408/whats-the-most-efficient-way-to-calculate-word-counts-for-4m-records-and-a-word | python, pandas, optimization, parallel-processing, nlp | 1,748,346,059 |
se_79638902 | stackoverflow | ARTIFICIAL_INTELLIGENCE | What should I set as LoRA target_modules for each stage of continued pretraining on Qwen2.5-VL-Instruct using Unsloth? | What should I set as LoRA target_modules for each stage of continued pretraining on Qwen2.5-VL-Instruct using Unsloth?
I would like to perform continued pretraining of Qwen2.5-VL-Instruct using Unsloth + LoRA, following a three-stage training process:
Stage 1: Train only the projector (Alignment)
Stage 2: Train both ... | https://stackoverflow.com/questions/79638902/what-should-i-set-as-lora-target-modules-for-each-stage-of-continued-pretraining | python, nlp, huggingface-transformers, large-language-model, peft | 1,748,262,346 |
se_79633111 | stackoverflow | ARTIFICIAL_INTELLIGENCE | How to properly save and load a PEFT-trained Unsloth model with resized token embeddings? | How to properly save and load a PEFT-trained Unsloth model with resized token embeddings?
I'm using Unsloth's FastVisionModel with the base model unsloth/qwen2-VL-2B-Instruct to train on a dataset that includes text with many unique characters. Here's the overall process I followed:
Training Steps I Took:
Load the ba... | https://stackoverflow.com/questions/79633111/how-to-properly-save-and-load-a-peft-trained-unsloth-model-with-resized-token-em | nlp, huggingface-transformers, tokenize, peft, text-generation | 1,747,890,456 |
se_79605339 | stackoverflow | ARTIFICIAL_INTELLIGENCE | Tokenize and pad text sequences using TensorFlow for NLP classification | Tokenize and pad text sequences using TensorFlow for NLP classification
I'm working on a text classification problem using TensorFlow and NLP. I'm using the Tokenizer and pad_sequences utilities from tensorflow.keras.preprocessing.text. However, I'm encountering issues with sequence lengths and model input shapes.
fro... | https://stackoverflow.com/questions/79605339/tokenize-and-pad-text-sequences-using-tensorflow-for-nlp-classification | python, tensorflow, nlp | 1,746,339,824 |
se_79619113 | stackoverflow | ARTIFICIAL_INTELLIGENCE | Generating partial string as output after fine-tuning T5 model | Generating partial string as output after fine-tuning T5 model
I'm using fine-tuned T5 model for performing spell checks in my dataset of consisting of reviews. However, I'm facing an issue where the model when performing spell checks does not give entire string as an output or sometimes repeats the phrases of the giv... | https://stackoverflow.com/questions/79619113/generating-partial-string-as-output-after-fine-tuning-t5-model | python, machine-learning, nlp, simpletransformers | 1,747,119,840 |
se_79630713 | stackoverflow | ARTIFICIAL_INTELLIGENCE | OpenAI GPT-3 token logprobs and word-level surprisal: inconsistent values and missing outputs for multi-token targets | OpenAI GPT-3 token logprobs and word-level surprisal: inconsistent values and missing outputs for multi-token targets
I’m trying to compute word-level surprisal values for a set of sentence stimuli using OpenAI’s Completions API (legacy endpoint).
In information-theoretic terms, surprisal is the negative base-2 logari... | https://stackoverflow.com/questions/79630713/openai-gpt-3-token-logprobs-and-word-level-surprisal-inconsistent-values-and-mi | python, nlp, huggingface-transformers, tokenize, openai-api | 1,747,753,706 |
se_79313756 | stackoverflow | ARTIFICIAL_INTELLIGENCE | Fetch proximity between two languages through Python | Fetch proximity between two languages through Python
Input 1 - "English"
Input 2 - "French"
Expected Output - 46.9 (Based on this website - http://www.elinguistics.net/Compare_Languages.aspx)
Is there any Python library that supports such a language similarity request? There are plenty of options for checking similari... | https://stackoverflow.com/questions/79313756/fetch-proximity-between-two-languages-through-python | python, nlp | 1,735,388,148 |
se_79629392 | stackoverflow | ARTIFICIAL_INTELLIGENCE | How to build a lightweight rule-based NLP tagger that mimics GPT-style subtext interpretation? | How to build a lightweight rule-based NLP tagger that mimics GPT-style subtext interpretation?
I'm working on a small NLP tool that tags user input with basic subtext labels using plain Python rules.
Instead of using large LLMs, I'm trying to compress interpretive logic into conditionals.
For example:
if "not mad" in ... | https://stackoverflow.com/questions/79629392/how-to-build-a-lightweight-rule-based-nlp-tagger-that-mimics-gpt-style-subtext-i | python, nlp, fastapi, rule-engine | 1,747,684,306 |
se_79520986 | stackoverflow | ARTIFICIAL_INTELLIGENCE | Converting data into spacy format "convert_to_spacy_format" in Name entity recognition Model | Converting data into spacy format "convert_to_spacy_format" in Name entity recognition Model
Dataset structureCan somebody help me with the NER model in converting the data into spacy format.
The dataset format is shown in the screenshot here (https://www.kaggle.com/datasets/naseralqaydeh/named-entity-recogn... | https://stackoverflow.com/questions/79520986/converting-data-into-spacy-format-convert-to-spacy-format-in-name-entity-recog | python, string, nlp, spacy, named-entity-recognition | 1,742,406,233 |
se_63920887 | stackoverflow | ARTIFICIAL_INTELLIGENCE | Whitelist tokens for text generation (XLNet, GPT-2) in huggingface-transformers | Whitelist tokens for text generation (XLNet, GPT-2) in huggingface-transformers
In the documentation on text generation (https://huggingface.co/transformers/main_classes/model.html#generative-models) there is the option to put
bad_words_ids (List[int], optional) – List of token ids that are not allowed to be generated... | https://stackoverflow.com/questions/63920887/whitelist-tokens-for-text-generation-xlnet-gpt-2-in-huggingface-transformers | python-3.x, nlp, pytorch, huggingface-transformers | 1,600,262,138 |
se_79610433 | stackoverflow | ARTIFICIAL_INTELLIGENCE | Natural language to JSON for N8N workflows | Natural language to JSON for N8N workflows
We’re in the early stages of designing a system that converts natural language descriptions of automation workflows into structured JSON outputs, specifically for n8n workflows. The final JSON will be used directly in the n8n UI or sent to an endpoint for activation.
We are c... | https://stackoverflow.com/questions/79610433/natural-language-to-json-for-n8n-workflows | json, nlp, artificial-intelligence, multi-agent, n8n | 1,746,617,859 |
se_79606346 | stackoverflow | ARTIFICIAL_INTELLIGENCE | Not able to generate output on certain reviews by using fine-tune model | Not able to generate output on certain reviews by using fine-tune model
I'm using T5, a text-to-text model for performing spell checks in a given dataset consisting of reviews. The model is fine-tuned in 2 iterations of 20k reviews and 40k reviews each. The training loss and validation loss in this entire process were... | https://stackoverflow.com/questions/79606346/not-able-to-generate-output-on-certain-reviews-by-using-fine-tune-model | python, machine-learning, nlp, huggingface-transformers | 1,746,421,522 |
se_79591863 | stackoverflow | ARTIFICIAL_INTELLIGENCE | import gensim binary incompatibility | import gensim binary incompatibility
import gensim
import numpy
import scipy
print("gensim version:", gensim.__version__)
print("numpy version:", numpy.__version__)
print("scipy version:", scipy.__version__)
ValueError Traceback (most recent call last)
<ipython-input-17-4e23b2e74105> in... | https://stackoverflow.com/questions/79591863/import-gensim-binary-incompatibility | python, numpy, pip, nlp, gensim | 1,745,559,460 |
se_79598098 | stackoverflow | ARTIFICIAL_INTELLIGENCE | Why is this python code not running under first execution? | Why is this python code not running under first execution?
from transformers import pipeline
summarizer = pipeline("summarization")
result = summarizer(
"""
America has changed dramatically during recent years. Not only has the number of
graduates in traditional engineering disciplines such as mechanical... | https://stackoverflow.com/questions/79598098/why-is-this-python-code-not-running-under-first-execution | machine-learning, nlp, artificial-intelligence, huggingface-transformers, large-language-model | 1,745,921,042 |
se_60511708 | stackoverflow | ARTIFICIAL_INTELLIGENCE | AttributeError: module 'sst' has no attribute 'train_reader' | AttributeError: module 'sst' has no attribute 'train_reader'
I am very new to sentiment analysis. Trying to use Stanford Sentiment Treebank(sst) and ran into an error.
from nltk.tree import Tree
import os
import sst
trees = "C:\\Users\m\data\trees"
tree, score = next(sst.train_reader(trees))
[Output... | https://stackoverflow.com/questions/60511708/attributeerror-module-sst-has-no-attribute-train-reader | python, nlp, stanford-nlp, sentiment-analysis | 1,583,253,214 |
se_64738626 | stackoverflow | ARTIFICIAL_INTELLIGENCE | Measuring F1-score for NER | Measuring F1-score for NER
I am trying to evaluate a model of artificial intelligence for NER (Named Entity Recognition).
In order to compare with other benchmarks, I need to calculate the model's F1-score. However, I am unsure how to code this.
My idea was:
True-positives: equal tokens and equal tags, true-positive f... | https://stackoverflow.com/questions/64738626/measuring-f1-score-for-ner | nlp, artificial-intelligence, named-entity-recognition, measurement | 1,604,842,214 |
se_79603499 | stackoverflow | ARTIFICIAL_INTELLIGENCE | Training a custom tokenizer with Huggingface gives weird token splits at inference | Training a custom tokenizer with Huggingface gives weird token splits at inference
So I trained a tokenizer from scratch using Huggingface’s tokenizers library (not AutoTokenizer.from_pretrained, but actually trained a new one). Seemed to go fine, no errors. But when I try to use it during inference, it splits words i... | https://stackoverflow.com/questions/79603499/training-a-custom-tokenizer-with-huggingface-gives-weird-token-splits-at-inferen | python, tensorflow, nlp, bert-language-model | 1,746,193,405 |
se_22118350 | stackoverflow | ARTIFICIAL_INTELLIGENCE | Python - Sentiment Analysis using Pointwise Mutual Information | Python - Sentiment Analysis using Pointwise Mutual Information
from __future__ import division
import urllib
import json
from math import log
def hits(word1,word2=""):
query = "http://ajax.googleapis.com/ajax/services/search/web?v=1.0&q=%s"
if word2 == "":
results = urllib.urlopen(query % word1)
... | https://stackoverflow.com/questions/22118350/python-sentiment-analysis-using-pointwise-mutual-information | python, nlp, nltk, sentiment-analysis | 1,393,697,836 |
se_1383503 | stackoverflow | ARTIFICIAL_INTELLIGENCE | How to determine the (natural) language of a document? | How to determine the (natural) language of a document?
I have a set of documents in two languages: English and German. There is no usable meta information about these documents, a program can look at the content only. Based on that, the program has to decide which of the two languages the document is written in.
Is t... | https://stackoverflow.com/questions/1383503/how-to-determine-the-natural-language-of-a-document | .net, nlp, text-mining | 1,252,162,231 |
se_76535146 | stackoverflow | ARTIFICIAL_INTELLIGENCE | It's possible create a dataset in document ai processor and import documents via python API? | It's possible create a dataset in document ai processor and import documents via python API?
It's possible, to do the steps in the below guide, using the Python API? I saw some documentation about creating processors and training processors via Python API. But, none about creating the dataset and importing documen... | https://stackoverflow.com/questions/76535146/its-possible-create-a-dataset-in-document-ai-processor-and-import-documents-via | machine-learning, nlp, cloud-document-ai | 1,687,462,619 |
se_76633836 | stackoverflow | ARTIFICIAL_INTELLIGENCE | What does langchain CharacterTextSplitter's chunk_size param even do? | What does langchain CharacterTextSplitter's chunk_size param even do?
My default assumption was that the chunk_size parameter would set a ceiling on the size of the chunks/splits that come out of the split_text method, but that's clearly not right:
from langchain.text_splitter import RecursiveCharacterTextSplitter... | https://stackoverflow.com/questions/76633836/what-does-langchain-charactertextsplitters-chunk-size-param-even-do | python, machine-learning, text, nlp, langchain | 1,688,701,827 |
se_68058974 | stackoverflow | ARTIFICIAL_INTELLIGENCE | How to do batch inferenece for Hugging face models? | How to do batch inferenece for Hugging face models?
I want to do batch inference on MarianMT model. Here's the code:
from transformers import MarianTokenizer
tokenizer = MarianTokenizer.from_pretrained('Helsinki-NLP/opus-mt-en-de')
src_texts = [ "I am a small frog.", "Tom asked his teacher for advice."]
tgt_texts = ["... | https://stackoverflow.com/questions/68058974/how-to-do-batch-inferenece-for-hugging-face-models | machine-learning, deep-learning, nlp, huggingface-transformers, machine-translation | 1,624,214,150 |
se_78693499 | stackoverflow | ARTIFICIAL_INTELLIGENCE | UndefinedFile: could not open extension control file "/usr/share/postgresql/14/extension/vector.control": No such file or directory | UndefinedFile: could not open extension control file "/usr/share/postgresql/14/extension/vector.control": No such file or directory
I'm trying to run postgres along with pgvector but getting this error: UndefinedFile: could not open extension control file "/usr/share/postgresql/14/extension/vector.control": ... | https://stackoverflow.com/questions/78693499/undefinedfile-could-not-open-extension-control-file-usr-share-postgresql-14-e | postgresql, vector, nlp, pgvector | 1,719,854,209 |
se_59402205 | stackoverflow | ARTIFICIAL_INTELLIGENCE | Dose Chinese need WordPiece? | Dose Chinese need WordPiece?
I want to use Chinese Bert model. In tokenization.py, I found a WordpieceTokenizer function, but I don't think it is needed to use WordPiece for Chinese, because the minimal unit of Chinese is character.
WordpieceTokenizer is just for English text, am I right? | https://stackoverflow.com/questions/59402205/dose-chinese-need-wordpiece | tensorflow, nlp | 1,576,719,035 |
se_79592549 | stackoverflow | ARTIFICIAL_INTELLIGENCE | Cannot interpret 'dtype('int64')' in NLP Python Code from adashofdata | Cannot interpret 'dtype('int64')' in NLP Python Code from adashofdata
I am trying to run the NLP project shared at https://github.com/adashofdata/nlp-in-python-tutorial, but I am encountering an issue with the code in 4-Topic-Modeling.ipynb. I am running the code on Google Colab and experiencing an err... | https://stackoverflow.com/questions/79592549/cannot-interpret-dtypeint64-in-nlp-python-code-from-adashofdata | python, nlp, google-colaboratory | 1,745,585,280 |
se_79533402 | stackoverflow | ARTIFICIAL_INTELLIGENCE | Creating regular expression(s) which finds capitalization errors | Creating regular expression(s) which finds capitalization errors
This is a Sentence which contains
Some capitalization errors.
So far I have this: (?<![.!?]\s)(?<!^)(?<!\sI\s)(?!I['’][a-z])(?!\b(?:Dr|Mr|Mrs)\.[\s\r\n])\b(?!I\b)[A-Z]\w*
It will find "Sentence" in the above. It avoids hitting on I and I' contractions, ... | https://stackoverflow.com/questions/79533402/creating-regular-expressions-which-finds-capitalization-errors | regex, nlp, capitalization | 1,742,899,633 |
se_77131746 | stackoverflow | ARTIFICIAL_INTELLIGENCE | How to download punkt tokenizer in nltk? | How to download punkt tokenizer in nltk?
I installed the NLTK library using
pip install nltk
and while using the lib
from nltk.tokenize import sent_tokenize
sent_tokenize(text)
I am getting this error
LookupError:
**********************************************************************
Resource punkt not found.
... | https://stackoverflow.com/questions/77131746/how-to-download-punkt-tokenizer-in-nltk | python, machine-learning, nlp, nltk | 1,695,098,219 |
se_70719940 | stackoverflow | ARTIFICIAL_INTELLIGENCE | How to get bag of words and term frequency in text format using Sklearn? | How to get bag of words and term frequency in text format using Sklearn?
I would like to print out the list of words (i.e., bag of words) for each document in a coprus and their respective term frequency (in text format), using Sklearn's CountVectorizer. How could I achieve that?
Here is my code:
from sklearn.feature_... | https://stackoverflow.com/questions/70719940/how-to-get-bag-of-words-and-term-frequency-in-text-format-using-sklearn | python, scikit-learn, nlp, corpus, countvectorizer | 1,642,235,584 |
se_76963864 | stackoverflow | ARTIFICIAL_INTELLIGENCE | Low score and wrong answer for Flan-T5-XXL "question-answering" task | Low score and wrong answer for Flan-T5-XXL "question-answering" task
I'm trying to run Flan-T5-XXL model for a "question-answering" task.
Here's how I loaded and executed the model:
model_id = "~/Downloads/test_LLM/flan-t5-xxl"
tokenizer = AutoTokenizer.from_pretrained(model_id)
model = AutoModelForQuestionA... | https://stackoverflow.com/questions/76963864/low-score-and-wrong-answer-for-flan-t5-xxl-question-answering-task | python, tensorflow, nlp, huggingface-transformers, huggingface | 1,692,813,807 |
se_30843011 | stackoverflow | ARTIFICIAL_INTELLIGENCE | Save and reuse TfidfVectorizer in scikit learn | Save and reuse TfidfVectorizer in scikit learn
I am using TfidfVectorizer in scikit learn to create a matrix from text data. Now I need to save this object to reuse it later. I tried to use pickle, but it gave the following error.
loc=open('vectorizer.obj','w')
pickle.dump(self.vectorizer,loc)
*** TypeError: can't pic... | https://stackoverflow.com/questions/30843011/save-and-reuse-tfidfvectorizer-in-scikit-learn | python, scikit-learn, file-io, nlp, pickle | 1,434,364,538 |
se_70218068 | stackoverflow | ARTIFICIAL_INTELLIGENCE | semantic similarity for mix of languages | semantic similarity for mix of languages
I have a database of several thousands of utterances. Each record (utterance) is a text representing a problem description, which a user has submitted to a service desk. Sometimes also the service desk agent's response is included. The language is highly technical, and it conta... | https://stackoverflow.com/questions/70218068/semantic-similarity-for-mix-of-languages | nlp, spacy, word2vec, bert-language-model, sentence-similarity | 1,638,550,768 |
se_79559702 | stackoverflow | ARTIFICIAL_INTELLIGENCE | NameError: name 'init_empty_weights' is not defined while using hugging face models | NameError: name 'init_empty_weights' is not defined while using hugging face models
I am trying to set up hugging face locally and im running into this issue.
NameError: name 'init_empty_weights' is not defined
Here is the code I have tested my installation with
from transformers import pipeline
classifier = ... | https://stackoverflow.com/questions/79559702/nameerror-name-init-empty-weights-is-not-defined-while-using-hugging-face-mod | nlp, huggingface-transformers, huggingface | 1,744,023,761 |
se_79574001 | stackoverflow | ARTIFICIAL_INTELLIGENCE | Is there a way to reuse a heavy service across tasks in Airflow? | Is there a way to reuse a heavy service across tasks in Airflow?
I'm building an Airflow DAG where some of the steps should do ML/NLP processing.
I have a service class that loads NLP model in constructor. E.g.:
class SentenceService:
def __init__(self, model: str = "abc"):
self.nlp = spacy.load(model)
I'... | https://stackoverflow.com/questions/79574001/is-there-a-way-to-reuse-a-heavy-service-across-tasks-in-airflow | nlp, airflow, microservices | 1,744,664,660 |
se_70308466 | stackoverflow | ARTIFICIAL_INTELLIGENCE | Why are weight matrices shared between embedding layers in 'Attention is All You Need' paper? | Why are weight matrices shared between embedding layers in 'Attention is All You Need' paper?
I am using the Transformer module in pytorch from the paper "Attention is All You Need". On page 5, the authors state that
In our model, we share the same weight matrix between the two embedding layers and the pre-so... | https://stackoverflow.com/questions/70308466/why-are-weight-matrices-shared-between-embedding-layers-in-attention-is-all-you | nlp, pytorch, word-embedding, transformer-model | 1,639,158,171 |
se_52580818 | stackoverflow | ARTIFICIAL_INTELLIGENCE | When is entity replacement necessary for relation extraction? | When is entity replacement necessary for relation extraction?
In this tutorial for "Training a Machine Learning Classifier for Relation Extraction from Medical Literature" the author does Entity replacement because that "we don’t want the model to learn according to a specific entity name, but we want it to learn acco... | https://stackoverflow.com/questions/52580818/when-is-entity-replacement-necessary-for-relation-extraction | machine-learning, nlp | 1,538,331,733 |
se_21514270 | stackoverflow | ARTIFICIAL_INTELLIGENCE | Natural Language Processing Tag definitions | Natural Language Processing Tag definitions
When parsing and tagging the words with OpenNLP i was wondering if the tags (eg S, NP, VP, ADJP) actually mean, i found a few by researching the web, but some of them are still missing,
which i am unable to find, currently my code outputs this:
The movie was really good
\-S... | https://stackoverflow.com/questions/21514270/natural-language-processing-tag-definitions | nlp, artificial-intelligence, opennlp | 1,391,364,726 |
se_7945130 | stackoverflow | ARTIFICIAL_INTELLIGENCE | Natural Language Processing Model | Natural Language Processing Model
I'm making a project to parse, and understand the intentions of input lines by a user in english.
Here is what I think I should do:
Create a text of sentences with POS tagging & marked intentions for every sentence by hand.
Create a model say: decision tree and train it on the above ... | https://stackoverflow.com/questions/7945130/natural-language-processing-model | nlp, machine-learning | 1,319,980,854 |
se_69574624 | stackoverflow | ARTIFICIAL_INTELLIGENCE | How extract text from PDF including images and text | How extract text from PDF including images and text
I am going to extract text from multiple PDF files. The PDF files include text and some images and even some pages are scanned pages (I assumed the scanned pages are like images). I followed the below commands to extract text from PDF files.
How can I edit my command... | https://stackoverflow.com/questions/69574624/how-extract-text-from-pdf-including-images-and-text | python, nlp, text-mining, text-extraction | 1,634,230,791 |
se_61620517 | stackoverflow | ARTIFICIAL_INTELLIGENCE | Extracting Values from text using Python | Extracting Values from text using Python
I have long list of text from a pandas dataframe. However I am going to explain what I want to do just with one example. I have two pre-defined lists. These two-predefined list can be used for extracting the values I need from the text:
ingredient_name_list = ['butter', 'butt... | https://stackoverflow.com/questions/61620517/extracting-values-from-text-using-python | python, nlp | 1,588,703,904 |
se_60723464 | stackoverflow | ARTIFICIAL_INTELLIGENCE | Multi-Label emotion classification | Multi-Label emotion classification
i'm working on an Multi-Label Emotion Classification problem to be solved by word2vec. this is my code that i've learned from a couple of tutorials. now the accuracy is very low. about 0.02 which is telling me something is wrong in my code. but i cannot find it. can anyone find any m... | https://stackoverflow.com/questions/60723464/multi-label-emotion-classification | python, nlp, classification, word2vec, emotion | 1,584,451,960 |
se_79549787 | stackoverflow | ARTIFICIAL_INTELLIGENCE | Why does Presidio with spacy nlp engine not recognize organizations and PESEL while spaCy does? | Why does Presidio with spacy nlp engine not recognize organizations and PESEL while spaCy does?
I'm using spaCy with the pl_core_news_lg model to extract named entities from Polish text. It correctly detects both organizations (ORG) and people's names (PER):
import spacy
nlp = spacy.load("pl_core_news_lg")
text = "Ja... | https://stackoverflow.com/questions/79549787/why-does-presidio-with-spacy-nlp-engine-not-recognize-organizations-and-pesel-wh | python, nlp, spacy, presidio | 1,743,573,371 |
se_61323621 | stackoverflow | ARTIFICIAL_INTELLIGENCE | How to understand hidden_states of the returns in BertModel? | How to understand hidden_states of the returns in BertModel?
Returns last_hidden_state (torch.FloatTensor of shape (batch_size,
sequence_length, hidden_size)): Sequence of hidden-states at the
output of the last layer of the model.
pooler_output (torch.FloatTensor: of shape (batch_size, hidden_size)):
Last layer hidde... | https://stackoverflow.com/questions/61323621/how-to-understand-hidden-states-of-the-returns-in-bertmodel | nlp, pytorch, huggingface-transformers, bert-language-model, electrate | 1,587,389,197 |
se_77994129 | stackoverflow | ARTIFICIAL_INTELLIGENCE | How can I use label studio to annotate text data in google colab? | How can I use label studio to annotate text data in google colab?
How can I use label studio to annotate text data in google colab? And please also suggest good alternatives to label studio which I can easily used in google colab to annotate/label text data?
I tried installing label studio in google colab but unable t... | https://stackoverflow.com/questions/77994129/how-can-i-use-label-studio-to-annotate-text-data-in-google-colab | nlp, label-studio | 1,707,912,001 |
se_75709831 | stackoverflow | ARTIFICIAL_INTELLIGENCE | Zero Accuracy in Sentiment Analysis FFNN Model (Pytorch) | Zero Accuracy in Sentiment Analysis FFNN Model (Pytorch)
I'm constructing a feedforward neural net (FFNN) for binary sentiment classification using movie review dataset. It's a simplified task with only two class labels, i.e., positive (1) and negative (0). It FFNN makes word embeddings, averages them, runs them throu... | https://stackoverflow.com/questions/75709831/zero-accuracy-in-sentiment-analysis-ffnn-model-pytorch | python, deep-learning, pytorch, nlp, sentiment-analysis | 1,678,572,297 |
se_79501178 | stackoverflow | ARTIFICIAL_INTELLIGENCE | Store images instead of showing in a server | Store images instead of showing in a server
I am running the code found on this site in my server and I would like to store images instead of showing them since I have connected remotely with an ssh connection to my server via an SSH connection.
The code is for instance this one:
skip_tokens = [1] # skip the special ... | https://stackoverflow.com/questions/79501178/store-images-instead-of-showing-in-a-server | python, nlp, large-language-model | 1,741,704,631 |
se_76868251 | stackoverflow | ARTIFICIAL_INTELLIGENCE | how to load deberta-v3 properly | how to load deberta-v3 properly
I am trying to fine tune a DeBERTa model for a regression task,
the problem is that when I load the model using this code
from transformers import AutoConfig, AutoTokenizer, AutoModel
## Model Configurations
MODEL_NAME = 'microsoft/deberta-v3-base'
config = AutoConfig.from_pretrained(M... | https://stackoverflow.com/questions/76868251/how-to-load-deberta-v3-properly | python, nlp, huggingface-transformers | 1,691,587,649 |
se_58605143 | stackoverflow | ARTIFICIAL_INTELLIGENCE | dl4j does not contain text and models modules | dl4j does not contain text and models modules
In my project, I need to use the Word2Vec model. I decide to use dl4j for this. I load all dependencies, but there are no modules such as deeplearning4j.text and deeplearning4j.models
I tried to change the version of dl4j from beta5 to 4 and 3 but the problem still here
... | https://stackoverflow.com/questions/58605143/dl4j-does-not-contain-text-and-models-modules | java, neural-network, nlp, deeplearning4j | 1,572,343,306 |
se_64337550 | stackoverflow | ARTIFICIAL_INTELLIGENCE | Neither PyTorch nor TensorFlow >= 2.0 have been found.Models won't be available and only tokenizers, configuration and file/data utilities can be used | Neither PyTorch nor TensorFlow >= 2.0 have been found.Models won't be available and only tokenizers, configuration and file/data utilities can be used
I am trying to install transformers using pip
pip install transformers
after import transformers
this error show
Neither PyTorch nor TensorFlow >= 2.0 have been... | https://stackoverflow.com/questions/64337550/neither-pytorch-nor-tensorflow-2-0-have-been-found-models-wont-be-available | python, tensorflow, nlp | 1,602,600,570 |
se_26134036 | stackoverflow | ARTIFICIAL_INTELLIGENCE | How to detect homophone | How to detect homophone
I am wondering how homophones are detected. I am in search for an API which gives similarity between two words on the basis of how they are pronounced.
for example: "to" and "two" are highly similar in terms of how they sound with respect to say "to" and "from". | https://stackoverflow.com/questions/26134036/how-to-detect-homophone | nlp, speech-recognition, voice-recognition | 1,412,137,074 |
se_75586733 | stackoverflow | ARTIFICIAL_INTELLIGENCE | ChatGPT Token Limit | ChatGPT Token Limit
I want ChatGPT to remember past conversations and have a consistent (stateful) conversation.
I have seen several code of ChatGPT prompt engineering.
There were two ways to design the prompt shown below (pseudo code):
Use a single input (Cheap) <- Better if possible
Stack all of previous history (... | https://stackoverflow.com/questions/75586733/chatgpt-token-limit | text, nlp, prompt, openai-api, gpt-3 | 1,677,542,809 |
se_39532572 | stackoverflow | ARTIFICIAL_INTELLIGENCE | How to replace an Embedding layer with a Time Distributed Dense after training? | How to replace an Embedding layer with a Time Distributed Dense after training?
I have the following problem:
I want to use a LSTM network for text classification. In order to speed up training and make code more clear I want to use an Embedding layer along keras.Tokenizer in order to train my model.
Once I trained ... | https://stackoverflow.com/questions/39532572/how-to-replace-an-embedding-layer-with-a-time-distributed-dense-after-training | machine-learning, nlp, neural-network, embedding, keras | 1,474,032,085 |
se_5929154 | stackoverflow | ARTIFICIAL_INTELLIGENCE | Designing a System that would detect typos and suggestions | Designing a System that would detect typos and suggestions
This was asked in an interview.
I think the answer can be done by constructing a trie of all valid words and then suggestions can be made based on a possible valid path which was otherwise given as incorrect.
Say if user types apfle, and system would detect th... | https://stackoverflow.com/questions/5929154/designing-a-system-that-would-detect-typos-and-suggestions | nlp, spell-checking | 1,304,877,113 |
se_42489 | stackoverflow | ARTIFICIAL_INTELLIGENCE | How to implement a "related" degree measure algorithm? | How to implement a "related" degree measure algorithm?
I was going to Ask a Question earlier today when I was presented to a surprising functionality in Stackoverflow. When I wrote my question title stackoverflow suggested me several related questions and I found out that there was already two similar questi... | https://stackoverflow.com/questions/42489/how-to-implement-a-related-degree-measure-algorithm | algorithm, machine-learning, indexing, nlp, full-text-search | 1,220,473,264 |
se_66633664 | stackoverflow | ARTIFICIAL_INTELLIGENCE | label_smoothing in "The Annotated Transformer" | label_smoothing in "The Annotated Transformer"
In "The Annotated Transformer", label smoothing is implemented as the following:
class LabelSmoothing(nn.Module):
"Implement label smoothing."
def __init__(self, size, padding_idx, smoothing=0.0):
super(LabelSmoothing, self).__init__()
se... | https://stackoverflow.com/questions/66633664/label-smoothing-in-the-annotated-transformer | nlp, transformer-model | 1,615,792,132 |
se_79515458 | stackoverflow | ARTIFICIAL_INTELLIGENCE | Gensim on Google Colab : ModuleNotFoundError: No module named 'numpy.strings' | Gensim on Google Colab : ModuleNotFoundError: No module named 'numpy.strings'
I've had some problems using GENSIM.
After running:
pip install --upgrade gensim
i execute:
import gensim.downloader as api
I get the following error:
---------------------------------------------------------------------------
Modu... | https://stackoverflow.com/questions/79515458/gensim-on-google-colab-modulenotfounderror-no-module-named-numpy-strings | numpy, nlp, google-colaboratory, gensim | 1,742,236,466 |
se_79513881 | stackoverflow | ARTIFICIAL_INTELLIGENCE | How to Fine-Tune Projection Layer in CLIP Model Using LoRA? | How to Fine-Tune Projection Layer in CLIP Model Using LoRA?
I'm trying to fine-tune the projection layers in the CLIP model using LoRA.
I need help identifying the exact projection layers to modify for my fine-tuning and how I can apply LoRA to them.
Model loading:
import clip
device = "cuda" if torch.cuda.is_availab... | https://stackoverflow.com/questions/79513881/how-to-fine-tune-projection-layer-in-clip-model-using-lora | nlp, artificial-intelligence, large-language-model, image-text | 1,742,197,071 |
se_79526774 | stackoverflow | ARTIFICIAL_INTELLIGENCE | Unable to get the tokenizer of Gemma-3 | Unable to get the tokenizer of Gemma-3
I am trying to get the tokenizer using huggingface AutoTokenizer library, but I am unable to fetch, is there any other way to get it?
Where I am doing wrong?
from transformers import AutoTokenizer
# Load Gemma 3‑27B‑IT’s tokenizer
MODEL_GEMMA = "google/gemma-3-27b-it"
gemma_token... | https://stackoverflow.com/questions/79526774/unable-to-get-the-tokenizer-of-gemma-3 | deep-learning, nlp, huggingface-transformers, huggingface-tokenizers, gemma | 1,742,602,817 |
se_8967544 | stackoverflow | ARTIFICIAL_INTELLIGENCE | Using Stanford CoreNLP | Using Stanford CoreNLP
I am trying to get around using the Stanford CoreNLP. I used some code from the web to understand what is going on with the coreference tool. I tried running the project in Eclipse but keep encountering an out of memory exception. I tried increasing the heap size but there isnt any difference.
W... | https://stackoverflow.com/questions/8967544/using-stanford-corenlp | java, eclipse, nlp, stanford-nlp | 1,327,296,584 |
se_62525680 | stackoverflow | ARTIFICIAL_INTELLIGENCE | Save only best weights with huggingface transformers | Save only best weights with huggingface transformers
Currently, I'm building a new transformer-based model with huggingface-transformers, where attention layer is different from the original one. I used run_glue.py to check performance of my model on GLUE benchmark. However, I found that Trainer class of huggingface-t... | https://stackoverflow.com/questions/62525680/save-only-best-weights-with-huggingface-transformers | deep-learning, nlp, pytorch, huggingface-transformers | 1,592,873,636 |
se_30052147 | stackoverflow | ARTIFICIAL_INTELLIGENCE | Building Q&A-like application using Stanford NLP | Building Q&A-like application using Stanford NLP
I am working on building Question and Answer module using Stanford NLP.
Are there any java api from Stanford to develop Q&A related application?
Something like where i first feed my data like as
Tiger killed dog.
After this if i ask questions like
who killed dog ?
W... | https://stackoverflow.com/questions/30052147/building-qa-like-application-using-stanford-nlp | java, nlp, stanford-nlp | 1,430,826,556 |
se_73098799 | stackoverflow | ARTIFICIAL_INTELLIGENCE | sentiment analysis for tweets | sentiment analysis for tweets
tweets = [
"Wow, what a great day today!! #sunshine",
"I feel sad about the things going on around us. #covid19",
"I'm really excited to learn Python with @JovianML #zerotopandas",
"This is a really nice song. #linkinpark",
"The python programming language is useful fo... | https://stackoverflow.com/questions/73098799/sentiment-analysis-for-tweets | python, nlp, sentiment-analysis | 1,658,669,165 |
se_40240929 | stackoverflow | ARTIFICIAL_INTELLIGENCE | NLP with Racket | NLP with Racket
I am studying NLP with Racket and Dr. Racket.
I am working with this code:
#lang racket
(define english-1
'((Initial (1))
(Final (9))
(From 1 to 3 by NP)
(From 1 to 2 by DET)
(From 2 to 3 by N)
(From 3 to 4 by BV)
(From 4 to 5 by ADV)
(From 4 to 5 by |#|)
(From 5 to... | https://stackoverflow.com/questions/40240929/nlp-with-racket | nlp, lisp, racket | 1,477,401,051 |
se_79523261 | stackoverflow | ARTIFICIAL_INTELLIGENCE | How to Identify Similar Code Parts Using CodeBERT Embeddings? | How to Identify Similar Code Parts Using CodeBERT Embeddings?
I'm using CodeBERT to compare how similar two pieces of code are. For example:
# Code 1
def calculate_area(radius):
return 3.14 * radius * radius
# Code 2
def compute_circle_area(r):
return 3.14159 * r * r
CodeBERT creates "embeddings," which are like det... | https://stackoverflow.com/questions/79523261/how-to-identify-similar-code-parts-using-codebert-embeddings | machine-learning, nlp, bert-language-model, plagiarism-detection, multihead-attention | 1,742,481,035 |
se_51476682 | stackoverflow | ARTIFICIAL_INTELLIGENCE | Training a model to identify names appearing in a sentence | Training a model to identify names appearing in a sentence
I have a dataset containing the names of about 238583 people. The names can contain more than one word for example:
Willie Enriquez , James J Johnson, D.J. Khaled.
My problem is to identify these names when it appears in a sentence. I am trying to create a m... | https://stackoverflow.com/questions/51476682/training-a-model-to-identify-names-appearing-in-a-sentence | machine-learning, nlp, named-entity-recognition | 1,532,341,830 |
se_77503261 | stackoverflow | ARTIFICIAL_INTELLIGENCE | Changing examples value in langchain chain | Changing examples value in langchain chain
Assuming we have langchain chain my_chain created using my_schema via:
from langchain.chat_models import ChatOpenAI
from kor.extraction import create_extraction_chain
from kor.nodes import Object, Text, Number
from langchain.chat.models import ChatOpenAI
from langchain.llms ... | https://stackoverflow.com/questions/77503261/changing-examples-value-in-langchain-chain | python, nlp, langchain, large-language-model, chatgpt-api | 1,700,238,992 |
se_57099613 | stackoverflow | ARTIFICIAL_INTELLIGENCE | How is teacher-forcing implemented for the Transformer training? | How is teacher-forcing implemented for the Transformer training?
In this part of Tensorflow's tutorial, they mentioned that they are training with teacher-forcing. To my knowledge, teacher-forcing involves feeding the target output into the model so that it converges faster. So I'm curious as to how this is done here?... | https://stackoverflow.com/questions/57099613/how-is-teacher-forcing-implemented-for-the-transformer-training | tensorflow, machine-learning, nlp, transformer-model | 1,563,469,945 |
se_79523269 | stackoverflow | ARTIFICIAL_INTELLIGENCE | Trouble getting importing gensim to work in colab | Trouble getting importing gensim to work in colab
I am trying to import gensim into colab.
!pip install gensim
I get the following error:
/usr/local/lib/python3.11/dist-packages/numpy/__init__.py in __getattr__(attr)
365 raise AssertionError()
366 except AssertionError:
--> 367 ... | https://stackoverflow.com/questions/79523269/trouble-getting-importing-gensim-to-work-in-colab | numpy, nlp, dependencies, google-colaboratory, gensim | 1,742,481,362 |
se_79207778 | stackoverflow | ARTIFICIAL_INTELLIGENCE | How to use Hugging Face model with 512 max tokens on longer text (for Named Entity Recognition) | How to use Hugging Face model with 512 max tokens on longer text (for Named Entity Recognition)
I have been using the Named Entity Recognition (NER) model https://huggingface.co/cahya/bert-base-indonesian-NER on Indonesian text as follows:
text = "..."
model_name = "cahya/bert-base-indonesian-NER"
tokenizer = BertToke... | https://stackoverflow.com/questions/79207778/how-to-use-hugging-face-model-with-512-max-tokens-on-longer-text-for-named-enti | python-3.x, nlp, bert-language-model, named-entity-recognition, huggingface | 1,732,115,020 |
se_79510017 | stackoverflow | ARTIFICIAL_INTELLIGENCE | How can I deploy and run a Flask web application using heavy NLP libraries (pandas, numpy, sklearn) on a SiteGround shared hosting plan? | How can I deploy and run a Flask web application using heavy NLP libraries (pandas, numpy, sklearn) on a SiteGround shared hosting plan?
I have a Flask-based web application that performs NLP tasks using libraries like pandas, numpy, sklearn, and nltk. I've tried deploying it to my current hosting (SiteGround shared h... | https://stackoverflow.com/questions/79510017/how-can-i-deploy-and-run-a-flask-web-application-using-heavy-nlp-libraries-pand | python, flask, nlp | 1,741,978,996 |
se_63020298 | stackoverflow | ARTIFICIAL_INTELLIGENCE | Named Entity Recognition using Python spaCy | Named Entity Recognition using Python spaCy
I want to code a Named Entity Recognition system using Python spaCy package. However, I couldn't install my local language inside spaCy package. Is there anyone who can tell me how to install or otherwise use my local language?
I tried:
python -m spacy download xx_ent_wiki_s... | https://stackoverflow.com/questions/63020298/named-entity-recognition-using-python-spacy | python, nlp, spacy, named-entity-recognition | 1,595,354,018 |
se_43912195 | stackoverflow | ARTIFICIAL_INTELLIGENCE | Re-Training spaCy's NER v1.8.2 - Training Volume and Mix of Entity Types | Re-Training spaCy's NER v1.8.2 - Training Volume and Mix of Entity Types
I'm in the process of (re-) training spaCy's Named Entity Recognizer and have a couple of doubts that I hope a more experienced researcher/practitioner can help me figure out:
If a few hundred examples are considered 'a good starting point',... | https://stackoverflow.com/questions/43912195/re-training-spacys-ner-v1-8-2-training-volume-and-mix-of-entity-types | python-2.7, nlp, named-entity-recognition, spacy | 1,494,496,686 |
se_52384517 | stackoverflow | ARTIFICIAL_INTELLIGENCE | Training a new entity type with spacy | Training a new entity type with spacy
Need help to try adding new entity and train my own model with spacy named entity recognition. I wanted first to try the example already done here:
https://github.com/explosion/spaCy/blob/master/examples/training/train_new_entity_type.py
but i'am getting this error :
ipykernel_lau... | https://stackoverflow.com/questions/52384517/training-a-new-entity-type-with-spacy | python, nlp, spacy, named-entity-recognition | 1,537,266,475 |
se_79482283 | stackoverflow | ARTIFICIAL_INTELLIGENCE | Presidio with Langchain Experimental does not detect Polish names | Presidio with Langchain Experimental does not detect Polish names
I am using presidio/langchain_experimental to anonymize text in Polish, but it does not detect names (e.g., "Jan Kowalski"). Here is my code:
from presidio_anonymizer import PresidioAnonymizer
from presidio_reversible_anonymizer import PresidioReversibl... | https://stackoverflow.com/questions/79482283/presidio-with-langchain-experimental-does-not-detect-polish-names | python, nlp, spacy, langchain, presidio | 1,741,040,827 |
se_78072885 | stackoverflow | ARTIFICIAL_INTELLIGENCE | Error when installing Constituent Tree Lib in Python | Error when installing Constituent Tree Lib in Python
I am trying to use the so visually attractive Constituent Tree Lib in Python : https://github.com/Halvani/Constituent-Treelib. I have followed the steps in the installation (pip install, ...), but I get this error :
Collecting constituent-treelib
Downloading constit... | https://stackoverflow.com/questions/78072885/error-when-installing-constituent-tree-lib-in-python | python, nlp, libraries | 1,709,108,334 |
se_10401076 | stackoverflow | ARTIFICIAL_INTELLIGENCE | Difference between constituency parser and dependency parser | Difference between constituency parser and dependency parser
What is the difference between a constituency parser and a dependency parser? What are the different usages of the two? | https://stackoverflow.com/questions/10401076/difference-between-constituency-parser-and-dependency-parser | parsing, nlp, terminology | 1,335,890,701 |
se_8897593 | stackoverflow | ARTIFICIAL_INTELLIGENCE | How to compute the similarity between two text documents? | How to compute the similarity between two text documents?
I want to take two documents and determine how similar they are. Any programming language if fine but I prefer Python. | https://stackoverflow.com/questions/8897593/how-to-compute-the-similarity-between-two-text-documents | python, nlp | 1,326,815,469 |
se_59955402 | stackoverflow | ARTIFICIAL_INTELLIGENCE | Getting word-level encodings from sub-word tokens encodings | Getting word-level encodings from sub-word tokens encodings
I'm looking into using a pretrained BERT ('bert-base-uncased') model to extract contextualised word-level encodings from a bunch sentences.
Wordpiece tokenisation breaks down some of the words in my input into subword units. Possibly a trivial question, but ... | https://stackoverflow.com/questions/59955402/getting-word-level-encodings-from-sub-word-tokens-encodings | nlp, tokenize, bert-language-model, huggingface-transformers | 1,580,238,135 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.