doc
This commit is contained in:
parent
e9511ad649
commit
4c5d3311b8
11 changed files with 113 additions and 19 deletions
|
|
@ -325,4 +325,32 @@
|
||||||
doi = {10.1038/s41586-020-2649-2},
|
doi = {10.1038/s41586-020-2649-2},
|
||||||
publisher = {Springer Science and Business Media {LLC}},
|
publisher = {Springer Science and Business Media {LLC}},
|
||||||
url = {https://doi.org/10.1038/s41586-020-2649-2}
|
url = {https://doi.org/10.1038/s41586-020-2649-2}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
% This file was created with Citavi 6.15.2.0
|
||||||
|
|
||||||
|
@misc{Gupta.20062016,
|
||||||
|
abstract = {Product classification is the task of automatically predicting a taxonomy path for a product in a predefined taxonomy hierarchy given a textual product description or title. For efficient product classification we require a suitable representation for a document (the textual description of a product) feature vector and efficient and fast algorithms for prediction. To address the above challenges, we propose a new distributional semantics representation for document vector formation. We also develop a new two-level ensemble approach utilizing (with respect to the taxonomy tree) a path-wise, node-wise and depth-wise classifiers for error reduction in the final product classification. Our experiments show the effectiveness of the distributional representation and the ensemble approach on data sets from a leading e-commerce platform and achieve better results on various evaluation metrics compared to earlier approaches.},
|
||||||
|
author = {Gupta, Vivek and Karnick, Harish and Bansal, Ashendra and Jhala, Pradhuman},
|
||||||
|
date = {20/06/2016},
|
||||||
|
year = {2016},
|
||||||
|
title = {Product Classification in E-Commerce using Distributional Semantics},
|
||||||
|
url = {https://arxiv.org/pdf/1606.06083.pdf},
|
||||||
|
urldate = {09/03/2023},
|
||||||
|
file = {1606.06083:Attachments/1606.06083.pdf:application/pdf}
|
||||||
|
}
|
||||||
|
|
||||||
|
% This file was created with Citavi 6.15.2.0
|
||||||
|
|
||||||
|
@article{AliCevahir.,
|
||||||
|
author = {{Ali Cevahir} and {Koji Murakami}},
|
||||||
|
title = {Large-scale Multi-class and Hierarchical Product Categorization for an E-commerce Giant},
|
||||||
|
url = {https://aclanthology.org/C16-1051.pdf},
|
||||||
|
year ={2016},
|
||||||
|
urldate = {31/05/2023},
|
||||||
|
file = {Ali Cevahir, Koji Murakami - Large-scale Multi-class and Hierarchical Product:Attachments/Ali Cevahir, Koji Murakami - Large-scale Multi-class and Hierarchical Product.pdf:application/pdf}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -457,11 +457,17 @@ Listing \ref{code:triangularLR} is the code to train the model using triangular
|
||||||
|
|
||||||
|
|
||||||
\subsection{Experimentation and analysis}
|
\subsection{Experimentation and analysis}
|
||||||
In this experiment, the model is trained with and without triangular learning rate method. The total number of iterations is $10000 \times 10$. The graph of Loss Vs Learning rate and time taken to complete the iterations illustrates the performance of the model. The graph plotted for each $2500$ iterations provide insight on how the model is performing. The lesser the time taken
|
In this experiment, the model is trained with and without triangular learning rate method. The total number of iterations is $10000 \times 10$. The graph of Loss Vs Learning rate and time taken to complete the iterations illustrates the performance of the model. The graph plotted for each $2500$ iterations provide insight on how the model is performing.
|
||||||
\begin{enumerate}
|
\begin{enumerate}
|
||||||
\item Triangular learning rate; where $base\_lr =0.0075$ and $max\_lr=0.02$: \\
|
\item Triangular learning rate; where $base\_lr =0.0075$ and $max\_lr=0.02$: \\
|
||||||
|
|
||||||
|
\begin{figure}[H]
|
||||||
|
\centering
|
||||||
|
\includegraphics[scale=0.5]{lossinfo_tlr.png}
|
||||||
|
\caption{Loss with TLR, where $base\_lr =0.0075$ and $max\_lr=0.02$
|
||||||
|
}
|
||||||
|
\label{fig:trl_loss}
|
||||||
|
\end{figure}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -2,3 +2,38 @@
|
||||||
|
|
||||||
\section{Topic overview}
|
\section{Topic overview}
|
||||||
|
|
||||||
|
While working at an E-commerce company selling automobile parts, author realized that various manufacture and suppliers of similar kind of automobile parts may have different product taxonomy. Defining the product taxonomy is a prior task of product deployment. Manually defining the product taxonomy requires a significant amount of time and are prone to error. \\
|
||||||
|
|
||||||
|
E-commerce industry is growing, and many products are sold online. Use of machine learning model for suggesting the products to the customer, auto completing the search text, auto filtering of products based on the text provided by the user describing the product are few of the tasks which is managed by artificial intelligence. All the tasks can only be performed appropriately only if the product taxonomy is well-defined. \\
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
\section{Problem statement and Research question}
|
||||||
|
|
||||||
|
\begin{itemize}
|
||||||
|
\item RQ1: How to define product features as an input for machine learning model?
|
||||||
|
\item RQ2 : Which type of neural network is the best suitable for text classification in terms of product classification?
|
||||||
|
\item RQ3 : How should the model parameters be defined to optimize the neural network?
|
||||||
|
\end{itemize}
|
||||||
|
|
||||||
|
\section{Methodology}
|
||||||
|
|
||||||
|
Machine learning model to text classification for predicting the product taxonomy is a methodology in which a lot of research have been conducted \parencite{AliCevahir.} \parencite{Gupta.20062016}. In this thesis, author classifies the product by representing the features of the product into vector of entire vocabulary of dataset. This approach is inspired by \parencite{sean}, in which the language of the name is predicted based on the pattern of characters in name input.
|
||||||
|
|
||||||
|
\section{Thesis structure}
|
||||||
|
|
||||||
|
In the first chapter, gives the introduction of the thesis along with research questions and methodology.
|
||||||
|
|
||||||
|
In the second chapter, defining or selecting the features from a document is described. It introduces various analytic engine tools and methods for feature selection.
|
||||||
|
|
||||||
|
The third chapter describes various methods to standardize the text data and preprocess it before making it as an input to the classification model.
|
||||||
|
|
||||||
|
The fourth chapter focuses on retaining the missing textual data from the dataset from which the classification model will be predicting the product category.
|
||||||
|
|
||||||
|
The fifth chapter is a guideline on vectoring or transforming the text into machine usable numerical form called feature extraction.
|
||||||
|
|
||||||
|
In the sixth chapter, how author classifies the product by representing the features of the product into vector of entire vocabulary of dataset is depicted. The architecture of neural network used for the prediction is described in this chapter. Mathematical equations on probability distribution, Softmax and why to apply log to softmax is formulated.
|
||||||
|
|
||||||
|
In the seventh chapter, the model is trained to classification. The experimentation and analysis of model with different approaches and varying model parameters is conducted.
|
||||||
|
|
||||||
|
The eight chapter, is research on creating a knowledge graph with natural language processing.
|
||||||
BIN
doc/images/lossinfo_tlr.png
Normal file
BIN
doc/images/lossinfo_tlr.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 53 KiB |
|
|
@ -66,13 +66,13 @@ preliminary/affidavit, %
|
||||||
preliminary/abstract, %
|
preliminary/abstract, %
|
||||||
preliminary/acronyms, %
|
preliminary/acronyms, %
|
||||||
chapters/introduction, %
|
chapters/introduction, %
|
||||||
chapters/chapter1,%
|
|
||||||
chapters/chapter2,%
|
chapters/chapter2,%
|
||||||
chapters/chapter3,%
|
chapters/chapter3,%
|
||||||
chapters/chapter4,%
|
chapters/chapter4,%
|
||||||
chapters/chapter5,%
|
chapters/chapter5,%
|
||||||
chapters/chapter6,%
|
chapters/chapter6,%
|
||||||
chapters/chapter7
|
chapters/chapter7,%
|
||||||
|
chapters/chapter1%
|
||||||
}
|
}
|
||||||
|
|
||||||
\begin{document}
|
\begin{document}
|
||||||
|
|
@ -99,14 +99,14 @@ chapters/chapter7
|
||||||
|
|
||||||
%---------------------------------------
|
%---------------------------------------
|
||||||
\include{chapters/introduction.tex}
|
\include{chapters/introduction.tex}
|
||||||
\include{chapters/chapter1}
|
|
||||||
\include{chapters/chapter2}
|
\include{chapters/chapter2}
|
||||||
\include{chapters/chapter3}
|
\include{chapters/chapter3}
|
||||||
\include{chapters/chapter4}
|
\include{chapters/chapter4}
|
||||||
\include{chapters/chapter5}
|
\include{chapters/chapter5}
|
||||||
\include{chapters/chapter6}
|
\include{chapters/chapter6}
|
||||||
\include{chapters/chapter7}
|
\include{chapters/chapter7}
|
||||||
|
\include{chapters/chapter1}
|
||||||
|
|
||||||
|
|
||||||
\pagenumbering{roman}
|
\pagenumbering{roman}
|
||||||
|
|
|
||||||
BIN
loss_tlr.png
BIN
loss_tlr.png
Binary file not shown.
|
Before Width: | Height: | Size: 46 KiB |
BIN
loss_tlr2.png
BIN
loss_tlr2.png
Binary file not shown.
|
Before Width: | Height: | Size: 65 KiB |
Binary file not shown.
|
Before Width: | Height: | Size: 25 KiB |
BIN
lossinfo.png
BIN
lossinfo.png
Binary file not shown.
|
Before Width: | Height: | Size: 40 KiB After Width: | Height: | Size: 54 KiB |
|
|
@ -16,7 +16,7 @@ class Train():
|
||||||
self.rnn= RNN(self.inputSize, self.n_hidden, self.n_category)
|
self.rnn= RNN(self.inputSize, self.n_hidden, self.n_category)
|
||||||
|
|
||||||
self.lr_low=0.0075
|
self.lr_low=0.0075
|
||||||
self.lr_max=0.02
|
self.lr_max=0.0125
|
||||||
self.learning_rate= 0.00000000000001
|
self.learning_rate= 0.00000000000001
|
||||||
self.criterion = nn.NLLLoss()
|
self.criterion = nn.NLLLoss()
|
||||||
|
|
||||||
|
|
@ -160,7 +160,7 @@ class Train():
|
||||||
output, loss = self.train(category_tensor, name_tensor)
|
output, loss = self.train(category_tensor, name_tensor)
|
||||||
self.current_loss += loss
|
self.current_loss += loss
|
||||||
# Print ``iter`` number, loss, name and guess
|
# Print ``iter`` number, loss, name and guess
|
||||||
if epoch % 2500 == 0:
|
if epoch % 1000 == 0:
|
||||||
guess, guess_i = self.data.categoryFromOutput(output)
|
guess, guess_i = self.data.categoryFromOutput(output)
|
||||||
correct = '✓' if guess == category else '✗ (%s)' % category
|
correct = '✓' if guess == category else '✗ (%s)' % category
|
||||||
|
|
||||||
|
|
@ -173,28 +173,48 @@ class Train():
|
||||||
correct, self.learning_rate))
|
correct, self.learning_rate))
|
||||||
|
|
||||||
|
|
||||||
if epoch % 2500 == 0:
|
if epoch % 5000 == 0:
|
||||||
if (math.isnan(self.current_loss)!=True):
|
if (math.isnan(self.current_loss)!=True):
|
||||||
self.all_losses.append(self.current_loss / 2500)
|
self.all_losses.append(self.current_loss / 1000)
|
||||||
learning_rates.append(self.learning_rate)
|
learning_rates.append(self.learning_rate)
|
||||||
times.append(self.helper.timeSince(start))
|
times.append(self.helper.secondsSince(start))
|
||||||
self.current_loss = 0
|
self.current_loss = 0
|
||||||
else:
|
else:
|
||||||
break
|
break
|
||||||
|
|
||||||
# Plot loss curve
|
# Plot loss curve
|
||||||
# Initialise the subplot function using number of rows and columns
|
# Initialise the subplot function using number of rows and columns
|
||||||
figure, axs = plt.subplots(2,sharex=True)
|
# figure, axs = plt.subplots(2,sharex=True)
|
||||||
figure.suptitle("Loss")
|
# figure.suptitle("Loss vs Learning rate and time with TLR")
|
||||||
# plt.figure()
|
# # plt.figure()
|
||||||
axs[0].plot(self.all_losses,learning_rates,'tab:orange')
|
# axs[0].plot(self.all_losses,learning_rates,'tab:orange')
|
||||||
axs[1].plot(self.all_losses,times,'tab:green')
|
# axs[1].plot(self.all_losses,times,'tab:green')
|
||||||
|
|
||||||
for ax in axs.flat:
|
# for ax in axs.flat:
|
||||||
ax.set(xlabel='Loss')
|
# ax.set(xlabel='Loss')
|
||||||
|
|
||||||
# plt.ylabel("Loss")
|
# plt.ylabel("Loss")
|
||||||
# plt.xlabel('Learning rate')
|
# plt.xlabel('Learning rate')
|
||||||
# # # Title and display the plot
|
# # # Title and display the plot
|
||||||
# ax1.set_title('Losses Vs Learning rate')
|
# ax1.set_title('Losses Vs Learning rate')
|
||||||
|
plt.figure(figsize=(10, 5))
|
||||||
|
plt.subplot(1, 2, 1)
|
||||||
|
|
||||||
|
plt.plot(learning_rates, self.all_losses, marker='o', linestyle='-')
|
||||||
|
plt.title('Learning Rate vs. Loss')
|
||||||
|
plt.xlabel('Learning Rate')
|
||||||
|
plt.ylabel('Loss')
|
||||||
|
# plt.xscale('log') # Log scale for learning rate for better visualization
|
||||||
|
plt.grid(True)
|
||||||
|
|
||||||
|
# Create a plot for time vs. loss
|
||||||
|
plt.subplot(1, 2, 2)
|
||||||
|
plt.plot(times, self.all_losses, marker='o', linestyle='-')
|
||||||
|
plt.title('Training Time vs. Loss')
|
||||||
|
plt.xlabel('Training Time (seconds)')
|
||||||
|
plt.ylabel('Loss')
|
||||||
|
plt.grid(True)
|
||||||
|
|
||||||
|
plt.tight_layout()
|
||||||
|
|
||||||
plt.savefig("lossinfo")
|
plt.savefig("lossinfo")
|
||||||
|
|
@ -40,6 +40,11 @@ class Helper():
|
||||||
s -= m * 60
|
s -= m * 60
|
||||||
return '%dm %ds' % (m, s)
|
return '%dm %ds' % (m, s)
|
||||||
|
|
||||||
|
def secondsSince(self,since):
|
||||||
|
now = time.time()
|
||||||
|
s = now - since
|
||||||
|
return s
|
||||||
|
|
||||||
def plot(self,data,name):
|
def plot(self,data,name):
|
||||||
plt.figure()
|
plt.figure()
|
||||||
plt.plot(data)
|
plt.plot(data)
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue