{'fraction_non_alphanumeric': 0.04128834078691783, 'fraction_numerical': 0.008853954917107106, 'mean_word_length': 4.883072017007707, 'pattern_counts': {'":': 0, '<': 33, '<?xml version=': 0, '>': 33, 'https://': 0, 'lorem ipsum': 0, 'www.': 2, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
Opinion Identification in Spanish Texts

We present our work on the identification of opinions and its components: the source, the topic and the message. We describe a rule-based system for which we achieved a recall of 74% and a precision of 94%. Experimentation with machine-learning techniques for the same task is currently underway.


Introduction
For some tasks in language processing such as Information Extraction or Q&A Systems, it is important to know the opinions expressed by different sources and their polarity, positive or negative, with respect to different topics. There are even commercial applications that provide this kind of service (http://www.jodange.com). We here present a system for identifying opinions in Spanish texts. We define opinion as the report of someone's statement about any subject ( El investigador de la Politécnica afirma que el principal problema de este sistema es conseguir que sea fácil de usar / The researcher at the Politécnica asserts that the main problem with this system is making it easy to use), or as any mention of discourse participants' beliefs (El PRI acepta participar en el debate / The PRI agrees to participate in the debate).
As a first step, we study the impact of elements that typically introduce such expressions in written text. These elements are mainly verbs of communication (decir, declarar / say, state) but other verb classes (belief, agreement, appreciation) are also considered. In other cases, the opinions will be expressed through nouns (opinión/opinion, declaración/statement) or segments introduced by según (according to) or similar expressions. To complete the opinion, we identify its characteristic arguments: the source, the topic and the message.
In addition to recognizing an opinion, we try to determine its semantic orientation. To this end, we consider certain subjective elements and operators (reverse, intensifier, enhancing, neutralizing, etc.) which affect them. In this article, we present only results on the semantic orientation of opinion verbs, opinion nouns and topic introducers (sobre/about, con respecto a/with respect to, etc.).
There are many studies that address these issues: Pang and Lee (2008), for instance, discuss in detail various concepts in the area of "Opinion Mining" or "Sentiment Analysis" and present the main proposals, resources and applications. For our work, which focuses on the identification of source, topic and message, we have mainly drawn on the following: the scheme for annotating opinions and emotions proposed by Wiebe, Wilson, and Cardie (2005); the work on opinion-holder (source) propositional opinion identification presented in (Bethard et al., 2004); a system for source identification using statistical methods (Choi et al, 2005); a method for opinion-holder and topic extraction from Kim and Hovy (2006); the study on the identification of source and target presented in (Ruppenhofer et al., 2008); and a work on topic annotation (Stoyanov and Cardie, 2008).
For our semantic orientation study, we have taken some concepts from Turney and Littman (2003) and analyzed some work on subjectivity operators (Polanyi and Zaenen, 2004;Moilanen and Pulman, 2007;Choi and Cardie, 2008).
In what follows, we briefly present the model that has been defined to represent opinions and two methods for their automatic recognition. First, we describe a rule-based system that incorporates lexical resources. This system, whose evaluation is detailed below, achieves a recall of 74% and a precision of 97%. During the evaluation process we produced an annotated corpus of 13,000 words, by manually correcting the system output. The second system, currently under development, involves the application of machine-learning techniques to the annotated corpus.

Opinion components
An opinion is composed of a predicative element and its characteristic arguments. The set of opinion predicates includes verbs, nouns and prepositions (or prepositional locutions). Verbs belong to various semantic classes: communication (decir / say, declarar / state), assessment (criticar / criticize, felicitar / compliment), belief (creer / believe, opinar / think) and acceptance (aceptar / accept, rechazar / reject). These classes are similar to those proposed in (Asher et al., 2008), the main difference being that they include the class Sentiment but we do not. Nouns are generally derived from the aforementioned verbs (opinión / opinion, declaración / statement, apoyo / support). Some prepositions and prepositional locutions are según, de acuerdo a, para / according to.
The relevant arguments that we identified for the opinion predicates are, as already mentioned, source, topic and message. To establish this scheme we analysed syntactico-semantic schemes proposed in ADESSE 2 for selected verb classes (García-Miguel et al., 2005) and some of the Spanish FrameNet frames 3 (Subirats-Rüggeberg and Petruck., 2003), mainly the opinion frame whose frame elements include cognizer (source), topic and opinion (message) and the communication frame for which some elements are communicator (source), topic and message.
Our definition deviates from much of the literature on this subject because we limit our work to opinions introduced by an opinion predicate, as explained above, while many of the cited works identify all kinds of subjective expressions, mainly adjectives with positive or negative polarity, as with the expressive subjective elements described in (Wiebe et al., 2005).
As in our work we focus on finding the source, the message and the topic for each opinion, we ignore all the text fragments in which there is no evidence that the author is quoting or referring to other participants' opinions. These text fragments constitute the message, as defined above, stated by the text author. So, once our system has identified other participants' opinions, the remaining text should be attributed to the text author.
Identifying subjective elements is necessary in order to determine the semantic orientation of the opinion. We think the treatment of these elements within the author's message is similar to the treatment that must be applied within the message attributed to any other source. Such a treatment is not addressed in this work, since the semantic orientation study presented here is restricted to opinion predicates and topic introducers.
In some respects our work is related to that of (Bethard et al., 2004). For opinions introduced by opinion verbs, they identify the source (opinion holder) and the message (propositional opinion), restricting the study to messages that constitute subordinate clauses. However, we seek also to identify the explicit references to the topic and we consider not only verbs but also some nouns and prepositions such as según / according to. A fur-ther difference is that they distinguish propositions containing an opinion from those transmitting facts or predictions, whereas we do not make this distinction.
In our recognition of the topic we consider only explicit references to the opinion subject. We look for topic-introducing elements, such as sobre / about, con respecto a / regarding, en contra de / against, without trying to deduce the topic from the study of the message itself.
For this general scheme, there are different instances in which the arguments can take different forms. Thus, for some opinion verbs such as rechazar / reject, the message is usually empty. For other verbs the topic will be a noun phrase, such as aceptar la propuesta / to accept the proposal, while for others it will be a prepositional phrase, for example, hablar de literatura / to speak about literature.

Some opinion examples
In a standard reported speech utterance (1), the opinion predicate is a communication verb. The source is the subject of the verb and the message is contained in the subordinate clause. Normally, there is not a segment expressing the topic.
(1) [The researcher at the Politécnica]f [said] p [that the main problem with this system is making it easy to use] m.
In (2), there is a verb that introduces referred speech in which a verbal act is mentioned, but the words uttered (message) are not reproduced (Maldonado, 1999 However, we also found cases in which reported speech includes an explicit mention of the topic (3) and cases in which referred speech includes the uttered words (4) As noted earlier, the opinion predicate can be a noun or a preposition such as según / according to. In (5), the source is the noun complement, introduced by de / of. In (6), the source is the noun phrase within the prepositional phrase headed by según / according to. Note that in (5) there is another opinion predicate, the verb criticize, occurring in a non-factive context. The factivity of events is not addressed in this work, but it can be expected to affect opinion recognition.

The rule-based system
We developed a rule-based system for the identification of the opinion elements. The system takes as input a pre-processed text using the POS-tagger Freeling (Atserias et al., 2006) and Clatex (Wonsever et al, 2006), a system that segments texts into propositions. Several rule modules are then applied, introducing XML annotations showing the identified opinions and their elements.
The following example illustrates the system output: <opinion><menssage>Hasta el momento el virus H1N1 tiene una predominancia mayor que la de los demás virus en esos estudios</message>, <predicate>precisó</predicate><source>la ministra</source></opinion>. <opinion><message>So far, the H1N1 virus has a higher prevalence than other viruses in these stud-ies</message>, <predicate>said</predicate> <source>Minister</source></opinion>. The rules are based on the contextual rules formalism defined by Wonsever and Minel (2004), including some further extensions. This type of rule allows the specification of contexts, exclusion zones, optionality, negation, and elimination of existing labels, among others. In addition, for each rule it is possible to check various conditions on its components, for example, membership in a list of words. For applying the rules we used a system implemented in Prolog.
The hand-written rules were derived from corpus analysis. They are grouped into modules according to the element they recognize: opinion predicate (verbs, nouns and prepositions), source, topic and message. There is also a final module that builds the entire opinion and some auxiliary modules: the complex noun phrase identifying module (El director del Hospital Maciel, Daniel Parada / The director of the Hospital Maciel, Daniel Parada) and the subjective elements and operators identifying module. Table 1 shows the number of rules contained in each module. In the next section we describe the source rules module.

Source rules
In order to show the rules features, we will describe the source module. Table 2 shows some (simplified) rules for source identification. fue1a no(prep), <np>, (zone,3), verOp fue1b punt, verOp, (zone,3), <np> fue1c punt, verOp, (zone,3), prep, np, <np> fue2 verOpPart, "por", <np> fue3a nOp, "de", <np> fue3b <np>, verSup, op(det), nOp fue3c nOp, verSupPart, "por", <np> fue4a "según", op(verOp), <np> fue4b endS, "para", <np> fue4c "de acuerdo a", <np> fue4d "de acuerdo con", <np> fue4e "a juicio de", <np> Table 2 Simplified rules for source recognition. Notation used: np -nominal phrase; < > -element labeled by the rule; zone,x -exclusion zone up to x words; verOpFin -finite opinion verb; verOpPartopinion verb, participle; nOp -opinion noun; ver-Sup -support verb; endS -end of sentence; detdeterminer; op -optionality operator These rules assign the source tag to text segments that match the rule body (indicated by <> in the table). The elements that precede the body and those that follow it are the left and right contexts, respectively. In addition to assigning the tag, the rules assign values to some attributes: -code of the rule that assigned the label -syntactic structure (subject before verb / subject after verb / noun complement introduced by de) -semantic orientation value (-, +, 0) The three rules fue1 identify sources that are the subject of an opinion verb. We allow up to 3 words between the subject and the verb; these words cannot be verb, np, punctuation or conjunction (<El senador> este martes dijo ... / <the senator> said Tuesday ...). For rule fue1c we also allow a prepositional phrase (prep + np) between the source and the verb (..., dijo ayer a la prensa <el senador> / ..., said yesterday to the reporters the senator). As mentioned, we show simplified rules; the actual rules include other restrictions such as checking for subject-verb agreement.
Rule fue2 is applied when the opinion verb is in participle form and the source is an agent complement (las palabras expresadas por el senador / the words uttered by the senator).
The three rules fue3 concern noun phrases. The source is usually introduced by de (las opiniones del senador / the senator's opinions) but it is also common to find nouns in a support verb construction (el senador emitió una declaración / the senator issued a statement).
Finally, the five rules fue4 identify sources introduced by según, para, de acuerdo a, de acuerdo con, a juicio de / according to. When the source introducer is según, we can find an opinion verb between según and the source (según el senador / según dijo el senador / according to the senator), For the preposition para / for, preceding punctuation is required because of its high ambiguity.
In particular, the list of opinion verbs and nouns was manually created from corpora containing Spanish texts: Corin (Grassi et al., 2001), Corpus del Español (Davies, 2002) and a digital media corpus created for this study. Only those verbs and nouns that are frequently used in opinion contexts were included in the list, so as to minimize ambiguity. At the time of evaluation, the list comprised 86 verbs and 42 nouns.

The opinion verbs and nouns list
For each verb or noun, we register its lemma and other information related to its syntactic and semantic properties.
For verbs, we record the following information: • semantic orientation [-, 0, +] • semantic role of the subject [source, topic] • prepositions that introduce the subject.
For nouns, the information of interest is: • semantic orientation [-, 0, +] • semantic role of the complement introduced by de [source, topic, ambiguous] For example, for the noun anuncio / announcement, the corresponding values are (0, ambiguous). Note that this noun is ambiguous because the complement introduced by de can be either the source (el anuncio del senador / the senator's announcement) or the topic (el anuncio de la extensión del plazo / the announcement about the deadline extension). For the noun comentario / comment the values are (0,source) and for apoyo / support the values are (+, source).
The information associated to opinion predicates is taken into account when applying the rules. For example, the second attribute of the opinion noun is checked when rule fue3a is applied: if the attribute value is "source", the rule matches all np satisfying the remaining rule conditions, whereas if the attribute value is "ambiguous", the rule requires that the np contain a person or institution indicator. The rule does not apply if the attribute value is "topic".
Some of the message rules (not shown here) check that the final opinion verb attribute has the value "yes", indicating that it accepts a subordinate clause (dijo que ... / he said that ...). These rules label the proposition following the verb as a message. The proposition has already been segmented by Clatex.
The attribute that indicates which is the verb subject role is important in differentiating the rules shown in the table (fue1 to fue4), which only recognize verbs for which the subject role is source, from a set of additional rules (not shown in the table) that look for the source in the dative case, when the subject role is topic (la propuesta gustó a los senadores / senators liked the proposal).

Semantic orientation
For each element recognized, the rules assign a semantic orientation value. For the opinion predicate, source and topic this value comes from the lexical resources. For the message, this value is calculated from its subjective elements and operators. We consider that the final opinion semantic orientation can be calculated from the orientation values of its elements. We hypothesize that when the opinion predicate or the topic introducer are not neutral (they have a positive or negative semantic orientation) the complete opinion takes on the same value and there is no need to analyze the message. If these two elements are neutral the opinion semantic orientation must be obtained from the message.
To determine the message semantic orientation we carried out some experiments that are still ongoing. Semantic orientation values for opinion predicates are stated in the verb and noun lists, as mentioned. The semantic orientation for topic introducers is also stated in the corresponding list (sobre / about is neutral, en contra de / against is negative, etc.). The number of elements of this type is very limited. We did not study the source semantic orientation, in future work we will analyze expressions like Los optimistas sostienen que ... / Optimists say that ....

System evaluation
To evaluate the system we worked with a digital media corpus; the texts were taken from the same publications as those used to create the derivation corpus. The corpus contains 38 texts with an average of 300 words each, making a total size of approximately 13,000 words. We applied the system to the entire corpus and performed a manual review of the output in order to evaluate the identification of the defined elements and also the complete opinion identification. We also made a partial semantic orientation evaluation, taking into account only opinion predicates and topic introducers' values and their effect on the complete opinion value.
In addition to assessing the rules performance, during the review stage the annotated corpus was manually corrected in order to obtain an opinion annotated corpus suitable for machine-learning. Most opinion predicates present in the corpus are included in our opinion verbs and nouns list (91%).
Several sources and topics were partially recognized because the rules do not incorporate some complements (prepositional complements or subordinate clause) to the noun phrase.
Message is partially recognized when a pseudodirect discourse is used (Parada agregó que "la empresa reconoció que hubo un cálculo entre horas estimadas y horas reales y eso fue lo que pasó. Nosotros, primero empezamos a controlar a nuestro personal ..."). This style is usually present in journalistic texts (Maldonado, 1999).

Semantic orientation evaluation
We recognized 25 non neutral opinion predicates in the corpus: 12 positive verbs and 14 negative verbs. One verb (especular / speculate) was incorrectly assigned a negative value, its means in this particular context is neutral.
We just found 3 non-neutral topic introducers, the 3 are negative.
The opinion predicates or topic introducers' semantic orientation values were assigned to the opinions containing them. This method for calculating opinion semantic orientation was correct in all cases (except for the verb especular that was incorrectly analyzed).

Machine-learning system
The evaluation system resulted in the generation of an annotated corpus, processed by the rule-based system and then manually reviewed and corrected. This corpus of about 13,000 words allows us to undertake some experiments applying machinelearning techniques.
We are currently experimenting with Conditional Random Fields, using the CRF++ tool (http://crfpp.sourceforge.net/). We are now determining the attributes to be considered for the training phase and defining the most appropriate templates for the kind of learning we need. While carrying out these prior tasks, we will extend the corpus using the same semi-automatic procedure as that already implemented.

Linguistic resources
Many of the linguistic resources needed to achieve our objectives have already been mentioned. Some of them were created especially in the context of this work and are available as a contribution to the development of Spanish text processing: • opinion verbs and nouns lists with syntactic and semantic attributes, • person and institution indicators lists, • topic introducers list, • subjective elements lists, created from available resources for Spanish (Redondo et al, 2007) and English (General Inquirer: www.wjh.harvard.edu), the latter translated into Spanish, • subjective operators list. We also used some resources that are available for Spanish, including: • Freeling (POS-tagger), • Clatex (propositions analyzer). Freeling also provides a dependency parser that was not used here because the tests we carried out scored poorly in sentences containing opinions.
Resources such as a semantic role tagger or an anaphora resolution tool could no doubt improve our system, but as far as we know they are not available for Spanish.
As we did for the General Inquirer dictionary, we can apply machine translation to other English resources: subjective dictionaries and annotated corpora (Brooke et alt, 2009, Banea et alt, 2009. Tools for subjectivity analysis in English can be applied to a translated Spanish raw corpus (Banea et alt, 2009

Conclusions
We have implemented a rule-based system for opinion identification in Spanish texts. We have also created some resources for Spanish: opinion verbs and nouns lists, subjective elements lists and an opinion annotated corpus. We think these resources are an important contribution to the development of Spanish text processing.
In our present work, we are experimenting with machine-learning techniques for recognizing opinion elements. The results will be compared with those obtained by the rule-based system. We hope to improve our results by combining rule-based and machine-learning modules.