\documentclass[xetex]{beamer}   
\usepackage{polyglossia} % 25pt 
\usepackage{fontspec}                   
\usepackage{mathtools}
\usepackage{graphicx}
\usepackage{multirow}
\usepackage{svg}

%\usepackage[utf8]{inputenc}
%\usepackage[T1]{fontenc}

%\DeclareUnicodeCharacter{0167}{\tstrok}

\usetheme{Montpellier} %Montpellier
\usecolortheme{beaver}
\usepackage{color}
%\definecolor{ao}{rgb}{0.0, 0.0, 1.0}
\definecolor{brightmaroon}{rgb}{0.76, 0.13, 0.28}
\definecolor{byzantium}{rgb}{0.44, 0.16, 0.39}
\definecolor{DarkBlue}{rgb}{0.1,0.1,0.5}
%\definecolor{Green}{rgb}{0.1,0.7,0.6}
\definecolor{Green}{RGB}{34,139,34}
\definecolor{Red}{rgb}{0.9,0.0,0.1}
\definecolor{harmaa}{cmyk}{0.3,0.1,0.1,0.4}
\definecolor{ao}{rgb}{0.36, 0.54, 0.66}
\usepackage{linguex}

\begin{document}


\title{Constraint grammar -- Ráddjehusgrammatihkka}

\author{Lene Antonsen \\
%Giellatekno \\ http://giellatekno.uit.no/ \\ 
}

\date



\frame{\titlepage} 

%\frame{\frametitle{Contents}\tableofcontents} 

\frame{\frametitle{Divvun ja Giellatekno almmuheamit}
\url{https://giellatekno.uit.no/publications/index.html}
}

\section{Morfologalaš analysáhtorat}


\frame{\frametitle{Morfologalaš analysáhtorat}
    \includegraphics[scale=0.38]{tabealla2.4.png}\\
     \\
{\tiny{Antonsen, Lene 2018: Sámegielaid modelleren – huksen ja heiveheapmi duohta giellamáilbmái. PhD}}
}

\frame{\frametitle{Morfologalaš analysáhtor}
    \includegraphics[scale=0.38]{tabealla2.4caption.png} \\
     \\
{\tiny{Antonsen, Lene 2018: Sámegielaid modelleren – huksen ja heiveheapmi duohta giellamáilbmái. PhD}}
}


\frame{\frametitle{Morfologalaš analysáhtora heiveheapmi}
    \includegraphics[scale=0.45]{fstNorm.png} \\ Deskriptiiva ja normatiiva analysáhtorat.
}


\frame{\frametitle{Morfologalaš analysáhtora heiveheapmi}
Leksikonas: \\
\textcolor{blue}{kanála+N+Sem/Plc-abstr\_Route:kanál SOSIAL ; \\
kanála+N+Err/Orth+Sem/Plc-abstr\_Route:kánal SOSIAL ;}\\
 \\  

Morfologiijas: \\
\textcolor{blue}{ +Err/Orth:X5 GODII- ;}   \\
 \\
X5  WeG, Diphthong Simplification, Stem vowel alternations 

}


\section{Disambigueren}

\frame{\frametitle{Disambigueren}
Dehálaš sátni: \textcolor{blue}{disambigueret} \\
 \\
omd. \url{https://en.wikipedia.org/wiki/Disambiguation_(disambiguation)}\\
 \\  
\textcolor{blue}{CG} = Constraint Grammar (Ráddjehusgrámmatihkka)
}


\frame{\frametitle{Disambigueren}

\textcolor{brightmaroon}{Man boaris don leat?} \\
 \\
  \includegraphics[scale=0.4]{leat_multi.png}

}



%\frame{\frametitle{Disambigueren}
%\textcolor{brightmaroon}{Man boaris don leat?} \\
% \\
%  \includegraphics[scale=0.3]{donleat.png} 
%}

\frame{\frametitle{Disambigueren}
\textcolor{brightmaroon}{Man boaris don leat?} \\
 \\
  \includegraphics[scale=0.33]{donleat2.png} 
}


\frame{\frametitle{CG njuolggadus}

  \includegraphics[scale=0.3]{donleat2.png} \\
 \\

\textcolor{blue}{SELECT (Sg2) IF (0 ("leat") LINK -1 (Pers Sg2 Nom)) ;} \\  
 \\

OPERÁHTOR:namma (gilkor) IF (eaktu) ; \\
Posišuvnnat: -3 -2 -1 0 1 2 3\\  
 \\
\textcolor{blue}{SELECT:TestNjuolggadus  (Sg2) IF (0 (V) LINK -1 (Pers Sg2 Nom)) ;} \\

}

\frame{\frametitle{CG njuolggadus}

\textcolor{brightmaroon}{Son lea doppe gos don dál leat.} \\
\textcolor{brightmaroon}{Son lea doppe gos don ge dál leat.} \\
 \\

\textcolor{blue}{SELECT:Test1 (Sg2) IF (0 (V) LINK -1 (Pers Sg2 Nom)) ;} \\
 \\

\textcolor{blue}{SELECT:VSg2 (Sg2) IF (0 V LINK *-1 (Pers Sg2 Nom) BARRIER NOT-ADV-PCLE) ;} \\
 \\
LIST WORD = N Pron A Num V Adv Pcle Po Pr Interj CC CS ;
LIST Adv = Adv ;\\
LIST V = V ;\\
SET NOT-ADV = WORD - Adv  ;\\
SET NOT-ADV-PCLE = NOT-ADV - Pcle ;

}


\frame{\frametitle{}
\begin{itemize}
\item \textcolor{blue}{"<leat>"} sátnehápmi / wordform
\item \textcolor{blue}{"leat"} lemma / lexeme
\item \textcolor{blue}{V} gilkor / tag
\item \textcolor{blue}{IF (0 asdfdsd )} eaktu / constraint
\item \textcolor{blue}{0} posišuvdna
\item cealkkarádji / delimiter
\end{itemize}


}
\section{CG analysa}


\frame{\frametitle{Masa sáhttit CG geavahit?}
\begin{itemize}
\item disambigueren
\begin{itemize}
\item SELECT, REMOVE
\end{itemize}
\item lasihit syntáksagilkoriid
\begin{itemize}
\item MAP, ADD, SUBSTITUTE
\end{itemize}
\item lasihit dependeansaloguid
\begin{itemize}
\item SETPARENT, SETCHILD
\end{itemize}
\item grammatihkkadárkkisteapmi
\item jearrat-vástidit-bargobihtát
\item dihtorjorgaleapmi
\end{itemize}

}



\frame{\frametitle{}

  \includegraphics[scale=0.5]{miileatoastan.png}
}
\frame{\frametitle{Analysatorat: Sámegielat}

\begin{table}
\begin{center}
\begin{tabular}{|l|c|c|c|c|c|}  
\hline
Analysáhtor & \multicolumn{5}{c|}{Gielat} \\
\hline
\textbf{Lexicon/} & Davvis. & Julevs. & Lullis. & Anárašg. & Nuort.   \\
\textbf{morph.} & transd. & transd. & transd. & transd. & transd. \\
lemmat & 154 478 & 49 683 & 60 091 & 46 491 & 38 779 \\
\hline
\textbf{Disam-} & Davvis.  & Julevs.  & Lullis.  & Davvis.  &  Nuort.  \\
\textbf{biguator}  &   &   &   & heiveh.  &   \\
njuolggadusat   & 2703 & 713 & 397 & 943 & 242 \\
\hline 
\textbf{Functions} & \multicolumn{5}{c|}{Sámegielaid oktasaš analysáhtor, 466}   \\
\hline
\textbf{Depen-} & \multicolumn{5}{c|}{ }  \\
\textbf{dency} & \multicolumn{5}{c|}{Sámegielaid oktasaš analysáhtor, 135}  \\
\hline
\end{tabular} \\
\caption{Giella-sme, Giella-smj, Giella-sma, Giella-smn, Giella-sms}
\end{center}
\end{table}%
}

\frame{\frametitle{115 CG-njuolggadusa}
  \includegraphics[scale=0.45]{CGbeaktilvuohta.png} \\
  {\tiny{Antonsen, Lene and Trond Trosterud 2011: Next to nothing -- a cheap South Saami disambiguator. NEALT Proceedings Series 2011. Volum 14 [10]. \par}} 
}


\section{CG syntáksa}


\frame{\frametitle{Constraint Grammar -- duogáš}
\footnotesize
\begin{itemize}
\item Karlsson, Fred (1990) \textcolor{brightmaroon}{Constraint grammar as a framework for parsing running text}. COLING '90 Proceedings of the 13th conference on Computational linguistics. Volum 3: 168--173.
\item Karlsson, Fred, A. Voutilainen, J. Heikkilä ja A. Anttila (1995) \textcolor{brightmaroon}{Constraint Grammar. A Language-Independent System for Parsing Unrestricted Text}. Natural Language Processing. Berlin, New York  
\item Tapanainen, Pasi (1996) \textcolor{brightmaroon}{The constraint grammar parser CG-2} Publications of the Department of General Linguistics, University of Helsinki. Volum 27.  
\item Eckhard Bick (2000) (\textcolor{brightmaroon}{vislcg3})  <== Dánmárkkus
\begin{itemize}
%\item \url{http://sourceforge.net/projects/vislcg/}
\item \url{http://visl.sdu.dk/constraint_grammar.html}
\item Tino Didriksen
\end{itemize}
\end{itemize}

}


\frame{\frametitle{CG-fiila}
\begin{itemize}
\item DELIMITERS = "<.>" "<!>" "<?>" "<...>" "<¶>" ;   
\item Sets
\begin{itemize}
\item LIST Adv = Adv ; which is equal with  (Adv)  
\item LIST WORD = N A Adv V Pron CC Po Pr Interj Pcle Num  ;
\item LIST PLACE-ADV =  "bajábealde" "davábealde" "lagabus" ;  
\item SET REAL-WORD = WORD - Num - Ord ;
\item SET MEASURE = VOLUME OR WEIGHT OR LENGTH OR AMOUNT OR TEMPERATURE OR TIME-UNIT OR ("m2") ;  
\end{itemize}
\item BEFORE-SECTIONS, SECTION  (x N), AFTER-SECTIONS  
\end{itemize}

}



\frame{\frametitle{Operáhtorat}
\begin{itemize}
\item \textcolor{blue}{SELECT} (remove other readings)
\item \textcolor{blue}{REMOVE} (remove this reading)
\item IFF, COPY, INCLUDE... 
\item \textcolor{blue}{MAP} (add this tag to the reading, on no more tags)
\item ADD (add this tag to the reading, and possible more tags)
\item ja daidda lassin:
\begin{itemize}
\item LIST, SET
\item \textcolor{blue}{TARGET, IF, LINK, NOT, NEGATE, OR, BARRIER}
\item C, ...
\end{itemize}
\end{itemize}

}



\end{document}

\frame{\frametitle{Lexical selection with Constraint Grammar}
SELECT ("rein"i) (0 ("<heagga>"i) LINK -1 num - ("okta")) ; \\
\vspace{0.5cm}
SELECT:fallback ("liv"i) (0 ("<heagga>"i)) ;
}


\frame{\frametitle{Feedback on grammar error with Constraint Grammar}

\begin{figure}
  \centering
    \includegraphics[scale=0.38]{deiven_vastas.png}
\end{figure}
‘Who did you meet at the cafe?’ ‘I {\color{blue}{meet, funny, friend}}’\\


}



\frame{\frametitle{Analysis}
\begin{figure}
  \centering
  \includegraphics[scale=0.38]{deivet_analysa.png}
%\caption{The question and answer pair is given to the analyser as one string. The given lemmas are placed in the same cohort as the QDL (question delimiter) and CG-rules map error tags to the string if they are not represented in the answer. The input is disambiguated to some degree. A CG rule maps the \texttt{\&grm-non-agr-subj-v} tag to the verb to trigger feedback on the missing subject-verbal agreement. The question-answer pair is translated in Section \ref{drills}.}
\end{figure}

}



\frame{\frametitle{Rule for detecting grammar errors}

\begin{figure}
  \centering
  \includegraphics[scale=0.4]{map_CG.png}
\end{figure} 
LIST PERSON-NUMBER-TAG = Sg1 Sg2 Sg3 Du1 Du2 Du3 Pl1 Pl2 Pl3 ;
}


\frame{\frametitle{Meta comments with Constraint Grammar}

\begin{figure}
  \centering
  \includegraphics[scale=0.4]{adjlemma.png}
\end{figure}

$\rightarrow$ "You must use the given adjective."

}

\frame{\frametitle{Implicit feedback}
\begin{figure}
  \centering
  \includegraphics[scale=0.45]{Sahka_honnega.png}
%\caption{The question and answer pair is given to the analyser as one string. The given lemmas are placed in the same cohort as the QDL (question delimiter) and CG-rules map error tags to the string if they are not represented in the answer. The input is disambiguated to some degree. A CG rule maps the \texttt{\&grm-non-agr-subj-v} tag to the verb to trigger feedback on the missing subject-verbal agreement. The question-answer pair is translated in Section \ref{drills}.}
\end{figure}

}




\frame{\frametitle{Navigating with Constraint Grammar}
\begin{figure}
  \centering
  \includegraphics[scale=0.35]{Sahka_deaja_an.png}
%\caption{The question and answer pair is given to the analyser as one string. The given lemmas are placed in the same cohort as the QDL (question delimiter) and CG-rules map error tags to the string if they are not represented in the answer. The input is disambiguated to some degree. A CG rule maps the \texttt{\&grm-non-agr-subj-v} tag to the verb to trigger feedback on the missing subject-verbal agreement. The question-answer pair is translated in Section \ref{drills}.}
\end{figure}

}


\frame{\frametitle{Rules for navigating}


\begin{figure}
  \includegraphics[scale=0.35]{add_CG.png}
\end{figure}

\begin{figure}
  \includegraphics[scale=0.35]{add_CG_tea.png}
\end{figure}


}


\frame{\frametitle{Navigating to the relevant next question}
      <text>Háliidat go gáfe vai deaja?</text> \\
      <alt target="coffee" link="sugar\_question"/> \\
{\color{red}{<alt target="tea" link="honey\_question"/>}} \\
      <alt target="negative" link="drink\_something\_else\_question"/> \\
      <alt target="default"> link="next\_topic"/>

}



\end{document}
