Questions tagged [bag-of-words]
The bag-of-words tag has no usage guidance.
21
questions
0
votes
1
answer
43
views
Why would a sequence-model vs n-gram model depending on ratio of Samples / Words per Sample
This ML tutorial from Google is analyzing the imdb reviews dataset to predict the tag positive or negative. When choosing a model
Calculate the number of samples/number of words per sample ratio.
If ...
0
votes
0
answers
23
views
How does relu appears in first layer gradient of backpropagation?
I'm following Stanford's Natural language processing course in Coursera. I'm learning about "Continuous bag of words" model Where neural network with one relu(first layer) and one softmax(...
0
votes
0
answers
37
views
Generate vector database for userdata
I need a point in the right direction for the problem I'm trying to solve:
I have a lot of already classified short articles. The articles themselves or a reference to them should be stored in some ...
0
votes
1
answer
329
views
Word2vec CBOW model with negative sampling
From this article:
In vanilla skip gram model, softmax is computationally very expensive, as
it requires scanning through the entire output embedding matrix (W_output) to compute the probability ...
1
vote
1
answer
278
views
Is n-gram a special instance of bag of word? What are their differences?
Is n-gram a special instance of bag of word? What are their differences? From my understanding, n-gram is when replacing the words in bag of words with n-grams, and follow the same procedures to ...
0
votes
1
answer
185
views
Getting context-word pairs for a continuous bag of words model and other confusions
Suppose I have a corpus with documents:
...
2
votes
1
answer
643
views
Should bag of words in training set include test set data when doing text classification?
I'm doing text classification to identify 'attacks' from Wikipedia comments using a simple bag of words model and a linear SVM classifier. Because of class imbalance, I'm using the F1 score as my ...
2
votes
1
answer
44
views
Usage of KL divergence to improve BOW model
For a university project, I chose to do sentiment analysis on a Google Play store reviews dataset. I obtained decent results classifying the data using the bag of words (BOW) model and an ADALINE ...
1
vote
2
answers
1k
views
How to decide to go with BOW or TFIDF
I know that there are methods that help in selecting features such as Matual Info, and Info Gain, etc.
But for datasets with thousands of records and thousands of features it is time consuming to ...
0
votes
2
answers
366
views
How to decide which method to use TFIDF, or BOW
In a huge dataset for NLP it is taking very long time to classify my dataset
therefore, trying each feature extraction method separetly is time consuming and not effecient.
Is there a way that can ...
1
vote
1
answer
24
views
Which phrase should be returned in case of multiple matches when comparing text?
I want to compare one sentence to some other sentences using the Bag of Words model. Suppose that my comparing sentence is:
I am playing football
and there are three more sentences that I want to ...
1
vote
2
answers
183
views
Bag-of-words and Spam classifiers
I implemented a spam classifier using Bernoulli Naive Bayes, Logistic Regression, and SVM. Algorithms are trained on the entire Enron spam emails dataset using the Bag-of-words (BoW) approach. ...
0
votes
1
answer
121
views
How to use scikit-learn to extract features from text when I only have positive and unlabeled data?
I'm looking for something similar to this
https://scikit-learn.org/stable/auto_examples/text/plot_document_classification_20newsgroups.html#sphx-glr-auto-examples-text-plot-document-classification-...
1
vote
1
answer
1k
views
Why I would use TF-IDF after Bag-of-Words (CountVectorizer)?
In my recent studies over Machine Learning NLP tasks I found this very nice tutorial teaching how to build your first text classifier:
https://towardsdatascience.com/machine-learning-nlp-text-...
1
vote
1
answer
184
views
One-hot vector for fixed vocabulary
given a vocabulary with $|V|=4$ and V = {I, want, this, cat} for example.
How does the bag-of-words representation with this vocabulary and one-hot encoding look like regarding example sentences:
You ...
0
votes
1
answer
279
views
Machine learning algorithms for forming Homophones from input dataset word
https://www.google.com/search?sxsrf=ALeKk01_SgA8G4UfNm4rOqku4yJBFvKhLw%3A1600154854621&source=hp&ei=5mxgX8ztI6KZ4-EPq-mL8Ak&q=homophones+example&oq=Homophones&gs_lcp=...
1
vote
1
answer
128
views
Machine learning algorithms for correct words formation from jumbled words
https://www.google.com/search?q=jumbled+words&oq=jumbled&aqs=chrome.1.69i57j0l4.3399j0j9&client=ms-android-lava&sourceid=chrome-mobile&ie=UTF-8
Can Machine learning algorithms ...
0
votes
2
answers
2k
views
Is it good practice to remove the numeric values from the text data during preprocessing?
Im doing preprocessing on a text dataset. I have certain numerics in it like:
date(1st July)
year(2019)
tentative values (3-5 years/ 10+ advantages).
unique values (room no 31/ user rank 45)
...
1
vote
3
answers
2k
views
How to process the hyphenated english words for any nlp problem?
Im doing preprocessing on english text dataset. I encounter hyphenated words like 'well-known'. Will it be useful
if I remove the hyphen as special character and treat it as a single word 'wellknown' ...
2
votes
1
answer
159
views
Word representation that gives more weight to terms frequent in corpus?
The tf-idf discounts the words that appear in a lot of documents in the corpus. I am constructing an anomaly detection text classification algorithm that is trained only on valid documents. Later I ...
4
votes
0
answers
180
views
Bag of words: Prediction on new (out-of-sample) data
I'm working with a bag of words in R:
library(tm)
corpus = VCorpus(textsource)
dtm = DocumentTermMatrix(corpus)
dtm = as.matrix(dtm)
I use the matrix ...