From 26f2023eb58618c1b134f7ccb48a8b454c675645 Mon Sep 17 00:00:00 2001 From: "shoney.arickathil" Date: Fri, 28 Jul 2023 13:21:16 +0200 Subject: [PATCH] doc --- doc/chapters/chapter5.tex | 13 ++++++++++--- doc/chapters/chapter6.tex | 5 +++++ doc/index.tex | 4 +++- doc/preliminary/acronyms.tex | 1 + 4 files changed, 19 insertions(+), 4 deletions(-) create mode 100644 doc/chapters/chapter6.tex diff --git a/doc/chapters/chapter5.tex b/doc/chapters/chapter5.tex index 334def0..1f9819f 100644 --- a/doc/chapters/chapter5.tex +++ b/doc/chapters/chapter5.tex @@ -38,9 +38,9 @@ Consider a data frame with columns \textit{ProductName} and data value as in tba The length of the vocabulary is the number of unique tokens in the data frame column. In the sample data the vocabulary length is six. The vector has the dimensionality equal to the size of the vocabulary. Adding one in the dimension to each of the word in the vocabulary represents one hot encoding. -\begin{table}[h] +\begin{table}[] \centering - \caption{One hot encoding} + \caption{Sample One-Hot encoding} \label{table:countencode} \begin{tabular}{ ll } \toprule @@ -68,5 +68,12 @@ Count Vectorization can also be performed on range of grams of words. \end{lstlisting} -The code in listing \ref{ngramcode}, will add additional vocabularies of two words such as "drive shaft". This enables to preserve local ordering information. +The code in listing \ref{ngramcode}, will add additional vocabularies of two words such as "drive shaft". This enables to preserve local ordering information. +\section{Pickling the Vectorizer} + +Pickle \footnote{https://docs.python.org/3/library/pickle.html} module creates a portable serialized representation of python object. Reusing the CountVectorizer object once it has been fit with the document can be enabled by Pickle module. + +\begin{lstlisting}[language=Python,label=pickle, caption={Pickle vectorization}] + pickle.dump(self.vectorizer, open("vector.pickel", "wb")) +\end{lstlisting} \ No newline at end of file diff --git a/doc/chapters/chapter6.tex b/doc/chapters/chapter6.tex new file mode 100644 index 0000000..3249519 --- /dev/null +++ b/doc/chapters/chapter6.tex @@ -0,0 +1,5 @@ +\chapter{Model selection - Neural networks} + +\parencite{sean} tutorial on \textit{classifying names with a character-level \acs{RNN}} provides a basic foundation for classification algorithm. In this tutorial, \Citeauthor{sean} train on few thousand surnames from 18 languages of origin, and predicts which language the name is from based on the spelling. + +Similarly, in this paper author predicts category based on the name of the product. diff --git a/doc/index.tex b/doc/index.tex index 2dd8289..beb9a8a 100644 --- a/doc/index.tex +++ b/doc/index.tex @@ -52,7 +52,8 @@ chapters/chapter1,% chapters/chapter2,% chapters/chapter3,% chapters/chapter4,% -chapters/chapter5 +chapters/chapter5,% +chapters/chapter6 } \begin{document} @@ -91,6 +92,7 @@ chapters/chapter5 \include{chapters/chapter3} \include{chapters/chapter4} \include{chapters/chapter5} +\include{chapters/chapter6} \appendix % \include{chapters/appendix.tex} diff --git a/doc/preliminary/acronyms.tex b/doc/preliminary/acronyms.tex index 01ee54f..d60f5e2 100644 --- a/doc/preliminary/acronyms.tex +++ b/doc/preliminary/acronyms.tex @@ -27,6 +27,7 @@ \acro{Tf}[Tf-Idf]{Term frequency} \acro{Idf}[Idf]{Inverse document frequency} \acro{KNN}[KNN]{\textit{k} -Nearest Neighbors} +\acro{RNN}[RNN]{Recurrent Neural Network} \end{acronym}