{'fraction_non_alphanumeric': 0.0322099198222901, 'fraction_numerical': 0.011905175106730068, 'mean_word_length': 4.922302158273381, 'pattern_counts': {'":': 0, '<': 4, '<?xml version=': 0, '>': 0, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 1, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
Graph Based Sentiment Aggregation using ConceptNet Ontology

The sentiment aggregation problem accounts for analyzing the sentiment of a user towards various aspects/features of a product, and meaningfully assimilating the pragmatic significance of these features/aspects from an opinionated text. The current paper addresses the sentiment aggregation problem, by assigning weights to each aspect appearing in the user-generated content, that are proportionate to the strategic importance of the aspect in the pragmatic domain. The novelty of this paper is in computing the pragmatic significance (weight) of each aspect, using graph centrality measures (applied on domain specific ontology-graphs extracted from ConceptNet), and deeply ingraining these weights while aggregating the sentiments from opinionated text. We experiment over multiple real-life product review data. Our system consistently outperforms the state of the art - by as much as a F-score of 20.39% in one case.


Introduction
User-generated content accounts for a large fraction of the online content that is available today. The advent of web-platforms such as on online social networks (e.g., Facebook, Twitter etc.), blogs, discussion forums and product portals (e.g., Amazon) has resulted in creation of a plethora of usergenerated opinionated-content. The task of sentiment analysis focuses on analyzing such text, and deciphering user sentiment towards given products or their features, often referred to as aspects.
The task of sentiment aggregation builds upon sentiment analysis processes in general. While sentiment analysis (SA) aims to classify an opinion into positive or negative or neutral categories (in case of coarse-grained SA) or into more intricate categories (in case of finegrained/dimensional SA), often enough, it considers the opinion in its entirety, and is agnostic of the aspect-specific sentiments expressed. However, in practical settings, opinions expressed by users (such as product reviews) often tend to focus on multiple aspects, not just one. The diversity of the aspects, does not allow the aspect-specific sentiment-polarity values to be just naively summed up for the purpose of obtaining an overall aggregated sentiment of a given user towards a given product.
As an example, let us consider the following text regarding a software application: This app has a beautiful interface. It is not bug free though. The first sentence here is a positive feel to it from the interface feature (aspect). The second sentence has a negative feel to it from the accuracy (bug) feature (aspect). Thus, a simple linear aggregation (sum of the individual polarities) of the features, will yield a overall neutral review polarity score. This is not necessarily accurate. While an interface is a necessary enabler for users to use a software, it is of imperative necessity that the software runs accurately, without posing problems of bugs. Perhaps, a reasonable interface with an error-free running platform, is more necessary for an application software, than to just have a beautiful interface and erroneous execution. So the overall polarity of this review should be negative.
Let us flip the above example to the following: This app has a bad and unfriendly interface. The software is, however, stellar in terms of execution. This time, the first sentence shows a negative intent, while the second shows positive. Again, clearly, the overall sentiment can be deemed positive, although a simple-minded sum of the individual aspects would yield a neutral value. While in the previous examples the words such as however and though could potentially appear to act as discourse markers, such discourse markers will not appear in most of the cases. For instance, consider the following review example: I hated the little hints they gave us hardcore NDers on the Dare to Play message board. I had extremely high hopes for this game-I adored Last Train to Blue Moon Canyon and waited AGES for this game. Now, besides the absurd level of difficulty in this game [it was seemingly VERY hard in my eyes-I could not make it the first time through without the assistance of a walkthrough], I LOVED it. Clearly, while there are both positive and negative aspects in the review, the aggregate sentiment of the review is overall positive. And there is no discourse marker to simplify detecting the aggregated sentiment.
Assigning an overall review polarity requires a deeper aggregation of the sentiment polarity of each aspect. This involves not only understanding the sentiment purely from a natural language processing (NLP) standpoint, but also needs to account for the domain, and the pragmatic significance of the feature in the given domain.
Multiple works in the literature, such as (Hatzivassiloglou and Wiebe, 2000), (Turney, 2002), (Wu et al., 2009) and (Chen and Yao, 2010) have attempted to perform sentiment aggregation. One promising line of work explores usage of domain ontologies in order to factor for the pragmatic value of each aspect of the product. A recent work by (Mukherjee and Joshi, 2013) attempted to use ConceptNet (Liu and Singh, 2004), to learn the product attribute-hierarchy over attributes, synonyms, essential components and functionalities, and create a domain-specific ontology tree, using ConceptNet relationships across concepts. They subsequently map the sentiments associated with each feature of each given product to this ontology tree, and determine the overall aggregated sentiment as a weighted sum of these features, where the weights are computed as a function of proximity of the concept to the root node of the ontology.
Our work also uses domain ontologies for sentiment aggregation; however, we do not use the concept of ontology trees that has been used in the literature (Mukherjee and Joshi, 2013). We propose a novel approach, that extracts ontology-graphs from ConceptNet, around given themes, e.g., software. The extracted concepts are assigned weights using a measure of their centrality to the theme under consideration (e.g., the centrality of bug given the theme software). Akin to Mukherjee and Joshi (2013), these weights are combined with the associated feature sentiments, and a weighted aggregation is carried out to obtain the final sentiment aggregation scores for each user review.
For experiments, we use the same datasets as used by (Mukherjee and Joshi, 2013). Our system is more effective compared to the rest of the literature: it outperforms the state of the art for all the domains, including a large F-score margin of 20.39% in one case. Amongst the four datasets we experiment with, closeness centrality often outperforms the other graph centrality measures we use, namely betweenness centrality and PageRank; however, betweenness centrality outperforms the rest in a few cases. These centrality measures are explained in Section 3.1.
Overall, we provide a novel graph-driven baseline over domain ontologies, for deeply ingraining pragmatic information of various aspects of product reviews. Experiments indicate that the performance of our system is consistent across datasets, and also it consistently outperforms the state of the art. The system is expected to provide insights to organizations in understanding overall user sentiments towards products, by analyzing user-generated natural language text content.

Related Work
Sentiment analysis (SA) has been an area of longstanding area of research. A seminal work was carried out by Hatzivassiloglou and McKeown (1997), attempting to identify the sentiment polarity orientation of adjectives, using conjunction constraints, using a four-step supervised learning algorithm. One school of research has conducted significant exploration towards SA from user generated content, and a large fraction of these works look at the social media such as Twitter. This includes works by Agarwal et al. (2011), Barbosa and Feng (2010) and Kouloumpis et al. (2011), and Opinion Finder at University of Pittsburgh (Wilson et al., 2005). Many recent works, such as Khan et al. (2015), Kolchyna et al. (2015), Le and Nguyen (2015), Severyn and Moschitti (2015), and Zimbra et al. (2016), have also investigated the sentiment analysis problem on user generated content. Recent systems are based on variants of deep neural network built on top of embed-dings. A few representative works in this direction for sentiment analysis are based on Convolutional Neural Networks (CNNs) (dos Santos and Gatti, 2014;Kim, 2014;, Recurrent Neural Networks (RNNs) (Dong et al., 2014;Liu et al., 2015) and combined architecture (Wang et al., 2016). A few works exist on using deep neural networks for sarcasm detection, such as by Ghosh and Veale (2016) that uses a combination of RNNs and CNNs.
Sentiment analysis for product reviews has been investigated since a long time, in the literature. An early work attempting to classify reviews into positive vs. negative was conducted by Tong (2001), generating sentiment timelines. This was followed by several works, that attempted to replace the bag-of-words based early models by more sophisticated feature driven models (such as lexical, syntactic and semantic features). Some noteworthy works in this space include Hatzivassiloglou and Wiebe (2000), Kamps et al. (2001), Turney (2002 and Turney and Littman (2003). However, neither did these works consider domain-specific information, nor did they account for users' views on the different aspects (features) of a given product -all of which are central to comprehend the overall aggregate sentiment of a user towards a product.
Subsequent works attempted to incorporate user sentiments towards specific product aspects (product features); few of these incorporated deeper NLP techniques, such as dependency parsing (Wu et al., 2009;Chen and Yao, 2010;Mukherjee and Bhattacharyya, 2012) and joint sentiment topic models using LDA (Lin and He, 2009). These works, however, do not provide methodical or robust approaches to combine the feature-specific sentiments, to form the aggregate review polarity of a given user towards a given product. Mukherjee and Joshi (2013), which happens to be the work closest to ours, attempt to overcome this shortcoming, extending over Wei and Gulla (2010) and Sureka et al. (2010). Wei and Gulla (2010) propose a hierarchical learning method for labeling product attributes and the associated sentiments in product reviews, using a Sentiment Ontology Tree (HL SOT) with a supervised learning technique. However, the work requires featurespecific labeling, which is not practicable in reallife applications, as well as, falls short of proposing any elegant aggregation mechanism for integrating feature-specific sentiments. Sureka et al. (2010) were among the first ones to use Concept-Net (Liu and Singh, 2004) in sentiment analysis. Mukherjee and Joshi (2013) borrow from the concept of sentiment ontology tree, extract featurespecific ontology using ConceptNet, and finally present an Expected Sentiment Weight based combination of the feature-specific polarities, relying upon (a) the feature-specific sentiment polarity and strength, and (b) the weight of the sentiment derived as a function of the distance of the concept phrase (feature) from the root of the ontology tree. Their system also accounts for noisy and one-tomany relations in ConceptNet, and topic drift.
We notice that, there is scope in research, to fully exploit the intricate inter-relationship of the non-independent concepts that are practically bound to arise in a real-life setting. For example, in a world of camera, the concepts of lens and flash cannot be completely independent. And yet, in the ontology-tree based approach, such interdependencies go uncaptured. Such examples are clearly seen in Figure 1 in Mukherjee and Joshi (2013). This motivates the need to better capture the intricate interdependencies of such concepts, in terms of interdependencies as well as the significance of such dependencies. We hence propose a graph-based approach, where graph vertex properties, including weights, derived from the connectivity structures, can accommodate for such factors. Our approach is weakly supervised, unlike most of the recent SA systems mentioned above, including the conceptually similar but supervised approach of Socher et al. (2013) who model RNN on sentiment treebank for sentiment aggregation. The system is easy to implement and deploy, and consistently outperforms the literature for all the sentiment aggregation benchmark datasets.

Why Graph based Solutions?
As discussed earlier, a sentiment aggregator should leverage an ontology structure to alleviate the lack of awareness of the inter-relationships between aspects. It is, however, essential for ontology-driven sentiment aggregators to be aware of all possible inter-relationships between the aspects appearing in the opinionated text. The problem with the existing method of transforming the ontology into a tree structure and aggregation of sentiment in a bottom-up manner (Mukherjee and Joshi, 2013) is that it assumes the relationships between aspects (which are essentially mapped to concepts present in the ontology) to be hierarchical, thereby straight-away eliminating nonhierarchical relationships (like metonymy). As discussed earlier, concepts like "lens" and "flash" in camera domain do not share a parent-child relationship; it is thus impossible to find a connection between these two nodes in the ontology-tree. Moreover, as per Mukherjee and Joshi (2013), the intensity of sentiment expressed are aggregated from the leaf node towards the root. This does not allow sharing of sentiment related information between nodes at same levels (like "lens" and "flash"). Our proposed systems overcomes this problem by using the ontology-graph structure as it is, without performing any lossy transformation, unlike Mukherjee and Joshi (2013). We measure the pragmatic importance of the nodes of the ontology-graph through various centrality measures (discussed in Section 3.1), which helps our system decide how much sentiment-information can be shared across nodes during sentiment aggregation. We believe, a graph-based sentiment aggregation technique like ours offers a more natural way of sentiment aggregation that preserves all possible interrelationships amongst aspects.

Graph Centrality: Definitions
The centrality measures, the key constituents our approach, are explained below. The definitions are borrowed from the domain of graph theory.
Closeness Centrality: The closeness centrality (Bavelas, 1950) of a vertex in a connected graph indicates how central the vertex is to the overall graph structure. This is defined as the average length of the shortest paths between the given vertex and all other vertices in the given graph. If a given connected graph G comprises n vertices, then, the closeness centrality C(v) of a vertex v ∈ G is computed as where d(u, v) represents the shortest path distance between the vertices u and v.
Betweenness Centrality: For each pair of vertices in any connected graph, there exists at least one shortest path between the pair of vertices, such that, the number of edges constructing the path is minimized (in case of unweighted graphs), or, the total weight of the edges constructed is minimized (weighted graphs). The betweenness cen-trality (Freeman, 1977) of a given vertex of a graph is defined as the number of such shortest paths passing through the vertex. For a given vertex v, this is computed as where σ st is the total number of shortest paths from vertex s to vertex t and σ st (v) of these pass through vertex v. PageRank: The PageRank (Brin and Page, 1998) of a given vertex in a graph denotes the stationary probability of a random walk with restarts to arrive on the given vertex. For a given vertex v i on a given graph G constituting of n vertices, the PageRank of the vertex P (v i ) is computed as u ji is the number of neighbors of vertex j, and α, the damping factor, represents the probability of the random walk to continue.

Our Approach: Sentiment Aggregation using Graph Centrality
Our approach consists of two steps for assigning an overall polarity to a review for a product, based on the polarities expressed for individual aspects.
• The first step computes the pragmatic significance score for each aspect of a product, based on the graph centrality metrics obtained from domain specific ontology-graphs constructed from ConceptNet.
• The second step aggregates the polarities of different aspects to get one overall polarity for a review text, based on the scores from the earlier step and the polarities expressed for each aspect.
We provide the details of our approach below.

Ontology Graph Construction
We first construct the ontology graph, for each given concept/domain. Domain ontology captures intricate relationships and dependencies among different aspects of a product. We exploit the domain ontology in constructing a rich graph where nodes represent aspects and edges connecting them represent relationships among them. The graph representation rightly captures all the dependencies among the aspects as well as the complicated relationships among them. The graph is constructed as follows. The concept/domain is identified by a seed word such as, camera, automobile, etc.. A vertex is constructed for the seed word, and is marked as unexplored in the set of graph vertices. This is added to V, the set of vertices in the ontology graph G = (V, E). For each unexplored vertex v in the graph, each concept in ConceptNet that has at least one relationship with v, a vertex u is added to the vertex set V and is marked as unexplored, as well as, an edge (u, v) is added to E. At this stage, the vertex v is marked as explored. The ontology graph creation algorithm completes, when all vertices in V are marked as explored. We provide a maximum graph distance cut-off of n (a given number), where n is number of edges on the minimumlength path to reach from the concept to the seed word in the graph. Algorithm 1 provides the details of the ontology graph creation algorithm. Three types of ConceptNet relationships are used to form the edges, shown in Table 1. Hierarchical relationships represent parent-child relationships of concepts. Synonymous relationships are used to identify related concepts. Functional relationships are used to identify the purpose or property of interest of the given concept.

Graph Centrality Computation
This step computes the centrality of each concept appearing in the domain ontology graph constructed in the earlier step. For computing pragmatic significance score for each aspect, we employ graph centrality measures. Specifically, we propose to use centrality metrics such as closeness centrality, betweenness centrality and page rank, since these centrality measures captures significance of a node from different perspectives. In if graph distance(s,u) ≤ n then computation of the different centrality metrics we do not consider the type of relationship on an edge. An example of a closeness centrality graph, has been provided in Figure 1, for the domain camera.

Feature/Aspect-Specific Sentiment Computation
A user's opinion (review) could constitute of multiple aspects (features) of a given product, and different sentiment (opinion) polarities with respect to each aspect. The process of overall user sentiment analysis, mandates understanding the user's sentiment towards each of these aspects. To determine the sentiment polarity expressed by a user towards each aspect (feature), we perform dependency parsing of each review, to associate a given aspect of the review, with the opinion of the user towards the given feature, expressed in the text. Let R be a user review towards a product. Let W be the words constituting the review R. Following the approach of (Mukherjee and Bhattacharyya, 2012), we perform dependency parsing, and obtain D, the set of significant dependency relations in the corpus (e.g., nsubj, amod, dobj, etc). For each dependency D l where D l (d i , d j ) ∈ D, a graph G(W, E) is constructed A PoS tagger is used to extract the entities (nouns). These entities are used as the initial feature (aspect) set f i ∈ F . For each feature f i , a cluster C i is initiated, where f i acts as the cluster head of C i . Each word w ∈ W occurring in review R, is assigned to the cluster having closest cluster head. The "closest" distance is measured, using the number of edges in the shortest path, that connects the word to the closest cluster head. Two clusters are merged, if the distance between the two cluster heads are less than a given threshold.
The set of words W i belonging to each cluster C i , are used to determine the user's opinion about feature f i . This is attained by conducting a simple majority voting of the sentiment values of the individual words w i ∈ W i , using sentiment lexicons. A final aspect-specific sentiment score is produced, as −1 for negative, 0 for neutral and +1 for positive.
Also note that, we use the simple negation handling framework that was also adopted by (Mukherjee and Joshi, 2013). We reverse the sentiment polarities of all the words appearing within a window of size 5 (Hu and Liu, 2004), starting from any of the negation operators not, nor, neither and no.

Sentiment Polarity Aggregation
In this step, we aggregate polarities across all the aspects, to assign overall polarity to a review text. We define the overall polarity of a text as a weighted sum of (a) the sentiment polarity expressed by the user towards each aspect (feature) of the product the review text, and (b) the pragmatic significance of the aspect in the given domain, reflected in the graph centrality measures. These two factors ensure that the final polarity value for a given review text aggregates polar-ity values across different aspects, with adequate weightage that the aspect requires.
Let R be a review text, for a product P which has M aspects. Let m i and m i p represent i th aspect, and it's sentiment polarity as computed as described earlier. Let c m i represent the centrality score for an aspect m i computed using the ontology graph for the domain which P belongs to. The polarity value p(sum) for a review text R is found by computing the polarity value, as the following: Finally, the aggregated sentiment polarity S is assigned as: To find the aggregate sentiment of all users for a given product, we again opt for a majority-voting strategy. The overall methodology is presented in Algorithm 2.

Datasets and Ontologies
Dataset from four different domains corresponding to automobile, camera, kitchen and software are used for experiments. The camera reviews are collected from Mukherjee and Joshi (2013). The automobile, kitchen and software reviews are taken from Blitzer et al. (2007).  Note that, akin to Mukherjee and Joshi (2013), all the words have been lemmatized in the reviews, which ensures that all the terms such as camera and cameras are treated as the root word camera. Further, words such as hvnt, dnt have been replaced to their original forms.
In the ontology graph construction process, we keep adding unexplored vertices to the vertex set, Domain  Features  Nodes  Edges   Automobile  132  114  778  Camera  986  979  1280  Kitchen  767  670  10629  Software  150  135  842   Table 3: Ontology-graph Statistics as long as, there is at least one edge between the corresponding concept to an existing vertex in the vertex-set, of one of the types functional, hierarchical or synonymous. However, we restrict to adding vertices such that the maximum distance between the seed word and the newly added concept remains less than a given threshold n. We empirically fix n = 4, which practically provides a sufficiently large number of concepts that are realistically related to the concept of the seed word.

Corpus Frequent Ontology Ontology
Higher values of n lead to domain concept delusion and topic drift. Table 3 presents statistics of the ontology graphs extracted for four domains.

Tools and Resources
We use several well-known tools and resources.
• For PoS tagging, we use Stanford NLP Toolkit 1 . PoS tagging is carried out to tag the user reviews, which in turn is used to identify the entities (noun concepts) in the reviews.
• For ontology construction for the domains, we use ConceptNet 5 2 .
• To compute centrality measures of the ontology graphs, we use the graph tool R 3 .
• For dependency parsing of the user reviews, we use Stanford Dependency Parser 4 .
• For sentiment lexicons, we experiment with SentiWordNet (Baccianella et al., 2010) and Bing Liu sentiment dictionary (Hu and Liu, 2004). Although we report our results only for the Bing Liu sentiment dictionary for the sake of brevity, we observe similar performances using SentiWordNet also.

Results
We establish the first baseline of our work, using the lexical classification based approach of (Taboada et al., 2011). In this approach, a sentiment lexicon is used as a reference, that consists of words having positive and negative sentiment polarities. In a given review, if the total number of positive terms is higher compared to the total number of negative terms, the review is considered positive, and is considered negative if the opposite holds true. The baseline does not incorporate the feature (aspect) specific approach. We modify the approach to associate the lexical terms with the aspects (features), and thus obtain a featurespecific lexical sentiment. We subsequently aggregate these sentiments, to obtain improved baseline results. For sentiment lexicon, we empirically ex-plore with SentiWordNet and Bing Liu sentiment dictionary.
We further compare our work against the reported approach for the same task by (Mukherjee and Joshi, 2013) which also uses ConceptNet, and has an approach similar to ours. However, as mentioned earlier, they consider ontology as a tree while we construct a graph. Also, they assign pragmatic weights to each aspect present in the review, using the height (distance) of the aspect from the root (seed word) of the ontology tree they construct, while we use graph centrality measures. Table 4 illustrates the results we obtain with different approaches. The performance of the systems are reported in terms of accuracy (to ensure direct comparison with previous work) and weighted F1-score (to tackle class-imbalances). We report the results of the lexical baseline by (Taboada et al., 2011) using Bing Liu sentiment dictionary baseline, the results of Mukherjee and  Table 4: Overall F1 score and accuracy (in %) of all models across all domains. For all domains, the performance improvements obtained using Closeness centrality measure over that reported in the literature (Mukherjee et al., 2013) are statistically significant (with p << 0.05), as confirmed by McNemar test.
Joshi (2013), and our results, using the three different graph centrality measures. As observed, all our proposed centrality based approaches outperform the baseline. The closeness centrality measure performs the best, with statistically significant improvement (p << 0.05) observed over the system reported by Mukherjee and Joshi (2013).
Other graph based approaches also show improvement, except for the software domain.

Conclusion and Future Work
In this paper, we performed sentiment aggregation as a combination of user sentiments, analyzed towards multiple aspects/features of a product, from user-generated content. The novelty of this work was in deeply ingraining the sentiment weight of each entity derived from the user generated content, and pragmatic significance of the entity in the domains that was obtained by using a graph-structured ontology. We observe a consistently high performance of our system across all the keywords that we experiment with. We outperform the state of the art by a F-score of 3.02%, 3.46%, 20.39% and 0.68%, for automobile, camera, kitchen and software respectively. Further, the effectiveness of our system often increases by using closeness centrality over the other graph centrality measures such as betweenness centrality and PageRank, although betweenness centrality does outperform the rest of the methods in some cases. In future, we would like to improve the current technique to include the intensity of sentiment bearing words appearing in the reviews. Integrating lexico-semantic knowledge acquired through concept-embeddings learned from ontology structures in the aggregation step is also a future work. Our system will have significant real-life impact in helping organizations understand overall user sentiment towards products, on e-commerce sites (e.g., Amazon) as well as online social networks, discussion forums and blogs.