code: def get_phrases(filename):
      tree = ET.parse(filename)
      fragments = []
  
      root = tree.getroot()
      for child in root:
          if child.tag == "paragraph":
              for subchild in child:
                  if subchild.tag == "sentence":
                      text = subchild.attrib["S"].strip()
                      if len(text) <= 2:
                          continue
                      polarity = None
                      for inner in subchild:
                          if inner.tag == "Polarity":
                              polarity = inner
                              break
                      if polarity is None:
                          print(
                              "Found sentence with no polarity in {}: {}".format(
                                  filename, text
                              )
                          )
                          continue
                      if polarity.text == "消极":
                          sentiment = "0"
                      elif polarity.text == "中性":
                          sentiment = "1"
                      elif polarity.text == "积极":
                          sentiment = "2"
                      else:
                          raise ValueError(
                              "Unknown polarity {} in {}".format(
                                  polarity.text, filename
                              )
                          )
                      fragments.append(SentimentDatum(sentiment, text))
  
      return fragments
  
file_path: stanza/stanza/utils/datasets/sentiment/process_ren_chinese.py
imports: import glob
  import os
  import random
  import sys
  import xml.etree.ElementTree
  from collections import namedtuple
  import stanza
  from stanza.models.classifiers.data import SentimentDatum
  import stanza.utils.datasets.sentiment.process_utils
label_desc: Use image node_id 1 for calling a global function with example usage: get_phrases(filename) and returns: fragments