Finding document are chosen for conversion while the

Finding a good data set was a requirement that could provide enough labelled documents for the supervised classification algorithms that will categorize the new test documents based on the training. This article has used the popular 20 Newsgroups data set obtained from its original website. Before applying classification algorithms to the training documents, it is important to pre-process the text data and convert into a form required by all the algorithms. In this case, the pre-processing step requires that all the training documents from the data set be merged into a single textual document. After the merging is done, the single text document is fed as an input to an implementation of the Word2vec word embedding algorithm supported by Gensim for learning new word vectors from the text. Gensim is an open source Python library for natural language processing, with a focus on topic modelling. It only requires that the input must provide sentences sequentially when iterated over. Word embeddings are a modern approach for representing text in natural language processing. Word2vec is one algorithm for learning a word embedding from a text corpus. Word2vec training is an unsupervised task and accepts several parameters that affect both training speed and quality. It is a semantic learning framework that uses a shallow neural network to learn the representations of words in a particular text. Simply put, its an algorithm that takes in all the terms including repetitions in a particular document, divided into sentences, and outputs a vector representation of each. Ideally, it is able to learn the context and place them together in its semantic space. Thus Gensim’s Word2vec API was used to convert each sentence of the single large text document iteratively into its vector representation, in this case, each word of the sentence is converted to 10 unique floating point numbers. This size depends on and varies with the choice of dimensionality. Words that occur at least 5 times in the document are chosen for conversion while the rest are ignored for least relevance to the document’s annotated category. Word2vec allows setting parameters as per the requirements.Many machine learning classification algorithms are unable to process raw data in its text form. In such cases, it becomes important to produce word embeddings from the raw text input. Word embeddings are numerical representations of textual data. This step requires merging all the training text documents into a single large text document and using it as text input to Word2vec. Word2vec is a predictive model used for learning word embeddings from raw text and it can utilize either of two model architectures, the CBOW model and the Skip-Gram model. It takes as its input a large text corpus and produces a set of feature vectors for words for that corpus. The purpose of Word2vec is to detect similarities mathematically by grouping the vectors of similar words together in vector space. Same words in the corpus get represented as a unique vector consisting of numbers in the vector space.CBOW, one of the algorithms used for training Word2vec vectors, is used to predict a target word from its surrounding context. CBOW works by predicting the probability of a word given a context which may be a single word or a group of words. The input to the model could be w extsubscript{i-2},w extsubscript{i-1},w extsubscript{i+1},w extsubscript{i+2} the preceding and following words of the current word. The output of the model will be w extsubscript{i}. The number of words used depends on the setting for the window size. The BOW model is used to represent an unordered collection of words as a vector. One of the most common uses of CBOW is for simple document classification, such as the task of spam email detection. In the BOW model, this simple form is just a histogram of the occurrence of each word in the text. A BOW representation contains how many times each word appears in a document. However, it does not take into account the order of the words. BOW model only includes n most frequent words in a corpus which helps in reducing the memory needed to store relatively infrequent words. 

x

Hi!
I'm Isaac!

Would you like to get a custom essay? How about receiving a customized one?

Check it out