code: def score_xrefs_by_semsim(self, xg, ont=None):
          
          logging.info("scoring xrefs by semantic similarity for {} nodes in {}".format(len(xg.nodes()), ont))
          for (i,j,d) in xg.edges(data=True):
              pfx1 = self._id_to_ontology(i)
              pfx2 = self._id_to_ontology(j)
              ancs1 = self._blanket(i)
              ancs2 = self._blanket(j)
              s1,_,_ = self._sim(xg, ancs1, ancs2, pfx1, pfx2)
              s2,_,_ = self._sim(xg, ancs2, ancs1, pfx2, pfx1)
              s = 1 - ((1-s1) * (1-s2))
              logging.debug("Score {} x {} = {} x {} = {} // {}".format(i,j,s1,s2,s, d))
              xg[i][j][self.SIMSCORES] = (s1,s2)
              xg[i][j][self.SCORE] *= s
docs: Given an xref graph (see ref:`get_xref_graph`), this will adjust scores based on
          the semantic similarity of matches.