code: def process_text(self, text, format='json'):
          
          if self.eidos_reader is None:
              self.initialize_reader()
          default_arg = lambda x: autoclass('scala.Some')(x)
          today = datetime.date.today().strftime("%Y-%m-%d")
          fname = 'default_file_name'
  
          annot_doc = self.eidos_reader.extractFromText(
              text,
              True, # keep text
              False, # CAG-relevant only
              default_arg(today), # doc creation time
              default_arg(fname) # file name
              )
          if format == 'json':
              mentions = annot_doc.odinMentions()
              ser = autoclass(eidos_package +
                              '.serialization.json.WMJSONSerializer')
              mentions_json = ser.toJsonStr(mentions)
          elif format == 'json_ld':
              # We need to get a Scala Seq of annot docs here
              ml = _list_to_seq([annot_doc])
              # We currently do not need toinstantiate the adjective grounder
              # if we want to reinstate it, we would need to do the following
              # ag = EidosAdjectiveGrounder.fromConfig(
              #   EidosSystem.defaultConfig.getConfig("adjectiveGrounder"))
              # We now create a JSON-LD corpus
              jc = autoclass(eidos_package + '.serialization.json.JLDCorpus')
              corpus = jc(ml)
              # Finally, serialize the corpus into JSON string
              mentions_json = corpus.toJsonStr()
          json_dict = json.loads(mentions_json)
          return json_dict
docs: Return a mentions JSON object given text.
  
          Parameters
          ----------
          text : str
              Text to be processed.
          format : str
              The format of the output to produce, one of "json" or "json_ld".
              Default: "json"
  
          Returns
          -------
          json_dict : dict
              A JSON object of mentions extracted from text.