text:
\section{Introduction}
In the last few years, the application of deep neural models has allowed rapid progress in NLP. Tasks in phonology and morphology have been no exception to this, with neural encoder-decoder models achieving strong results in recent shared tasks in phonology \cite{gorman-etal-2020-sigmorphon} and morphology \cite{vylomova-etal-2020-sigmorphon}. However, the neural models that perform well on these tasks make use of hundreds, if not thousands of training examples for each language. Additionally, the patterns that neural models identify are not interpretable. In this paper, we explore the problem of learning interpretable phonological and morphological rules from only a small number of examples, a task that humans are able to perform.

Consider the example of verb forms in the language Mandar presented in \cref{tab:sampleprob}. How would a neural model tasked with filling the two blank cells do? The data comes from a language that is not represented in large-scale text datasets that could allow the model to harness pretraining, and the number of samples presented here is likely not sufficient for the neural model to learn the task.

However, a human would fare much better at this task even if they didn't know Mandar. Identifying rules and patterns in a different language is a principal concern of a descriptive linguist \cite{brown2010concise}. Even people who aren't trained in linguistics would be able to solve such a task, as evidenced by contestants in the Linguistics Olympiads\footnote{\url{https://www.ioling.org/}}, and general-audience puzzle books \cite{bellos2020language}. In addition to being able to solve the task, humans would be able to express their solution explicitly in terms of rules, that is to say, a \textit{program} that maps inputs to outputs.

\begin{table}[t]
    \centering
    \begin{tabular}{cc}
    \toprule
        \textbf{to \textit{V}} & \textbf{to be \textit{V}ed} \\
    \midrule
        \textipa{mappasuN} & \textipa{dipasuN} \\
        \textipa{mattunu} & \textipa{ditunu} \\
        ? & \textipa{ditimbe} \\
        ? & \textipa{dipande} \\
    \bottomrule
    \end{tabular}
    \caption{Verb forms in Mandar \cite{mandar_problem}}
    \label{tab:sampleprob}
\end{table}

\textit{Program synthesis} \cite{ProgramSynthesisNow} is a method that can be used to learn programs that map an input to an output in a \textit{domain-specific language} (DSL). It has been shown to be a highly sample-efficient technique to learn interpretable rules by specifying the assumptions of the task in the DSL \cite{FlashFill}.

This raises the questions
\begin{enumerate*}[label={(\roman*)}]
    \item Can program synthesis be used to learn linguistic rules from only a few examples?
    \item If so, what kind of rules can be learnt?
    \item What kind of operations need to explicitly be defined in the DSL to allow it to model linguistic rules?
    \item What knowledge must be implicitly provided with these operations to allow the model to choose rules that generalize well?
\end{enumerate*}

\begin{table*}[t]
    \centering
    \begin{small}
    \begin{tabular}{p{1.8in}p{3.7in}}
    \toprule
        \textbf{Predicate} & \\
    \midrule
        $\texttt{IsToken(}w, s, i\texttt{)}$ & Is $x$ equal to the token $s$? This allows us to evaluate matches with specific tokens. \\ \midrule
        $\texttt{Is(}w, f, i\texttt{)}$ & Is $f$ true for $x$? This allows us to generalize beyond single tokens and use features that apply to multiple tokens. \\ \midrule
        $\texttt{TransformationApplied(}w, t, i\texttt{)}$ & Has the transformation $t$ has been applied to $x$ in a previous pass? This allows us to reference previous passes in learning rules for the current pass. \\ \midrule
        $\texttt{Not(}p\texttt{)}$ & Negates the predicate $p$. \\
    \bottomrule
    \end{tabular}
    \end{small}
    \caption{Predicates that are used for synthesis. The predicates are applied to a token $x$ that is at an offset $i$ from the current token in the word $w$. The offset may be positive to refer to tokens after the current token, zero to refer to the current token, or negative to refer to tokens before the current token.}
    \label{tab:predicates}
\end{table*}

In this work, we use program synthesis to learn phonological rules for solving Linguistics Olympiad problems, where only the minimal number of examples necessary to generalize are given \cite{sahin-etal-2020-puzzling}.
We present a program synthesis model and a DSL for learning phonological rules, and curate a set of Linguistics Olympiad problems for evaluation.

We perform experiments and comparisons to baselines, and find that program synthesis does significantly better than our baseline approaches. We also present some observations about the ability of our system to find rules that generalize well, and discuss examples of where it fails.

\section{Program synthesis}

Program synthesis is ``the task of automatically finding programs from the underlying programming language that satisfy (user) intent expressed in some form of constraints'' \cite{ProgramSynthesisNow}. This method allows us to specify domain-specific assumptions as a language, and use generic synthesis approches like \textsf{FlashMeta} \cite{flashmeta} to synthesize programs.

The ability to explicitly encode domain-specific assumptions gives program synthesis broad applicability to various tasks. In this paper, we explore applying it to the task of learning phonological rules. Whereas previous work on rule-learning has focused on learning rules of a specific type \cite{brill-1992-simple,johnson-1984-discovery}, the DSL in program synthesis allows learning rules of different types, and in different rule formalisms.

In this work, we explore learning rules similar to rewrite rules \cite{chomsky1968sound} that are used extensively to describe phonology. Sequences of rules are learnt using a noisy disjunctive synthesis algorithm \textsf{NDSyn} \cite{iyer2019synthesis} extended to learn \textit{stateful multi-pass rules} \cite{prolinguist}.

\subsection{Phonological rules as programs}

The synthesis task we solve is to learn a program in a domain-specific language (DSL) for string transduction, that is, to transform a given sequence of input tokens
$i \in \mathcal{I}^*$ to a sequence of output tokens $o \in \mathcal{O}^*$, where $\mathcal{I}$ is the set of input tokens, and $\mathcal{O}$ is the set of output tokens. Each token is a symbol accompanied by a feature set, a set of key-value pairs that maps feature names to boolean values.

We learn programs for token-level examples, which transform an input token in its context to output tokens. The program is a sequence of rules which are applied to each token in an input string to produce the output string. The rules learnt are similar to rewrite rules, of the form
\begin{align*}
    \phi_{-l}\cdots\phi_{-2}\phi_{-1}X\phi_1\phi_2\cdots\phi_r &\rightarrow T
\end{align*}
where
\begin{enumerate*}[label={(\roman*)}]
    \item $X: \mathcal{I} \rightarrow \mathbb{B}$ is a boolean predicate that determines input tokens to which the rule is applied
    \item $\phi_i: \mathcal{I} \rightarrow \mathbb{B}$ is a boolean predicate applied to the $i$\textsuperscript{th} character relative to $X$, and the predicates $\phi$ collectively determine the context in which the rule is applied
    \item $T: \mathcal{I} \rightarrow \mathcal{O}^*$ is a function that maps an input token to a sequence of output tokens.
\end{enumerate*}

$X$ and $\phi$ belong to a set of predicates $\mathcal{P}$, and $T$ is a function belonging to a set of transformation functions $\mathcal{T}$. $\mathcal{P}$ and $\mathcal{T}$ are specified by the DSL.

We allow the model to synthesize programs that apply multiple rules to a single token by synthesizing rules in passes and maintaining state from one pass to the next. This allows the system to learn stateful multi-pass rules \cite{prolinguist}.

\subsection{Domain-specific language}

\begin{table*}[t]
    \centering
    \begin{small}
    \begin{tabular}{p{1.5in}p{4in}}
    \toprule
        \textbf{Transformation} & \\
    \midrule
        $\texttt{ReplaceBy(}x, s_1, s_2\texttt{)}$ & If $x$ is $s_1$, it is replaced with $s_2$. This allows the system to learn conditional substitutions. \\ \midrule
        $\texttt{ReplaceAnyBy(}x, s\texttt{)}$ & $x$ is replaced with $s$. This allows the system to learn unconditional substitutions. \\ \midrule
        $\texttt{Insert(}x, S\texttt{)}$ & This inserts a sequence of tokens $S$ after $x$ at the end of the pass. It allows for the insertion of variable-length affixes. \\ \midrule
        $\texttt{Delete(}x\texttt{)}$ & This deletes $x$ from the word at the end of the pass. \\ \midrule
        $\texttt{CopyReplace(}x, i\texttt{)}$ & \multirow{4}{4in}{These are analogues of the \texttt{ReplaceBy} and \texttt{Insert} transformations where the token which is added is the same as the token at an offset $i$ from $x$. They allow the system to learn phonological transformations such as assimilation and gemination.} \\
        $\texttt{CopyInsert(}x, i\texttt{)}$ & \\
        & \\
        & \\\midrule
        $\texttt{Identity(}x\texttt{)}$ & This returns $x$ unchanged. It allows the system where a transformation applies under certain conditions, but does not under others. \\
    \bottomrule
    \end{tabular}
    \end{small}
    \caption{Transformations that are used for synthesis. The transformations are applied to a token $x$ in the word $w$. The offset $i$ for the \texttt{Copy} transformations may be positive to refer to tokens after the current token, zero to refer to the current token, or negative to refer to tokens before the current token.}
    \label{tab:transforms}
\end{table*}

The domain-specific language (DSL) is the declarative language which defines the allowable string transformation operations.
The DSL is defined by a set of operators, a grammar which determines how they can be combined, and a semantics which determines what each operator does.
By defining operators to capture domain-specific phenomena, we can reduce the space of programs to be searched to include those programs that capture distinctions relevant to the domain. This allows us to explicitly encode knowledge of the domain into the system.

Operators in the DSL also have a score associated with each operator that allows for setting domain-specific preferences for certain kinds of programs. We can combine scores for each operator in a program to compute a ranking score that we can use to identify the most preferred program among candidates. The ranking score can capture implicit preferences like shorter programs, more/less general programs, certain classes of transformations, etc.

The DSL defines the predicates $\mathcal{P}$ and set of transformations $\mathcal{T}$ that can be applied to a particular token. The predicates and transformations in the DSL we use, along with the description of their semantics, can be found in \cref{tab:predicates,tab:transforms}.

\begin{figure}
    \centering
    \vspace{-0.73cm}
    \begin{programs}
output := Map(disjunction, input_tokens)
disjunction := Else(rule, disjunction)
rule := transformation
        | IfThen(predicate, rule);
    \end{programs}
    \vspace{-0.5cm}
    \caption{\texttt{IfThen-Else} statements in the DSL}
    \label{fig:ifthenelse}
\end{figure}

Sequences of rules are learnt as disjunctions of \texttt{IfThen} operators, and are applied to each token of the input using a \texttt{Map} operator (\cref{fig:ifthenelse}). The conjunction of predicates $X$ and $\phi$ that define the context are learnt by nesting \texttt{IfThen} operators.

A \texttt{transformation} produces an token that is tagged with the transformation that is applied. This allows for maintaining state across passes.

The operators in our DSL are quite generic and can be applied to other string transformations as well. In addition to designing our DSL for string transformation tasks, we allow for phonological information to be specified as features, which are a set of key-value pairs that map attributes to boolean values. While we restrict our investigation to features based only on the symbols in the input, more complex features based on meaning and linguistic categories can be provided to a system that works on learning rules for more complex domains like morphology or syntax. We leave this investigation for future work.

\subsection{Synthesis algorithm}

\begin{figure*}[t]
    \centering
    \resizebox{\textwidth}{!}{\input{multipassalgo.tikz}}
    \caption{An illustration of the synthesis algorithm. \textsf{FM} is \textsf{FlashMeta}, which synthesizes rules which are combined into a disjunction of rules by \textsf{NDSyn}. Here, rule \texttt{\#1} is chosen over \texttt{\#4} since it uses the more general concept of the \texttt{voice} feature as opposed to a specific token, and thus has a higher ranking score.}
    \label{fig:multipassalgo}
\end{figure*}

We use an extension \cite{prolinguist} of the \textsf{NDSyn} algorithm \cite{iyer2019synthesis} that can synthesize stateful multi-pass rules.
\citet{iyer2019synthesis} describe an algorithm for selecting disjunctions of rules, and use the \textsf{FlashMeta} algorithm as the rule synthesis component. \citet{prolinguist} extend the approach proposed by \citet{iyer2019synthesis} for disjunctive synthesis to the task of grapheme-to-phoneme (G2P) conversion in Hindi and Tamil. They propose the idea of learning transformations on token aligned examples, and use language-specific predicates and transformations to learn rules for G2P conversion. We use a similar approach, and use a different set of predicates and transformations that are language-agnostic.
\cref{fig:multipassalgo} sketches the working of the algorithm.

\begin{figure*}
    \centering
    \resizebox{\textwidth}{!}{\input{flashmeta.tikz}}
    \caption{An illustration of the search performed by the \textsf{FlashMeta} algorithm. The \textcolor{blue}{blue} boxes show the specification that an operator must satisfy in terms of input-output examples, with the input token underlined in the context of the word. The \textcolor{orange}{\texttt{Inverse Semantics}} of an operator is a function that is used to infer the specification for each argument of the operator based on the semantics of the operator. This may be a single specification (as for \textsf{predicate}) or a disjunction of specifications (as for \textsf{token} and \textsf{offset}). The algorithm then recursively searches for programs to satisfy the specification for each argument, and combines the results of the search to obtain a program. The \textcolor{mygreen}{search} for the \textsf{rule} in an \texttt{IfThen} statement proceeds similarly to the search for a \textsf{predicate}. Examples of programs that are inferred from a specification are indicated with $\implies$. A dashed line between inferred specifications indicates that the specifications are inferred jointly.}
    \label{fig:flashmeta}
\end{figure*}

The \textsf{NDSyn} algorithm is an algorithm for learning disjunctions of rules, of the form shown in \cref{fig:ifthenelse}. Given a set of examples, it first generates a set of candidate rules using the \textsf{FlashMeta} synthesis algorithm \cite{flashmeta}. This algorithm searches for a program in the DSL that satisfies a set of examples by recursively breaking down the search problem into smaller sub-problems. Given an operator, and the input-output constraints it must satisfy, it infers constraints on each of the arguments to the operator, allowing it to recursively search for programs that satisfy these constraints on each of the arguments. For example, given the \texttt{Is} predicate and a set of examples where the predicate is true or false, the algorithm infers constraints on the arguments the token $s$ and offset $i$ such that the set of examples is satisfied.
The working of \textsf{FlashMeta} is illustrated with an example in \cref{fig:flashmeta}.
We use the implementation of the \textsf{FlashMeta} algorithm available as part of the \textsc{prose}\footnote{\url{https://www.microsoft.com/en-us/research/group/prose/}} framework.

From the set of candidate rules, \textsf{NDSyn} selects a subset of rules with a high ranking score that correctly answers the most examples as well incorrectly answers the least\footnote{A rule will not produce any answer to examples that don't satisfy the context constraints of the rule.}. Additional details about the algorithm are provided in \cref{sec:ndsyn}.

The synthesis of multi-pass rules proceeds in passes. In each pass, a set of token-aligned examples is provided as input to the \textsf{NDSyn} algorithm. The resulting rules are then applied to all the examples, and those that are not solved are passed as the set of examples to \textsf{NDSyn} in the next pass. This proceeds until all the examples are solved, or for a maximum number of passes.

\section{Dataset} \label{sec:phonologyprobs}

To test the ability of our program synthesis system to learn linguistic rules from only a few examples, we require a task with a small number of training examples, and a number of test examples which measure how well the model generalises to unseen data. Additionally, to ensure a fair evaluation, the test examples should be chosen such that the samples in the training data provide sufficient evidence to correctly solve the test examples.

To this end, we use problems from the Linguistics Olympiad. The Linguistics Olympiad is an umbrella term describing contests for high school students across the globe. Students are tasked with solving linguistics problems---a genre of  composition that presents linguistic facts and phenomena in enigmatic form \cite{derzhanski_payne_2010}. These problems typically have 2 parts: the \textit{data} and the \textit{assignments}.

The data consists of examples where the solver is presented with the application rules to some linguistic forms (words, phrases, sentences) and the forms derived by applying the rules to these forms. The data typically consists of 20-50 forms, the minimal number of examples required to infer the correct rules is presented \cite{sahin-etal-2020-puzzling}.

The assignments provide other linguistic forms, and the solver is tasked with applying the rules inferred from the data to these forms.
The forms in the assignments are carefully selected by the designer to test whether the solver has correctly inferred the rules, including making generalizations to unseen data. This allows us to see how much of the intended solution has been learnt by the solver by examining responses to the assignments.

The small number of training examples (data) tests the generalization ability and sample efficiency of the system, and presents a challenging learning problem for the system. The careful selection of test examples (assignment) lets us use them to measure how well the model learns these generalizations.

We present a dataset of 34 linguistics problems, collected from various publicly accessible sources. These problems are based on phonology, and some aspects of the morphology of languages, as well as the orthographic properties of languages. These problems are chosen such that the underlying rules depend only on the given word forms, and not on inherent properties of the word like grammatical gender or animacy.
The problems involve
\begin{enumerate*}[label={(\arabic*)}]
    \item inferring phonological rules in morphological inflection (\cref{tab:movima})
    \item inferring phonological changes between multiple related languages (\cref{tab:turkishtatar})
    \item converting between the orthographic form of a language and the corresponding phonological form (\cref{tab:micmac})
    \item marking the phonological stress on a given word (\cref{tab:aleut}).
\end{enumerate*}
We refer to each of these categories of problems as morphophonology, multilingual, transliteration, and stress respectively. We further describe the dataset in \cref{sec:dataappendix}\footnote{The dataset is available \href{https://github.com/saujasv/phonological-generalizations}{here}.}.

\begin{table*}[t]
    \small
    \centering
    \begin{subtable}{0.26\textwidth}
        \centering
        \begin{tabular}{ll}
        \toprule
        \textbf{base form} & \textbf{negative form} \\
        \midrule
        \textipa{joy} & \textipa{kas joya:ya'} \\
        \textipa{bi:law} & \textipa{kas bika'law} \\
        \textipa{tipoysu:da} & ?\\
        ? & \textipa{kas wurula:la'} \\
        \bottomrule
        \end{tabular}
        \caption{Movima negation} %
        \label{tab:movima}
    \end{subtable}
    \begin{subtable}{0.2\textwidth}
        \centering
        \begin{tabular}{ll}
        \toprule
            \textbf{Turkish} & \textbf{Tatar} \\
        \midrule
            \textipa{bandIr} & \textipa{mandIr} \\
            \textipa{yelken} & \textipa{cilk\"an} \\
            ? & \textipa{osta} \\
            \textipa{bilezik} & ? \\
        \bottomrule
        \end{tabular}
        \caption{Turkish and Tatar} %
        \label{tab:turkishtatar}
    \end{subtable}
    \begin{subtable}{0.26\textwidth}
        \centering
        \begin{tabular}{ll}
        \toprule
            \textbf{Listuguj}
            & \textbf{Pronunciation} \\
        \midrule
            \textit{g'p'ta'q} & \textipa{g@b@da:x} \\
            \textit{epsaqtejg} & \textipa{epsaxteck} \\
            \textit{emtoqwatg} & ? \\
            ? & \textipa{@mtesk@m} \\
        \bottomrule
        \end{tabular}
        \caption{Micmac orthography}%
        \label{tab:micmac}
    \end{subtable}
    \begin{subtable}{0.24\textwidth}
        \centering
        \begin{tabular}{ll}
        \toprule
            \textbf{Aleut}
            & \textbf{Stress} \\
        \midrule
            \textipa{tatul} & \texttt{01000} \\
            \textipa{n@tG@lqin} & \texttt{000010000} \\
            \textipa{sawat} & ? \\
            \textipa{qalpuqal} & \texttt{00001000} \\
        \bottomrule
        \end{tabular}
        \caption{Aleut stress}%
        \label{tab:aleut}
    \end{subtable}
    \caption{A few examples from different types of Linguistics Olympiad problems. `?' represents a cell in the table that is part of the test set.}
    \label{tab:exampleproblems}
\end{table*}

\subsection{Structure of the problems} \label{sec:probstructure}
Each problem is presented in the form of a matrix $M$. Each row of the matrix contains data pertaining to a single word/linguistic form, and each column contains the same form of different words, i.e., an inflectional or derivational paradigm, the word form in a particular language, the word in a particular script, or the stress values for each phoneme in a word. A test sample in this case is presented as a particular cell $M_{ij}$ in the table that has to be filled. The model has to use the data from other words in the same row ($M_{i:}$) and the words in the column ($M_{:j}$) to predict the form of the word in $M_{ij}$.

In addition to the data in the table, each problem contains some additional information about the symbols used to represent the words. This additional information is meant to aid the solver understand the meaning of a symbol they may not have seen before. We manually encode this information in the feature set associated with each token for synthesis. Where applicable, we also add consonant/vowel distinctions in the given features, since this is a basic distinction assumed in the solutions to many Olympiad problems.

We use the assignments that accompany every problem as the test set, ensuring that the correct answer can be inferred based on the given data.

\subsection{Dataset statistics}
The dataset we present is highly multilingual. The 34 problems contain samples from 38 languages, drawn from across 19 language families. There are 15 morphophonology problems, 7 multilingual problems, 6 stress, and 6 transliteration problems. The set contains 1452 training words with an average of 43 words per problem, and 319 test words with an average of 9 per problem. Each problem has a matrix that has between 7 and 43 rows, with an average of 23. The number of columns ranges from 2 to 6, with most problems having 2.

\begin{table*}[t]
    \centering
    \small
    \begin{tabular}{lcccccccccc}
    \toprule
        \multirow{2}{*}{\textbf{Model}} & \multicolumn{2}{c}{\textbf{All}} & \multicolumn{2}{c}{\textbf{Morphophonology}} & \multicolumn{2}{c}{\textbf{Multilingual}} & \multicolumn{2}{c}{\textbf{Transliteration}} & \multicolumn{1}{c}{\textbf{Stress}} \\
    \cmidrule(lr){2-3}\cmidrule(lr){4-5}\cmidrule(lr){6-7}\cmidrule(lr){8-9}\cmidrule(lr){10-10} \\
         & \textsc{Exact} & \textsc{chrF} & \textsc{Exact} & \textsc{chrF} & \textsc{Exact} & \textsc{chrF} & \textsc{Exact} & \textsc{chrF} & \textsc{Exact} \\ \midrule

         \textsc{NoFeature} & 26.8\% & 0.64 & 30.1\% & 0.72 & 42.1\% & 0.59 & 12.0\% & 0.51 & 15.4\% \\
         \textsc{Token} & \textbf{32.7\%} & 0.63 & 37.5\% & 0.68 & \textbf{45.3\%} & 0.60 & 16.4\% &  0.52 & 22.2\% \\
         \textsc{Feature} & 30.9\% & 0.51 & \textbf{38.6\%} & 0.56 & 39.9\% & 0.42 & 9.5\% & 0.49 & \textbf{23.0\%} \\\midrule
         LSTM & 8.2\% & 0.44 & 9.2\% & 0.49 & 5.7\% & 0.45 & 2.1\% & 0.31 & 15.0\% \\
         Transformer & 5.4\% & 0.42 & 2.3\% & 0.39 & 9.2\% & 0.50 & 1.7\% & 0.42 & 12.6\% \\
         WFST & 20.9\% & 0.56 & 16.3\% & 0.47 & 38.7\% & 0.63 & \textbf{29.7\%} & 0.71 & 2.8\% \\
    \bottomrule
    \end{tabular}
    \caption{Metrics for all problems, and for problems of each type. The \textsc{chfF} score for stress problems is not calculated, and not used to determine the overall \textsc{chrF} score.}
    \label{tab:metricresults}
\end{table*}

\section{Experiments}
\subsection{Baselines}
Given that we model our task as string transduction, we compare with the following transduction models used as baselines in shared tasks on G2P conversion \cite{gorman-etal-2020-sigmorphon} and morphological reinflection \cite{vylomova-etal-2020-sigmorphon}.

\noindent\textbf{Neural:} We use LSTM-based sequence-to-sequence models with attention as well as Transformer models as implemented by \citet{neuraltransducer}. For each problem, we train a single neural model that takes the source and target column numbers, and the source word, and predicts the target word.

\noindent\textbf{WFST:} We use models similar to the pair $n$-gram models \cite{novak_minematsu_hirose_2016}, with the implementation similar to that used by \citet{lee-etal-2020-massively}. We train a model for each pair of columns in a problem. For each test example $M_{ij}$, we find the column with the smallest index $j'$ such that $M_{ij'}$ is non-empty and use $M_{ij'}$ as the source string to infer $M_{ij}$.

Additional details of baselines are provided in \cref{sec:baselines}.

\subsection{Program synthesis experiments}
As discussed in \cref{sec:probstructure}, the examples in a problem are in a matrix, and we synthesize programs to transform entries in one column to entries in another. Given a problem matrix $M$, we refer to a program to transform an entry in column $i$ to an entry in column $j$ as $M_{:i} \rightarrow M_{:j}$.
To obtain token-level examples, we use the Smith-Waterman alignment algorithm \cite{smith1981identification}, which favours contiguous sequences in aligned strings.

We train three variants of our synthesis system with different scores for the \texttt{Is} and \texttt{IsToken} operators. The first one, \textsc{NoFeature}, does not use features, or the \texttt{Is} predicate. The second one, \textsc{Token}, assigns a higher score to \texttt{IsToken} and prefers more specific rules that reference tokens.  The third one, \textsc{Feature}, assigns a higher score to \texttt{Is} and prefers more general rules that reference features instead of tokens. All other aspects of the model remain the same across variants.

\noindent\textbf{Morphophonology and multilingual problems:} For every pair of columns $(s, t)$ in the problem matrix $M$, we synthesize the program $M_{:s} \rightarrow M_{:t}$. To predict the form of a test sample $M_{ij}$, we find a column $k$ such that the program $M_{:k} \rightarrow M_{:j}$ has the best ranking score, and evaluate it on $M_{ik}$.

\noindent\textbf{Transliteration problems:} Given a problem matrix $M$, we construct a new matrix $M'$ for each pair of columns $(s, t)$ such that all entries in $M'$ are in the same script. We align word pairs $(M_{is}, M_{it})$ using the Phonetisaurus many-to-many alignment tool \cite{jiampojamarn-etal-2007-applying}, and build a simple mapping $f$ for each source token to the target token with which it is most frequently aligned. We fill in $M'_{is}$ by applying $f$ to each token of $M_{is}$ and $M'_{it} = M_{it}$. We then find a program $M'_{:s} \rightarrow M'_{:t}$.

\noindent\textbf{Stress problems:} For these problems, we do not perform any alignment, since the training pairs are already token aligned. The synthesis system learns to transform the source string to the sequence of stress values.

\subsection{Metrics}
We calculate two metrics: exact match accuracy, and \textsc{chrF} score \cite{popovic-2015-chrf}. The exact match accuracy measures the fraction of examples the synthesis system gets fully correct.
\begin{align*}
    \textsc{Exact} &= \frac{\#\{\text{correctly predicted test samples}\}}{\#\{\text{test samples}\}}
\end{align*}
The \textsc{chrF} score is calculated only at the token level, and measures the $n$-gram overlaps between the predicted answer and the true answer, and allows us to measure partially correct answers. We do not calculate the \textsc{chrF} score for stress problems as $n$-gram overlap is not a meaningful measure of performance for these problems.

\subsection{Results}
\cref{tab:metricresults} summarizes the results of our experiments. We report the average of each metric across problems for all problems and by category.

We find that neural models that don't have specific inductive biases for the kind of tasks we present here are not able to perform well with this amount of data. The synthesis models do better than the WFST baseline overall, and on all types of problems except transliteration. This could be due to the simple map computed from alignments before program synthesis causing errors that the rule learning process cannot correct.

\section{Analysis}
We examine two aspects of the program synthesis models we propose. The first is the way it uses the explicit knowledge in the DSL and implicit knowledge provided as the ranking score to generalize. We then consider specific examples of problems, and show examples of where our models succeed and fail in learning different types of patterns.

\begin{table}[h]
    \small
    \centering
    \begin{tabular}{cccc}
    \toprule
        \textbf{Model} &
        $100\%$ &
        $\ge 75\%$  &
        $\ge 50\%$ \\ \midrule
        \textsc{NoFeature} & 3 & 5 & 7 \\
        \textsc{Token} & 3 & 6 & 10 \\
        \textsc{Feature} & \textbf{3} & \textbf{6} & \textbf{11} \\
        WFST & 1 & 2 & 7 \\
        \bottomrule
    \end{tabular}
    \caption{Number of problems where the model achieves different thresholds of the \textsc{Exact} score.}
    \label{tab:threshold}
\end{table}

\subsection{Features aid generalization}
Since the test examples are chosen to test specific rules, solving more test examples correctly is indicative of the number of rules inferred correctly. In \cref{tab:threshold}, we see that providing the model with features allows it to infer more general rules, solving a greater fraction of more problems. We see that allowing the model to use features increases its performance, and having it prefer more general rules involving features lets it do even better.

\subsection{Correct programs are short}

In \cref{fig:rulesplot} we see that the number of rules in a problem\footnote{To account for some problems having more columns than others (and hence more rules), we find the average number of rules for each pair of columns.} tends to be higher when the model gets the problem wrong, than when it gets it right. This indicates that when the model finds many specific rules, it overfits to the training data, and fails to generalize well. This holds true for all the variants,
as seen in the downward slope of the lines.

\begin{figure}[t]
    \centering
    \includegraphics[width=\columnwidth]{plot.png}
    \caption{Number of rules plotted against \textsc{Exact} score}
    \label{fig:rulesplot}
\end{figure}

We also find that allowing and encouraging a model to use features leads to shorter programs. The average length of a program synthesized by \textsc{NoFeatures} is 30.5 rules, while it is 25.8 for \textsc{Token}, and 20.7 for \textsc{Feature}. This suggests that explicit access to features, and implicit preference for them leads to fewer, more general rules.

\subsection{Using features}
Some problems provide additional information about certain sounds. For example, a problem based on the alternation retroflexes in Warlpiri words \cite{warlpiri_problem} explicitly identifies retroflex sounds in the problem statement. In this case, a program produced by our \textsc{Feature} system is able to use these features, and isolate the focus of the problem by learning rules such as
\begin{figure}[!h]
    \centering
    \vspace{-1cm}
\begin{programs}
    IfThen(Not(Is(w, "retroflex", 0)),
        Identity(x))
\end{programs}
    \vspace{-0.5cm}
    \label{fig:my_label}
\end{figure}

The system learns a concise solution, and is able to generalize using features rather than learning separate rules for individual sounds.

In the case of inflecting a Mandar verb \cite{mandar_problem}, the \textsc{Feature} system uses a feature to find a more general rule than is the case. To capture the rule that the prefix \textit{\textipa{di-}} changes to \textit{\textipa{mas-}} when the root starts with \textit{\textipa{s}}, the model synthesizes
\begin{figure}[!h]
    \centering
    \vspace{-1cm}
\begin{programs}
    IfThen(Is(w, "fricative", 1),
        ReplaceBy(x, "i", "s"))
\end{programs}
    \vspace{-0.5cm}
    \label{fig:my_label}
\end{figure}

However, since \textit{\textipa{s}} is the only fricative in the data, this rule is equivalent to a rule specific to \textit{\textipa{s}}. This rule also covers examples where the root starts with \textit{\textipa{s}}, and causes the model to miss the more general rule of a voiceless sound at the beginning of the root to be copied to the end of the prefix. It identifies this rule only for roots starting with \textit{\textipa{p}} as
\begin{figure}[!h]
    \centering
    \vspace{-1cm}
\begin{programs}
    IfThen(IsToken(w, "p", 1),
        CopyReplace(x, w, 1))
\end{programs}
    \vspace{-0.5cm}
    \label{fig:my_label}
\end{figure}

The \textsc{Token} system does not synthesize these rules based on features, and instead chooses rules specific to each initial character in the root.

Since the DSL allows for substituting one token with one other, or inserting multiple tokens, the system has to use multiple rules to substitute one token with multiple tokens. In the case of
Mandar, we see one way it does this, by performing multiple substitutions (to transform \textit{\textipa{di-}} to \textit{\textipa{mas-}} it replaces \textit{\textipa{d}} and \textit{\textipa{i}} with \textit{\textipa{a}} and \textit{\textipa{s}} respectively, and then inserts \textit{\textipa{m}}).

\subsection{Multi-pass rules}
In a problem on Somali verb forms \cite{somali_problem}, we see a different way of handling multi-token substitutions by using multi-pass rules to create a complex rule using simpler elements. The problem requires being able to convert verbs from 1st person to 3rd person singular.
The solution includes a rule where a single token (\textit{\textipa{l}}) is replaced with (\textit{\textipa{sh}}).
The learned program uses two passes to capture this rule through sequential application of two rules: first \texttt{ReplaceBy(x, "l", "h")}, followed by

\begin{figure}[!h]
    \centering
    \vspace{-1cm}
\begin{programs}
    IfThen(TransformationApplied(w,
            "{ReplaceBy, h}", 1),
        Insert(x, "s"))
\end{programs}
    \vspace{-0.5cm}
    \label{fig:my_label}
\end{figure}

\subsection{Selecting spans of the input}
In a problem involving reduplication in Tarangan \cite{tarangan_problem}, all variants fail to capture any synthesis rules. Reduplication in Tarangan involves copying one or two syllables in the source word to produce the target word. However, the DSL we use does not have any predicates or transformations that allow the system to reference a span of multiple tokens (which would form a syllable) in the input. Therefore, it fails to
model reduplication.

\subsection{Global constraints}
Since we provide the synthesis model with token-level examples,
it does not have access to word-level information.
This results in poor performance on stress problems, as stress depends on the entire word.
Consider the example of Chickasaw stress \cite{chickasaw_problem}. It correctly learns the rule
\begin{figure}[!h]
    \centering
    \vspace{-1cm}
\begin{programs}
    IfThen(Is(w, "long", 0),
        ReplaceAnyBy(x, "1"))
\end{programs}
    \vspace{-0.5cm}
    \label{fig:my_label}
\end{figure}

that stresses any long vowel in the word. However, since it cannot check if the word has a long vowel that has already been stressed, it is not able to correctly model the case when the word doesn't have a long vowel.
This results in some samples being marked with stress at two locations, one where the rule for long vowels applies, and one where the rule for words without long vowels applies.

\section{Related work}
\citet{gildea-jurafsky-1996-learning} also study the problem of learning phonological rules from data, and explicitly controlling generalization behaviour. We pursue a similar goal, but
in a few-shot setting.

\citet{barke-etal-2019-constraint} and \citet{NIPS2015_5785} study program synthesis applied to linguistic rule learning. They make much stronger assumptions about the data (the existence of an underlying form, and the availability of additional information like IPA features). We take a different approach, and study program synthesis models that can work only on the tokens in the word (like \textsc{NoFeature}), and also explore the effect of providing features in these cases. We also test our approach on a more varied set of problems that involves aspects of morphology, transliteration, multilinguality, and stress.

\citet{sahin-etal-2020-puzzling} also present a
set of Linguistics Olympiad problems as a test of the metalinguistic reasoning abilities of NLP models. While problems in their set involve finding phonological rules, they also require the knowledge of syntax and semantics that are out of the scope of our study. We present a set of problems that only requires reasoning about surface word forms,
and
without requiring the
meanings.

\section{Conclusion}
In this paper, we explore the problem of learning linguistic rules from only a few training examples.
We approach this using program synthesis,
and demonstrate that it is a powerful and flexible technique for
learning phonology rules in
Olympiad problems. These problems are designed to be challenging
tasks that require learning rules from a minimal number of examples.
These problems also allow us to specifically test for generalization.

We compare our approach to various baselines, and find that
it is capable of learning phonological rules that generalize
much better than existing approaches. We show that using the DSL, we can explicitly control the structure of rules, and using the ranking score, we can provide the model with implicit preferences for certain kinds of rules.

Having demonstrated the potential of program synthesis as a learning technique that can work with very little data and provide human-readable models, we hope to apply it to learning more complex types of lingusitic rules in the future.

In addition to being a way to learn rules from data, the ability to explicity control the generalization behaviour of the model allows for the use of program synthesis to understand the kinds of learning biases and operations that are required to model various linguistic processes. We leave this exploration to future work.

\section*{Acknowledgements}
We would like to thank Partho Sarthi for invaluable help with \textsc{prose} and \textsf{NDSyn}. We would also like to thank the authors of the ProLinguist paper for their assistance. Finally, we would like to thank the anonymous reviewers for their feedback.

\bibliographystyle{acl_natbib}

redpajama_set_name: RedPajamaArXiv


text:
HomeCelebritiesBollywood ActressesSara Arjun
CelebritiesBollywood Actresses
Sara Arjun
Sara Arjun Biography :
Birthplace : Mumbai
Parents: Raj Arjun, Sanya Arjun
Awards: Vijay Awards – Special Jury Award
Sara Arjun is a popular child actor who was born on 18th June 2005 in Bombay to a Hindu father and a Muslim mother Sanya Ahmed. Her father is an actor who has appeared in a number of films, while her mother is a dance teacher. Her parents are from Bhopal and migrated to Mumbai to pursue the dreams in 2000. She has appeared in a number of TV commercials and movies apart from the short films as well, which include both Hindi and south Indian films.
She got her debut in commercial ad when she was barely one and half years old as was spotted in a mall by ad filmmaker. She then went to shoot for McDonalds and other brands. A south Indian film director called Vijay whom she did a number of commercial ads and short films as well in Mumbai. Her first film as a child actor was Deiva Thirumagal, which was a known Tamil movie. Once the film released, it turned out to be a big hit giving loads of laurels to the cute little girl. She looked cute and skilled in the movie helping the film to earn huge over the box office and giving the rave reviews for the film.
As far as the Bollywood movies are concerned, Sara Arjun first film was Ek Thi Daayan, which was produced by Ekta Kapoor wherein she worked with Emraan Hashmi and Konkana Sen Sharma. The film gave her the cute little kid positive reviews, but failed to get a good response over the box office. Most of the critics have given her positive review, which helped her gain confidence. Some of her south Indian films include Chithirayil Nilachoru, Saivam and Dagudumootha Dandakor, while Jazbaa is her upcoming Bollywood movie, which she is doing with Aishwarya Rai Bachchan and Irrfan Khan.
bollywood child actress
Sara Arjun family
Sara Arjun parents
Previous articleAnushka Shetty
Next articleSalim Khan Gets the Discharge from Hospital
Sara Ali Khan takes a break from shooting, visits Shiv temple in Ujjain with mother Amrita Singh
Priyanka Chopra: "Someone from northeast should have play the role of Marry Kom, I don't look like her"
Throwback pic from the days of Miss India: Dia Mirza is all smiles with Lara Dutta and Priyanka Chopra

redpajama_set_name: RedPajamaCommonCrawl


text:
Q: Passing an array of strings through a socket I have a simple TCP connection with a server and a client program.
I made a simple struct in both the server and the client to pass as the message:
struct {int c; char** v;} msg;

I am just trying to send the argc and argv (input from terminal) from the client:
int main(int argc, char **argv){
...
msg.c = argc;
msg.v = argv;
sendto(Socket, &msg, sizeof(msg), 0, (struct sockaddr *)&input, sizeof(input));

but when sent to the server I can call msg.c to get the number and I can use that
but if I try to use the array of strings I get a seg fault:
recvfrom(Socket, &msg, sizeof(msg), 0, (struct sockaddr *)&input, &sizep);
printf("%d\n", msg.c);
printf("%s\n", msg.v[2]);

I have tried this with just one char * and I wasn't able to send the string across either.
What am I doing wrong?

A: The sendto() function doesn't follow pointers, at all. So you're sending your message which consists of an integer, and one pointer, to the other side. The receiver gets a pointer value that points to some random place in memory that doesn't mean anything.
What you need to do is serialize your data into something that can be sent across a socket. That means, no pointers. For example, for a single string you could send the length, followed by the actual bytes of the string. For multiple strings, you could send a count, followed by a number of strings in the same format as a single string.
Once you receive the data you will need to unserialize the data into an array of char * strings, if that's what you need in the receiver.

A: You cannot send an Array. What you seem to do is to send a pointer to an array. The pointer is a value that points to the beginning of the array in the sender's RAM. However this address is local to one client. If you need to send complex data like an array or classes / structs you usually need to serialize them. There are libraries around to support you. I used Google's Protocol Buffers and liked it; you may want to take a look at it.

redpajama_set_name: RedPajamaStackExchange


Scientists have now observed a particularly rapid type of pair production in the laboratory: Hydrocarbons double when two peroxyl radicals react with each other. This means that stable products with the carbon skeleton of both peroxyl radicals are formed, which very likely will have a peroxide structure. Proof of this reaction path has now become possible with the aid of state-of-the-art measuring technology. Researchers from the Leibniz Institute for Tropospheric Research (TROPOS) and the Universities of Innsbruck and Helsinki are presenting their findings in the current issue of the journal "Applied Chemistry".
The new findings will play an important part in improving our understanding of the decomposition pathways of hydrocarbons in the atmosphere. The rapidly formed reaction products are usually very non-volatile and are precursors for the secondary organic aerosol, which is important for the earth's climate.
The special flow apparatus that allows interference-free experiments of gas phase reactions at atmospheric pressure.
At the TROPOS in Leipzig, the team succeeded in demonstrating this process in laboratory experiments using a special flow apparatus.
Hydrocarbons are regarded as building blocks of life, combining the elements carbon and hydrogen to give rise to millions of different chemical compounds. In addition to methane, these "organic compounds" also include a large number of other gases that play an important role in the atmosphere. Global emissions of these non-methane hydrocarbons from vegetation and human activities are estimated at around 1.3 billion tonnes per year. It is therefore important to know their degradation processes and the products they produce.
Atmospheric decomposition is initiated by oxidising agents such as ozone or OH radicals (the "atmospheric detergent"), resulting almost exclusively in peroxyl radicals as highly reactive intermediates that can continue to react rapidly with nitric oxide (NO) or other peroxyl radicals. So far, it has been assumed that the formation of accretion products from the reaction of two peroxyl radicals is insignificant, which can be traced back to findings from the 60s and 70s.
The new experiments coupled with the necessary kinetic measurements now lead to the conclusion that the formation of the non-volatile reaction products is significant under all atmospheric conditions. "It is fascinating to be able to follow the formation of peroxyl radicals and their reaction products on-line in the mass spectrometer. This gives us a direct insight into the elementary processes during a chemical reaction," reported Dr Torsten Berndt from TROPOS.
At the TROPOS in Leipzig, the team succeeded in demonstrating this process in laboratory experiments using a special flow apparatus that allows interference-free experiments of gas phase reactions at atmospheric pressure. New mass spectrometric techniques developed in Innsbruck and Leipzig were used here for the first time.
In the mass spectrometric analysis, the compound under investigation is ionised and then identified by the mass-to-charge ratio. The gentle ionisation methods used permit the sensitive detection of peroxyl radicals and their reaction products with a detection limit of up to 1 ppqV. With this technique, it is now possible to reliably determine a specific molecule in a mixture of one quadrillion (1015) molecules.
The identification of this new reaction pathway in the atmosphere is of great importance for climate research, as it is another piece of the puzzle in the search for not yet fully understood sources in the formation of the secondary organic aerosol and the subsequent cloud formation.
They are subject to an independent evaluation procedure that is unparalleled in its transparency. Due to the importance of the institutions for the country as a whole, they are funded jointly by the Federation and the Länder, employing some 18,700 individuals, including 9,500 researchers. The entire budget of all the institutes is approximately 1.8 billion Euros.


text:
Ти́рваський район (, ) — адміністративно-територіальна одиниця Естонської РСР з 26 вересня 1950 до 24 січня 1959 року.

Географічні дані
Площа району станом на 1955 рік — 922,0 км2.

Адміністративний центр — місто Тирва.

Історія
26 вересня 1950 року в процесі скасування в Естонській РСР повітового та волосного адміністративного поділу утворений Тирваський сільський район, який безпосередньо підпорядковувався республіканським органам. До складу новоутвореного району ввійшли місто Тирва як адміністративний центр та 14 сільських рад: Гелмеська, Йиґевестеська, Кооркюласька, Леебікуська, Рійдаяська, Голдреська, Тааґепераська, Унаметсаська, Вооруська, Пікруська, Гуммуліська, Пуйдеська, Арукюласька, Кярстнаська.

Після прийняття 3 травня 1952 року рішення про поділ Естонської РСР на три області Тирваський район включений до складу Пярнуської області. Проте вже 28 квітня 1953 року області в Естонській РСР були скасовані і в республіці знов повернулися до республіканського підпорядкування районів.

20 березня 1954 року відбулася зміна кордонів між районами Естонської РСР, зокрема Тирваський район передав 74,41 га Аб'яському та 270,4 га Вільяндіському районам і отримав 73,21 га від Аб'яського та 307,75 га від Вільяндіського районів.

17 червня 1954 року розпочато в Естонській РСР укрупнення сільських рад, після чого в Тирваському районі замість 14 залишилися 7 сільрад: Гелмеська, Гуммуліська, Кооркюласька, Кярстнаська, Рійдаяська, Тааґепераська, Вооруська.

24 січня 1959 року Тирваський район ліквідований, а його територія поділена між районами Валґаським (місто Тирва та Гелмеська, Гуммуліська, Кооркюласька, Рійдаяська й Тааґепераська сільські ради) та Вільяндіським (Кярстнаська та Вооруська сільські ради).

Керівництво району

Перші секретари районного комітету КПЕ
 1955—1959   (Jüri Hindriku p. Suurhans)

Голови виконкому районної Ради депутатів трудящих
 1953—1955  Юрій Гіндрікович Суурханс

Друкований орган
2 лютого 1951 року тричі на тиждень почала виходити газета «Uus Elu» (, «Нове життя»), друкований орган Тирваського районного комітету комуністичної партії Естонії та Тирваської районної ради депутатів трудящих. Останній номер вийшов 31 січня 1959 року.

Примітки

Джерела
 Eesti Entsüklopeedia
 Eesti NSV Teataja / Ведомости Эстонской ССР

Тирваський район
Райони Естонської РСР
Засновані в Європі 1950

redpajama_set_name: RedPajamaWikipedia


Philadelphia has a highly educated and diverse regional workforce, fueled by top-ranked universities. With a dynamic technology sector, access to technical talent, and a fast increasing millennial population, Philadelphia has serious growth potential.
"When you bring the smartest people together with the best possible resources, you get new ideas. You get discovery, you get day one innovation. That's what I feel across Philadelphia."


A luminous channel glass rainscreen clads the award-winning Shaw Center for the Arts in Baton Rouge, LA. Referred to as the "Lantern on the Levee," the building withstood hurricanes Katrina and Rita without damage.
A showcase for channel glass rainscreen design, Shaw Center for the Arts is product of the collaboration of Schwartz/Silver Architects and Eskew+Dumez+Ripple Architecture. The channel glass is installed flanges-out, in front of a watertight corrugated aluminum facade. Varied glass lengths and widths, staggered mid-point wind clips, and 2″ (5 cm) joints lend the rainscreen a distinctive texture that emulates the shimmering surface of the nearby Mississippi. The rainscreen features approx. 38,000 sq. ft. (over 3,500 sq. m) of Bendheim channel glass.


The Bob Baker Marionette Theater has been serving up laughs and ice cream since 1963.
The residents of the Land of Make-Believe live without much fanfare within the Pittsburgh Children's Museum.
A vintage penny arcade hidden in the back of a fun fair-themed bar.
Dozens of vintage puppets are displayed in an unassuming hallway at the public library.
A small but hugely whimsical theater where marionettes play out the "The Battle of Stalingrad."
Peru's only toy museum houses everything from pre-Inca whistles to lead soldiers and terrifying dolls.
Larry Schmidt has been offering the free performances at his California home for over a decade.
The international event's roots go back to a puppeteer who entertained kids during the Nazi occupation.
Meet the hidden tool that defines what a Punch and Judy show sounds like.
This thing is incredibly lifelike.
This famed marionette theater and museum is bursting with imaginative string puppets.


text:
Nutreco delisted from Euronext
As of close of market Thursday (16 April, 2015) Dutch feed company Nutreco was delisted from the Euronext Amsterdam stock exchange, after 18 years.
The company's move to delist itself came after the takeover, last year, by SHV a trade conglomerate, which is owned by the Fentener Van Vlissingen family.
At one stage Cargill was also in the running to takeover Nutreco but this interest prompted SHV to up its offer. The takeover was authorised by the European Commission in December 2014.
Dutch feed company awarded for financial openness
Nutreco was listed on the stock market for over 18 years under the ticker symbol NUO, with the initial public offering taking place on 3 June 1997. The total shareholders return over that peiod is 885%, outperforming most of the AEX and AMX constituent companies. Nutreco won the Sijthoff Prize three times for excellence in financial reporting by Dutch listed companies for its annual report, which reflects also on the openness with which the company has sought to engage with the capital markets.
Knut Nesse, CEO Nutreco: "I would like to thank our shareholders for their support over the years. Today marks the end of an important era in the history of the company. I appreciate the trust that our shareholders have placed in Nutreco, which has enabled us to successfully grow as a company and to deliver value to them and our other stakeholders."
New chapter for Dutch feed company
With the takeover by SHV a new chapter opens for Nutreco as a private company. The existing 'Driving sustainable growth' strategy will be continued with the full support of new shareholder SHV.
Read more about Nutreco:
Nutreco ends divestment process in Portugal/Spain
Cargill drops intentions to buy Nutreco
Nutreco acquires two Brazilian companies
Feed Industry
Steady growth for China's feed industry
Even the output of China's feed industry went down slightly in H1 2017, the overall trend is marked by...
On 29 Sep 2017 In Compound feed
Friday Feed Update: The latest developments listed
It is Friday again, and at the end of each week All About Feed wraps up the latest developments, new product...
On 13 Apr 2018 In Home
Friday Feed Update: What did you miss?
It is Friday again and time for All About Feed's wrap up of the latest developments and business updates from...
On 7 Dec 2018 In Home
Weekly feed business update
New feed additives, upcoming events and mergers and acquisitions. All About Feed wraps up the latest updates and...
On 12 Jan 2018 In Home


text:
Q: Fargate Task with Nat Gateway fails to connect with RDS database Basically, I'm follow these two guides:

*

*Deploying Hasura on AWS with Fargate, RDS and Terraform

*Deploying Containers on Amazon's ECS using Fargate and Terraform: Part 2
I have:

*

*Postgres RDS Database deployed in 'Multi-AZ'

*My python/flask app deployed in Fargate across multiple AZ's

*I run a migration inside the task definition before the app

*ALB Load balancing between the tasks

*Logging for RDS, ECS and ALB into Cloudwatch Logs.

*A NAT gateway with an Elastic IP for each private subnet to get internet connectivity

*A new route table for the private subnets

*NO certificates

*I use terraform 0.12 for the deploy.

*The repository is on ECR

But...
My app can't connect to the RDS database:
sqlalchemy.exc.OperationalError
(psycopg2.OperationalError): FATAL:  password authentication failed for user "postgres"

These are the logs on pastebin-logs
I've already tried changing the password to a very simple one, before deploy, on the console directly, opening ports, turning access public, changing private to public subnet, etcetera, etcetera...
Please, I have a week with this error!!!
UPDATE
I inject the database credentials in this way:
pastebin-terraform

A: I cannot comment, but I mean this as a comment.
What does the security group egress look like on your ECS service that runs the task? You need to make sure it can talk to the RDS, usually on port 5432.


text:
HometownMcLennan County
Wet summer worsening problems with weeds for farmers
By: Caleb Chevalier
CENTRAL TEXAS — July brought its fair share of rain and August has followed suit. All that moisture has fostered the growth of some unwanted guests. We're talking about weeds.
Earlier this month we spoke with Hungate Farm, which was in a battle of its own due to all the rain. But for farmers of crops like wheat, oats, and milo, finding time to cut isn't the problem. Their issue lies with an intruder in the ground. Farmer Rodney Schmalriede says that the definition of a weed is simple: it's any unwanted plant.
"That's not what we're going to grow. We don't want it. It's unwanted, it's a weed," said Schmalriede.
The wheat and oat crop has been fighting weed growth since the beginning of the growing season. February's winter storm had a lot to do with that.
"It stunted back a lot of our wheat. And our oats, burned back the oats. And then when the oats and wheat were trying to come back, the weeds made a flush as well," said Schmalriede.
An abnormally wet summer has further contributed to the problem. Farmers can fight the weeds in one of two ways: plow the fields or turn to spraying. Roots of the weed may not come out when plowed if the ground is wet, and that's when spraying is used.
"We as farmers do not enjoy using the chemicals because they're expensive. But we do use the ones that are, you know, as absolutely safe as possible," said Schmalriede.
Farmers have to carry a license to use certain chemicals for spraying because of the danger involved.
Schmalriede says they take the utmost care to make sure those chemicals are contained. The last thing someone wants is for those chemicals to make it into neighboring fields. Certain chemicals are more desirable than others because of the minimal effect on crops. Getting rid of the weeds as soon as possible, and as safely as possible, is the priority. Any weed left in the ground could rob the crops of nutrients and moisture. The fields must be paid frequent attention so none of the crops are lost. Even after a harvest, the battle doesn't stop.
"There's still some leftover nutrients after we finish a crop. There's still leftover fertilizer," said Schmalriede. "There's still leftover, you know, stuff that each plant can use. We don't want to feed a weed."
Schmalriede has moved on to harvesting his milo fields, and he says he will plow the fields afterward to minimize any weed growth. Spraying will commence after that if the weeds survive. Just like how the plows may get stuck in the mud if the ground is soggy, the spraying equipment may become tricky to operate if the ground cannot dry out.
What the milo farmers are hoping for now is some hot and rain-free weather, so they can get their harvest in without a hitch.


text:
Wall Street's alarm on trade spreads with Goldman's bear warning
Amid the global retreat from monetary stimulus, Morgan Stanley has also soured on equities
Fri, Sep 14, 2018 - 5:50 AM
WHILE US equity investors have kept their cool during this year's escalation of trade tensions, the warnings from Wall Street are only getting louder.
Goldman Sachs Group Inc and JPMorgan Chase & Co have weighed in, highlighting the potential danger to corporate America if a full-blown trade war erupts.
In separate notes this week, strategists at the firms estimated the possible hit to earnings. Goldman chief strategist David Kostin went as far as to call for a bear market under a scenario where the US imposed 10 per cent tariffs on all imports.
The concerns echo those of UBS Group AG strategist Keith Parker, who last week alerted investors that the standout resilience of US stocks is under threat with President Donald Trump mulling a new round of levies against China.
SEE ALSO: US: Stocks end higher after dovish Fed comments
Amid the global retreat from monetary stimulus, Morgan Stanley has also soured on equities.
"We're not that bullish on equities anywhere globally at Morgan Stanley right now," Jonathan Garner, chief strategist for Asia and emerging markets, said in Hong Kong on Thursday. "The latest move that we made on the US side was to recommend reducing positions in US equities," he said in an interview with Bloomberg Television.
Morgan Stanley is instead recommending securitised products linked to Libor, "to take advantage of those higher short yields," Mr Garner said.
While all the anxiety seems to be at odds with investor attitudes - considering they've pushed the S&P 500 Index toward its best year since 2014 versus the rest of the world - it coincides with growing unease among corporate executives.
After studying more than 7,000 earnings transcripts and conference calls, JPMorgan found that trade tariffs surpassed tax cuts as a more frequent topic during the last reporting season, with 35 per cent of companies citing them as a threat.
The firm's strategists led by Dubravko Lakos-Bujas estimate that the combined per-share earnings for S&P 500 companies could drop by as much as US$10 if bi-lateral tariffs of 25 per cent are imposed. This year's earnings forecast for the benchmark is US$165 per share.
"Trade escalation could be a significant drag on forward EPS, especially next year," Mr Lakos-Bujas wrote.
Goldman's Mr Kostin painted a more dire picture. A 25 per cent tariff on Chinese goods could wipe out growth for S&P 500 companies next year.
And in a more extreme case, where the US imposed levies on all global imports, earnings could drop 10 per cent as costs went up for Americans, the firm estimated.
Investor sentiment could also suffer, driving down valuations. As a result, the worst-case scenario could result in the S&P 500 falling to 2,230, Mr Kostin wrote in a note earlier this week. That would represent a 23 per cent decline from the record 2,914 reached last month, meeting the traditional definition of a bear market.
The S&P 500 briefly rebounded on Wednesday on news that the US is proposing a new round of trade talks with China in the near future. The benchmark gauge has climbed about 8 per cent this year, compared with a 6 per cent decline in the MSCI World ex-US Index. BLOOMBERG
Federal Reserve officials see prudence of acting early to sustain growth


We stayed here for the best Thanksgiving vacation ever! The property offers everything you could dream of, beautiful house, fantastic staff, amazing chef. The beach is private & pristine. And yet you are close to the action and tourist sites of Tulum and nearby attractions. Honestly, we barely wanted to leave the house! Greatest vacation ever!
Just got back from the Villa Vidorra and was sad to leave. Had an amazing time, from the Mole on the 1st night we arrived. To the amazing fruit platters,best pancakes ever, we all swear the eggs and chicken are better there. Down to the bacon and the OJ. Not to mention all the amazing meals in between. The breakfast nachos as we called them they are ( chilaquiles) they are a must so are the fish tacos. We also had the lobster and rib eye. Manuel and his chefs are amazing. Don't leave without having his secret sauce it is orange but the green one is great too. The grouper was so good. Hard to pick a favorite. Now for Louis the amazing bartender and I can say amazing cause I live in Vegas haha. Just tell him what you do and don't like and you will have some of the best drinks ever. A must try is the chocolate banana milk shake yes it is for grown ups. I don't like Strawberry but heard he did a Strawberry slushy drink that was awesome. He did me a vanilla version that was great. He makes extra and puts pitchers in the freezer before they leave around 7, I think it was. Now for the house keepers they come clean and do your bedrooms and bathrooms daily just like a hotel. Very nice staff. I recommend the massages. They have a guy the rakes the beach every day it makes the sand easier to walk on. They come and clean the grounds and the pool as well. You should bring water shoes the ocean has little rocks and coral so it hurts your feet a little if you don't. The beach and the pool is amazing they have hammocks, day beds and lounge chairs. Kayaks, snorkeling gear and stand up paddle boards. The pictures do not do this place justice.
A group of 8 of us stayed at Villa Vidorra for five nights and thoroughly enjoyed our stay at this beautiful home. The house is beautifully designed and appointed, peaceful, elegant, large yet intimate. It was the best of a five start hotel and your home, wrapped into one. The beach is yards away, its private, incredibly clean with beautiful white sand and crystal clear waters. The staff at Villa Vidorra were spectacular, making the entire stay such a pleasant experience. They were always there when you needed them, with either food or drink in hand. We eat several meals at the house and the food was some of the best Mexican food we've ever eaten. Chris, the owner, was an incredible host and made the whole experience, for booking to arranging for transportation a breeze. Villa Vidorra is a special place and we fully expect to return as quickly as possible.
Oh my, Beautiful Villa (check), great staff (check), best food (check), Bartender wonderful (check), amazing sunsets (check), The owner Chris is great. The Villa was an amazing surprise. It looks as great in person as it did on line. The backyard with the pool and the beach is wonderful. Best trip we have had in 10 years. My son, daughter and her boyfriend had the best time ever. Snorkling, kayaking, paddle boarding, sleeping in the hammocks in between the coconut trees. Thank you so much to the Owner and staff of the Villa Vidorra!!!!