Para el correcto desarrollo de los recursos lingüísticos se ha creado un nuevo CREOLE que contiene los siguientes módulos de procesamiento de GATE:
- VOCALI Tokenizer - VOCALI Gazetter - VOCALI NE Transducer
En la Figura 31 se puede ver una captura de pantalla de GATE procesando un comando de voz e identificando los tipos distintos de entidades en dicho comando.
Figura 31. Ejemplo de detección de entidades a partir de los recursos desarrollados
Una descripción parcial del fichero que define el CREOLE puede verse en la siguiente figura.
<RESOURCE>
<NAME>VOCALI Gazetteer</NAME>
<CLASS>gate.creole.gazetteer.DefaultGazetteer</CLASS> <PARAMETER NAME="document" RUNTIME="true"
COMMENT="The document to be processed"> gate.Document
</PARAMETER>
<PARAMETER NAME="gazetteerFeatureSeparator" DEFAULT="&" COMMENT="The character used to separate features for entries in gazetteer lists. Accepts strings like "\t" and will unescape it to the relevant character. If not specified, this gazetteer does not support extra features."
OPTIONAL="true"> java.lang.String </PARAMETER>
<PARAMETER NAME="listsURL" DEFAULT="gazetteer/lists.def" COMMENT="The URL to the file with list of lists" SUFFIXES="def">
java.net.URL </PARAMETER>
<PARAMETER NAME="caseSensitive" DEFAULT="false" COMMENT="Should this gazetteer diferentiate on case">
java.lang.Boolean </PARAMETER>
<PARAMETER NAME="encoding" DEFAULT="UTF-8" COMMENT="The encoding used for reading the definitions">
java.lang.String </PARAMETER>
<PARAMETER NAME="annotationSetName" RUNTIME="true" COMMENT="The annotation set to be used for the generated annotations" OPTIONAL="true">
java.lang.String </PARAMETER>
<PARAMETER NAME="wholeWordsOnly" DEFAULT="true" COMMENT="Should this gazetteer only match whole words" RUNTIME="true">
java.lang.Boolean </PARAMETER> <ICON>gazetteer</ICON> </RESOURCE> <RESOURCE> <NAME>VOCALI NE Transducer</NAME> <CLASS>gate.creole.ANNIETransducer</CLASS>
<PARAMETER NAME="document" RUNTIME="true" COMMENT="The document to be processed">
gate.Document </PARAMETER>
<PARAMETER NAME="inputASName" RUNTIME="true" COMMENT="The annotation set to be used as input for the transducer" OPTIONAL="true">
java.lang.String </PARAMETER>
<PARAMETER NAME="outputASName" RUNTIME="true" COMMENT="The annotation set to be used as output for the transducer" OPTIONAL="true">
java.lang.String </PARAMETER>
<PARAMETER NAME="grammarURL" COMMENT="The URL to the grammar file" DEFAULT="NE/main.jape" SUFFIXES="jape">
java.net.URL </PARAMETER>
<PARAMETER NAME="encoding" DEFAULT="UTF-8" COMMENT="The encoding used for reading the grammar">
java.lang.String </PARAMETER>
<ICON>ne-transducer</ICON> </RESOURCE>
Figura 32. Parte del fichero CREOLE con el plugin de GATE desarrollado.
En los siguientes subapartados se describen cada uno de estos módulos.
III.3.2.1.1. VÓCALI Tokenizer
El tokenizer que proporciona GATE por defecto está centrado en el idioma inglés y dispone de varios bugs, por esa razón para esta tesis doctoral se ha desarrollado un nuevo tokeniser para español que soluciona dichos bugs. Para ello, se ha definido un conjunto de reglas que implementan el tokeniser y que definen como se delimitan las
palabras y otros símbolos en el idioma español. En la Figura 33 se muestra un extracto de este fichero donde puede verse cómo se definen las palabras, números, espacios en blanco, símbolos, etc.
III.3.2.1.2. VÓCALI Gazetteer
Como se ha comentado en la sección 1, los gazetters representan lexicones o listas de términos de un determinado dominio. A continuación se va a explicar la estructura de los lexicones desarrollados en este trabajo de investigación.
III.3.2.1.3. Tipo de listas Gazetter
Se han desarrollado dos tipos distintos de lexicones del Gazetteer: las que son generales e independientes del trabahi y las que son válidas sólo para este trabajo de investigación. Para ello se insertan en el directorio /etc/gate/gazetter las listas que son generales y en /etc/gate/gazetterSmartMobileVoice las que son de interés para la tesis doctoral, por lo que en cada directorio habrá definido un fichero lists.def.
Todos los ficheros de listas deben tener nombres representativos que identifiquen claramente la información que contiene. La estructura de nombres que se utilizará será la siguiente:
[prefijo]_[subprefijo]_[nombre_lista].lst
El prefijo deberá identificar claramente el ámbito para el que está definida la lista. Por ejemplo actualmente se tienen los siguientes prefijos:
- addr_ : Recursos para identificar "address" - company_ : Recursos para identificar "company" - loc_ : Recursos para identificar "location"
- number_ : Recursos para identificar "number" - person_ : Recursos para identificar "person" - stopword_ : Recursos para identificar "stopword"
- time_ : Recursos para identificar expresiones temporales "date" o "time"
#words#
// a word can be any combination of letters, including hyphens, // but excluding symbols and punctuation, e.g. apostrophes
// Note that there is an alternative version of the tokeniser that // treats hyphens as separate tokens
"UPPERCASE_LETTER" (LOWERCASE_LETTER (LOWERCASE_LETTER|FORMAT)*)* > Token;orth=upperInitial;kind=word;
"UPPERCASE_LETTER" (DASH_PUNCTUATION|FORMAT)* (UPPERCASE_LETTER|FORMAT)+ > Token;orth=allCaps;kind=word;
"LOWERCASE_LETTER" (LOWERCASE_LETTER|FORMAT)* > Token;orth=lowercase;kind=word;
// MixedCaps is any mixture of caps and small letters that doesn't // fit in the preceding categories
("LOWERCASE_LETTER" "LOWERCASE_LETTER"+"UPPERCASE_LETTER"+ \ (UPPERCASE_LETTER|LOWERCASE_LETTER)*)|\
("LOWERCASE_LETTER" "LOWERCASE_LETTER"*"UPPERCASE_LETTER"+\ (UPPERCASE_LETTER|LOWERCASE_LETTER|DASH_PUNCTUATION|FORMAT)*)|\ ("UPPERCASE_LETTER" (DASH_PUNCTUATION)* "UPPERCASE_LETTER" (UPPERCASE_LETTER|LOWERCASE_LETTER|DASH_PUNCTUATION|FORMAT)*\ ("LOWERCASE_LETTER")+
(UPPERCASE_LETTER|LOWERCASE_LETTER|DASH_PUNCTUATION|FORMAT)*)|\ ("UPPERCASE_LETTER" "LOWERCASE_LETTER"+ ("UPPERCASE_LETTER"+ "LOWERCASE_LETTER"+)+)|\
((UPPERCASE_LETTER)+ (LOWERCASE_LETTER)+ (UPPERCASE_LETTER)+)\ > Token;orth=mixedCaps;kind=word;
(OTHER_LETTER|COMBINING_SPACING_MARK|NON_SPACING_MARK)+ >Token;kind=word;type= other;
#numbers#
// a number is any combination of digits "DECIMAL_DIGIT_NUMBER"+ >Token;kind=number; #whitespace# (SPACE_SEPARATOR) >SpaceToken;kind=space; (CONTROL) >NewLineToken;kind=control; #symbols# (MODIFIER_SYMBOL|MATH_SYMBOL|OTHER_SYMBOL) > Token;kind=symbol; CURRENCY_SYMBOL > Token;kind=symbol;symbolkind=currency; #punctuation# (DASH_PUNCTUATION|FORMAT)(DASH_PUNCTUATION|FORMAT)+ >Token;kind=punctuation;su bkind=2dashpunct; (DASH_PUNCTUATION|FORMAT) >Token;kind=punctuation;subkind=dashpunct;
#punctuaction – if there are more than one puntuaction system they have to be treated as just one token #
"START_PUNCTUATION" >Token;kind=punctuation;position=startpunct; "END_PUNCTUATION" >Token;kind=punctuation;position=endpunct;
Figura 33. Parte del fichero tokenizer.rules que describe el VOCALI Tokenizer desarrollado.
Además, las listas que comiencen por el prefijo "mobilevoice" serán dependientes del trabajo aplicación y podrán contener otro prefijo "context":
- mobilevoice_ : Recursos relacionados con la aplicación.
- mobilevoice_context_ : Recursos que ayuden a determinar expresiones que ayudan a determinar que viene a continuación (p.e. "añade al contacto Pepe García con teléfono 555555555" => la palabra "teléfono" debería estar en una lista de contexto pues nos indica que lo que viene a continuación es un teléfono, aunque no case exactamente con un patrón de los que tenemos).