text:
\section{Introduction}
\noindent
Open-domain response generation~~\cite{perez2011conversational,sordoni2015neural} for single-round short text conversation~\cite{shang2015neural}, aims at generating a meaningful and interesting response given a query from human users.
Neural generation models are of growing interest in this topic due to their potential to leverage massive conversational datasets on the web.
These generation models such as encoder-decoder models~\cite{vinyals2015neural,shang2015neural,wen2015semantically}, directly build a mapping from the input query to its output response, which treats all query-response pairs uniformly and optimizes the maximum likelihood estimation (MLE).
However, when the models converge, they tend to output bland and generic responses
~\cite{li2016diversity,li2016deep,serban2016building}.

Many enhanced encoder-decoder approaches have been proposed to improve the quality of generated responses.
They can be broadly classified into two categories (see Section~\ref{sec:related} for details):
(1) One that does not change the encoder-decoder framework itself.
These approaches only change the decoding strategy, such as encouraging diverse tokens to be selected in beam search~\cite{li2016diversity,li2016simple}; or adding more components based on the encoder-decoder framework, such as the Generative Adversarial Network (GAN)-based methods~\cite{xu2017neural,zhang2018generating,li2017adversarial} which
add discriminators to perform adversarial training;
(2) The second category modifies the encoder-decoder framework directly by
incorporating useful information as latent variables in order to generate more specific responses~\cite{yao2017towards,zhou2017mechanism}.
However, all these enhanced methods still optimize the MLE of the log-likelihood or the complete log-likelihood conditioned on their assumed latent information, and models estimated by the MLE naturally favor to output frequent patterns in training data.

Instead of optimizing the MLE, some researchers propose to use the conditional variational autoencoder (CVAE), which maximizes the lower bound on the conditional data log-likelihood on a continuous latent variable~\cite{zhao2017learning,shen2017conditional}.
Open-domain response generation is a one-to-many problem, in which a query can be associated with many valid responses.
The CVAE-based models
generally assume the latent variable follows a multivariate Gaussian distribution with a diagonal covariance matrix, which can capture the latent distribution over all valid responses.
With different sampled latent variables, the model is expected to decode diverse responses.
Due to the advantage of the CVAE in modeling the response generation process, we focus on improving the performance of the CVAE-based response generation models.

Although the CVAE has achieved impressive results on many generation problems~\cite{yan2016attribute2image,sohn2015learning}, recent results on response generation
show that the CVAE-based generation models still suffer from the low output diversity problem.
That is multiple sampled latent variables result in responses with similar semantic meanings.
To address this problem,  extra guided signals are often used to improve the basic CVAE. \citeauthor{zhao2017learning}~\shortcite{zhao2017learning} use dialogue acts to capture the discourse variations in multi-round dialogues as guided knowledge. However, such discourse information can hardly be extracted for short-text conversation.

In our work, we
propose a discrete CVAE (DCVAE), which utilizes a discrete latent variable with an explicit semantic meaning in the CVAE for short-text conversation.
Our model mitigates the low output diversity problem in the CVAE by exploiting the semantic distance between the latent variables to maintain good diversity between the sampled latent variables.
Accordingly, we propose a two-stage sampling approach to enable efficient selection of diverse variables from a large latent space assumed in the short-text conversation task.

To summarize, this work makes three contributions:
(1) We propose a response generation model for short-text conversation based on a DCVAE, which utilizes a discrete latent variable with an explicit semantic meaning and could generate high-quality responses.
(2) A two-stage sampling approach is devised to enable efficient selection of diverse variables from a large latent space assumed in the short-text conversation task.
(3) Experimental results show that the proposed DCVAE with the two-stage sampling approach outperforms various kinds of generation models under both automatic and human evaluations, and generates more high-quality responses.
All our code and datasets are available at \url{https://ai.tencent.com/ailab/nlp/dialogue}.

\section{Related Work}
\label{sec:related}
In this section, we briefly review recent advancement
in encoder-decoder models and CVAE-based models for response generation.

\subsection{Encoder-decoder models}
Encoder-decoder models for short-text conversation
~\cite{vinyals2015neural,shang2015neural}
maximize the likelihood of responses given queries. During testing, a decoder sequentially generates a response using search strategies such as beam search. However, these models frequently generate bland and generic responses.

Some early work improves the quality of generated responses by modifying the decoding strategy.
For example,
 \citeauthor{li2016diversity}~\shortcite{li2016diversity} propose to use the maximum mutual information (MMI) to penalize general responses in beam search during testing.
Some later studies alter the data distributions according to different sample weighting schemes, encouraging the model to put more emphasis on learning samples with rare words~\cite{nakamura2018another,liu2018towards}. As can be seen, these methods focus on either pre-processing the dataset before training or post-processing the results in testing, with no change to encoder-decoder models themselves.

Some other work use encoder-decoder models as the basis and add more components to refine the response generation process.
 \citeauthor{xu2017neural}~\shortcite{xu2017neural} present a GAN-based model with an approximate embedding layer. \newcite{zhang2018generating}
 employ an adversarial learning method to directly optimize the lower bounder of the MMI objective~\cite{li2016diversity} in model training.
 These models employ the encoder-decoder models as the generator and focus on how to design the discriminator and optimize the generator and discriminator jointly.
Deep reinforcement learning is also applied to model future reward in chatbot after an encoder-decoder model converges~\cite{li2016deep,li2017adversarial}.
The above methods directly integrate the encoder-decoder models as one of their model modules and still do not actually modify the encoder-decoder models.

 Many attentions have turned to incorporate useful information as latent variables in the encoder-decoder framework to improve the quality of generated responses.
 \citeauthor{yao2017towards}~\shortcite{yao2017towards} consider that a response is generated by a query and a pre-computed cue word jointly.
\citeauthor{zhou2017mechanism}~\shortcite{zhou2017mechanism} utilize a set of latent embeddings to model diverse responding mechanisms.
\citeauthor{xing2017topic}~\shortcite{xing2017topic}
introduce pre-defined topics from an external corpus to augment the information used in response generation.
\citeauthor{gao2019generating}~\shortcite{gao2019generating} propose a model that infers latent words to generate multiple responses.
These studies indicate that many factors in conversation are useful to model the variation of a generated response, but it is nontrivial to extract all of them.
Also, these methods
still optimize the MLE of the complete log-likelihood conditioned on their assumed latent information, and the model optimized with the MLE naturally favors to output frequent patterns in the training data.
Note that we apply a similar latent space assumption as used in \cite{yao2017towards,gao2019generating}, i.e. the latent variables are words from the vocabulary. However,  they use a latent word in a factorized encoder-decoder model, but our model uses it to construct a discrete CVAE and our optimization algorithm is entirely different from theirs.

\subsection{The CVAE-based models}
A few works indicate that it is worth trying to apply the CVAE to dialogue generation which is originally used in image generation~\cite{yan2016attribute2image,sohn2015learning} and optimized with the variational lower bound of the conditional log-likelihood.
For task-oriented dialogues,
\citeauthor{wen2017latent}~\shortcite{wen2017latent} use the latent variable to model intentions in the framework of neural variational inference.
For chit-chat multi-round conversations,
\citeauthor{serban2017hierarchical}~\shortcite{serban2017hierarchical}
model the generative process with multiple levels of variability based on a hierarchical sequence-to-sequence model with a continuous high-dimensional latent variable.
\citeauthor{zhao2017learning}~\shortcite{zhao2017learning} make use of the CVAE and the latent variable is used to capture discourse-level variations. \citeauthor{gu2018dialogwae}~\shortcite{gu2018dialogwae} propose to
induce the latent variables by transforming context-dependent Gaussian noise.
\citeauthor{shen2017conditional}~\shortcite{shen2017conditional} present a conditional variational framework for generating specific responses based on specific attributes.
Yet, it is observed in other tasks such as image captioning~\cite{wang2017diverse} and question generation~\cite{fan2018reinforcement} that the CVAE-based generation models suffer from the low output diversity problem, i.e. multiple sampled variables point to the same generated sequences.
In this work, we utilize a discrete latent variable with an interpretable meaning to alleviate this low output diversity problem on short-text conversation.

We find that \citeauthor{zhao2018unsupervised}~\shortcite{zhao2018unsupervised} make use of a set of discrete variables that define high-level attributes of a response.
Although they interpret meanings of the learned discrete latent variables by clustering data according to certain classes (e.g. dialog acts), such latent variables still have no exact meanings.
In our model, we connect each latent variable with a word in the vocabulary, thus each latent variable has an exact semantic meaning.
Besides, they focus on multi-turn dialogue generation and presented an unsupervised discrete sentence representation learning method learned from the context while our concentration is primarily on single-turn dialogue generation with no context information.

\begin{figure*}[t]
    \centering
    \includegraphics[width=0.85\linewidth]{arch.pdf}
    \caption{The architecture of the proposed discrete CVAE. $\seq{e}_{c_z}$ and $\seq{e}_z$ are embeddings of a cluster and a word sampled from the estimated discrete distributions. $\seq{e}_{c_z}$ is only applied when the two-stage sampling approach in Section~\ref{sec:two} is used. If $\seq{e}_{c_z}$ is applied, the latent representation $\seq{h}_z$ is  the sum of  $\seq{e}_{c_z}$ and $\seq{e}_z$; otherwise, $\seq{h}_z$ is $\seq{e}_z$. $\alpha$ denotes the attention weight. $\oplus$ denotes the sum of input vectors.

    }
    \label{fig:fig_model}
\end{figure*}

\section{Proposed Models}

\subsection{DCVAE and Basic Network Modules}
\label{sec:basic}
Following previous CVAE-based generation models~\cite{zhao2017learning},
we introduce a latent variable $z$ for each input sequence
and our goal is to maximize the lower bound on the conditional data log-likelihood $p(\seq{y}|\seq{x})$, where $\seq{x}$ is the input query sequence and $\seq{y}$  is the  target response sequence:
\begin{eqnarray}
\log p(\seq{y}|\seq{x})\!\! & \geq & \!\!\mathbb{E}_{z \sim q(z|\seq{y},\seq{x})}[\log p(\seq{y}|\seq{x},z)]\nonumber\\
&& \!\!\!\!- D_{KL}(q(z|\seq{y},\seq{x})||p(z|\seq{x})).
\end{eqnarray}
 Here, $p(z|\seq{x})$/$q(z|\seq{y},\seq{x})$/$p(\seq{y}|\seq{x},z)$ is parameterized by the prior/posterior/generation network respectively. $D_{KL}(q(z|\seq{y},\seq{x})||p(z|\seq{x}))$ is the Kullback-Leibler (KL) divergence between the posterior and prior distribution.
Generally, $z$ is set to follow a Gaussian distribution in both the prior and posterior networks.
As mentioned in the related work, directly using the above CVAE formulation causes the low output diversity problem. This observation is also validated in the short-text conversation task in our experiments.

Now, we introduce our basic discrete CVAE formulation to alleviate the low output diversity problem.
We change the continuous latent variable $z$ to a discrete latent one with an explicit interpretable meaning, which could actively control the generation
of the response.
An intuitive way is to connect each latent variable with a word in the vocabulary.

    With a sampled latent $z$ from the prior (in testing)/posterior network (in training), the generation network will take the query representation together with the word embedding of this latent variable as the input to decode the response.
Here, we assume that a single word is enough to drive the generation network to output diverse responses for short text conversation, in which the response is generally short and compact.

    A major advantage of our DCVAE is that for words with far different meanings, their word embeddings (especially that we use a good pre-trained word embedding corpus) generally have a large distance and drive the generation network to decode scattered responses, thus improve the output diversity. In the standard CVAE, $z$'s assumed in a continuous space may not maintain the semantic distance as in the embedding space and diverse $z$'s may point to the same semantic meaning, in which case the generation network is hard to train well with such confusing information.
    Moreover, we can make use of the semantic distance between latent variables to perform better sampling to approximate the objective during optimization, which will be introduced in Section~\ref{sec:two}.

The latent variable $z$ is thus set to follow a categorical distribution with each dimension corresponding to a word in the vocabulary. Therefore the prior and posterior networks should output categorical probability distributions:
\begin{eqnarray}
    p_{\theta}(z|\seq{x}) & = & \mbox{softmax}(g_{\theta}(\seq{x})), \label{prob_p} \label{eq:p}\\
    q_{\phi}(z|\seq{y},\seq{x}) &= &\mbox{softmax}(f_{\phi}(\seq{y},\seq{x})), \label{prob_q}
\end{eqnarray}
where $\theta$ and $\phi$ are parameters of the two networks respectively.
The KL distance of these two distributions can be calculated in a closed form solution:
\begin{eqnarray}
\lefteqn{D_{KL}(q(z|\seq{y},\seq{x})||p(z|\seq{x})) = }  \nonumber\\
&\quad\quad\quad\sum_{z \in Z} q(z|\seq{y},\seq{x})\log \frac{q(z|\seq{y},\seq{x})}{p(z|\seq{x})},
\end{eqnarray}
where $Z$ contains all words in the vocabulary.
\noindent
In the following, we present the details of the prior, posterior and generation network.

\noindent \textbf{Prior network $p(z|\seq{x})$}:
It aims at inferring the latent variable $z$ given the input sequence $x$.
 We first obtain an input representation $\seq{h}_{\seq{x}}^{p}$ by encoding the input query $\seq{x}$ with a bi-directional GRU
  and then compute $g_{\theta}(\seq{x})$ in Eq.~\ref{eq:p}  as follows:
\begin{eqnarray}
 g_{\theta}(\seq{x}) = {\seq{W}_2}
  \cdot \mbox{tanh}( \seq{W}_1  \seq{h}_{x}^{p} + \seq{b}_1 ) +  \seq{b}_2,
  \label{eq:prior}
\end{eqnarray}
where $\theta$ contains parameters in both the bidirectional GRU and Eq.~\ref{eq:prior}.

\noindent \textbf{Posterior network $q(z|\seq{y}, \seq{x})$}:
It infers a latent variable $z$ given a input query $\seq{x}$ and its target response $\seq{y}$. We construct both representations for the input and the target sequence by separated bi-directional GRU's, then add them up to compute $f_{\phi}(\seq{y}, \seq{x})$ in Eq.~\ref{prob_q} to predict the probability of $z$:
\begin{eqnarray}
 \!f_{\phi}(\seq{y}, \seq{x}) \! = \!
  \seq{W}_4
 \! \cdot \! \mbox{tanh}( \seq{W}_3  (\seq{h}_{x}^{q}\! +\! \seq{h}_{y}^q)
  \!+\! \seq{b}_3 )\! + \!   \seq{b}_4, \!\!\!
 \label{eq:post}
 \end{eqnarray}
where $\phi$ contains parameters in the two encoding functions and Eq.~\ref{eq:post}. Note that the parameters of the encoding functions are not shared in the prior and posterior network.

\noindent \textbf{Generation network} $p(\seq{y}|\seq{x},z)$:
We adopt an encoder-decoder model with attention~\cite{luong2015effective} used in the decoder.
With a sampled latent variable $z$, a typical strategy is to combine its representation, which in this case is the word embedding $\seq{e}_z$ of $z$, only in the beginning of decoding.
However, many previous works observe that the influence of the added information will vanish over time~\cite{yao2017towards,gao2019generating}.
Thus,
after obtaining an attentional hidden state at each decoding step,
we concatenate the representation $\seq{h}_z$ of the latent variable and the current hidden state to produce a final output in our generation network.

\subsection{A Two-Stage Sampling Approach}
\label{sec:two}
When the CVAE models are optimized, they tend to converge to a solution with a vanishingly
small KL term,  thus failing to encode meaningful information in $z$.
To address this problem, we follow the idea in~\cite{zhao2017learning}, which introduces an auxiliary loss that requires the decoder in the generation network
to predict the bag-of-words in the response $\seq{y}$.
Specifically,  the response $\seq{y}$ is now represented by two sequences simultaneously: $\seq{y}_o$ with word order and $\seq{y}_{bow}$ without order. These two sequences are assumed to be conditionally independent given $z$ and $\seq{x}$.
Then our training objective can be rewritten as:
\begin{equation}
    \begin{split}
        J(\Theta) = &\mathbb{E}_{z \sim q(z|\seq{y},\seq{x})}[\log p(\seq{y}|\seq{x},z)]  \\
        &- D_{KL}(q(z|\seq{y},\seq{x})||p(z|\seq{x})) \\
        &+ \mathbb{E}_{z \sim q(z|\seq{y},\seq{x})}[\log p(\seq{y}_{bow}|\seq{x}, z)],
    \end{split}
\end{equation}
where $p(\seq{y}_{bow}|\seq{x}, z)$ is obtained by a multilayer perceptron $\seq{h}^{b} = \mbox{MLP}(\seq{x}, z)$:
\begin{equation}
 p(\seq{y}_{bow}|\seq{x}, z) =  \prod_{t=1}^{|\seq{y}|}\frac{\exp(h_{y_t}^{b})}{\sum_{j \in V}\exp(h_{j}^{b})},
\end{equation}
where $|\seq{y}|$ is the length of $\seq{y}$, $y_t$ is the word index of $t$-{th} word in $\seq{y}$, and $V$ is the vocabulary size.

During training, we generally approximate $\mathbb{E}_{z \sim q(z|\seq{y},\seq{x})}[\log p(\seq{y}|\seq{x},z)]$ by sampling $N$ times of $z$ from the distribution $q(z|\seq{y}, \seq{x})$.
In our model, the latent space is discrete but generally large since we set it as the vocabulary in the dataset
\footnote{Note that we remove special tokens including UNK (unknown token), BOS (start of sentence) and EOS (end of sentence) in the latent space such that our model will only select meaningful words as the latent variables.}.
The vocabulary consists of words that are similar in syntactic or semantic.
Directly sampling $z$ from the categorical distribution in Eq.~\ref{prob_q} cannot make use of such word similarity information.

Hence, we propose to modify our model in Section~\ref{sec:basic} to consider the word similarity for sampling multiple accurate and diverse latent $z$'s. We first cluster $z \in Z$ into $K$ clusters $c_1,\ldots, c_K$. Each $z$ belongs to only one of the $K$ clusters and dissimilar words lie in distinctive groups. We use the K-means clustering algorithm to group $z$'s using a pre-trained embedding corpus~\cite{song2018directional}.
Then we revise the  posterior network to perform a two-stage cluster sampling by decomposing $q(z|\seq{y}, \seq{x})$ as :
\begin{eqnarray}
q(z|\seq{y}, \seq{x}) &=& \sum_{k}q(z|\seq{x}, \seq{y}, c_k) q(c_k|\seq{x}, \seq{y})\nonumber\\
&=&  q(z|\seq{x}, \seq{y},c_{k_z})q(c_{k_z}|\seq{x}, \seq{y}).
\end{eqnarray}
That is, we first compute $q(c_{k_z}|\seq{y}, \seq{x})$, which is the probability of the cluster that $z$ belongs to conditioned on both $\seq{x}$ and $\seq{y}$. Next, we compute $q(z|\seq{x}, \seq{y}, c_{k_z})$, which is the probability distribution of $z$ conditioned on the $\seq{x}$, $\seq{y}$ and the cluster $c_{k_z}$.
When we perform sampling from $q(z|\seq{x}, \seq{y})$, we can exploit the following two-stage sampling approach: first sample the cluster based on $q( c_{k} |\seq{x}, \seq{y})$; next sample a specific $z$ from $z$'s within the sampled cluster based on $q(z|\seq{x}, \seq{y}, c_{k_z})$.

Similarly, we can decompose the prior distribution $p(z| \seq{x})$ accordingly for consistency:
\begin{eqnarray}
p(z|\seq{x}) = p(z|\seq{x}, c_{k_z})p(c_{k_z}|\seq{x}).
\end{eqnarray}
In testing, we can perform the two-stage sampling according to
$p(c_{k}|\seq{x})$ and $p(z|\seq{x}, c_{k_z})$. Our full model is illustrated in Figure~\ref{fig:fig_model}.

\noindent
\textbf{Network structure modification:}
To modify the network structure for the two-stage sampling method, we first compute the probability of each cluster given $\seq{x}$ in the prior network (or $\seq{x}$ and $\seq{y}$ in the posterior network) with a softmax layer (Eq.~\ref{eq:prior} or Eq.~\ref{eq:post} followed by a softmax function). We then add the input representation and the cluster embedding $\seq{e}_{c_z}$ of a sampled cluster $c_{z}$, and use another softmax layer to compute the probability of each $z$ within the sampled cluster.
In the generation network, the representation of $z$ is the sum of the cluster embedding $\seq{e}_{c_z}$ and its word embedding $\seq{e}_{z}$.

\noindent
\textbf{Network pre-training:}
To speed up the convergence of our model, we pre-extract keywords from each query using the TF-IDF method. Then we use these keywords to pre-train the prior and posterior networks.
The generation network is not pre-trained because in practice it converges fast in only a few epochs.

\section{Experimental Settings}
Next, we describe our experimental settings including the dataset, implementation details, all compared methods, and the evaluation metrics.

\subsection{Dataset}
\label{sec:dataset}
We conduct our experiments on a short-text conversation benchmark dataset~\cite{shang2015neural} which contains about 4 million post-response pairs from the Sina Weibo~\footnote{\url{http://weibo.com}}, a Chinese social platforms. We employ the Jieba Chinese word segmenter~\footnote{\url{https://github.com/fxsjy/jieba}} to tokenize the queries and responses into sequences of Chinese words.
We use a vocabulary of 50,000 words (a mixture of Chinese words and characters), which covers 99.98\% of words in the dataset. All other words are replaced with $<$UNK$>$.

\subsection{Implementation Details}

We use single-layer
bi-directional GRU for the encoder in the prior/posterior/generation network, and one-layer GRU for the decoder in the generation network. The dimension of all hidden vectors is 1024. The cluster embedding dimension is 620. Except that the word embeddings are initialized by the word embedding corpus~\cite{song2018directional}, all other parameters are initialized by sampling from a uniform distribution $[-0.1,0.1]$. The batch size is 128. We use Adam optimizer with a learning rate of 0.0001.
For the number of clusters $K$ in our method, we evaluate four different values $(5, 10, 100, 1000)$ using automatic metrics and  set $K$ to 10 which tops the four options empirically.
It takes about one day for every two epochs of our model on a Tesla P40 GPU, and we train ten epochs in total. During testing, we use beam search with a beam size of 10.

\renewcommand\arraystretch{1.1}
\begin{table*}[tb]
    \small

    \begin{center}
        \setlength{\tabcolsep}{1.5mm}
        \begin{tabular}{ l | c | c | c | c | c | c || c|c|c}
            \hline

            \multirow{2}{*}{Method} & \multicolumn{6}{c}{Automatic Metrics} & \multicolumn{3}{c}{Human Evaluation}\\
            & BLEU-1 & BLEU-2 & BLEU-3 & BLEU-4 &dist-1 &dist-2 & quality & accept & good \\
            \hline
            Seq2seq & $0.63 \pm 0.14$& $0.49 \pm 0.16$& $0.35 \pm 0.14$& $0.21 \pm 0.12$ &$0.03$&$0.08$ & $1.64 \pm 0.30$  & $49\%$& $15\%$\\

            MMI-bidi & $0.54 \pm 0.17$& $0.39 \pm 0.18$& $0.28 \pm 0.15$& $0.17 \pm 0.13$ &$0.04$&$0.11$ & $1.71 \pm 0.34$ & $52\%$& 19\%\\

            CVAE & $0.60 \pm 0.13$& $0.43 \pm 0.16$& $0.30 \pm 0.14$& $0.18 \pm 0.11$ &$0.03$ &$0.06$ & $1.60 \pm 0.33$& $47\%$& 13\%\\
            MANM & $0.62 \pm 0.14$& $0.48 \pm 0.15$& $0.34 \pm 0.14$& $0.22 \pm 0.12$ &$0.05$ &$0.14$ & $1.73 \pm0.35$ & $53\%$& 21\%\\
            HGFU & $0.52 \pm 0.11$& $0.38 \pm 0.14$& $0.27 \pm 0.12$& $0.16 \pm 0.11$ &$0.08$ &$0.27$ & $1.63 \pm 0.39$& $51\%$& $12\%$\\
            \hline
            DCVAE & $\mathbf{0.64 \pm 0.14}$& $\mathbf{0.49 \pm 0.16}$& $\mathbf{0.35 \pm 0.15}$& $\mathbf{0.22 \pm 0.13}$ &$0.08$&$0.24$ & $\mathbf{2.03 \pm 0.34}$ & \textbf{73\%}& \textbf{30\%}\\
            \hline

        \end{tabular}
        \caption{The automatic and human evaluation results of all compared methods. Note that the acceptable ratio is the percentage of responses with 2 or 3 points.}
        \label{tab:weibo_auto}
    \end{center}
\end{table*}

\subsection{Compared Methods}
In our work, we focus on comparing various methods that model $p(\seq{y}|\seq{x})$ differently. We compare our proposed discrete CVAE ({\bf DCVAE}) with the two-stage sampling approach to three categories of response generation models:
\begin{enumerate}[wide=0.5\parindent]
\item Baselines: {\bf Seq2seq}, the basic encoder-decoder model with
soft attention mechanism ~\cite{bahdanau2015neural} used in decoding and  beam search used in testing;
{\bf MMI-bidi}~\cite{li2016diversity}, which uses the MMI to re-rank results from beam search.
\item {\bf CVAE}~\cite{zhao2017learning}: We adjust the original work which is for multi-round conversation for our single-round setting.
For a fair comparison, we utilize the same keywords used in our network pre-training as the knowledge-guided features in this model.
\item Other enhanced encoder-decoder models:
 Hierarchical Gated Fusion Unit ({\bf HGFU})~\cite{yao2017towards}, which incorporates a cue word extracted using pointwise mutual information (PMI) into the decoder to generate meaningful responses;
 Mechanism-Aware Neural Machine ({\bf MANM})~\cite{zhou2017mechanism}, which introduces latent embeddings to allow for multiple diverse response generation.
\end{enumerate}
\noindent
Here, we do not compare RL/GAN-based methods because all our compared methods can replace their objectives with the use of reward functions in the RL-based methods or add a discriminator in the GAN-based methods to further improve the overall performance.
However, these are not the contribution of our work, which we leave to future work to discuss the usefulness of our model as well as other enhanced generation models combined with the RL/GAN-based methods.

\subsection{Evaluation}
\label{sec:evaluation}
To evaluate the responses generated by all compared methods,
we compute the following automatic metrics on our test set:
\begin{enumerate}[wide=0\parindent]
    \item BLEU:

    BLEU-n measures the average n-gram precision on a set of reference responses. We report BLEU-n with n=1,2,3,4.
    \item Distinct-1 \& distinct-2 ~\cite{li2016diversity}: We count the numbers of distinct uni-grams and bi-grams in the generated responses and divide the numbers by the total number of generated uni-grams and bi-grams in the test set. These metrics can be regarded as an automatic metric to evaluate the diversity of the responses.
    \end{enumerate}
Three annotators from a commercial annotation company are recruited to conduct our human evaluation.
Responses from different models are shuffled for labeling. 300 test queries are randomly selected out, and annotators are asked to independently score the results of these queries with different points in terms of their quality: (1) Good (3 points): The response is grammatical, semantically relevant to the query, and more importantly informative and interesting; (2) Acceptable (2 points): The response is grammatical, semantically relevant to the query, but  too trivial or generic (e.g.,``我不知道(I don't know)", ``我也是(Me too)'', ``我喜欢(I like it)" etc.); (3) Failed (1 point): The response has grammar mistakes or irrelevant to the query.

\section{Experimental Results and Analysis}
In the following, we will present results of all compared methods and conduct a case study on such results. Then, we will perform further analysis of our proposed method by varying different settings of the components designed in our model.

\subsection{Results on All Compared Methods}
\label{sec:result1}
Results on automatic metrics are shown on the left-hand side of Table~\ref{tab:weibo_auto}.
From the results we can see that our proposed DCVAE achieves the best BLEU scores and the second best distinct ratios. The HGFU has the best dist-2 ratio, but its BLEU scores are the worst. These results indicate that the responses generated by the HGFU are less close to the ground true references.
Although the automatic evaluation generally indicates the quality of generated responses, it can not accurately evaluate the generated response and the automatic metrics may not be consistent with human perceptions~\cite{liu2016not}. Thus, we consider human evaluation results more reliable.

For the human evaluation results on the right-hand side of Table~\ref{tab:weibo_auto}, we show the mean and standard deviation of all test results as well as the percentage of acceptable responses (2 or 3 points) and good responses (3 points only).
Our proposed DCVAE has the best quality score among all compared methods. Moreover, DCVAE achieves a much higher good ratio, which means it generates more informative and interesting responses.
Besides, the HGFU's acceptable and good ratios are much lower than our model indicating that it may not maintain enough response relevance when encouraging diversity. This is consistent with the results of the automatic evaluation in Table~\ref{tab:weibo_auto}.
We also notice that the CVAE achieves the worst human annotation score.
This validates that the original CVAE for open-domain response generation does not work well and our proposed DCVAE is an effective way to improve the CVAE for better output diversity.

\begin{figure*}[t]
    \centering
    \includegraphics[width=\linewidth]{case_fig.pdf}
    \caption{Examples of the generated responses. The sampled latent words ($z$) are showed in the brackets.}
    \label{fig:fig_case}
\end{figure*}

\subsection{Case Study}
\label{sec:case}
Figure~\ref{fig:fig_case} shows four example queries with their responses generated by all compared methods.
The Seq2seq baseline tends to generate less informative responses. Though MMI-bidi can select different words to be used, its generated responses are still far from informative.
MANM can avoid generating generic responses in most cases, but sometimes its generated response is irrelevant to the query, as shown in the left bottom case. Moreover, the latent responding mechanisms in MANM have no explicit or interpretable meaning.
Similar results can be observed from HGFU.
If the PMI selects irrelevant cue words, the resulting response may not be relevant.
Meanwhile, responses generated by our DCVAE are more informative as well as relevant to input queries.

\subsection{Different Sizes of the Latent Space}

\noindent
We vary the size of the latent space (i.e., sampled word space $Z$) used in our proposed DCVAE.
Figure~\ref{fig:latent_word} shows the automatic and human evaluation results on the latent space setting to the top 10k, 20k, all words in the vocabulary.
On the automatic evaluation results, if the sampled latent space is getting larger, the BLEU-4 score increases but the distinct ratios drop.
We find out that though the DCVAE with a small latent space has a higher distinct-1/2 ratio, many generated sentences are grammatically incorrect. This is also why the BLEU-4 score decreases.
On the human evaluation results, all metrics improve with the use of a larger latent space.
This is consistent with our motivation that open-domain short-text conversation covers a wide range of topics and areas, and the top frequent words are not enough to capture the content of most training pairs. Thus a small latent space, i.e. the top frequent words only, is not feasible to model enough latent information and a large latent space is generally favored in our proposed model.

 \begin{figure}[tbp]
\begin{center}
\subfigure{
 \includegraphics[width=0.45\linewidth]{space_auto.pdf}
 }
 \subfigure{
  \includegraphics[width=0.45\linewidth]{space_human.pdf}
 }
\end{center}

\caption{
Different sizes of the latent space used in the DCVAE: automatic evaluation (left) and
human evaluation (right).}
\label{fig:latent_word}
\end{figure}

\subsection{Analysis on the Two-Stage Sampling}

\noindent
We further look into whether the two-stage sampling method is effective in the proposed DCVAE.
Here, the One-Stage method corresponds to the basic formulation in Section~\ref{sec:basic} with no use of the clustering information in the prior or posterior network.
Results on both automatic and human evaluation metrics are shown in Figure.~\ref{fig:stage_auto} and ~\ref{fig:stage_human}.
We can observe that the performance of the DCVAE without the two-stage sampling method drops drastically.
This means that the proposed two-stage sampling method is important for the DCVAE to work well.

Besides, to validate the effectiveness of clustering, we implemented a modified DCVAE (DCVAE-CD) that uses a pure categorical distribution in which each variable has no exact meaning. That is, the embedding of each latent variable does not correspond to any word embedding.  Automatic evaluation results of this modified model are shown in Figure.~\ref{fig:dcvae_cd}. We can see that DCVAE-CD performs worse, which means the distribution on word vocabulary is important in our model.

 \begin{figure*}[tb]
\begin{center}
\subfigure[]{\label{fig:stage_auto}
 \includegraphics[width=0.3\linewidth]{hir_auto.pdf}}
 \subfigure[]{\label{fig:stage_human}
  \includegraphics[width=0.3\linewidth]{hir_human.pdf}
 }
  \subfigure[]{\label{fig:dcvae_cd}
  \includegraphics[width=0.3\linewidth]{dcvae-cd.pdf}
 }
\end{center}
\caption{
(a)/(b): Automatic/human evaluation on the DCVAE with/without the two-stage sampling approach.
(c): Automatic evaluation on our proposed DCVAE and the modified DCVAE that uses a pure categorical distribution (DCVAE-CD) in which each variable has no exact meaning.}
\label{fig:two_stage}
\end{figure*}

\section{Conclusion}

In this paper, we have presented a novel response generation model for short-text conversation via a discrete CVAE. We replace the continuous latent variable in the standard CVAE by an interpretable discrete variable, which is set to a word in the vocabulary. The sampled latent word has an explicit semantic meaning,
acting as a guide to the generation of informative and diverse responses. We also propose to use a two-stage sampling approach to enable efficient selection of diverse variables from a large latent space, which is very essential for our model.
Experimental results show that our model outperforms various kinds of generation models under both automatic and human evaluations.

\section*{Acknowledgements}
This work was supported by National Natural Science Foundation of China (Grant No. 61751206, 61876120).

\end{CJK*}
\bibliographystyle{acl_natbib}

redpajama_set_name: RedPajamaArXiv


text:
Unilever, Google, Nestlé Join Forces to Transform Global Food Systems
Libby MacCarthy
Twenty-five leading global companies, including Google, Nestlé, Unilever, PepsiCo, DuPont and Kellogg's announced during the World Economic Forum Annual Meeting in Davos, Switzerland that they were joining together to launch FReSH, the Food Reform for Sustainability and Health program, under the leadership of the World Business Council for Sustainable Development (WBCSD) and the EAT Foundation (EAT).
FReSH is designed to accelerate transformational change in global food systems, to reach healthy diets for all, that are produced responsibly within planetary boundaries. To achieve this goal, FReSH is bringing business and science together. The program draws on knowledge and efforts from premier research institutions, and is working with the business community to develop successful, high-impact solutions.
The launch of FReSH follows the joint initiative announced by WBCSD and the EAT Foundation to create the "conference of parties" for food, in order to accelerate the transformation towards a healthy and sustainable global food system. The partnership was formally launched at the EAT Stockholm Food Forum on 14 June 2016.
"What we eat and how we produce it drives some of our greatest health and environmental challenges. On the other hand, getting it right on food is our greatest opportunity to improve the health of people and planet," said Gunhil Stordalen, Founder and President, EAT Foundation. "This will require concerted action across disciplines and sectors — and business will be a key part of the solution."
How the Food Industry is Reducing GHGs by Repurposing Waste
Learn how Vanguard Renewables, Starbucks and Unilever are working together to tackle food waste and create renewable energy in our upcoming webinar — Wednesday, January 27 at 1pm EST.
Close to 100 percent of the food consumed across the world is produced and supplied by the private sectors. This puts large and small businesses at the heart of the potential for transformational change in food systems all over the world.
FReSH is a platform for the private sector to achieve this transformation in a safe and pre-competitive space. In cooperation with science, academia, policy-makers and civil society, FReSH will catalyze change across the food systems, taking into account local eating patterns, by focusing on the following work streams:
Developing guidelines on healthy and sustainable diets taking into account social and environmental considerations;
Food production adjustment, including formulation and offering to help achieve healthy and sustainable diets;
Food consumption reorientation to strengthen demand for healthy and sustainable diets'
Improvement of food sourcing and reduction of food loss and waste;
Measurement, reporting and communicating progress.
FReSH draws on the findings of the EAR-Lancet Commission on Healthy Diets, where a multi-disciplinary group of world-leading scientists are synthesizing existing evidence to establish targets for healthy and sustainable food systems.
"Clear science-based targets will help businesses create ambitious yet implementable solutions, which can then be brought forward to guide policy makers to provide the framework for local or global food systems transformation," said Peter Bakker, President and CEO, WBCSD.
The World Economic Forum has launched a scenario report on the future of global food systems. This report identifies two critical uncertainties for the future of food systems — demand shift and market connectivity — and explores four potential scenarios they could create.
Additionally, the Business & Sustainable Development Commission has called for business leaders to take up the food systems challenges ahead of us. Meeting these challenges sustainably could unlock 14 business opportunities worth US$2.3 trillion annually by 2030, generating almost 80 million jobs. FReSH provides direct answers to these calls with an action agenda for concrete, meaningful and comprehensive measures. Additionally, the program will support the development of a Sustainable Development Goals (SDG) sector roadmap.
"The private sector has a role to play to make health and sustainable diets affordable, available and aspirational. The market shift will create large-scale opportunities for early adopters in business, as the report of the Business and Sustainable Development Commission clearly shows," said Feike Sijbesma, Chief Executive Officer and Chairman of the Managing Board DSM and Member of the Scaling Up (SUN) Lead Group.
Kellogg Company
Healthcare/Biotech/Pharmaceuticals
Published Jan 18, 2017 6pm EST / 3pm PST / 11pm GMT / 12am CET
KoAnn Skrzyniarz: 'I Choose to Believe …'
SB'19 Detroit: L'Oréal, TerraCycle Illustrate How Products Should Be Made, Packaged
SB'19 Detroit: Reaching Deep Into Communities to Cultivate Tomorrow's Changemakers
SoulBuffalo Gets Execs Out from Behind Desks to See Their Impacts on the World
EVERFI Commits $100M to End Systemic Social, Economic Inequity in K-12 Schools
$50M Venture Fund Aims to Bolster Sustainability Innovations by Women, Minorities
Classroom-in-a-Backpack Bringing Education to the Masses in Off-Grid Bangladesh
Supply Chain Partnership to Aid Small Ag Businesses Impacted by COVID

redpajama_set_name: RedPajamaCommonCrawl


text:
<?php

session_start();

require_once '../vendor/autoload.php';
require_once 'utils.php';

$params = [
    /**
     * API Keys
     * These are common api keys, you can use it to test integration.
     */
    'cw.client_id' => 'ff72ce315d1259e822f47d87d02d261e',
    'cw.client_secret' => '$2a$10$E2jVWDADFA5gh6zlRVcrlOOX01Q/HJoT6hXuDMJxek.YEo.lkO2T6',
    /**
     * CodesWholesale ENDPOINT
     */
    'cw.endpoint_uri' => \CodesWholesale\CodesWholesale::SANDBOX_ENDPOINT,
    /**
     * Due to security reasons you should use SessionStorage only while testing.
     * In order to go live you should change it do database storage.
     *
     * If you want to use database storage use code below.
     *
     * new \CodesWholesale\Storage\TokenDatabaseStorage(
     * new PDO('mysql:host=localhost;dbname=your_db_name', 'username', 'password'))
     *
     * Also remember to use SQL code included in import.sql file
     *
     */
    'cw.token_storage' => new \CodesWholesale\Storage\TokenSessionStorage()
];

$clientBuilder = new \CodesWholesale\ClientBuilder($params);
$client = $clientBuilder->build();

$languages = $client->getLanguages();

displayFilters($languages);

redpajama_set_name: RedPajamaGithub


Conversations between two like-minded people over coffee can often inspire great ideas. Such was the case a year and a half ago when saxophonist Noa Even and cellist Sophie Benn got together to discuss ways to promote new music in Cleveland. The result of that meeting was a new addition to the area's music scene — the Cleveland Uncommon Sound Project.
On Thursday, January 18 at the Bop Stop, CUSP will host "Toasty Tunes," a winter fundraiser to support the organization's Re:Sound New Music Festival, to be held from June 7-10 of this year. The doors will open at 7:00 pm for a meet-and-greet with the evening's performers and the CUSP team. Performances by saxophone duo Ogni Suono (Noa Even and Phil Pierick) and saxophonist/composer Nick Zoulek will begin at 7:30 pm. Attendees can learn more about CUSP and Re:Sound during a conversation with the founders moderated by me, Mike Telin. Click here for tickets and event information. The evening will conclude with a late-night improv jam session at 10:00 pm. Bring your own instruments and join in — that session is free but donations will be appreciated.


What is Chest Bone Pain?
Chest Bone Pain is the type of pain which originates in the bones located in the thoracic cavity or the front part of the chest. Chest Bone Pain has a particularly distinct feeling from other types of chest pains and should not be confused with symptoms of angina, heartburn or heart attack.
The bones around the thoracic cavity, or the chest cavity, consist of ribs, which are joined at the very front by means of a small, flat piece of bone known as sternum. The costal cartilage joins the ribs to the sternum, while at the back, the ribs are attached to the vertebrae or the backbone. Chest bone pain mostly occurs either in the sternum or the ribs, but even origins in the spine can cause pain in the chest.
The following are the major and frequent causes of Chest Bone Pain.
Fractures are an obvious cause of chest bone pain. Fracture in any one bone making up the thoracic cavity, including the sternum, rib bones or clavicle, can cause severe pain. While the vertebrae would not technically count as bones covering the front side of the thoracic cavity, but a fracture in them could also result in chest bone pain as a fracture would cause pain in all the adjoining tissues near the spot that suffered the worst trauma. Fractures are often caused by conditions such as Costochondritis and Osteoporosis, as is explained ahead.
Managed through pain killers and restricting movement. Complex conditions could be operated, especially when involving organ trauma. Mechanical ventilation and other breathing aid could be provided. A cervical collar and rigid braces could be used in the case of spinal fractures.
Costochondritis is a condition that involves the inflammation of the bone cartilage. This disease is a major cause of Chest Bone Pain, as it frequently affects the joint connecting sternum and the ribs. The main cause of the condition is trauma, which could include increased rib cage pressure, such as during sneezing and lifting weights. The condition is particularly characterized by pain during breathing, in some cases, during inhaling particularly. The condition is considered benign.
The treatment is prescribed as per the diagnosis of the underlying or related problem which could be cardiac, gastrointestinal, musculoskeletal, psychogenic, respiratory or due to anxiety and drug abuse.
Arthritis is the inflammation of joints. While Arthritis is not really uncommon, it is pretty rare when it comes to bones of the thoracic cavity. However, in case of Osteoarthritis, which is the most common form of arthritis, there is a fair possibility of that occurrence. Osteoarthritis involves the wear and tear of joint and bones and frequently affects the spine, causing chest bone pain. Apart from joint pain, inflammation is a major symptom of the condition.
This condition cannot be cured. However, physical therapy and pain killers can help patients manage it in a better way.
Osteoporosis is a serious bone and joint disorder which affects older people, especially older women. Osteoporosis involves the degeneration of bone density, resulting in weak bones and joints. This condition is complicated with increased risk of bone fractures. Chest bone pain can be caused if one of the bones making up the thoracic cavity is fractured.
Unfortunately, Osteoporosis is an incurable condition. However, lifestyle amends and better care can help the patient manage it properly and minimize the occurrence of fractures. Intake of Vitamin D, K and Calcium in diet and medicines such as bisphosphonates and teriparatides are administered.
Some bacterial and even fungal infections can cause Chest Bone Pain. Infections affecting the chest bones or Osteomyelitis are usually secondary reactions caused by other infections. The leading infection causing chest bone pain cases is tuberculosis or TB. TB affects the lungs and reaches the ribs and adjoining bones to weaken and infect them. Pulmonary TB can trigger the condition of Miliary TB when it affects the bones and is caused by a species of bacteria known as Mycobacterium Tuberculosis. An even more dangerous condition is known as Pott's Disease, which occurs when the bacterial infection affecting the thoracic cavity bones reaches the vertebrae.
The treatment of the primary infection is required in order to relieve chest bone pain, apart from symptom alleviating medicines. Antibiotics such as isoniazid and rifampicin are administered for the treatment of tuberculosis. More complex regimen can be prescribed too. For Pott's Disease, operative procedures such as intramedullary rod could be administered. Surgery could be required for the condition.


text:
A Far Cry from Africa All Study Guides Homework Help Lesson Plans
A Far Cry from Africa
by Derek Walcott
What are the difference and similarities between Britain and Africa as reflected in "A Far Cry from Africa"?
In "A Far Cry from Africa," Derek Walcott identifies the difference between Britain and Africa as one primarily of environment. Their similarities lie in the nature of their people, for both Africans and the British are guilty of abusing power and trying to assert their "divinity," fighting brutishly for a "dirty cause."
"What are the difference and similarities between Britain and Africa as reflected in "A Far Cry from Africa"?" eNotes Editorial, 20 May 2021, https://www.enotes.com/homework-help/what-are-the-difference-and-similarities-between-2771342. Accessed 27 Jan. 2023.
Amy Troolin, M.A.
Historian, Professional Writer
B.A. from St. Cloud State University M.A. from Franciscan University of Steubenville M.A. from St. Cloud State University M.A. from Signum University
The main point of Derek Walcott's poem "A Far Cry from Africa" is that people abuse their power no matter where in the world they live. Both Africans and the British are guilty of such abuse. "Corpses are scattered through a paradise," the poet notes, and no one has compassion on them. White people and natives alike are slaughtered, while scholars analyze "colonial policy" and officials try to use statistics to justify these horrors.
All people, Walcott maintains, inflict pain on others in order to try to assert their own "divinity." This, too, applies to Africans and the British alike. They fight each other with a "brutish necessity" and for a "dirty cause," without compassion and with poisonous blood. The native "savage" and the "drunken officer" of Britain are really not all that different. Both can be brutal, and both operate out of fear and depravity.
The difference between Britain and Africa is largely environmental. Walcott describes the "parched river" and "beast-teeming plain" of Africa as well as the rushes and the white dust as beaters chase the ibises. These are certainly not British scenes, nor is the depiction of warriors or hunters dancing "to the tightened carcass of a drum." The poet describes Africa as a "gorilla" wrestling with the British "superman," but both are poisonous, and he cannot decide how to deal with the split he finds in himself as he faces his African roots and his British ties.
Download the entire A Far Cry from Africa study guide as a printable PDF!
What are some symbols in "A Far Cry from Africa"?
What is the meaning of the title "Far Cry from Africa?"
How can we analyze the poem "A Far Cry from Africa" by post-colonial criticism approach?
Analyze history as a theme in Neruda's "The Way Spain Was" and Walcott's "A Far Cry from Africa."
What is the effectiveness of Walcott's decision to end the poem "A Far Cry from Africa" with a series of rhetorical questions?
Latest answer posted August 17, 2019 at 12:26:51 PM
How does Walcot compare man to nature in "A Far Cry From Africa"?
Latest answer posted June 28, 2021 at 7:32:15 AM
How does "A Far Cry from Africa" depict the Mau Mau rebellion?
Latest answer posted July 24, 2012 at 3:05:23 PM
What is the reference to 'Spain' in the poem "A Far Cry from Africa" by Derek Walcott? "...again A waste of our compassion, as with Spain The gorilla wrestles with the superman..."
Analyze the title of the poem "A Far Cry from Africa."
What is the figurative language in the poem "A Far Cry from Africa"?