\documentclass[10pt,a4paper]{scrartcl}
\usepackage{hhline,lmodern,url,moreverb}
\usepackage[square,numbers]{natbib}
\usepackage[british]{babel}
\usepackage[T1]{fontenc} % edh in BibTeX
%\usepackage{graphicx}
\newcommand{\sluga}{\rule{1.5em}{0em}}
\newcommand{\slugb}{\rule{1.0em}{0em}}
\newcommand{\slugc}{\rule{1.0em}{0em}}
\setlength{\textheight}{58\baselineskip}
\setlength{\voffset}{-20mm}
\urldef\mails\url|a.funk,i.roberts,w.peters@dcs.shef.ac.uk|
\selectlanguage{british}
%
\title{Implementing a Variety of Linguistic Annotations through a Common Web-Service Interface}
\author{Adam Funk and Ian Roberts and Wim Peters\\
  University of Sheffield, Department of Computer Science\\
  Regent Court, 211 Portobello, Sheffield, S1~4DP, UK\\
  \mails}
%
\begin{document}
\maketitle
%%%%%
We present a web service toolkit and common client for a series of natural language processing (NLP)
services as a contribution to CLARIN'S European Demonstrator~\cite{demonstrator}.


The CLARIN services are standard SOAP web services.  They take their input as binary data (as a MIME
attachment to the SOAP message, according to the MTOM specification)---though the services are
intended to process text they can handle input in many formats including XML, HTML and PDF,
extracting the text from the source data using the format handling mechanism provided by GATE.  A
service loads the input data into a GATE Document object, then processes that Document using a GATE
\emph{DocumentProcessor} (typically a wrapper around a saved GATE application), and returns its
output as XML data.


The various components making up the service implementation are configured using the Spring
framework, making it simple to slot in alternative \emph{DocumentProcessor} implementations for
different services without changes to the code.  The aspect-oriented programming tools provided by
Spring are used to allow pooling of several identical \emph{DocumentProcessors}, to support multiple
concurrent web service clients.  The web service layer is provided by the Apache CXF toolkit, which
itself uses Spring extensively and thus was a good fit with the Spring-driven architecture adopted
for the business logic.

This toolkit will work easily for any GATE application, and with suitable modification (in the
Spring beans configuration) can use any class that \emph{implements DocumentProcessor}---in effect,
any class that can analyse a single GATE Document and produce XML output (in any valid XML format).
Each web service provides a WSDL file available from the server and uses three methods:
%%
\begin{itemize}
\item \emph{process} send only the document content as a \url{byte[]};
\item \emph{processWithURL} also sends the document URL---the GATE Factory will take the filename
  into consideration when instantiating the Document (to distinguish PDFs properly, for example);
\item \emph{processWithParams} sends a parameter list, which allows the client to specify the
  original URL, encoding, and mime type (this method allows the greatest flexibility).
\end{itemize}


We also provide a GUI Java client\footnote{The full paper will include a screenshot.}, supplied as a
ZIP file with the necessary libraries, so the user needs only a Java 5 runtime environment (JRE).
This client uses the \emph{processWithParams} method and sends the \url{file://} URL, and
user-selected encoding along with the content of the selected local file.  The user selects the
service from the list of endpoint URLs included with the client, but can also type in a URL if he is
aware of a service that has been added since the client software was issued.  Of course, developers
can also use the services' WSDL files to produce their own clients for users' direct use or
embedment in other software.


We have implemented the following services so far, making use of standards which we have worked with
in previous projects (particularly LIRICS\footnote{\url{http://lirics.loria.fr/}},
SEKT\footnote{\url{http://www.sekt-project.com/}}, and
MUSING\footnote{\url{http://www.musing.eu/}}):
%%
\begin{itemize}
\item \emph{annie-alpha} runs the ANNIE\cite{Cun02b} named-entity recognition pipeline and returns
  the fully annotated document in   GATE XML format;
\item \emph{maf-en} runs GATE's sentence-splitter, tokenizer, POS-tagger and lemmatizer for English,
  and returns a MAF \cite{maf} XML document;
\item \emph{chunking-synaf-en} runs GATE's sentence-splitter, tokenizer, POS-tagger, and NP, VP, and
  PP chunkers for English, constructs a simple tree for each sentence based on containment, and
  returns a SYNAF \cite{synaf} XML document;
\item \emph{annie-rdf} runs ANNIE, analyses ANNIE's annotations by type and features, generates
  RDF according to the PROTON\footnote{\url{http://proton.semanticweb.org/}} \cite{Terziev2005}
  ontology, and returns an RDF-XML document.
\end{itemize}
%%


We plan to deploy services with MAF output for some other European languages (probably a selection
from Bulgarian, Dutch, German, and Spanish) in the near future, based on the resources we have
available, and are open to suggestions for others, especially if suitable language resources and
processing tools are available to be shared with us and suitable for integration with GATE.
%%%%%
\section*{Acknowledgements}
%%
This research is partially supported by the European Union's Seventh Framework Program project
CLARIN (FP7-212230).
%%%%%
\bibliographystyle{plainnat}
\bibliography{../../big,extra}
\end{document}
