# An Emotion-Based Rating System for Books Using Sentiment Analysis and Machine Learning in the Cloud
## 2 Methodology and Methods Framework
### Feature Extraction  
The computer interprets text using numbers. Word vectorization, also known as word embedding, converts words or text into vectors of real value. This feature extraction strategy divides a text into sentences, which are subsequently broken down into texts, and creates a matrix or a feature map as a result [21]. Every individual feature column in the final obtained matrix denotes a document or phrase, and the values present in the feature map's cells typically indicate the frequency of the word in the document or phrase. \"Bag of Terms\" (BOW), one of the most straightforward techniques for feature extraction, defines a fixed-length vector of the count, where every item corresponds to terms in a specified dictionary. If a word in a sentence is absent from the pre-defined dictionary, it obtains a score of 0; otherwise, depending on the frequency of its appearance in the sentence, it is assigned a value greater than or equal to 1. As a result, the vector's length is always equal to the entire set of words in the English language. The simplicity of this approach offers advantages, but there are also several disadvantages, including the generation of a sparse matrix, the loss of the order of words in a phrase, and the inability to accurately capture the content of a sentence. For instance, using the pre-defined existing dictionary, the line \"are you enjoying reading\" might be represented as we, hope, you, are, enjoying, reading. However, text pre-processing, n-grams, and TF-IDF can be used to enhance these representations. In phrase vector encoding, the N-gram approach serves as a good stand-in for word order resolution. Here, the words are represented as a combination of discrete n-gram meaning groupings of \(n\) number of adjacent keywords or words in an n-gram vector representation. In this context, any of the natural numbers can be used as \(n\). The trigrams such as \"to teach is\", \"is to touch\", \"teach is to\", \"is to touch a life\", and \"a life forever\" is formed from the phrase \"to teach is to touch a life forever\". The sentences' original arrangement is maintained as a result. N-gram features outperform the BOW method because they contain grammatical patterns that convey essential data. Despite maintaining word order, n-grams lack data and are highly dimensional [22]. The term frequency-inverse document frequency (TF-IDF) technique is one of the well-liked feature extraction strategies. This technique encodes text as a matrix, where each integer corresponds to the amount of data each phrase in a document contains [23]. It is based on the notion that uncommon words in texts contain rich knowledge. IDF is computed from the ratio of the total number of documents (N) to the total number of documents in which a word \(W\) appears \(n\). Term frequency is computed from the ratio of the total number of words \(W\) in a document by the number of times a word \(W\) is present in that document. To choose the most effective methodology, we tested two feature extraction methodologies and used six pre-processing procedures. They employed six machine learning techniques, including n-grams with \(n=2\) and TF-IDF, to extract characteristics from the dataset of SS-tweet and found that TF-IDF outperformed n-gram [24]. A deep learning network can choose the best vector representations because of the large amount of data. Using neural network-based word embedding to extract features results in more informative features. Words with similar meanings or those connected to one another are represented by comparable vector embedding in word representation based on neural networks [25]. Due to the preservation of word semantics, this is more frequent in word prediction. Researchers at Stanford University created GloVe, a deep learning-based word embedding technique, and Facebook introduced FastText. Word2 vec vectors take longer to train than GloVe vectors and cannot compete with FastText vectors in several ways.