code: def convert_sentence_to_json(sentence):
      if "_" in sentence:
          prefix, rest = sentence.split("_", 1)
          query, rest = rest.split("_", 1)
          query_index = len(prefix.rstrip().split(" "))
      else:
          query, query_index = None, None
  
      prefix, rest = sentence.split("[", 1)
      pronoun, rest = rest.split("]", 1)
      pronoun_index = len(prefix.rstrip().split(" "))
  
      sentence = (
          sentence.replace("_", "").replace("[", "").replace("]", "")
      )
  
      return {
          "idx": 0,
          "text": sentence,
          "target": {
              "span1_index": query_index,
              "span1_text": query,
              "span2_index": pronoun_index,
              "span2_text": pronoun,
          },
      }
  
file_path: fairseq/examples/roberta/wsc/wsc_utils.py
imports: import json
  from functools import lru_cache
label_desc: Use image node_id 1 for calling a global function with example usage: convert_sentence_to_json(sentence) and returns: dict