'Loads the XML-file (with sentiment annotations) from the given path.
By default, Sentiment.path is lazily loaded.'

def load(self, path=None):

    if (not path):
        path = self._path
    if (not os.path.exists(path)):
        return
    (words, synsets, labels) = ({}, {}, {})
    xml = cElementTree.parse(path)
    xml = xml.getroot()
    for w in xml.findall('word'):
        if ((self._confidence is None) or (self._confidence <= float(w.attrib.get('confidence', 0.0)))):
            (w, pos, p, s, i, label, synset) = (w.attrib.get('form'), w.attrib.get('pos'), w.attrib.get('polarity', 0.0), w.attrib.get('subjectivity', 0.0), w.attrib.get('intensity', 1.0), w.attrib.get('label'), w.attrib.get(self._synset))
            psi = (float(p), float(s), float(i))
            if w:
                words.setdefault(w, {}).setdefault(pos, []).append(psi)
            if (w and label):
                labels[w] = label
            if synset:
                synsets.setdefault(synset, []).append(psi)
    self._language = xml.attrib.get('language', self._language)
    for w in words:
        words[w] = dict(((pos, map(avg, zip(*psi))) for (pos, psi) in words[w].items()))
    for (w, pos) in words.items():
        words[w][None] = map(avg, zip(*pos.values()))
    for (id, psi) in synsets.items():
        synsets[id] = map(avg, zip(*psi))
    dict.update(self, words)
    dict.update(self.labeler, labels)
    dict.update(self._synsets, synsets)
