def run(self, query):
    """Run model on given query and entity.

    Args:
      query: String.

    Returns:
      logits: Numpy array of logits for each output entity.
    """
    tf.logging.info("Tokenizing query: %s", query)
    qry_input_ids, qry_input_mask, _ = input_fns.get_tokens_and_mask(
        query, self.tokenizer, self.max_qry_length)
    tf.logging.info("Finding entities using %s", self.linker)
    mentions = self.tfidf_linking(qry_input_ids, qry_input_mask,
                                  self.num_entities)
    tf.logging.info("Converting to features")
    entities = [self.entity2id[mention] for mention in mentions]
    current_features = [{
        "qas_ids": 0,
        "qry_input_ids": qry_input_ids,
        "qry_input_mask": qry_input_mask,
        "qry_entity_id": entities + [0] * (self.num_entities - len(entities)),
        "num_entities": len(entities),
    }]
    tf.logging.info("Running DrKIT")
    preds = self.fast_predictor.predict(current_features)[0]
    return self.postprocess(preds, query)
Run model on given query and entity.

    Args:
      query: String.

    Returns:
      logits: Numpy array of logits for each output entity.
    
language/labs/drkit/hotpotqa/demo.py