class_docstr: Aspect module
  Parameters
  ----------
  data: List[tuple], required
      A triplet list of user, item, and sentiment information         which also a triplet list of aspect, opinion, and sentiment,         e.g., data=[('user1', 'item1', [('aspect1', 'opinion1', 'sentiment1')])].
class_docstr_tok: ["Aspect","module","Parameters","--","--","--","--","--","data",":","List","[","tuple","]",",","required","A","triplet","list","of","user",",","item",",","and","sentiment","information","which","also","a","triplet","list","of","aspect",",","opinion",",","and","sentiment",",","e.g.",",","data=","[","(","'user1","'",",","'item1","'",",","[","(","'aspect1","'",",","'opinion1","'",",","'sentiment1","'",")","]",")","]","."]
code: def _build_sentiment(self, uid_map, iid_map, dok_matrix):
      self.user_sentiment = OrderedDict()
      self.item_sentiment = OrderedDict()
      aid_map = OrderedDict()
      oid_map = OrderedDict()
      sentiment = OrderedDict()
      for idx, (raw_uid, raw_iid, sentiment_tuples) in enumerate(
          self.raw_data
      ):
          user_idx = uid_map.get(raw_uid, None)
          item_idx = iid_map.get(raw_iid, None)
          if (
              user_idx is None
              or item_idx is None
              or dok_matrix[user_idx, item_idx] == 0
          ):
              continue
          user_dict = self.user_sentiment.setdefault(
              user_idx, OrderedDict()
          )
          user_dict[item_idx] = idx
          item_dict = self.item_sentiment.setdefault(
              item_idx, OrderedDict()
          )
          item_dict[user_idx] = idx
  
          mapped_tup = []
          for tup in sentiment_tuples:
              aspect, opinion, polarity = tup[0], tup[1], float(tup[2])
              aspect_idx = aid_map.setdefault(aspect, len(aid_map))
              opinion_idx = oid_map.setdefault(opinion, len(oid_map))
              mapped_tup.append((aspect_idx, opinion_idx, polarity))
          sentiment.setdefault(idx, mapped_tup)
  
      self.sentiment = sentiment
      self.aspect_id_map = aid_map
      self.opinion_id_map = oid_map
  
file_path: cornac/cornac/data/sentiment.py
imports: from .None import Modality
  from collections import OrderedDict
label_desc: Use image node_id 14 for calling the SentimentModality obj's underlying member method code with example usage: obj._build_sentiment(uid_map, iid_map, dok_matrix) without return types