\documentclass{article}
\usepackage[utf8]{inputenc}
\usepackage[english]{babel}
\usepackage[T1]{fontenc}
\usepackage{ngerman}
\usepackage[]{listings}
\usepackage{hyperref}

\title{Text Mining Lab \\ Training Rasa-Chatbots with Natural Language Texts \\ Project Report}
\author{David Fuhry \\ Leonard Haas \\ Lukas Gehrke \\ Lucas Schons \\ Jonas Wolff}
\date{Winter Term 2018/2019}

\begin{document}

\maketitle

\tableofcontents

\pagebreak

% To be edited - my (Lukas) suggestion so far
\section{Project Description}
    \subsection{Converstaional AI and Training}
    Conversational AI describes computer systems that users can interact with by having a conversation. One important goal is to make the conversation seem as natural as possible. Ideally, an interacting user should assume to be interacting with another human beeing. This can make communication with a computer become very pleasant and easy for humaning beeings as they are simply using the language the always use. Besides there is no need for menu interaction with the system and thus no learning curve required.
    % TODO add example use case (website information)
    % TODO add more benefits (24/7 availability)
    \\ Conversational AI can be used in Voice Assistants that communicate through spoken words or
    through chatbots that imitate a human beeing one is chatting with by text messages.
    \subsection{Rasa Framwork}
    Rasa is a collection of frameworks for conversational AI software. The Rasa Stack contains two open source libraries called Rasa NLU and Rasa Core that can be used to create contextual chatbots. Rasa NLU is a library for natural language understanding with intent classification and entity extraction Rasa Core is a Chatbot framework with machine learning based dialogue management. Both can be uses independently but rasa recommends using both.
    % TODO add description of how a rasa bot must be trained to achieve results

    \subsection{Research Question}
    The objective of this project is to find out, wether chatbots can be trained with natural language texts \textit{automatically}. There are two inital research questions: Given that chatbots need to be trained with knowledge, called facts.
    \begin{itemize}
        \item Can these facts be extracted from natural language text?
        \item Can this be done automaitcally? 
    \end{itemize}
    
\section{Solution Approach}
    \subsection{Project Goals}
    
		\subsection{Rasa Setup and Intents}

		The Rasa-Stack consists of two components: \textit{Rasa-Core} and \textit{Rasa-NLU}. The \textit{Rasa-NLU} component takes care of getting user input and matching it with the respective intents. It also extracts all possibly provided entities and stores them in variables, called ``slots''. After that, the \textit{Rasa-Core} component executes all actions associated with the determined intent.

    \subsection{Scrapping of Source Texts}
    \subsection{Fact Extraction Approaches}

\section{Software Architecture}
    \subsection{Rasa Chatbot}
    The Rasa Chatbot built for this project uses both Rasa Stack components - \textit{Rasa Core} and \textit{Rasa NLU}. Configuration has been organised in reference to examples from the Rasa github repository. \\ Rasa NLU has been trained with example questions in Markdown format that cotain highlighted enities. This ensures the bot to understand intents and extract the entities inside the sentences. One example can be seen in Figure \ref{nlu_example}. \\
    \lstinputlisting[label={nlu_example}, caption={NLU example}]{nlu_example.md} 
    Rasa Core has been configured with \textit{stories} that contain example conversation flows as training data \ref{stories_example} and the \textit{domain} of the bot. The domain contains all actions, entities, slots, intents, and templates the bot deals with. \textit{Templates} means template strings for bot utterances. \textit{Slots} are variables that can hold different values. The bot proposed in this project uses a slot to store the name of a recognized physicist entity for instance. According to the Rasa website \footnote{\url{https://rasa.com/docs/get_started_step2/}}, the domain is \textit{the universe the bot is living in}. \\
    \lstinputlisting[label={stories_example}, caption={Example Story}]{stories_example.md}
    The bot recognizes the intents shown in Figure \ref{intent_plot}. It can be started through \textit{MAKE}-commands. For further details, please refer to the README \footnote{\url{https://git.informatik.uni-leipzig.de/text-mining-chatbot/wiki-rasa/blob/master/README.md}}. Development of the bot was focused on proof of concept so there is not a lot of natural conversation ability available.
    % TODO complete table.

    \begin{center}
        \begin{tabular}{| l | l | l |}
            \hline
            No & Intent & Example \\ \hline
            1 & birthdate & When was Albert Einstein born \\ \hline
            1 & birthdate & When was Albert Einstein born \\ \hline
            1 & birthdate & When was Albert Einstein born \\ \hline
            1 & birthdate & When was Albert Einstein born \\
            \hline
        \end{tabular}
    \end{center}

    \subsection{R Package 'wikiproc'}
    \subsection{Interworking of R and Rasa}
    %TODO add architecture chart made by Lucas


\section{Results}
    \subsection{Precision}
    \subsection{Recall}
    \subsection{Conclusion}

\section{Restraints}
    \subsection{Thoughts on Rasa}
    \subsection{Thoughts on Knowledge Extraction}

\section{Outlook}
    \subsection{Learning to Ask Approach}


\end{document}