code: def compute_pairwise_similarity_score(self):
          
          pairs = []
          all_scores = []
          for i, unit in enumerate(self.parsed_response):
              for j, other_unit in enumerate(self.parsed_response):
                  if i != j:
                      pair = (i, j)
                      rev_pair = (j, i)
                      if pair not in pairs and rev_pair not in pairs:
                          score = self.compute_similarity_score(unit, other_unit)
                          pairs.append(pair)
                          pairs.append(rev_pair)
                          all_scores.append(score)
  
          #remove any "same word" from the mean
          all_scores = [i for i in all_scores if i != self.same_word_similarity]
          self.measures["COLLECTION_" + self.current_similarity_measure + "_pairwise_similarity_score_mean"] = get_mean(
              all_scores) \
              if len(pairs) > 0 else 'NA'
docs: Computes the average pairwise similarity score between all pairs of Units.
  
          The pairwise similarity is calculated as the sum of similarity scores for all pairwise
          word pairs in a response -- except any pair composed of a word and
          itself -- divided by the total number of words in an attempt. I.e.,
          the mean similarity for all pairwise word pairs.
  
          Adds the following measures to the self.measures dictionary:
              - COLLECTION_collection_pairwise_similarity_score_mean: mean of pairwise similarity scores
  
          .. todo: divide by (count-1)?