def non_ascii_equal(website, field, value, node_text):
    """Compares value and node_text by their non-ascii texts.

    Website/field are used for handling special cases.

    Args:
      website: the website that the value belongs to, used for dealing with
        special cases.
      field: the field that the value belongs to, used for dealing with special
        cases.
      value: the value string that we want to compare.
      node_text: the clean text of the node that we want to compare.

    Returns:
      a boolean variable indicating if the value and node_text are equal.
    """
    value = clean_format_str(value)
    node_text = clean_format_str(node_text)

    # A special case in the ALLMOVIE website's MPAA_RATING,
    # the truth values are not complete but only the first character.
    # For example, truth value in the file:"P", which should be "PG13" in htmls.
    # Note that the length of the truth should be less than 5.
    if website == "allmovie" and field == "mpaa_rating" and len(node_text) <= 5:
        return node_text.strip().startswith(value.strip())

    # A special case in the AMCTV website, DIRECTOR field.
    # The name are not complete in the truth values.
    # E.g. truth value in files, "Roy Hill" and real value: "Geogre Roy Hill".
    if website == "amctv" and field == "director":
        return node_text.strip().endswith(value.strip())
    return value.strip() == node_text.strip()
Compares value and node_text by their non-ascii texts.

    Website/field are used for handling special cases.

    Args:
      website: the website that the value belongs to, used for dealing with
        special cases.
      field: the field that the value belongs to, used for dealing with special
        cases.
      value: the value string that we want to compare.
      node_text: the clean text of the node that we want to compare.

    Returns:
      a boolean variable indicating if the value and node_text are equal.
    
markuplm/examples/fine_tuning/run_swde/prepare_data.py